navidrome/tests/fixtures
Deluan Quintão 91fab68578
Some checks failed
Pipeline: Test, Lint, Build / Lint i18n files (push) Has been cancelled
Pipeline: Test, Lint, Build / Test JS code (push) Has been cancelled
Pipeline: Test, Lint, Build / Get version info (push) Has been cancelled
Pipeline: Test, Lint, Build / Lint Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Test Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Check Docker configuration (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-1 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-2 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-3 (push) Has been cancelled
Pipeline: Test, Lint, Build / Upload Linux PKG (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-4 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-5 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-6 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-7 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-8 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-9 (push) Has been cancelled
Pipeline: Test, Lint, Build / Push Docker manifest (push) Has been cancelled
Pipeline: Test, Lint, Build / Build Windows installers (push) Has been cancelled
Pipeline: Test, Lint, Build / Package/Release (push) Has been cancelled
fix: handle UTF BOM in lyrics and playlist files (#4637)
* fix: handle UTF-8 BOM in lyrics and playlist files

Added UTF-8 BOM (Byte Order Mark) detection and stripping for external lyrics files and playlist files. This ensures that files with BOM markers are correctly parsed and recognized as synced lyrics or valid playlists.

The fix introduces a new ioutils package with UTF8Reader and UTF8ReadFile functions that automatically detect and remove UTF-8, UTF-16 LE, and UTF-16 BE BOMs. These utilities are now used when reading external lyrics and playlist files to ensure consistent parsing regardless of BOM presence.

Added comprehensive tests for BOM handling in both lyrics and playlists, including test fixtures with actual BOM markers to verify correct behavior.

* test: add test for UTF-16 LE encoded LRC files

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-10-31 09:07:23 -04:00
..
#snapshot Fix pipeline 2024-09-13 17:43:50 -04:00
$Recycle.Bin Fix pipeline. 2023-03-09 22:25:56 -05:00
...unhidden_folder Improve scanner (#1054) 2021-04-28 19:51:02 -04:00
.hidden_folder Fix ignoring hidden folders when scanning 2020-10-22 13:59:54 -04:00
artist Implement artist art priority (#2266) 2023-03-30 18:28:05 -04:00
empty_folder Move test file to fixtures folder 2020-04-28 11:59:47 -04:00
ignored_folder Skip scanning folders if they contain a .ndignore file. Closes #297 2020-05-18 14:37:01 -04:00
invalid-files Add OS Lyrics extension (#2656) 2023-12-27 20:20:29 -05:00
playlists fix: handle UTF BOM in lyrics and playlist files (#4637) 2025-10-31 09:07:23 -04:00
._02 Invisible.mp3 Ignore "hidden" files when importing a folder 2020-08-21 11:50:18 -04:00
01 Invisible (RED) Edit Version.m4a fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
01 Invisible (RED) Edit Version.mp3 getCoverArt.view working 2016-03-03 12:08:44 -05:00
bom-test.lrc fix: handle UTF BOM in lyrics and playlist files (#4637) 2025-10-31 09:07:23 -04:00
bom-utf16-test.lrc fix: handle UTF BOM in lyrics and playlist files (#4637) 2025-10-31 09:07:23 -04:00
deezer.search.artist.json feat(agents): Add Deezer API artist image provider agent (#4180) 2025-06-28 17:50:06 -04:00
empty.txt fix(scanner): improve M3U playlist import times (#2706) 2024-09-18 20:12:12 -04:00
index.html Fix background images when BaseURL is specified 2022-11-29 14:48:05 -05:00
itunes-library.xml Retrofitting with tests 2016-02-29 10:04:30 -05:00
lastfm.album.getinfo.empty_urls.json Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061) 2023-01-17 20:22:54 -05:00
lastfm.album.getinfo.json Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061) 2023-01-17 20:22:54 -05:00
lastfm.artist.getinfo.json Add initial last.fm client implementation 2020-10-20 16:07:31 -04:00
lastfm.artist.getinfo.unknown.json Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
lastfm.artist.getsimilar.json Add dedicated SimilarArtists call 2020-10-20 16:07:31 -04:00
lastfm.artist.getsimilar.unknown.json Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
lastfm.artist.gettoptracks.json Add "real" TopSongs 2020-10-20 22:53:52 -04:00
lastfm.artist.gettoptracks.unknown.json Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
listenbrainz.nowplaying.request.json feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
listenbrainz.scrobble.request.json feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
mixed-lyrics.flac fix(scanner): lyrics tag parsing to properly handle both ID3 and aliased tags 2025-07-09 00:27:40 -03:00
no_replaygain.mp3 fix: Allow nullable ReplayGain and support 0.0 (#4239) 2025-06-17 12:02:25 -04:00
robots.txt Rename manifest.json to manifest.webmanifest (#1399) 2021-10-12 20:06:09 -04:00
spotify.search.artist.json Add initial spotify client implementation 2020-10-20 16:07:31 -04:00
symlink Follow symlinks to directories when scanning 2020-04-23 20:31:44 -04:00
symlink2dir WIP 2020-10-29 23:19:26 -04:00
test.aiff fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.flac fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.lrc feat:(server): support reading lyrics from filesystem (#2897) 2025-04-30 08:10:19 -04:00
test.m4a fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.mp3 fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.ogg fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.tak feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
test.txt feat:(server): support reading lyrics from filesystem (#2897) 2025-04-30 08:10:19 -04:00
test.wav fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.wma fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
test.wv fix(scanner): check if aiff/wma file has cover art (#3996) 2025-04-25 13:00:26 -04:00
zero_replaygain.mp3 fix: Allow nullable ReplayGain and support 0.0 (#4239) 2025-06-17 12:02:25 -04:00