Skip to content
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

Import: allow edit right after applying search results #2441

Closed
Vrihub opened this issue Feb 18, 2017 · 17 comments · Fixed by #2731
Closed

Import: allow edit right after applying search results #2441

Vrihub opened this issue Feb 18, 2017 · 17 comments · Fixed by #2731
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@Vrihub
Copy link
Contributor

Vrihub commented Feb 18, 2017

Feature request. Often the information retrieved automatically by search engines during the import procedure needs some corrections (e.g. most CD reissues have the year of release as "year", instead of the year of the original recording): I'd like to make these fixes right away, using the "edit" command, instead of waiting for the import procedure to finish, and then run beet edit ... with the proper query to only match the album just imported.

Currently an "Edit" command is available in import mode, but it can be used alternatively to the Search command (i.e. starting from a blank template), it would be very convenient if "Edit" would be available right after applying the results of a search, using those as starting values in the editor.

@sampsyo
Copy link
Member

sampsyo commented Feb 18, 2017

Hi! It sounds like you want to edit the candidate metadata, which is actually possible already. At this prompt:

Apply, More candidates, [S]kip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates, plaY?

choose the "edit Candidates" option instead of the "eDit" option. Does that do what you want?

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Feb 18, 2017
@Vrihub
Copy link
Contributor Author

Vrihub commented Feb 19, 2017

choose the "edit Candidates" option

Hey, wait a moment, I've never seen that option!!! Ah, it must be because of (quoting the Edit plugin documentation):

Also, please be aware that the edit Candidates choice can only be used with the matches found during 
the initial search (and currently not supporting the candidates found via the Enter search or enter Id choices). 

I almost always import files that lack any tags, so I can't use that option :(
Any possibility to make it available also in my use-case?

@sampsyo
Copy link
Member

sampsyo commented Feb 19, 2017

Hmm, that's odd—I wonder why the documentation says that! In a little experiment I ran here, it did actually appear after entering an ID. I can't really think of a reason that would have been a limitation in the past, but maybe it's just out of date somehow?

@Vrihub
Copy link
Contributor Author

Vrihub commented Apr 28, 2017

it did actually appear after entering an ID.

You are talking about a different use-case. Here is mine, in detail:

  1. beet import some-directory
  2. beets doesn't come up with any automated results (not enough info in my filenames), so i choose Enter search and do a manual search for artist/album
  3. beets presents me with the search results, and offers the following options
    [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums, Enter search, enter Id, aBort, eDit?

My problem is: I would like to have the edit Candidates option too. Is this clear now?

beets version 1.4.3
python version 2.7.13

@sampsyo
Copy link
Member

sampsyo commented Apr 29, 2017

Ah, sorry, I did misunderstand. But I did another experiment here too, using the "Enter search" option… and the screen that appeared after that did include the "edit Candidates" option. I'm guessing you had a single high-confidence match. Have you tried choosing "More candidates"? I think the option should then appear after it shows you a listing.

@Vrihub
Copy link
Contributor Author

Vrihub commented Apr 30, 2017

Have you tried choosing "More candidates"? I think the option should then appear after it shows you a listing.

No it doesn't.

I tried removing the if clause in beetsplug/edit.py line 358, to always append edit Candidates unconditionally: the option now appears but it doesn't work (I'm trapped in an infinite loop of Enter one of 1-0), so it seems more work is needed (hints?).

Once we fix this, the next step would be to remove the limitation of only being able to edit the item-level fields, and also allow editing the album-level fields.

@sampsyo
Copy link
Member

sampsyo commented May 1, 2017

