spotify-downloader icon indicating copy to clipboard operation
spotify-downloader copied to clipboard

Preserve original `list-position`, when local/unavailable songs are skipped

Open dxrcy opened this issue 9 months ago • 0 comments

Requested Feature

When downloading with {list-position} included in the --output option.

When a local song is ignored, the following songs in the playlist will be saved under a different track number than that of the original playlist (shifted down to fill gaps). I think that an option to preserve the original number would be beneficial, especially if a user wants to manually include the local tracks, so they won't have to rename the files to fix the numbers.

Playlist order as shown on Spotify:

  1. foo
  2. bar (local/unavailable)
  3. baz

Tracks downloaded:

  1. foo
  2. baz (should be 3)

This is a very minor issue, so I do not mind if this is considered out of scope or not worthwhile :-)

See #2105

Possible implementation

  • Set the list_position field in song in types/playlist.py:111
  • Don't override it in utils/spotify.py:303

-- or --

  • Append None (or some sentinal value) to songs after showing the local song warning, in types/playlist.py:101.
  • Check for None whenever the songs list is looped over, such as utils/search.py:300

dxrcy avatar May 24 '24 10:05 dxrcy