From 1571887928a742657f7bb7284b81edf0c915f8bf Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 17 Nov 2015 18:58:58 -0500 Subject: [PATCH 1/2] Change how station logo default is returned --- airtime_mvc/application/controllers/ApiController.php | 1 - airtime_mvc/application/controllers/DashboardController.php | 6 +----- airtime_mvc/application/models/Preference.php | 4 +++- airtime_mvc/application/services/PodcastService.php | 2 +- .../views/scripts/form/preferences_general.phtml | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 3b2c52eb4..deac3f998 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -23,7 +23,6 @@ class ApiController extends Zend_Controller_Action "shows", "show-tracks", "show-schedules", - "station-logo", "show-logo", "stream-m3u" ); diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php index dbf273f03..3e403f818 100644 --- a/airtime_mvc/application/controllers/DashboardController.php +++ b/airtime_mvc/application/controllers/DashboardController.php @@ -101,11 +101,7 @@ class DashboardController extends Zend_Controller_Action $this->_helper->layout->setLayout('livestream'); $logo = Application_Model_Preference::GetStationLogo(); - if ($logo === DEFAULT_LOGO_PLACEHOLDER) { - $this->view->logo = "/".DEFAULT_LOGO_FILE; - } else { - $this->view->logo = "data:image/png;base64,".$logo; - } + $this->view->logo = "data:image/png;base64,".$logo; } public function helpAction() diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 874a75969..05bc43f8f 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -576,7 +576,9 @@ class Application_Model_Preference } else { // We return the Airtime logo if no logo is set in the database. // airtime_logo.png is stored under the public directory - return DEFAULT_LOGO_PLACEHOLDER; + $image = @file_get_contents(Application_Common_HTTPHelper::getStationUrl() . DEFAULT_LOGO_FILE); + $image = base64_encode($image); + return $image; } } diff --git a/airtime_mvc/application/services/PodcastService.php b/airtime_mvc/application/services/PodcastService.php index 333e8a865..ba0852fd5 100644 --- a/airtime_mvc/application/services/PodcastService.php +++ b/airtime_mvc/application/services/PodcastService.php @@ -368,7 +368,7 @@ class Application_Service_PodcastService self::addEscapedChild($channel, "language", $podcast->getDbLanguage()); self::addEscapedChild($channel, "copyright", $podcast->getDbCopyright()); - $imageUrl = Application_Common_HTTPHelper::getStationUrl(false)."images/airtime_logo.png"; + $imageUrl = Application_Common_HTTPHelper::getStationUrl(false)."api/station-logo"; $image = $channel->addChild("image"); $image->addChild("title", "image title"); self::addEscapedChild($image, "url", $imageUrl); diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 514afb9f2..4ef93aaa5 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -14,7 +14,7 @@
element->getView()->logoImg; - $src = ($logoImg === DEFAULT_LOGO_PLACEHOLDER) ? DEFAULT_LOGO_FILE : "data:image/png;base64,".$logoImg; + $src = "data:image/png;base64,".$logoImg; ?>
From 6aafe25fd1213359c3c6edc99fb0b52fac39939e Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 17 Nov 2015 19:28:52 -0500 Subject: [PATCH 2/2] Change station RSS image title to match channel title --- airtime_mvc/application/services/PodcastService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/services/PodcastService.php b/airtime_mvc/application/services/PodcastService.php index ba0852fd5..16241d4a3 100644 --- a/airtime_mvc/application/services/PodcastService.php +++ b/airtime_mvc/application/services/PodcastService.php @@ -370,7 +370,7 @@ class Application_Service_PodcastService $imageUrl = Application_Common_HTTPHelper::getStationUrl(false)."api/station-logo"; $image = $channel->addChild("image"); - $image->addChild("title", "image title"); + $image->addChild("title", $podcast->getDbTitle()); self::addEscapedChild($image, "url", $imageUrl); self::addEscapedChild($image, "link", Application_Common_HTTPHelper::getStationUrl(false));