Explorar el Código

symuid-import-cmus: show warning if file not found

Fabian Peter Hammerle hace 7 años
padre
commit
0d5b74ede7
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      symuid-import-cmus

+ 3 - 1
symuid-import-cmus

@@ -12,7 +12,9 @@ def symuid_import_cmus(cache_path):
         path=os.path.expanduser(cache_path),
     )
     for cmus_track in lib.get_tracks():
-        if cmus_track.play_count > 0:
+        if not os.path.exists(cmus_track.path):
+            sys.stderr.write('{!r}: not found\n'.format(cmus_track.path))
+        elif cmus_track.play_count > 0:
             print(cmus_track.play_count, cmus_track.path)