geigerzaehler / beets-alternatives

Beets plugin to manage external files
MIT License
93 stars 21 forks source link

Don't corrupt files on format change #27

Closed wisp3rwind closed 5 years ago

wisp3rwind commented 5 years ago

Consider the following scenario:

Initial configuration:

alternatives:
    myexternal:
        formats: m4a wma

add a file:

+/path/to/track 1.wma

At some point (maybe due to a new media player not supporting wma), you change this to

alternatives:
    myexternal:
        formats: m4a

On the next update, this will happen:

>/path/to/track 1.wma -> /path/to/track 1.m4a

While it's not feasible to detect every kind of format change (which might be minor such as modified target bitrates), beets-alternatives should not rename files to incorrect extensions, but actually reencode in these cases. Hence this PR.

(The PR is relative to #26)

wisp3rwind commented 5 years ago

Rebased on master.