Permalink
Browse files

MythMusic: look for icons in the MusicArt storage group

  • Loading branch information...
Paul Harrison
Paul Harrison committed Apr 25, 2013
1 parent 998f203 commit eccf27415df7e2725a2a6b624b0c22711a06dce6
Showing with 24 additions and 1 deletion.
  1. +24 −1 mythplugins/mythmusic/mythmusic/musicutils.cpp
@@ -10,6 +10,7 @@
#include <mythdirs.h>
#include <mythlogging.h>
#include <mythcorecontext.h>
#include <remotefile.h>
extern "C" {
#include <libavformat/avformat.h>
@@ -32,7 +33,27 @@ QString fixFilename(const QString &filename)
QString findIcon(const QString &type, const QString &name)
{
QString cleanName = fixFilename(name);
QString file = GetConfDir() + QString("/MythMusic/Icons/%1/%2").arg(type).arg(cleanName);
QString file = QString("Icons/%1/%2").arg(type).arg(cleanName);
// first look in the 'MusicArt' storage group
QString filename = gCoreContext->GenMythURL(gCoreContext->GetSetting("MasterServerIP"),
gCoreContext->GetNumSetting("MasterServerPort"),
file, "MusicArt");
if (RemoteFile::Exists(filename + ".jpg"))
return filename + ".jpg";
if (RemoteFile::Exists(filename + ".jpeg"))
return filename + ".jpeg";
if (RemoteFile::Exists(filename + ".png"))
return filename + ".png";
if (RemoteFile::Exists(filename + ".gif"))
return filename + ".gif";
// not found so try the local config directory
file = GetConfDir() + "MythMusic/" + file;
if (QFile::exists(file + ".jpg"))
return file + ".jpg";
@@ -46,6 +67,8 @@ QString findIcon(const QString &type, const QString &name)
if (QFile::exists(file + ".gif"))
return file + ".gif";
LOG(VB_FILE, LOG_INFO, QString("findicon: not found for type: %1, name: %2").arg(type).arg(name));
return QString();
}

0 comments on commit eccf274

Please sign in to comment.