beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.58k stars 1.8k forks source link

Fix extension issue in convert plugin when exporting a playlist #5203

Open pierreay opened 2 months ago

pierreay commented 2 months ago

Description

Fix extension substitution inside path of the exported playlist.

Before this, the exported playlist contained relative paths pointing to the converted files BUT the extension were not substituted comparing to before and the after the conversion. Therefore, running the playlist will fail for files which have been converted and where extension have changed.

Example:

  1. Convert /path/to/library/artist.flac to /path/to/converted/artist.mp3 using the -m playlist.m3u command-line flag.
  2. Open the generated playlist, and find the incorrect path /path/to/converted/artist.flac inside.

To Do

pierreay commented 1 week ago

Hi! Thanks for the PR. I've left a comment or two. Would you also be able to add a test that fails under the old code and succeeds with the new?

I'm not familiar with unit tests in Python, but since you ask, I will give a try!

pierreay commented 2 days ago

I added the appropriate test case! ;)