mirror of
https://github.com/Rafiuth/Soggfy.git
synced 2026-04-26 07:35:54 +03:00
[GH-ISSUE #37] "The directory name is invalid" for some songs #35
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Soggfy#35
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 @mbharanya on GitHub (Jun 14, 2022).
Original GitHub issue: https://github.com/Rafiuth/Soggfy/issues/37
Setup:
Currently for a lot of songs I'm getting the following error messages, mostly when scrolling through my saved songs. It also prevents me from downloading some of the files, as it only creates the folder with the lyrics file, but then is unable to recognize it somehow.
Example
C:\shortcuts\raid10\Music\Spotify_Downloaded\Architects\Daybreakerexists, Soggfy was able to create the folder, write the lyrics file, but is unable to save the track after:One guess I have is that it might be be the special characters in songs like
Hush Sally, Hush!,Devil's Island. It also happens with songs with spaces in it.Happy for any pointers!
@Rafiuth commented on GitHub (Jun 18, 2022):
The "directory name is invalid" error is a bit weird, I don't think it's because of the
\\?\prefix because from what i've seen it was supported before win10. Did you ever see a check mark before on the playlist tracks?Also, is
C:\shortcuts\raid10a symlink to the netshare or just a normal directory?@mbharanya commented on GitHub (Jun 18, 2022):
@Rafiuth I created the symlink
C:\shortcuts\raid10pointing to a network share in hopes of fixing the issue. Using\\<ip>\raid10\Musichad the same issue.I do see checkmarks and most songs are able to be downloaded. The error just seems to happen for a few select songs.
@Rafiuth commented on GitHub (Jun 21, 2022):
I've managed to reproduce this issue (or at least a related one) using a Samba server on WSL, but I didn't find a solution. You could workaround it by saving to some temporary path inside the VM and copying it to the NAS later.
Apparently, after calling
std::filesystem::exists()on some existing file, the directory containing that file will no longer be recognized as a directory for some period of time. When Soggfy tries to save a track, the create_directories() call will throw an exception because it thinks that the path is a file and not a directory. The exception should be caught and logged as[ERR] Failed to save track, but it just crashes Spotify for me. I believe it also causes the "invalid directory name" error.I've isolated a minimal repro which works most of the time, but the bug could be anywhere on the MSVC STL, Windows or Samba (most likely?):
Output:
As per spec, 32=FILE_ATTRIBUTE_ARCHIVE and 16=FILE_ATTRIBUTE_DIRECTORY.
@mbharanya commented on GitHub (Jun 21, 2022):
@Rafiuth Thank you so much for the thorough investigation. This really seems interesting, if something like
std::filesystem::exists()fails for such a use case.I've just been trying to isolate if the issue only persists for network shares, and so far it seems that mounting the directory as a shared folder in VMware seems to no longer throw that error. I'll be watching it though, as it happened quite infrequently. This way it's still a "network" drive, but probably uses a different protocol than SMB.