streamrip
streamrip copied to clipboard
fix(directory): Fix overflow char and add unit tests
- In windows, if you try to call
os.makedirs
with astr
that contains...
in place of a true ellipsis…
, the...
(three dots) gets dropped, causing a FileNotFoundException. - You can repro it like this:
rip url https://play.qobuz.com/album/lj1s9oz62wsqb
- The fix is to replace the
...
with a true ellipsis, orNone
. SeeAlbum.overflow_char
Run the tests:
pytest ~/streamrip/tests/media
Please review @nathom
Can you open separate requests for the overflow char and unit tests since they are not related to each other?
Hi, the foldernames getting too long is in 99% of the cases caused by the field {title} being too long for some albums on Qbz. Is there a possibility to add a field like {title_length} = 30 in the config file so whenever the lenght of the album title is exceeding that number that title is truncated? I've noticed that now the full pathname is truncated, + ". . ." is added but when folder_format = "{albumartist}\{title} - [{year}] - {bit_depth}-{sampling_rate} - #{id}" this truncating causes the fields in the end to be truncated (id, samplingrate, bitdepth and so on) By having a {title length} field the title can be truncated before the pathname is constructed, so the pathname is not too long AND the trailing fields remain intact.
Thank you in advance.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.