After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647898 - Retrieve cover art from files on import prior to downloading
Retrieve cover art from files on import prior to downloading
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Importing
2.0.0
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 658283 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-04-15 18:55 UTC by Age Bosma (IRC: Forage)
Modified: 2011-10-23 20:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
debug patch (3.74 KB, patch)
2011-04-15 21:36 UTC, Gabriel Burt
reviewed Details | Review
Log of successful album import (2.10 KB, text/plain)
2011-04-15 22:24 UTC, Age Bosma (IRC: Forage)
  Details
Log of failed album import (2.70 KB, text/plain)
2011-04-15 22:25 UTC, Age Bosma (IRC: Forage)
  Details
Test file (978.97 KB, application/octet-stream)
2011-06-24 22:46 UTC, Age Bosma (IRC: Forage)
  Details
Attempt to fetch coverart without having an internet connection (1.31 KB, patch)
2011-09-12 09:51 UTC, Age Bosma (IRC: Forage)
none Details | Review
Attempt to fetch coverart without having an internet connection (1.72 KB, patch)
2011-10-07 12:59 UTC, Age Bosma (IRC: Forage)
committed Details | Review

Description Age Bosma (IRC: Forage) 2011-04-15 18:55:31 UTC
Cover art is not being read from the audio files when importing new files. The cover art in files is ignored if you allow Banshee to retrieve cover art from the internet, it will be downloaded right away. Cover art from the files won't be used unless you start to play one of the album tracks if you don't allow Banshee to retrieve the cover art from the internet.

This is a waste of resources. The trouble people go through to get the right cover art is discarded and there is no need to start fetching from the internet in the first place.
It's also a pita if you are importing multiple albums. You'd have to go by them only by one to play a song just to get the cover art displayed.

It would be good if cover art retrieval from files gets a higher priority. Look for cover art in the album folder after that if the files don't contain cover art. Internet could then be used as a last resort.
Comment 1 Gabriel Burt 2011-04-15 19:58:49 UTC
Are you positive?  It's intended that the cover-art fetching process first looks inside the files' metadata, then for a local cover.jpg-ish in the file's folder, then goes out to the internet.

You can modify src/Core/Banshee.Services/Banshee.Metadata.Embedded/EmbeddedQueryJob.cs and add a Console.WriteLine or two to ensure it's not being run for your files.  Perhaps it is being run but is just failing to work right and get the cover art out?  If so, sounds similar to bug #647622.
Comment 2 Age Bosma (IRC: Forage) 2011-04-15 21:10:10 UTC
I'm positive. I have internet disabled because Banshee insists on downloading the cover art (often the incorrect one). If I add a new album I do not get to see cover art unless I play a file first. The issue was present in 1.8.x as well.
It might be related to bug #647622 but, unlike that issue, I do get the cover art if I start to play one file of the album.

Is cover art retrieval from files by any chance different when importing files compared to playing files?
Comment 3 Age Bosma (IRC: Forage) 2011-04-15 21:13:15 UTC
P.s. this happens for mp3 as well as m4a files.
Comment 4 Gabriel Burt 2011-04-15 21:21:48 UTC
Are your files on your local hard drive, or on some mount?
Comment 5 Gabriel Burt 2011-04-15 21:36:16 UTC
Created attachment 186051 [details] [review]
debug patch