Weird! I don't know why I can't seem to reproduce the same problem. Are you running the latest source? (Sorry it's been so long since the last release—totally my fault.)

@Vrihub
Copy link
Contributor Author

Vrihub commented May 1, 2017

Are you running the latest source?

I was running 1.4.3, so I pip-uninstalled it, downloaded the latest zip source from github, installed it via setup.py and repeated the test, but I still can't get the edit candidates option.

I also tried moving away my config file, to use the default config values: same result.

The kind of files that I usually import are m4a, with no information in the file name (e.g. 01.m4a etc) and sometimes the artist and/or title tag (but often they have no tags).

@sampsyo
Copy link
Member

sampsyo commented May 1, 2017

Weird! I'm still pretty stumped. I don't know why we're not seeing the same behavior.

Any chance you could include some pastes from full interactions—one where you did get the prompt and one where you didn't? Including verbose output would be even better.

@Vrihub
Copy link
Contributor Author

Vrihub commented Nov 1, 2017

...

Any chance you could include some pastes from full interactions—one where you did get the prompt and one where you didn't? Including verbose output would be even better.

Ok, I hope this can help. See the attached images.

Images 01.jpg and 02.jpg show what happens when I run beets -vv import mydir, where mydir contains one .mp3 file without any tags. As you see, I choose Enter search, I get 5 candidates and no Edit candidates option; then I choose candidate number 2, and still no Edit candidates option.
This is the situation I already described in my previous messages.

01
02

Image 03.jpg shows what happens when I repeat the same operation on a file that already has tags.
As you see, beets uses the tags information to automatically suggest some candidates, and gives the Edit candidates option.

03

All this with beets 1.4.5.

I'd really love to see this fixed, so please let me know how I can help.

@sampsyo
Copy link
Member

sampsyo commented Nov 1, 2017

Thank you for the extra detail! That really did help shed light on what was going on. Essentially, the plugin was seeing the original candidates found for an imported album, of which there were none, instead of the new ones after doing the manual search. Can you please try out #2731 to see if it solves the problem for you?

@Vrihub
Copy link
Contributor Author

Vrihub commented Nov 2, 2017

Can you please try out #2731 to see if it solves the problem for you?

Thanks a lot! Yes, it solves the problem, and I haven't noticed anything strange at least from a user's point of view.

@Vrihub
Copy link
Contributor Author

Vrihub commented Nov 2, 2017

and I haven't noticed anything strange

Uhm, actually I've now noticed a problem: if I import an album making some changes with the "Edit candidates" option, beets doesn't fetch and embed the album art automatically, as it always does in my configuration.

I tried re-importing the same album without making any changes via "Edit candidates", and beets correctly fetches and embeds the album art as expected.

I don't know if this is a regression in your patch, or if it's the default behaviour when "Edit candidates" is used (I had never used it before! :) ), anyway it seems a bug to me.

@sampsyo
Copy link
Member

sampsyo commented Nov 2, 2017

Hmm! Would you mind trying it with and without the patch to see if that's the cause? A verbose log from when things went wrong would also be really helpful.

@Vrihub
Copy link
Contributor Author

Vrihub commented Nov 2, 2017

Ok, I tried without the patch and the album art problem is still there.

This is what happens when I import something without making changes via "Edit candidates":

...
Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? a
Sending event: import_task_choice
Sending event: import_task_apply
0 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
fetchart: trying source filesystem for album Wolfgang Amadeus Mozart - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
fetchart: trying source coverart for album Wolfgang Amadeus Mozart - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
fetchart: downloading image: https://coverartarchive.org/release/00185b27-bb54-40fb-b5cc-b26f246a6078/front
fetchart: downloaded art to: /tmp/tmpTD9lQ9.jpg
fetchart: using remote image /tmp/tmpTD9lQ9.jpg
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: import_task_files
Sending event: art_set
embedart: Resizing album art to 600 pixels wide
artresizer: ImageMagick resizing XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/wolfgang_amadeus_mozart_0000_eine_kleine_nachtmusik___symphony_no._40_in_g_minor___symphony_no._41__jupiter_/albumart.jpg to /tmp/tmpStol6V.jpg
embedart: Embedding album art into Wolfgang Amadeus Mozart - 0000 - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter"
embedart: embedding /tmp/tmpStol6V.jpg
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: album_imported
Sending event: import
Sending event: cli_exit

And here's what happens when I make some changes: it seems the fetchart and embedart plugins are not called at all:

...
Enter search, enter Id, aBort, eDit, edit Candidates? c
# selection (default 1)? 1
edit: invoking editor command: ['vim', '/tmp/tmpGx7YKR.yaml']
Wolfgang Amadeus Mozart - 0000 - Eine Kleine Nachtmusik / Symphony no. 40 in G minor / Symphony no. 41 "Jupiter" - 01 - Eine Kleine Nachtmusik
  title: Eine Kleine Nachtmusik -> Eine Kleine Nachtmusik test test test
continue [E]diting, Apply, Cancel? a
Sending event: import_task_choice
0 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: import_task_files
Sending event: album_imported
Sending event: import
Sending event: cli_exit

@sampsyo
Copy link
Member

sampsyo commented Nov 2, 2017

Very strange! Well, it sounds like this is a separate issue deserving of a separate investigation, unfortunately. In the mean time, I'll leave this PR open for a little while longer so we can test it more thoroughly before merging.

@Vrihub
Copy link
Contributor Author

Vrihub commented Nov 3, 2017

Well, it sounds like this is a separate issue deserving of a separate investigation

Indeed, I opened #2734 for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants