Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the ChannelIcon storage group in the services API Guide/GetChanne…

…lIcon()
  • Loading branch information...
commit d34c696d2308bc1318b2704781bc15c0b4319b8c 1 parent 26454ee
@stuartm stuartm authored
Showing with 29 additions and 3 deletions.
  1. +29 −3 mythtv/programs/mythbackend/services/guide.cpp
View
32 mythtv/programs/mythbackend/services/guide.cpp
@@ -229,12 +229,38 @@ QFileInfo Guide::GetChannelIcon( int nChanId,
if (sFileName.isEmpty())
return QFileInfo();
- if ((nWidth <= 0) && (nHeight <= 0))
+ // ------------------------------------------------------------------
+ // Search for the filename
+ // ------------------------------------------------------------------
+
+ StorageGroup storage( "ChannelIcons" );
+ QString sFullFileName = storage.FindFile( sFileName );
+
+ if (sFullFileName.isEmpty())
{
- // Use default pixmap
- return QFileInfo( sFileName );
+ LOG(VB_UPNP, LOG_ERR,
+ QString("GetImageFile - Unable to find %1.").arg(sFileName));
+
+ return QFileInfo();
}
+ // ----------------------------------------------------------------------
+ // check to see if the file (still) exists
+ // ----------------------------------------------------------------------
+
+ if ((nWidth == 0) && (nHeight == 0))
+ {
+ if (QFile::exists( sFullFileName ))
+ {
+ return QFileInfo( sFullFileName );
+ }
+
+ LOG(VB_UPNP, LOG_ERR,
+ QString("GetImageFile - File Does not exist %1.").arg(sFullFileName));
+
+ return QFileInfo();
+ }
+ // -------------------------------------------------------------------
QString sNewFileName = QString( "%1.%2x%3.png" )
.arg( sFileName )
Please sign in to comment.
Something went wrong with that request. Please try again.