Permalink
Browse files

AlbumArtImages: add a function to retrieve an image by ID

  • Loading branch information...
1 parent ad113b1 commit 4fe3cbc7c6e0acf26fc1afb982cedfc2da7b7dcf Paul Harrison committed Mar 2, 2014
Showing with 13 additions and 0 deletions.
  1. +12 −0 mythtv/libs/libmythmetadata/musicmetadata.cpp
  2. +1 −0 mythtv/libs/libmythmetadata/musicmetadata.h
@@ -1836,6 +1836,18 @@ AlbumArtImage *AlbumArtImages::getImage(ImageType type)
return NULL;
}
+AlbumArtImage *AlbumArtImages::getImageByID(int imageID)
+{
+ AlbumArtList::iterator it = m_imageList.begin();
+ for (; it != m_imageList.end(); ++it)
+ {
+ if ((*it)->id == imageID)
+ return *it;
+ }
+
+ return NULL;
+}
+
QStringList AlbumArtImages::getImageFilenames(void) const
{
QStringList paths;
@@ -478,6 +478,7 @@ class META_PUBLIC AlbumArtImages
void addImage(const AlbumArtImage &newImage);
uint getImageCount() { return m_imageList.size(); }
AlbumArtImage *getImage(ImageType type);
+ AlbumArtImage *getImageByID(int imageID);
QStringList getImageFilenames(void) const;
AlbumArtList *getImageList(void) { return &m_imageList; }
AlbumArtImage *getImageAt(uint index);

0 comments on commit 4fe3cbc

Please sign in to comment.