diff options
Diffstat (limited to 'backend/zmusic/endpoints/scan.py')
-rw-r--r-- | backend/zmusic/endpoints/scan.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/backend/zmusic/endpoints/scan.py b/backend/zmusic/endpoints/scan.py index 275c7a8..d1a3078 100644 --- a/backend/zmusic/endpoints/scan.py +++ b/backend/zmusic/endpoints/scan.py @@ -14,11 +14,11 @@ def scan_music(): def do_scan(): yield "%i | Begin.\n" % int(time.time()) all_files = {} - for root, dirs, files in os.walk(unicode(app.config["MUSIC_PATH"])): + for root, dirs, files in os.walk(app.config["MUSIC_PATH"]): if len(files) != 0: - yield "%i | Scanning [%s].\n" % (int(time.time()), encode_filename(root)) + yield "%i | Scanning [%s].\n" % (int(time.time()), root) for name in files: - name = encode_filename(os.path.join(root, name)) + name = os.path.join(root, name) all_files[name] = True song = Song.query.get(name) if song != None: @@ -36,14 +36,14 @@ def scan_music(): continue song.sync_picard(tags) db.session.add(song) - yield "%i | Adding [%s].\n" % (int(time.time()), encode_filename(song.filename)) + yield "%i | Adding [%s].\n" % (int(time.time()), song.filename) for song in db.session.query(Song.filename): if song.filename not in all_files: Song.query.filter(Song.filename == song.filename).delete(False) - yield "%i | Removing [%s].\n" % (int(time.time()), encode_filename(song.filename)) + yield "%i | Removing [%s].\n" % (int(time.time()), song.filename) db.session.commit() yield "%i | Done.\n" % int(time.time()) - response = Response(do_scan(), mimetype="text/plain", direct_passthrough=True) + response = Response(do_scan(), mimetype="text/plain") response.headers.add("X-Accel-Buffering", "no") response.cache_control.no_cache = True return response |