From 3d0bdd00e57551f86862efe20d6a25f1e33de2c7 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 1 Sep 2013 17:05:08 +0200 Subject: Fixed a bug that banner is only filled with path if image exists in Filesystem --- HISTORY | 4 ++++ imageserver.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index d69b584..4422ba7 100644 --- a/HISTORY +++ b/HISTORY @@ -26,3 +26,7 @@ Version 0.0.4 - do some more sophisticated search for recordings first replace all "-" with " " in rec title second remove everything behind "-" in rec title + +Version 0.0.5 +- Fixed a bug that banner is only filled with path if + image exists in Filesystem diff --git a/imageserver.c b/imageserver.c index 0e72b13..2fb14a4 100644 --- a/imageserver.c +++ b/imageserver.c @@ -80,11 +80,17 @@ tvMedia cImageServer::GetPoster(int id, scrapType type) { tvMedia cImageServer::GetBanner(int id) { tvMedia media; + media.path = ""; + media.width = 0; + media.height = 0; stringstream path; path << config.GetBaseDir() << "/series/" << id << "/banner.jpg"; - media.path = path.str(); - media.width = 758; - media.height = 140; + string fileBanner = path.str(); + if (FileExists(fileBanner)) { + media.path = fileBanner; + media.width = 758; + media.height = 140; + } return media; } -- cgit v1.2.3