Pārlūkot izejas kodu

symuid-import-cmus: adapt assert msg, added cmt

Fabian Peter Hammerle 6 gadi atpakaļ
vecāks
revīzija
9c9b277140
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      symuid-import-cmus

+ 2 - 2
symuid-import-cmus

@@ -18,14 +18,14 @@ def symuid_import_cmus(library_id, cache_path):
     for cmus_track in lib.get_tracks():
         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:  # TODO play_count = 0
+        elif cmus_track.play_count > 0:  # check before symuid.Track to improve performance
             symuid_track = symuid.Track(path=cmus_track.path.decode())
             last_count = symuid_track.get_latest_play_count(
                 player=PLAYER_NAME,
                 library_id=library_id,
             )
             assert last_count is None or last_count.count <= cmus_track.play_count, \
-                (symuid_track.path, last_count, cmus_track.play_count)
+                (symuid_track.path, last_count.count, cmus_track.play_count)
             if last_count is None or last_count.count != cmus_track.play_count:
                 symuid_track.register_play_count(
                     player=PLAYER_NAME,