If you could build Banshee from source (http://banshee.fm/download/development/) and apply this patch (patch -p1 < embedded_coverart_debug.patch) and run Banshee again (make run), it will help check what's happening.
Comment 6 Age Bosma (IRC: Forage) 2011-04-15 22:24:56 UTC
Created attachment 186053 [details]
Log of successful album import
Comment 7 Age Bosma (IRC: Forage) 2011-04-15 22:25:24 UTC
Created attachment 186054 [details]
Log of failed album import
Comment 8 Age Bosma (IRC: Forage) 2011-04-15 22:27:17 UTC
This is so unfair. After applying the patch, the first album I added fetched the cover art from the files like a charm :-S The second album, however, did fail.

Attached are two files:
- "success.log", containing the log of the first album import with successful album art retrieval
- "failed.log", containing the log of the second album import with failed album art retrieval, followed by playing a track to get the art again.

I wanted to upload a test mp3 file as well but it is larger then the allowed size for an attachment.

Files where (previous version) and are located on a local drive.

Let me know if you need any more info.
Comment 9 Gabriel Burt 2011-04-15 23:37:02 UTC
Age, the Alain Clark album log looks like it did indeed find the artwork - though the img is only 5674 bytes compared to 80k for the successful one.  Can you run

eog /home/forage/.cache/media-art/album-a8207356f613f873f39d923dee84dd5f.jpg

and see if it loads?
Comment 10 Age Bosma (IRC: Forage) 2011-04-16 00:43:26 UTC
In this case it is a small image indeed but note that it was retrieved when starting to play the track. On import, just before the play, no cover art was retrieved. Nothing of such a thing is mentioned in the log, unlike in the log of the successful import of the other album.
Comment 11 Gabriel Burt 2011-04-16 00:59:13 UTC
If you can `git pull` your git checkout, I just committed a change.  Can you try again w/ the failed album, but this time running banshee with --fetch-artwork as well?  That is,

BANSHEE_DEV_OPTIONS="--fetch-artwork" make run

should do the trick.  This will tell Banshee to ignore its rate-limiting etc that prevents it from looking up artwork on the same album within a set amount of time.
Comment 12 Age Bosma (IRC: Forage) 2011-04-16 12:30:12 UTC
Sorry to inform you but unfortunately it didn't do the trick.

For the record, steps to reproduce:
- Enable "Disable features requiring internet access" in the "Preferences"
- Import an album not imported before by "Media - Import Media..."

Result:
- No cover art is displayed for the new album

Additional steps:
- Play a track of the album

Result:
- Cover art is displayed

Note the "not imported before". When the cover art is retrieved once before, it will get displayed right away if you import the album again.
Comment 13 Fabio Durán Verdugo 2011-06-24 19:09:34 UTC
any news for this report?
Comment 14 Age Bosma (IRC: Forage) 2011-06-24 22:39:27 UTC
From my side not really. The provided patch did not change anything and the issue is still present.

I tried writing the tags to the MP3 files in different ways (ID3v2.3, ID3v2.4, UTF-8, UTF-16, ISO8859-1, with tag padding, without tag padding, explicitly setting the image type to front cover) with different applications (easytag, foobar2000, mp3tag) just to see if it would make any change but so far no luck.
Comment 15 Age Bosma (IRC: Forage) 2011-06-24 22:46:01 UTC
Created attachment 190627 [details]
Test file

Smallest file I could find for testing
Comment 16 Hernando Torque 2011-09-05 21:35:19 UTC
*** Bug 658283 has been marked as a duplicate of this bug. ***
Comment 17 Age Bosma (IRC: Forage) 2011-09-05 21:57:15 UTC
The issue remains present in version 2.1.3 of Banshee
Comment 18 Hernando Torque 2011-09-05 22:15:14 UTC
My findings for importing folders with "cover.jpg" like cover art:
* If I disable features requiring internet access (Edit → Preferences → General), the cover art isn't fetched from disk.
* If I don't disable features requiring internet access, then cover art is fetched, while images from disk take precedence over files from the internet. However, I don't want covers to be downloaded at all and I don't want to enable any other features that require internet access.
Comment 19 Age Bosma (IRC: Forage) 2011-09-05 22:31:23 UTC
I can confirm Hernando's findings with some additions.

I embedded a fake cover art file in an MP3 file. It will read the cover art from the file but only when the option "Disable features requiring internet access" is UNCHECKED and the extension "Cover Art Fetching" is CHECKED.
If it is any other way then nothing is done with the locally present images.

Both these options should not have any influence on the reading of the embedded cover art or, as in Hernando's case, the separate image file, but they have.

This does, however, contradict my earlier statement. At the time of reporting I was convinced that it was ignoring the embedded coverart completely, downloading all. I'm sure it was the situation at the time but I can't reproduce it as fast as I would like. Maybe it was the case for just a selection of the files.
Once the situation described above is fixed I'll perform a more extensive test.
Comment 20 Age Bosma (IRC: Forage) 2011-09-12 09:51:11 UTC
Created attachment 196237 [details] [review]
Attempt to fetch coverart without having an internet connection

Here's a patch fixing the issue. Any attempt to fetch coverart was prevented when no internet connection was available. Embedded and Filesystem coverart jobs where therefore ignored. Instead, all coverart jobs requiring internet access (LastFM, etc,) should have, and have, an internet check on their own.

Note that, due to a different issue, it might appear that the issue has not been fixed with this patch when you add new albums to the library. Run Banshee with --fetch-artwork once after applying the patch as a workaround. As a bonus it will also fetch the (local) coverart of all files present in your library ;-)

I'll file a different issue for the other problem because it's not really related.
Comment 21 alejandro.maschiotakis 2011-10-06 15:18:35 UTC
I'm sorry but I'm kind of a newb.. how can I aplly this patch? I only see text..

Sorry to take up your time..

Thanks in advance,

Alejandro
Buenos Aires
Argentina
Comment 22 Age Bosma (IRC: Forage) 2011-10-06 15:37:48 UTC
(In reply to comment #21)
> I'm sorry but I'm kind of a newb.. how can I aplly this patch? I only see
> text..
> 

You'd have to get the Banshee source and compile it yourself. See comment 5 for an explanation, though instead of applying "embedded_coverart_debug.patch" you'd apply "fetch_without_inet.patch" (right-click the patch below and "Save Link As...")
Comment 23 Age Bosma (IRC: Forage) 2011-10-07 12:59:54 UTC
Created attachment 198526 [details] [review]
Attempt to fetch coverart without having an internet connection

Identical but properly formatted patch
Comment 24 Bertrand Lorentz 2011-10-23 20:21:20 UTC
Comment on attachment 198526 [details] [review]
Attempt to fetch coverart without having an internet connection

Thanks for the patch, good catch !

I split it in two commits, as the change in LastFMQueryJob is good but not directly related to the bug.
Comment 25 Bertrand Lorentz 2011-10-23 20:22:15 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.