Bugfixes and itunes compatibility fix

This commit is contained in:
Duncan Sommerville 2015-11-17 17:23:21 -05:00
parent f2fae3c67e
commit 30c9c730be
4 changed files with 16 additions and 8 deletions

View File

@ -18,7 +18,14 @@ class Application_Common_HTTPHelper
); );
} }
public static function getStationUrl() /**
* Construct the base station URL
*
* @param boolean $secured whether or not to use HTTPS
*
* @return string the station URL
*/
public static function getStationUrl($secured = true)
{ {
$CC_CONFIG = Config::getConfig(); $CC_CONFIG = Config::getConfig();
$baseUrl = $CC_CONFIG['baseUrl']; $baseUrl = $CC_CONFIG['baseUrl'];
@ -32,7 +39,7 @@ class Application_Common_HTTPHelper
} }
$scheme = "http"; $scheme = "http";
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { if ($secured && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
$scheme = "https"; $scheme = "https";
$basePort = "443"; //Airtime Pro compatibility hack $basePort = "443"; //Airtime Pro compatibility hack
} }

View File

@ -152,14 +152,14 @@ class Application_Service_PodcastService
public static function createStationPodcast() public static function createStationPodcast()
{ {
$podcast = new Podcast(); $podcast = new Podcast();
$podcast->setDbUrl(Application_Common_HTTPHelper::getStationUrl() . "feeds/station-rss"); $podcast->setDbUrl(Application_Common_HTTPHelper::getStationUrl(false) . "feeds/station-rss");
$title = Application_Model_Preference::GetStationName(); $title = Application_Model_Preference::GetStationName();
$title = empty($title) ? "My Station's Podcast" : $title; $title = empty($title) ? "My Station's Podcast" : $title;
$podcast->setDbTitle($title); $podcast->setDbTitle($title);
$podcast->setDbDescription(Application_Model_Preference::GetStationDescription()); $podcast->setDbDescription(Application_Model_Preference::GetStationDescription());
$podcast->setDbLink(Application_Common_HTTPHelper::getStationUrl()); $podcast->setDbLink(Application_Common_HTTPHelper::getStationUrl(false));
$podcast->setDbLanguage(explode('_', Application_Model_Preference::GetLocale())[0]); $podcast->setDbLanguage(explode('_', Application_Model_Preference::GetLocale())[0]);
$podcast->setDbCreator(Application_Model_Preference::GetStationName()); $podcast->setDbCreator(Application_Model_Preference::GetStationName());
$podcast->setDbOwner(self::getOwnerId()); $podcast->setDbOwner(self::getOwnerId());
@ -368,11 +368,11 @@ class Application_Service_PodcastService
self::addEscapedChild($channel, "language", $podcast->getDbLanguage()); self::addEscapedChild($channel, "language", $podcast->getDbLanguage());
self::addEscapedChild($channel, "copyright", $podcast->getDbCopyright()); self::addEscapedChild($channel, "copyright", $podcast->getDbCopyright());
$imageUrl = Application_Common_HTTPHelper::getStationUrl()."images/airtime_logo.png"; $imageUrl = Application_Common_HTTPHelper::getStationUrl(false)."images/airtime_logo.png";
$image = $channel->addChild("image"); $image = $channel->addChild("image");
$image->addChild("title", "image title"); $image->addChild("title", "image title");
self::addEscapedChild($image, "url", $imageUrl); self::addEscapedChild($image, "url", $imageUrl);
self::addEscapedChild($image, "link", Application_Common_HTTPHelper::getStationUrl()); self::addEscapedChild($image, "link", Application_Common_HTTPHelper::getStationUrl(false));
$xml->addAttribute('xmlns:xmlns:itunes', ITUNES_XML_NAMESPACE_URL); $xml->addAttribute('xmlns:xmlns:itunes', ITUNES_XML_NAMESPACE_URL);
self::addEscapedChild($channel, "xmlns:itunes:author", $podcast->getDbItunesAuthor()); self::addEscapedChild($channel, "xmlns:itunes:author", $podcast->getDbItunesAuthor());

View File

@ -1386,6 +1386,7 @@ var AIRTIME = (function(AIRTIME) {
}); });
var openPodcastEpisodeTable = function (podcast) { var openPodcastEpisodeTable = function (podcast) {
$("#library_filter").append(" - " + podcast.title);
mod.podcastEpisodeTableWidget.reload(podcast.id); mod.podcastEpisodeTableWidget.reload(podcast.id);
mod.podcastTableWidget.clearSelection(); mod.podcastTableWidget.clearSelection();
mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES); mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES);
@ -1427,7 +1428,6 @@ var AIRTIME = (function(AIRTIME) {
// in the left-hand pane. // in the left-hand pane.
mod.podcastTableWidget.assignDblClickHandler(function () { mod.podcastTableWidget.assignDblClickHandler(function () {
var podcast = mod.podcastDataTable.fnGetData(this); var podcast = mod.podcastDataTable.fnGetData(this);
$("#library_filter").append(" - " + $(this).find(".library_title").text());
openPodcastEpisodeTable(podcast); openPodcastEpisodeTable(podcast);
}); });
@ -1489,7 +1489,6 @@ var AIRTIME = (function(AIRTIME) {
click: function () { click: function () {
var episodes = mod.podcastEpisodeTableWidget.getSelectedRows(); var episodes = mod.podcastEpisodeTableWidget.getSelectedRows();
AIRTIME.podcast.importSelectedEpisodes(episodes, mod.podcastEpisodeTableWidget); AIRTIME.podcast.importSelectedEpisodes(episodes, mod.podcastEpisodeTableWidget);
mod.podcastEpisodeTableWidget.clearSelection();
} }
}, },
validateConstraints: function () { validateConstraints: function () {

View File

@ -516,6 +516,8 @@ var AIRTIME = (function (AIRTIME) {
remainingDiskSpace -= this.enclosure.length; remainingDiskSpace -= this.enclosure.length;
}); });
dt.clearSelection();
}; };
/** /**