def __init__(self, info): self.album = info.get('album', '') self.title = info.get('title', '') self.track = scan_number(info.get('track', '0')) self.artist = info.get('artist', '') self.genre = info.get('genre', '') self.year = scan_number(info.get('date', '0')) self.comment = info.get('comment', '')
def __init__(self, tag): self.album = self.get_value(tag, '', 'TALB', 'album') self.artist = self.get_value(tag, '', 'TPE1', 'artist') self.comment = self.get_value(tag, '', 'COMM', 'comment') self.genre = self.get_value(tag, '', 'TCON', 'genre') self.title = self.get_value(tag, '', 'TIT2', 'title') self.track = scan_number(self.get_value(tag, '0', 'TRCK', 'tracknumber')) self.year = scan_number(self.get_value(tag, '0', 'TYER', 'year'))