[mythtv-commits] Ticket #2942: Use id3v2 APIC tag for reading albumart
MythTV
mythtv at cvs.mythtv.org
Sat Apr 21 09:31:37 UTC 2007
#2942: Use id3v2 APIC tag for reading albumart
----------------------------+-----------------------------------------------
Reporter: myth at eskil.org | Owner: stuartm
Type: task | Status: assigned
Priority: minor | Milestone: 0.21
Component: mythmusic | Version: 0.20
Severity: low | Resolution:
----------------------------+-----------------------------------------------
Comment(by myth at eskil.org):
Ah, many rippers/taggers will just add an APIC frame with the cover art,
but with no description
Here's an addition to MetaIOTagLib::readAlbumArt (insert around line 327),
{{{
default:
VERBOSE(VB_GENERAL, QString ("Music Scanner - APIC tag
found "
"with unsupported type
%1").arg(frame->type()));
continue;
}
artlist.append(art);
}
// We didn't get any entries in artlist. If there are any APIC
// frames, many taggers/rippers just add the coverart but with no
// description, so let's just grab the first (we could go for
biggest?)
if (artlist.isEmpty () && apicframes.size () >= 1) {
VERBOSE(VB_GENERAL, "Music Scanner - no useable APIC tags
found, "
"using first...");
AlbumArtImage art;
AttachedPictureFrame *frame =
static_cast<AttachedPictureFrame*> (*apicframes.begin ());
art.imageType = (ImageType)frame->type();
art.typeName = "Front Cover";
art.description = TStringToQString(frame->description());
art.embedded = true;
artlist.append(art);
}
}}}
Pretty nasty, ie. casting the frame->type() directly to a ImageType is
going to be trouble, but it got me a bit closer. In most cases the 1 apic
will have type 0 (other), so instead of horrorcasting, we could just pick
the first type 0 frame and default to that if the artlist is empty. But
now it crashes because AlbumArtImages::getImageAt(unsigned int) is
missing...
'night...
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/2942#comment:7>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list