Samik081 / beets-beatport4

Beatport API v4 compatible beets plugin
MIT License
26 stars 2 forks source link

Import artwork issue #13

Closed djkc1072 closed 1 year ago

djkc1072 commented 1 year ago

Hi Samik,

I am importing some tracks that I originally purchased on beatport, the tracks have embedded art but the metadata is a mess. When I import them, all new metadata is intact but the original artwork has been removed and replaced with apples generic waveform image.

Could you please help?

`beet -vvv import /Users/jc/Music/iTunes/iTunes\ Media/My\ iTunes/Music/DJ\ MUSIC/HOUSE/3485264_Everyday_My_Life_featChrista_Original.mp3 user configuration: /Users/jc/.config/beets/config.yaml data directory: /Users/jc/.config/beets plugin paths: fetchart: lastfm: Disabling art source due to missing key fetchart: To use Spotify as an album art source, you must install the beautifulsoup4 module. See the documentation for further details. Sending event: pluginload library database: /Users/jc/Music/NEW_MUSIC_DB/newmusic.blbpip3 uninstall library directory: /Users/jc/Music/NEW_MUSIC Sending event: library_opened Sending event: import_begin beatport4: Started authorizing to the API using username and password beatport4: Authorized with username and password as djkc1072 <**> beatport4: Authorization code: ueOcbiq beatport4: Exchanged authorization code for the access token: {"access_token": "", "expires_in": 36000, "token_type": "Bearer", "scope": "app:docs user:dj", "refresh_token": "****lh8s"} Sending event: import_task_created Sending event: import_task_start Looking up: /Users/jc/Music/iTunes/iTunes Media/My iTunes/Music/DJ MUSIC/HOUSE/3485264_Everyday_My_Life_featChrista_Original.mp3 Tagging Sam Skilz - Everyday My Life (feat. Christa) No album ID found. Search terms: Sam Skilz - Everyday My Life (feat. Christa) Album might be VA: False Searching for MusicBrainz releases with: {'release': 'everyday my life (feat. christa)', 'artist': 'sam skilz', 'tracks': '1'} Requesting MusicBrainz release c4e5734e-6649-4886-8ca0-d067ee790290 Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_album_extract Sending event: albuminfo_received Candidate: Dajaé - Everyday My Life (c4e5734e-6649-4886-8ca0-d067ee790290) Computing track assignment... ...done. Success. Distance: 0.53 Requesting MusicBrainz release cf92cd08-66c7-4e0e-af6a-9ae978d5ab97 Sending event: mb_track_extract Sending event: mb_album_extract Sending event: albuminfo_received Candidate: Third Party - Everyday of My Life (cf92cd08-66c7-4e0e-af6a-9ae978d5ab97) Computing track assignment... ...done. Success. Distance: 0.43 Requesting MusicBrainz release ad73582d-aa3e-4cdd-98db-c18e1a83b376 Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_track_extract Sending event: mb_album_extract Sending event: albuminfo_received Candidate: Sam Tsui - Christmas Everyday (ad73582d-aa3e-4cdd-98db-c18e1a83b376) Computing track assignment... ...done. Success. Distance: 0.72 Requesting MusicBrainz release 7f342d22-2ddc-4b97-ad72-1cb959b5dfac Sending event: mb_track_extract Sending event: mb_album_extract Sending event: albuminfo_received Candidate: Concept Collective feat. Quazi, Blonde Larry & Fali - Everyday Life (7f342d22-2ddc-4b97-ad72-1cb959b5dfac) Computing track assignment... ...done. Success. Distance: 0.58 Requesting MusicBrainz release 4e316162-6e5f-4766-b220-26f59cb06451 Sending event: mb_track_extract Sending event: mb_album_extract Sending event: albuminfo_received Candidate: Coldplay - Everyday Life (4e316162-6e5f-4766-b220-26f59cb06451) Computing track assignment... ...done. Success. Distance: 0.61 Sending event: albuminfo_received Candidate: Sam Skilz - Everyday My Life (feat. Christa) (908650) Computing track assignment... ...done. Success. Distance: 0.07 Sending event: albuminfo_received Candidate: Max C, Notes2Selves - Sharing My Life (1595187) Computing track assignment... ...done. Success. Distance: 0.58 Sending event: albuminfo_received Candidate: Sam Skilz - Journey (feat. Emory Toler) (3534895) Computing track assignment... ...done. Success. Distance: 0.44 Sending event: albuminfo_received Candidate: Sam Skilz - Stay Together (feat. Grace Ashaye) (2106639) Computing track assignment... ...done. Success. Distance: 0.44 Sending event: albuminfo_received Candidate: Sam Skilz, Miss MAD - After Life (2715695) Computing track assignment... ...done. Success. Distance: 0.43 Evaluating 10 candidates.

/Users/jc/Music/iTunes/iTunes Media/My iTunes/Music/DJ MUSIC/HOUSE/3485264_Everyday_My_Life_feat__Christa_Original.mp3 (1 items) Sending event: import_task_before_choice Sending event: before_choose_candidate Tagging: Sam Skilz - Everyday My Life (feat. Christa) URL: https://beatport.com/release/everyday-my-life-feat-christa/908650 (Similarity: 92.7%) (missing tracks) (Beatport, Digital, 2012, GaGa Records, GR143) Missing tracks (1/2 - 50.0%): ! Everyday My Life feat. Christa (Dub Original Mix) (# 2) (6:32) [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums, Enter search, enter Id, aBort? 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 coverart for album Sam Skilz - Everyday My Life (feat. Christa) fetchart: getting URL: https://coverartarchive.org/release/908650 fetchart: Cover Art Archive: error loading response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

400 Bad Request

Bad Request

invalid MBID specified

fetchart: trying source coverart for album Sam Skilz - Everyday My Life (feat. Christa) fetchart: trying source google for album Sam Skilz - Everyday My Life (feat. Christa) fetchart: getting URL: https://www.googleapis.com/customsearch/v1?key=**********************************************Eu-mUI&cx=001442825323518660753%3Ahrh5ch1gjzm&q=Sam+Skilz%2CEveryday+My+Life+%28feat.+Christa%29&searchType=image fetchart: google fetchart error: accessNotConfigured fetchart: trying source amazon for album Sam Skilz - Everyday My Life (feat. Christa) fetchart: trying source albumart for album Sam Skilz - Everyday My Life (feat. Christa) 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 beatport4: Failed to embed image: 'ImportTask' object has no attribute 'item' Sending event: album_imported Sending event: import Sending event: cli_exit`

