Przeglądaj źródła

symuid-import-itunes: to_bytes signed=True

Fabian Peter Hammerle 6 lat temu
rodzic
commit
f26865e855
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      symuid-import-itunes

+ 3 - 1
symuid-import-itunes

@@ -42,7 +42,9 @@ def set_play_count_tag(track_path, player, library_id, reg_dt, play_count):
             track.tags[tag_label_mp4] = tag = mutagen.mp4.MP4FreeForm(
                 # "a signed big-endian integer with length one of { 1,2,3,4,8 } bytes"
                 # TODO set byte length properly
-                data=play_count.to_bytes(1, byteorder='big'),
+                # setting signed=True just to be explicit here
+                #  (irrelevant for positive integers)
+                data=play_count.to_bytes(1, byteorder='big', signed=True),
                 dataformat=mutagen.mp4.AtomDataType.INTEGER,
             )
             track.save()