navidrome / navidrome

🎧☁️ Your Personal Streaming Service
https://www.navidrome.org
GNU General Public License v3.0
12.22k stars 911 forks source link

[Bug]: Cover Art missing in folders that contain the U+200B character #2765

Open pimzand opened 10 months ago

pimzand commented 10 months ago

I confirm that:

Version

0.50.2-1.fc39 (source_archive)

Current Behavior

When any part of the path ends with Unicode character U+200B (Zero Width Space), no cover art will be shown for that music.

Expected Behavior

Any path valid for storing music files should also be valid for storing cover art files.

Steps To Reproduce

1, create a folder ending with U+200B. Populate it with valid content; in my case .flac files and a folder.jpg cover art file

  1. witness that the music files can be played, but the cover art is not detected
  2. rename the folder by removing the U+200B character
  3. witness that the cover art is now properly shown

Environment

- OS: Fedora 39
- Browser: Firefox
- Client: Fedora 39

How Navidrome is installed?

Package

Configuration

LogLevel = 'info'
ScanSchedule = '@every 1h'
#MusicFolder = "/var/lib/navidrome/music"
MusicFolder = "/music/main"
DataFolder = "/var/lib/navidrome/data"
CoverArtPriority = "folder.jpg"
PlaylistsPath = "../playlists/**/**"

Relevant log output

Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Accelerate/folder.jpg: no such file or directory" file=/Accelerate/folder.jpg requestId=myserver/yj60dRz6y2-000542 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Around the Sun/folder.jpg: no such file or directory" file="/Around the Sun/folder.jpg" requestId=myserver/yj60dRz6y2-000543 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Automatic for the People/folder.jpg: no such file or directory" file="/Automatic for the People/folder.jpg" requestId=myserver/yj60dRz6y2-000544 username>
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Collapse Into Now/folder.jpg: no such file or directory" file="/Collapse Into Now/folder.jpg" requestId=myserver/yj60dRz6y2-000546 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Document/folder.jpg: no such file or directory" file=/Document/folder.jpg requestId=myserver/yj60dRz6y2-000547 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Eponymous/folder.jpg: no such file or directory" file=/Eponymous/folder.jpg requestId=myserver/yj60dRz6y2-000548 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Green/folder.jpg: no such file or directory" file=/Green/folder.jpg requestId=myserver/yj60dRz6y2-000549 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Life's Rich Pageant/folder.jpg: no such file or directory" file="/Life's Rich Pageant/folder.jpg" requestId=myserver/yj60dRz6y2-000550 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Live (CD 1)/folder.jpg: no such file or directory" file="/Live (CD 1)/folder.jpg" requestId=myserver/yj60dRz6y2-000551 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Live (CD 2)/folder.jpg: no such file or directory" file="/Live (CD 2)/folder.jpg" requestId=myserver/yj60dRz6y2-000551 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Monster/folder.jpg: no such file or directory" file=/Monster/folder.jpg requestId=myserver/yj60dRz6y2-000552 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Murmur/folder.jpg: no such file or directory" file=/Murmur/folder.jpg requestId=myserver/yj60dRz6y2-000553 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /New Adventures in Hi-Fi/folder.jpg: no such file or directory" file="/New Adventures in Hi-Fi/folder.jpg" requestId=myserver/yj60dRz6y2-000554 username=p>
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Out Of Time/folder.jpg: no such file or directory" file="/Out Of Time/folder.jpg" requestId=myserver/yj60dRz6y2-000555 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Reckoning/folder.jpg: no such file or directory" file=/Reckoning/folder.jpg requestId=myserver/yj60dRz6y2-000557 username=pim
Jan 04 13:51:38 myserver navidrome[2033]: time="2024-01-04T13:51:38+01:00" level=warning msg="Could not open cover art file" error="open /Reveal/folder.jpg: no such file or directory" file=/Reveal/folder.jpg requestId=myserver/yj60dRz6y2-000558 username=pim
Jan 04 13:51:39 myserver navidrome[2033]: time="2024-01-04T13:51:39+01:00" level=warning msg="Could not open cover art file" error="open /Up/folder.jpg: no such file or directory" file=/Up/folder.jpg requestId=myserver/yj60dRz6y2-000560 username=pim

Anything else?

In all the error messages above, the first part of the path is missing. These are all R.E.M. albums, which are located in folder /music/main/R.E.M.(U+200B) The U+200B character was appended by my CD ripping program, to prevent creating folders that end with a dot, which would be illegal in Microsoft Windows, making it impossible to share the folder with Windows clients.

Code of Conduct

deluan commented 10 months ago

Hey, sorry for the delay. We currently use the Zero-width space char (U+200b) as a path separator for cover art paths. This is the root cause of the issue.

In the new Scanner (#2709), I'm using JSON lists to store lists in the DB, so this will be solved.

Interesting choice from your CD ripping program... Usually when a program needs to escape the . in the last char, it is replaced with _: Screenshot 2024-01-24 at 8 35 47 PM

Anyway, the only workaround for now is to remove such chars from the file/dir names.

pimzand commented 10 months ago

Thanks for finding the cause. I will be happy to wait for a build that fixes this. My CD ripping program https://github.com/jack-cli-cd-ripper/jack/ allows me to configure what to do with trailing dots using regex replacements. I chose U+200b myself because it does not visually change the name of the artist or album.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Navidrome team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

deluan commented 4 months ago

This will be fixed in the BFR: #2709

Szeraax commented 2 weeks ago

If there is already a fix place with #2709 that addresses this issue, can you please mark the project status as Done for this issue?