Samik081 commented 1 year ago

Hey @djkc1072, thank you for spotting this issue and attaching all the necessary info!

but the original artwork has been removed

This plugin's embedding part should overwrite the original artwork only if the specific config option is set. Is it your case? If not, maybe it's fetchart plugin which removed the image?

beatport4:
  art: yes
  art_overwrite: yes

I wasn't able to reproduce the exact error message visible in your logs, but I am pretty sure I ran into the problem with the same root cause. I have fixed it in v0.3.4 with f234ab478caba937d9c6ca846cb633896d571484.

Also, unfortunately, the image for this Beatport release is missing on the Beatport's side, even though the URL for the art is returned by their API, so you won't be able to check art embedding that this plugin offers with this exact track. _(This URL is returned via API should work https://geo-media.beatport.com/image_size/1400x1400/70954e46-a644-4c27-8a49-790f48305e64.jpg)_

Nevertheless, after updating the plugin, you should no longer get Failed to embed image: 'ImportTask' object has no attribute 'item' error and embedding for album imports should work fine. Could you please confirm that?

djkc1072 commented 1 year ago

Hi @Samik081, thank you for this, current artwork has stayed in place. I have removed fetchart and embedart from my config now. Your plugin is awesome as most of my music is from beatport, thanks!

/Users/jc/Music/iTunes/iTunes Media/My iTunes/Music/DJ MUSIC/HOUSE/11908881_Ya_Know_Original_Mix.mp3 Sending event: before_choose_candidate Correcting track tags from: Mat.Joe - Ya Know (Original Mix) Album: Ya Know To: Mat.Joe - Ya Know (Extended Mix) URL: https://beatport.com/track/ya-know/12317455 (Similarity: 95.3%) (title) (Beatport) [A]pply, More candidates, Skip, Use as-is, Enter search, enter Id, aBort? a Sending event: import_task_choice found duplicates: [246] default action for duplicates: a This item is already in the library! could not get filesize: [Errno 2] No such file or directory: b'/Users/jc/Music/NEWMUSIC//Mat.Joe/Ya Know/Ya Know (Extended Mix).mp3' Old: MP3, 320kbps, 5:32, 0.0 B New: MP3, 320kbps, 5:32, 12.9 MiB [S]kip new, Keep all, Remove old, Merge all? r Sending event: import_task_apply 0 of 1 items replaced Sending event: database_change Sending event: database_change removing 1 old duplicated items Sending event: database_change Sending event: item_removed deleting duplicate /Users/jc/Music/NEWMUSIC//Mat.Joe/Ya Know/Ya Know (Extended Mix).mp3 Sending event: item_copied Sending event: database_change Sending event: write Sending event: after_write Sending event: database_change Sending event: import_task_files beatport4: File already contains an art, skipping fetching new Sending event: item_imported Sending event: import Sending event: cli_exit

Samik081 commented 1 year ago

Hey @djkc1072, I'm very glad to read that! So, I'm closing this one, thanks for spotting the issue, confirming, and your kind words ❤️