diff options
-rw-r--r-- | nephilim/song.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nephilim/song.py b/nephilim/song.py index f322fa4..fb18ed3 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -22,7 +22,8 @@ from common import sec2min class Song(dict): """Song provides a dictionary-like wrapper around song metadata. - Its instances _shouldn't_ be stored, use SongRef or PlaylistEntryRef for that.""" + Its instances _shouldn't_ be stored, use SongRef or PlaylistEntryRef for that. + Access '?tag' to get always at least an empty string. """ def __init__(self, data): for tag in data: @@ -45,6 +46,9 @@ class Song(dict): try: return dict.__getitem__(self, key) except KeyError: + if key and key[0] == '?': + key = key[1:] + return self[key] if key in self else '' if key == 'tracknum': try: return int(self['track']) |