mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #506] OS error: file name too long #1225
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#1225
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @masoniis on GitHub (Jul 14, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/506
Describe the bug
When playing a song from a playlist that contains very long authors or song name, spotify_player runs into problems attempting to save files that have names which exceed the (mac) OS length limit for writing.
To Reproduce
On MacOS sonoma, play a song from an album such as this one. I did this on a separate chrome spotify client, before trying to launch the terminal. Now that the song is active, the terminal will produce this output:
Expected behaviour
The CLI doesn't attempt to write files which have names that exceed the mac limit. Perhaps they should be clipped, or encoded, etc.
Log and backtrace
No backtrace necessary, (my backtrace is entirely empty, this is my first launch of spotify_player). Here is the relevant log context:
It's clear from above what is causing the long file error.
Environment
@lodenrogue commented on GitHub (Jul 15, 2024):
It seems the max length for MacOS file names is 255 characters. [1]
Do all titles have a - before artist names? Maybe we can truncate there?
I think the main concern is having potential file name conflicts. I'm not familiar enough with this player to know how it handles this or whether that even matters.
[1] APFS: https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits
@aome510 commented on GitHub (Jul 15, 2024):
Yeah, we can truncate and the main concern is file name conflict. One simple way to fix this issue to only include first artist's name instead of all artists.
@komposer-aml commented on GitHub (Jul 31, 2024):
What about saving as some kind of UUID? I noticed someone mentioned this issue where they were thinking of using the album ID as a hash, but at that point, you might as well just use the album ID
If the concern is that it'd make it hard for users to look up songs in their files, maybe the solution is to include a command line argument that parses the files and returns the right file names? Maybe a local database to store the right file names and associate them with their IDs?
#514