ebb-earl-co / tidal-wave

Waving at the TIDAL music service
Apache License 2.0
38 stars 2 forks source link

Better folder name sanitization needed #186

Closed eevan78 closed 1 month ago

eevan78 commented 1 month ago

Hi, I have found one album, 43881329 on which tidal-wave breaks. The issue is caused by errors during folder creation.

2024-07-16:13:41:25,500 INFO     [requesting.py:100] Requesting from TIDAL API: albums/43881329/items
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in mkdir:1311                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\705631\\Music\\Bach Concentus \\ Ewald Demeyere \\ Vinciane Baudhuin\\Telemann - Les Nations - Ouvertures & Oboe Concerti
[43881329] [2015]'

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in mkdir:1311                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\705631\\Music\\Bach Concentus \\ Ewald Demeyere \\ Vinciane Baudhuin'

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in mkdir:1311                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\705631\\Music\\Bach Concentus \\ Ewald Demeyere '

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in main:127                                                                                      │
│                                                                                                  │
│ in get:234                                                                                       │
│                                                                                                  │
│ in set_album_dir:121                                                                             │
│                                                                                                  │
│ in mkdir:1315                                                                                    │
│                                                                                                  │
│ in mkdir:1315                                                                                    │
│                                                                                                  │
│ in mkdir:1316                                                                                    │
│                                                                                                  │
│ in mkdir:1311                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\705631\\Music\\Bach Concentus \\ Ewald Demeyere '
[17032] Failed to execute script 'pyinstaller' due to unhandled exception!

Artist name is Bach Concentus / Ewald Demeyere / Vinciane Baudhuin and Album name is Telemann: Les Nations - Ouvertures & Oboe Concerti

That seems to break the folder creation.

One more suggestion, it would be nice if --help output showed the tidal-wave version. It's not simple to find out which version is executing...

ebb-earl-co commented 1 month ago

@eevan78 thank you for having found a bug! I was just thinking about the version as well, so I'll try to implement it.

In terms of the artist name, that is indeed strange. I'll add some logic to try to head this off.

ebb-earl-co commented 1 month ago

@eevan78 I have changed the name to use "and" instead of the "/" character. I hope that that is robust enough not to break file systems. E.g. Bach Concentus and Ewald Demeyere and Vinciane Baudhuin/Telemann - Les Nations - Ouvertures & Oboe Concerti [43881329] [2015]/03 - Ouverture des Nations anciens et modernes in G Major, TWV 55 - G4 - III. Les Allemands anciens [L].m4a

ebb-earl-co commented 1 month ago

This will be solved in version 2024.7.1, to be released later today