[GH-ISSUE #100] [Bug Report] Metadata verifying causes IndexError #85

Closed
opened 2026-02-27 04:57:27 +03:00 by kerem · 1 comment
Owner

Originally created by @jrbq on GitHub (Oct 15, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/100

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
v0.9.21

Bug Description
Trying to verify the metadata using zotify -v causes a bug

Bug Triggering Command
zotify -v

Error Traceback / Logs

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\XXX\scoop\apps\python\current\Scripts\zotify.exe\__main__.py", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\__main__.py", line 119, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\app.py", line 321, in client
    update_track_metadata(track_ids[i], track_path, tracks[i])
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\track.py", line 161, in update_track_metadata
    mismatches = compare_audio_tags(track_path, reliable_tags, unreliable_tags)
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 272, in compare_audio_tags
    reliable_tags_onfile, unreliable_tags_onfile = get_audio_tags(track_path)
                                                   ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 217, in get_audio_tags
    genres = conv_genre_format(tags[GENRE].values)
  File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 155, in conv_genre_format
    return genres[0]
           ~~~~~~^^^

IndexError: list index out of range

Config File

{

    "SAVE_CREDENTIALS": "True",
    "CREDENTIALS_LOCATION": "",
    "OUTPUT": "",
    "SONG_ARCHIVE": "",
    "ROOT_PATH": "",
    "ROOT_PODCAST_PATH": "",
    "SPLIT_ALBUM_DISCS": "False",
    "DOWNLOAD_LYRICS": "False",
    "MD_SAVE_GENRES": "True",
    "MD_ALLGENRES": "False",
    "MD_GENREDELIMITER": ",",
    "DOWNLOAD_FORMAT": "mp3",
    "DOWNLOAD_QUALITY": "auto",
    "TRANSCODE_BITRATE": "auto",
    "SKIP_EXISTING": "True",
    "SKIP_PREVIOUSLY_DOWNLOADED": "True",
    "RETRY_ATTEMPTS": "1",
    "BULK_WAIT_TIME": "30",
    "OVERRIDE_AUTO_WAIT": "False",
    "CHUNK_SIZE": "20000",
    "DOWNLOAD_REAL_TIME": "False",
    "LANGUAGE": "en",
    "PRINT_SPLASH": "False",
    "PRINT_SKIPS": "True",
    "PRINT_DOWNLOAD_PROGRESS": "True",
    "PRINT_ERRORS": "True",
    "PRINT_DOWNLOADS": "False",
    "PRINT_API_ERRORS": "True",
    "PRINT_PROGRESS_INFO": "True",
    "PRINT_WARNINGS": "True",
    "TEMP_DOWNLOAD_DIR": ""

}

Additional Context
The error disappears and the command works by adding

    if not genres:
        return ""

below def conv_genre_format(genres: list[str]) -> list[str] | str: in utils.py of Zotify, didn't bother to investigate more of the code as the simple solution worked.

Originally created by @jrbq on GitHub (Oct 15, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/100 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** v0.9.21 **Bug Description** Trying to verify the metadata using `zotify -v` causes a bug **Bug Triggering Command** zotify -v **Error Traceback / Logs** ``` Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\XXX\scoop\apps\python\current\Scripts\zotify.exe\__main__.py", line 6, in <module> sys.exit(main()) ~~~~^^ File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\__main__.py", line 119, in main args.func(args) ~~~~~~~~~^^^^^^ File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\app.py", line 321, in client update_track_metadata(track_ids[i], track_path, tracks[i]) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\track.py", line 161, in update_track_metadata mismatches = compare_audio_tags(track_path, reliable_tags, unreliable_tags) File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 272, in compare_audio_tags reliable_tags_onfile, unreliable_tags_onfile = get_audio_tags(track_path) ~~~~~~~~~~~~~~^^^^^^^^^^^^ File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 217, in get_audio_tags genres = conv_genre_format(tags[GENRE].values) File "C:\Users\XXX\scoop\apps\python\current\Lib\site-packages\zotify\utils.py", line 155, in conv_genre_format return genres[0] ~~~~~~^^^ IndexError: list index out of range ``` **Config File** ``` { "SAVE_CREDENTIALS": "True", "CREDENTIALS_LOCATION": "", "OUTPUT": "", "SONG_ARCHIVE": "", "ROOT_PATH": "", "ROOT_PODCAST_PATH": "", "SPLIT_ALBUM_DISCS": "False", "DOWNLOAD_LYRICS": "False", "MD_SAVE_GENRES": "True", "MD_ALLGENRES": "False", "MD_GENREDELIMITER": ",", "DOWNLOAD_FORMAT": "mp3", "DOWNLOAD_QUALITY": "auto", "TRANSCODE_BITRATE": "auto", "SKIP_EXISTING": "True", "SKIP_PREVIOUSLY_DOWNLOADED": "True", "RETRY_ATTEMPTS": "1", "BULK_WAIT_TIME": "30", "OVERRIDE_AUTO_WAIT": "False", "CHUNK_SIZE": "20000", "DOWNLOAD_REAL_TIME": "False", "LANGUAGE": "en", "PRINT_SPLASH": "False", "PRINT_SKIPS": "True", "PRINT_DOWNLOAD_PROGRESS": "True", "PRINT_ERRORS": "True", "PRINT_DOWNLOADS": "False", "PRINT_API_ERRORS": "True", "PRINT_PROGRESS_INFO": "True", "PRINT_WARNINGS": "True", "TEMP_DOWNLOAD_DIR": "" } ``` **Additional Context** The error disappears and the command works by adding ``` if not genres: return "" ``` below `def conv_genre_format(genres: list[str]) -> list[str] | str:` in utils.py of Zotify, didn't bother to investigate more of the code as the simple solution worked.
kerem 2026-02-27 04:57:27 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Googolplexed0 commented on GitHub (Oct 16, 2025):

Good catch. I fixed this in efficient-api and didn't backport it.

<!-- gh-comment-id:3408937052 --> @Googolplexed0 commented on GitHub (Oct 16, 2025): Good catch. I fixed this in [efficient-api](https://github.com/Googolplexed0/zotify/tree/efficient-api) and didn't backport it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#85
No description provided.