فهرست منبع

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

Fabian Peter Hammerle 6 سال پیش
والد
کامیت
0d5b74ede7
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  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)