当前位置: 首页>>代码示例>>PHP>>正文


PHP Catalog::get_podcasts方法代码示例

本文整理汇总了PHP中Catalog::get_podcasts方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::get_podcasts方法的具体用法?PHP Catalog::get_podcasts怎么用?PHP Catalog::get_podcasts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Catalog的用法示例。


在下文中一共展示了Catalog::get_podcasts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: refreshpodcasts

 /**
  * refreshPodcasts
  * Request the server to check for new podcast episodes.
  * Takes no parameters.
  */
 public static function refreshpodcasts($input)
 {
     self::check_version($input, "1.9.0");
     if (AmpConfig::get('podcast') && Access::check('interface', 75)) {
         $podcasts = Catalog::get_podcasts();
         foreach ($podcasts as $podcast) {
             $podcast->sync_episodes(true);
         }
         $r = Subsonic_XML_Data::createSuccessResponse();
     } else {
         $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_UNAUTHORIZED);
     }
     self::apiOutput($input, $r);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:19,代码来源:subsonic_api.class.php

示例2: _musicChilds


//.........这里部分代码省略.........
                         list($maxCount, $items) = self::_slice($items, $start, $count);
                         foreach ($items as $item) {
                             if ($item['object_type'] == 'song') {
                                 $song = new Song($item['object_id']);
                                 $song->format();
                                 $mediaItems[] = self::_itemSong($song, $parent);
                             }
                         }
                     }
                     break;
             }
             break;
         case 'smartplaylists':
             switch (count($pathreq)) {
                 case 1:
                     // Get playlists list
                     $pl_ids = Search::get_searches();
                     list($maxCount, $pl_ids) = self::_slice($pl_ids, $start, $count);
                     foreach ($pl_ids as $pl_id) {
                         $playlist = new Search($pl_id, 'song');
                         $playlist->format();
                         $mediaItems[] = self::_itemPlaylist($playlist, $parent);
                     }
                     break;
                 case 2:
                     // Get playlist's songs list
                     $playlist = new Search($pathreq[1], 'song');
                     if ($playlist->id) {
                         $items = $playlist->get_items();
                         list($maxCount, $items) = self::_slice($items, $start, $count);
                         foreach ($items as $item) {
                             if ($item['object_type'] == 'song') {
                                 $song = new Song($item['object_id']);
                                 $song->format();
                                 $mediaItems[] = self::_itemSong($song, $parent);
                             }
                         }
                     }
                     break;
             }
             break;
         case 'live_streams':
             switch (count($pathreq)) {
                 case 1:
                     // Get radios list
                     $radios = Live_Stream::get_all_radios();
                     list($maxCount, $radios) = self::_slice($radios, $start, $count);
                     foreach ($radios as $radio_id) {
                         $radio = new Live_Stream($radio_id);
                         $radio->format();
                         $mediaItems[] = self::_itemLiveStream($radio, $parent);
                     }
                     break;
             }
             break;
         case 'podcasts':
             switch (count($pathreq)) {
                 case 1:
                     // Get podcasts list
                     $podcasts = Catalog::get_podcasts();
                     list($maxCount, $podcasts) = self::_slice($podcasts, $start, $count);
                     foreach ($podcasts as $podcast) {
                         $podcast->format();
                         $mediaItems[] = self::_itemPodcast($podcast, $parent);
                     }
                     break;
                 case 2:
                     // Get podcast episodes list
                     $podcast = new Podcast($pathreq[1]);
                     if ($podcast->id) {
                         $episodes = $podcast->get_episodes();
                         list($maxCount, $episodes) = self::_slice($episodes, $start, $count);
                         foreach ($episodes as $episode_id) {
                             $episode = new Podcast_Episode($episode_id);
                             $episode->format();
                             $mediaItems[] = self::_itemPodcastEpisode($episode, $parent);
                         }
                     }
                     break;
             }
             break;
         default:
             $mediaItems[] = self::_musicMetadata('artists');
             $mediaItems[] = self::_musicMetadata('albums');
             $mediaItems[] = self::_musicMetadata('songs');
             $mediaItems[] = self::_musicMetadata('playlists');
             $mediaItems[] = self::_musicMetadata('smartplaylists');
             if (AmpConfig::get('live_stream')) {
                 $mediaItems[] = self::_musicMetadata('live_streams');
             }
             if (AmpConfig::get('podcast')) {
                 $mediaItems[] = self::_musicMetadata('podcasts');
             }
             break;
     }
     if ($maxCount == 0) {
         $maxCount = count($mediaItems);
     }
     return array($maxCount, $mediaItems);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:101,代码来源:upnp_api.class.php


注:本文中的Catalog::get_podcasts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。