Skipping failed file moves instead of aborting

I’m seeing a crash when running unthreaded, due to a file ‘disappearing’ from the source, which I think is related to something bugging out during a import however to test, I want to skip and ideally log the failed move, rather than beets completely failing and losing all progress.

Looking at the code, I think the line that’ll need adjusting is https://github.com/beetbox/beets/blob/1b187fbf5345727e0dfdaea958a714f19e917a4e/beets/util/init.py#L494 - Possibly calling either action.SKIP or task.set_choice(action.SKIP) however I’m unsure exactly how to call the function correctly.

(My theory is that during the ‘analysing’ the file is being associated to two albums, as the file moves aren’t processed til later. Then, when the file moves are processed, the second one will fail.

Hi! Making that change so that filesystem operations skip an entire import task actually seems fairly hard. You’ll need a try/catch block in importer.py, not anything in the util module. Sorry this won’t be as easy as you thought!

Only tangentially related, but see also: