Hi! If anyone's curious and likes thinking about the internals of the beets importer, I've done a bunch of refactoring today that might entertain you.
The idea was to make the built-in prompt choices (use as-is, skip, abort, etc.) work more like the plugin-provided PromptChoice callbacks.
This has two benefits: plugins are more powerful (c.f. #2327), and the internals are now more consistent and have less duplication.
I'm particularly delighted that the `choose_candidate` function in `beets.ui.commands` has gotten rid of a *lot* of copypasta.
There are several points there where the set of prompt actions was mostly the same, with a few small differences, and we needed an identical chain of if/elif/elif/elif tests to select between them.
Now, the prompt choices are declared *once* (in _get_choices) and they can be reused across all of the possible prompts that can show up in the importer.
that's great, sampsyo, I recall when looking into adding [P]rint, the person who did had some challenges regarding that area of the code
sampsyo
Yeah, I hope this should be easier to understand now! And more capable, of course.
lengtche
you say that they can be reused across all possible prompts. does that mean that adding prompt choices when an album exists is now pluggable?
nevermind. looked at the logs and doesn't look like it.
GALL0
is it samps yo | sam Sio? sampsyo
simukis_ joined the channel
simukis_
Hi, is there any way I could ask beets to consider particular tracks to be a different file?
sampsyo
lengtche: That should be possible, using the fields on the `task` passed to the choice handler.
simukis_
I guess I could just whip out sqlite3 and tweak pathes manually, but I’m hoping for a more manual solution
sampsyo
simukis_: Hmm, I don't think I understand. What exactly are you looking to do?
simukis_
well, I got myself flac tracks of album I imported previously, but not all of them.
I would like to “upgrade” :D
behaviour-wise I suspect beets would simply find matching tracks that I’ve already imported and just change the `path` column of those to the new flacs
I suppose I’ll just edit the sqlite db directly
sampsyo
simukis_: That's what the "keep new" option does in the importer when a conflict is detected.
NOTICE: [beets] sampsyo pushed 3 new commits to master: https://github.com/beetbox/beets/compare/63f50287d589...413666a82531
NOTICE: beets/master c7351d9 Adrian Sampson: Flip an erroneous execute bit
NOTICE: beets/master 24d4363 Adrian Sampson: Slightly more helpful UnreadableFileError (#2351)...
NOTICE: beets/master 413666a Adrian Sampson: Fix #2351: crash in scrub on MediaFile errors
lengtche
sampsyo: do you mean via plugin or modifying the code itself?
NOTICE: [beets] SusannaMaria opened pull request #2352: Mosaicplugin (master...Mosaicplugin) https://github.com/beetbox/beets/pull/2352
simukis_
sampsyo: that option does not appear for partial album imports?
sampsyo: instead its telling me to pick between keeping either the old album or the new album with partial tracks