Example #1
0
 /**
  * getNewestPodcasts
  * Get the most recently published podcast episodes.
  * Takes the optional count in parameters
  */
 public static function getnewestpodcasts($input)
 {
     self::check_version($input, "1.13.0");
     $count = $input['count'] ?: 20;
     if (AmpConfig::get('podcast')) {
         $r = Subsonic_XML_Data::createSuccessResponse();
         $episodes = Catalog::get_newest_podcasts($count);
         Subsonic_XML_Data::addNewestPodcastEpisodes($r, $episodes);
     } else {
         $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_UNAUTHORIZED);
     }
     self::apiOutput($input, $r);
 }