Track result should contain key

This commit is contained in:
Thomas Adamcik 2010-11-01 23:23:59 +01:00
parent 74d004d6fe
commit dd25fadd8b
2 changed files with 2 additions and 0 deletions

View File

@ -141,6 +141,7 @@ def _add_to_tag_cache(result, folders, files):
path = uri_to_path(track_result['file'])
track_result['mtime'] = get_mtime(path)
track_result['file'] = re.sub(regexp, '', path)
track_result['key'] = os.path.basename(track_result['file'])
track_result = order_mpd_track_info(track_result.items())
result.extend(track_result)
result.append(('songList end',))

View File

@ -101,6 +101,7 @@ class TracksToTagCacheFormatTest(unittest.TestCase):
result = dict(translator.track_to_mpd_format(track))
result['file'] = uri_to_path(result['file'])
result['file'] = result['file'][len(folder)+1:]
result['key'] = os.path.basename(result['file'])
result['mtime'] = mtime('')
return translator.order_mpd_track_info(result.items())