Add simple proof of concept tag_cache generator
This commit is contained in:
parent
52c61634f5
commit
68a78e1c53
31
bin/mopidy-scan
Executable file
31
bin/mopidy-scan
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
from mopidy import settings
|
||||
from mopidy.scanner import Scanner, translator
|
||||
from mopidy.frontends.mpd.translator import tracks_to_tag_cache_format
|
||||
|
||||
tracks = []
|
||||
|
||||
def store(data):
|
||||
track = translator(data)
|
||||
tracks.append(track)
|
||||
print >> sys.stderr, 'Added %s' % track.uri
|
||||
|
||||
def debug(uri, error):
|
||||
print >> sys.stderr, 'Failed %s: %s' % (uri, error)
|
||||
|
||||
print >> sys.stderr, 'Scanning %s' % settings.LOCAL_MUSIC_FOLDER
|
||||
|
||||
scanner = Scanner(settings.LOCAL_MUSIC_FOLDER, store, debug)
|
||||
scanner.start()
|
||||
|
||||
print >> sys.stderr, 'Done'
|
||||
|
||||
for a in tracks_to_tag_cache_format(tracks):
|
||||
if len(a) == 1:
|
||||
print a[0]
|
||||
else:
|
||||
print u': '.join([unicode(b) for b in a])
|
||||
Loading…
Reference in New Issue
Block a user