2015-09-16 20:22:13 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Service_PodcastService
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* There is maximum of 50 podcasts allowed in the library - to limit
|
|
|
|
* resource consumption. This function returns true if the podcast
|
|
|
|
* limit has been reached.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public static function podcastLimitReached()
|
|
|
|
{
|
|
|
|
if (PodcastQuery::create()->count() >= 50) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-09-18 14:15:48 +02:00
|
|
|
* Returns parsed rss feed, or false if the given URL cannot be downloaded
|
2015-09-16 20:22:13 +02:00
|
|
|
*
|
|
|
|
* @param $podcastUrl String containing the podcast feed URL
|
|
|
|
*
|
2015-09-18 14:15:48 +02:00
|
|
|
* @return mixed
|
2015-09-16 20:22:13 +02:00
|
|
|
*/
|
2015-09-18 14:15:48 +02:00
|
|
|
public static function getPodcastFeed($podcastUrl)
|
2015-09-16 20:22:13 +02:00
|
|
|
{
|
2015-09-18 14:15:48 +02:00
|
|
|
try {
|
|
|
|
return Feed::loadRss($podcastUrl);
|
|
|
|
} catch (FeedException $e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getPodcastEpisodeFeed($podcast)
|
|
|
|
{
|
|
|
|
|
2015-09-16 20:22:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|