emmental/curds/playlist/genre.py

18 lines
504 B
Python

# Copyright 2019 (c) Anna Schumaker.
from . import playlist
from .. import notify
from .. import tree
GENRE_ICON = "emblem-generic"
class GenreNode(tree.ETree):
def __init__(self):
tree.ETree.__init__(self, "Genres", GENRE_ICON)
def alloc_child(self, name, icon):
return playlist.Playlist(name, icon,
[ "artist", "date", "album", "discnumber", "tracknumber" ])
def new_track(self, track):
self.find_child(track["genre"], GENRE_ICON).add(track)