streamrip icon indicating copy to clipboard operation
streamrip copied to clipboard

fix(directory): Fix overflow char and add unit tests

Open knguyen1 opened this issue 2 years ago • 1 comments

  • In windows, if you try to call os.makedirs with a str 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, or None. See Album.overflow_char

Run the tests:

pytest ~/streamrip/tests/media

knguyen1 avatar Aug 29 '22 22:08 knguyen1

Please review @nathom

knguyen1 avatar Aug 29 '22 22:08 knguyen1

Can you open separate requests for the overflow char and unit tests since they are not related to each other?

nathom avatar Sep 26 '22 22:09 nathom

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.

Wim1975 avatar Oct 23 '22 23:10 Wim1975

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.

stale[bot] avatar Dec 23 '22 02:12 stale[bot]