New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing event for already-found-in-your-library #3111

Open
mgerhardy opened this Issue Jan 9, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@mgerhardy
Copy link

mgerhardy commented Jan 9, 2019

Problem

I would like to be able to cleanup music collections that I've already imported into my beets collection. I would like to keep those that weren't automatically (beet import -m -q) imported, but would like to remove those that are already part of my library.

I thought I would just write a plugin for this, but can't find an event/trigger that would fire when the already-in-your-library-situation comes up. Is there any way to get some kind of callback to be able to delete the detected duplicate from the import directory (and keep/don't touch the already imported music in my library)?

This would greatly reduce the amount of work that I have to do on the manual import of the missing tracks.

@sampsyo

This comment has been minimized.

Copy link
Member

sampsyo commented Jan 9, 2019

Sure; sounds like a reasonable thing to add! How about a new event emitted from resolve_duplicates in the beets.importer module? The new event could be something like import_task_duplicated or something.

Alternatively, you could consider detecting the duplicate situation at a different point, in one of the other import_task_* events. For example, you can check the task.should_remove_duplicates or task.should_merge_duplicates to detect when the user has requested a particular action with the duplicates. Would that work for your use case?

@sampsyo sampsyo added the needinfo label Jan 9, 2019

@sophusweidemann

This comment has been minimized.

Copy link

sophusweidemann commented Jan 22, 2019

As per my post on discourse, I'm in need of some similar functionality. I am okay with writing a plugin myself, but I would need the event in question. If it fires from resolve_duplicates and somehow supplies some info about the release(s) in question. Then if I'm not mistaken on the application flow I could write some logic to skip the duplicate if it's near identical to the existing one (or OP could delete it).

@sampsyo

This comment has been minimized.

Copy link
Member

sampsyo commented Jan 22, 2019

Sounds cool! If you're interested in digging into the importer internals, it would be awesome to have help implementing the new event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment