Bug 15204 - Some tracks return absolute file path for artwork
: Some tracks return absolute file path for artwork
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Artwork
: 7.5.0
: PC Other
: P1 normal (vote)
: 7.5.0
Assigned To: Andy Grundman
: ipeng
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-28 03:25 UTC by Joerg Schwieder
Modified: 2010-04-08 17:25 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Schwieder 2009-11-28 03:25:06 UTC
Whenever the server scans a new album by browsing to the album, I then don't get an artwork ID or something but a "coverart" field containing the absolute path to the file, e.g. (INCLUDING the spaces!!! NOT URL encoded)

/mnt/music/Nick Cave/Murder Ballads/folder.jpg

SB Touch seems to be able to display those, but I haven't found a way to retrieve these files from the server. Using the track ID I don't get any artwork.

How is this supposed to work?
Comment 1 Andy Grundman 2009-11-28 09:04:17 UTC
Hmm that's wrong, but I bet it's fixed in 7.5 embedded, where I completely rewrote the way covers work.
Comment 2 Joerg Schwieder 2009-11-28 14:15:31 UTC
Can I run 7.5 embedded on a "normal" Linux System? Wil this be backported into the main branch?
Comment 3 Andy Grundman 2009-11-28 17:34:58 UTC
Yeah embedded can be run everywhere.
Comment 4 Joerg Schwieder 2009-11-29 03:25:33 UTC
Not on my Ubuntu server 8.04 LTS, see the forum thread, probably OT here :)
Comment 5 Michael Herger 2009-11-30 03:07:43 UTC
J?rg - what exact query are you using?
Comment 6 Joerg Schwieder 2009-11-30 04:33:49 UTC
status - 1 tags:uBJjKlax subscribe:42
Comment 7 Michael Herger 2009-11-30 05:55:16 UTC
Thanks - confirmed:

- connect to the server on the CLI
- create a status listener using the command in comment 6
- play some new music using BMF

-> the tracks.cover column instead of an id now has the path to the cover file
Comment 8 Andy Grundman 2009-11-30 05:58:43 UTC
It's broken in embedded?  tracks.cover is supposed to contain a full path.  tracks.coverid has the id for display.  The tag for coverid is 'c'.
Comment 9 Joerg Schwieder 2009-11-30 06:05:33 UTC
Andy,

a) why change these things with every release? In 7.4 "coverart" contains an id, why not add "coverartpath" or something instead of changing the meaning of one field and introducing a new one having the old meaning of the first one?

b) the biggest issue is that the path is invalid. coverart contains an absolute path on the machine the server runs on which is not even URL escaped; I did not find a way to retrieve a cover using that path.
Comment 10 Andy Grundman 2009-11-30 06:10:18 UTC
Because artwork is fundamentally broken in current releases, the main issue is the use of track IDs which can change after rescan and this causes cache issues for browsers, SP, iPeng, etc.  Now the id is a hex checksum based on the URL, filesize, and some other stuff thus fixing the cache problems.
Comment 11 Joerg Schwieder 2009-11-30 06:16:53 UTC
Ah. This is good.
But I still don't understand why not to use that in "coverart" instead of "coverartid"?

MY big issue here is that my code for displaying a cover already today looks like this:
	if (item) {
		lArtist.text = (temp) ? temp : [iPengAppAppDelegate globalDictString:@"REMOTE_STREAMING" andDefault:@"Remote-Stream"];
		int ca = 0;
		if ([(temp = [item objectForKey:@"coverart"]) respondsToSelector:@selector(intValue)])
			ca = [temp intValue];
		if (ca)
			path = [NSString stringWithFormat:PATH_ARTWORK_COVER(picSize), [item objectForKey:@"id"]];
		else if ([item objectForKey:@"artwork_track_id"])
			path = [NSString stringWithFormat:PATH_ARTWORK_COVER(picSize), [item objectForKey:@"artwork_track_id"]];
		else if ([item objectForKey:@"artwork_url"])
			path = [item objectForKey:@"artwork_url"];
		else if ([item objectForKey:@"remote"]) {
			artwork.image = [UIImage imageNamed:@"radio.png"];
			mirrorImage.image = nil;
			return;
		} else {
			artwork.image = [[UIImage imageNamed:@"cover.JPG"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0];
			mirrorImage.image = nil;
			return;
		}
	} else {
		lArtist.text = nil;
		artwork.image = [[UIImage imageNamed:@"coverDark.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0];
		mirrorImage.image = nil;
		if (player.artwork)
			player.artwork = nil;
		return;
	}

Now for 7.5 I have to add a few more exceptions and special cases. But I can't drop any of the old ones because I have to support other server versions as well.

What is so difficult about using new fields for new information and keeping old ones.
I don't care what _type_ the coverart field is, it may as well be a url, but I want to be able to retieve it from the server in the same way I could retrieve it before, which is not the case with something containing unescaped spaces and slashes.
Comment 12 Michael Herger 2009-12-01 23:01:39 UTC
Andy - what needs to be fixed here? I understand it you think it's a "works as designed" - why a P1 then?
Comment 13 Joerg Schwieder 2009-12-02 08:19:58 UTC
Because _in addition_ to the design change in the case above the URL is also wrong.
Comment 14 SVN Bot 2010-02-12 10:46:50 UTC
 == Auto-comment from SVN commit #30145 to the  repo by agrundman ==
 == https://svn.slimdevices.com/?view=revision&revision=30145 ==

Fixed bug 15204, coverArtExists method was returning the value of the cover column instead of 1
Comment 15 Andy Grundman 2010-02-12 10:48:39 UTC
The problem here was just that the 'j' tag was using coverArtExists() which was returning the actual cover column value.  This bug wasn't just related to BMF, but any track that contained a cover.jpg image.

BTW, don't worry about embedded, cover art works great with iPeng under embedded.  The changes I made are internal and don't affect the CLI.
Comment 16 Joerg Schwieder 2010-02-12 15:16:59 UTC
Thanks for fixing this :)
I'll give it a try with the next firmware on the touch.
Still can't get embedded to run on my main server, although I do now have another one to try it out on.
Comment 17 Chris Owens 2010-04-08 17:25:26 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!