strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.68k stars 184 forks source link

Albums missing if file path longer than 260 characters (Windows) #1277

Closed dbolton closed 8 months ago

dbolton commented 1 year ago

Describe the bug Albums missing from Strawberry when file path includes too many characters.

To Reproduce What I have:

Show up in Strawberry when file paths shortened to:

Expected behavior All albums in the scanned folders should appear in the Strawberry collection regardless of file length. For comparison, these albums appear in other audio players like Media Player (bundled with Windows), Exaile, foobar2000.

System Information:

jonaski commented 1 year ago

I can confirm this, but the issue is in TagLib.

TagLib: Could not open file C:/Data/Test_Music/LongPath/long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path_long_path/After_Paradise/02_-_Snowy_White_-_After_Paradise_-_Midnight_Blues.flac

jonaski commented 1 year ago

This is because TagLib uses MAX_PATH limitations: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry We have to wait for the next major TagLib release which should remove such restrictions. Not much I can do for now.

jonaski commented 8 months ago

Still an issue in TagLib 2.0, when debugging it I've found it is caused by CreateFileW used by TagLib, but according to according to https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry the limitation should be removed as of Windows 10, version 1607 if Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled is set to 1. But I can still reproduce it, but prefixing the path with "\?\" works.

jonaski commented 8 months ago

Opened a PR to fix this in TagLib: https://github.com/taglib/taglib/pull/1216