geigerzaehler / beets-alternatives

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

Check for existing files / Invoke convert's convert_item #42

Closed RollingStar closed 4 years ago

RollingStar commented 4 years ago

Convert.convert_item has destination file checking. Then it invokes encode. This plugin goes straight to convert.encode, skipping the dupe check, meaning existing files are overwritten by a new encode. I found this because I had to kill the convert process to shut my PC off. Resuming it today began from the beginning.

https://github.com/geigerzaehler/beets-alternatives/blob/c0010c035226ad2babb370b9791ec5153c86b376/beetsplug/alternatives.py#L286

https://github.com/beetbox/beets/blob/1b187fbf5345727e0dfdaea958a714f19e917a4e/beetsplug/convert.py#L295

convert_item has different arguments, so it won't be a drop-in replacement. Or this plugin could implement dupe checking on its own.

wisp3rwind commented 4 years ago

Are you sure that it actually restarted transcoding from scratch? What will happen after killing beets and running alt update again is the plugin scanning all files again (typically just an mtime comparison).

If I understand correctly what you suggest, then beets-alternatives already does that. A file will only be newly encoded if the ADD action is triggered. That in turn only happens if the file either didn't exist in the alternative collection before, or if the formats configuration changed. In all other cases, only tags and embedded art are updated. The line you quote is not reached in those cases.

wisp3rwind commented 4 years ago

Closing this, since I suspect there's no bug. In case you feel like beets-alternatives' behavior is indeed violating your expectations, feel free to re-open the issue.