Fix M3U parser truncating EXTINF duration to single character (#3152)
authorDavid Bishop <teancom@users.noreply.github.com>
Fri, 13 Feb 2026 09:48:06 +0000 (01:48 -0800)
committerGitHub <noreply@github.com>
Fri, 13 Feb 2026 09:48:06 +0000 (09:48 +0000)
commitc7b8389b509151c62ad112650c46114c4f0f76cf
tree6e3ac6aa438089b88dfdf80190231f42465d41e4
parent17114546c74d268b40e295edd1cb4482eea28a8f
Fix M3U parser truncating EXTINF duration to single character (#3152)

The EXTINF duration parser used `info[0].strip()[0]` which takes only
the first character of the duration string. For multi-digit durations
like "120", this truncates to "1". Also, the `-1` check on line 79
compared against "-1" but could only ever see "-" (a single char),
so negative/unknown durations were never properly detected.

Remove the erroneous `[0]` index so the full duration string is used
and the `-1` sentinel is correctly recognized.

Co-authored-by: David Bishop <git@gnuconsulting.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
music_assistant/helpers/playlists.py
tests/core/test_playlists.py [new file with mode: 0644]