beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.92k stars 1.82k forks source link

fetchart and thumbnails: When `remove_art_file` is enabled, image is deleted before thumbnail hook runs #1695

Open simonbcn opened 9 years ago

simonbcn commented 9 years ago
Ubuntu 14.04 64 bits
beets git version 1.3.16
Nautilus 3.10.1
directory: "/home/simon/M\xFAsica/"
library: /home/simon/.beets/musiclibrary.blb
threaded: no

plugins: convert fetchart info duplicates badfiles zero replaygain embedart lastgenre scrub chroma discogs thumbnails

fetchart:
  auto: yes
  maxwidth: 300

embedart:
  auto: yes
  maxwidth: 300
  remove_art_file: yes

match:
  strong_rec_thresh: 0.30
  max_rec:
    missing_tracks: strong

import:
  art: yes
  languages: es en

paths:
  default: $albumartist/$album/$track - $title
  singleton: $artist - $title
  comp: Varios/$album/$track - $title

replaygain:
  backend: bs1770gain
  overwrite: yes

lastgenre:
  canonical: yes

convert:
  auto: yes
  tmpdir: /tmp
  command: ffmpeg -i $source -y -codec:a libmp3lame -vn -qscale:a 1 $dest
  extension: mp3
  quiet: yes
  never_convert_lossy_files: yes

duplicates:
  path: yes

thumbnails:
  auto: yes
  force: yes

scrub: 
  auto: yes  

zero:
  fields: comments
  update_database: true

The image (cover.jpg) is in folder with mp3 files:

$ ls Música/Lana\ Del\ Rey/Honeymoon/
01 - Honeymoon.mp3               06 - Freak.mp3                     11 - The Blackest Day.mp3
02 - Music to Watch Boys To.mp3  07 - Art Deco.mp3                  12 - 24.mp3
03 - Terrence Loves You.mp3      08 - Burnt Norton (interlude).mp3  13 - Swan Song.mp3
04 - God Knows I Tried.mp3       09 - Religion.mp3                  14 - Don’t Let Me Be Misunderstood.mp3
05 - High by the Beach.mp3       10 - Salvatore.mp3                 cover.jpg

...but beet thumbnails doesn't find it:

$ beet -vv thumbnails 'lana del rey'
user configuration: /home/simon/.config/beets/config.yaml
data directory: /home/simon/.config/beets
plugin paths: 
Sending event: pluginload
artresizer: method is (2, (6, 7, 7))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
library database: /home/simon/.beets/musiclibrary.blb
library directory: /home/simon/Música
Sending event: library_opened
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
thumbnails: generating thumbnail for Lana Del Rey - Honeymoon
thumbnails: album Lana Del Rey - Honeymoon has no art
Sending event: cli_exit
sampsyo commented 9 years ago

File being present in the folder isn't enough for beets to know there's album art there; the art needs to be associated with the album in the database. You can do this with fetchart.

You can also check whether an album has associated art with:

beet ls -af '$artpath' QUERY
sampsyo commented 9 years ago

Please reopen if you're still having trouble.

simonbcn commented 8 years ago

The problem is embedartwith remove_art_file: yes, it deletes the album cover before it executes thumbnails plugin:

$ beet --verbose im /dunehd/Musica\ pendiente/Adele\ -\ 25\ \(2015\)\ \[FLAC\]/
user configuration: /home/juan/.config/beets/config.yaml
data directory: /home/juan/.config/beets
plugin paths: 
Sending event: pluginload
artresizer: method is (2, (6, 9, 3))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
library database: /home/juan/.beets/musiclibrary.blb
library directory: /home/juan/Música
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /dunehd/Musica pendiente/Adele - 25 (2015) [FLAC]
Tagging Adele - 25
No album IDs found.
Search terms: Adele - 25
Album might be VA: False
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
chroma: acoustid album candidates: 5
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Evaluating 15 candidates.
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.06
Candidate: Adele - 25
Success. Distance: 0.06
Candidate: Adele - 25
Success. Distance: 0.03
Candidate: Adele - 25
Success. Distance: 0.11
Candidate: Adele - 25
Success. Distance: 0.03
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Duplicate.
Candidate: Adele - 25
Success. Distance: 0.08
Candidate: Adele - 25
Success. Distance: 0.00
Candidate: Adele - 25
Success. Distance: 0.08

/dunehd/Musica pendiente/Adele - 25 (2015) [FLAC] (11 items)
Sending event: before_choose_candidate
Tagging:
    Adele - 25
URL:
    http://musicbrainz.org/release/944d3546-54d2-4baa-9ad3-3f154a21d99b
(Similarity: 100.0%) (Digital Media, 2015, JP, Mastered for iTunes)
 * Water Under the Bridge -> Water Under The Bridge
 * Love in the Dark       -> Love In The Dark
Sending event: import_task_choice
found duplicates: [598]
This album is already in the library!
Old: 11 items, MP3, 215kbps, 48:26, 75.5 MiB
New: 11 items, FLAC, 827kbps, 48:25, 286.7 MiB
[S]kip new, Keep both, Remove old? r
Sending event: import_task_apply
0 of 11 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
replaygain: analyzing Adele - 25
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
artresizer: ImageMagick resizing /dunehd/Musica pendiente/Adele - 25 (2015) [FLAC]/front.jpg to /tmp/tmpi34BPx.jpg
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
removing 11 old duplicated items
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/01 - Hello.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/02 - Send My Love (To Your New Lover).mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/03 - I Miss You.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/04 - When We Were Young.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/05 - Remedy.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/06 - Water Under The Bridge.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/07 - River Lea.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/08 - Love In The Dark.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/09 - Million Years Ago.mp3
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/10 - All I Ask.mp3
Sending event: database_change
Sending event: database_change
Sending event: item_removed
deleting duplicate /home/juan/Música/Adele/25/11 - Sweetest Devotion.mp3
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: item_copied
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
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: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: import_task_files
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: art_set
artresizer: ImageMagick resizing /home/juan/Música/Adele/25/cover.jpg to /tmp/tmpnbPYxU.jpg
embedart: Embedding album art into Adele - 25
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: write
Sending event: after_write
Sending event: database_change
thumbnails: album Adele - 25 has no art
Sending event: database_change
Sending event: album_imported
Sending event: import
Sending event: cli_exit
simonbcn commented 8 years ago

If I suppress remove_art_file: yes option it works, but I don't want to keep the cover images.

sampsyo commented 8 years ago

Thanks for doing the investigation! That definitely seems like a problem we should solve.

simonbcn commented 7 years ago

The problem still exists. Moreover if I run beet thumbnails it tries to use image files that aren't:

$ beet -vv thumbnails album:Agnes
user configuration: /home/juan/.config/beets/config.yaml
data directory: /home/juan/.config/beets
plugin paths: 
Sending event: pluginload
artresizer: method is (2, (6, 9, 8))
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
library database: /home/juan/.beets/musiclibrary.blb
library directory: /home/juan/Música
Sending event: library_opened
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
thumbnails: generating thumbnail for Agnes - Agnes
ImageMagick size query failed
`convert` exited with (status 1) when getting size with command ['identify', '-format', '%w %h', b'/home/juan/M\xc3\xbasica/Agnes/Agnes/cover.jpg']:
identify: unable to open image `/home/juan/Música/Agnes/Agnes/cover.jpg': No such file or directory @ error/blob.c/OpenBlob/2701.
thumbnails: problem getting the picture size for /home/juan/Música/Agnes/Agnes/cover.jpg
Sending event: cli_exit