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


PHP Catalog::get_artists方法代码示例

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


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

示例1: getChildren

 public function getChildren()
 {
     $children = array();
     $catalogs = null;
     if ($this->catalog_id > 0) {
         $catalogs = array();
         $catalogs[] = $this->catalog_id;
     }
     $artists = Catalog::get_artists($catalogs);
     foreach ($artists as $artist) {
         $children[] = new WebDAV_Directory($artist);
     }
     return $children;
 }
开发者ID:nioc,项目名称:ampache,代码行数:14,代码来源:webdav_catalog.class.php

示例2: getartists

 /**
  * getArtists
  * Get all artists.
  * Takes no parameter.
  */
 public static function getartists($input)
 {
     self::check_version($input, "1.7.0");
     $r = Subsonic_XML_Data::createSuccessResponse();
     $artists = Catalog::get_artists(Catalog::get_catalogs());
     Subsonic_XML_Data::addArtistsRoot($r, $artists, true);
     self::apiOutput($input, $r);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:13,代码来源:subsonic_api.class.php

示例3: setSectionAll_Artists

 public static function setSectionAll_Artists(SimpleXMLElement $xml, Catalog $catalog)
 {
     self::setSectionAllAttributes($xml, $catalog, 'All Artists', 'artist');
     $artists = Catalog::get_artists(array($catalog->id));
     foreach ($artists as $artist) {
         self::addArtist($xml, $artist);
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:8,代码来源:plex_xml_data.class.php

示例4: _musicChilds

 public static function _musicChilds($prmPath, $prmQuery, $start, $count)
 {
     $mediaItems = array();
     $maxCount = 0;
     $queryData = array();
     parse_str($prmQuery, $queryData);
     $parent = 'amp://music' . $prmPath;
     $pathreq = explode('/', $prmPath);
     if ($pathreq[0] == '' && count($pathreq) > 0) {
         array_shift($pathreq);
     }
     switch ($pathreq[0]) {
         case 'artists':
             switch (count($pathreq)) {
                 case 1:
                     // Get artists list
                     //$artists = Catalog::get_artists();
                     //list($maxCount, $artists) = self::_slice($artists, $start, $count);
                     $artists = Catalog::get_artists(null, $count, $start);
                     list($maxCount, $artists) = array(999999, $artists);
                     foreach ($artists as $artist) {
                         $artist->format();
                         $mediaItems[] = self::_itemArtist($artist, $parent);
                     }
                     break;
                 case 2:
                     // Get artist's albums list
                     $artist = new Artist($pathreq[1]);
                     if ($artist->id) {
                         $album_ids = $artist->get_albums();
                         list($maxCount, $album_ids) = self::_slice($album_ids, $start, $count);
                         foreach ($album_ids as $album_id) {
                             $album = new Album($album_id);
                             $album->format();
                             $mediaItems[] = self::_itemAlbum($album, $parent);
                         }
                     }
                     break;
             }
             break;
         case 'albums':
             switch (count($pathreq)) {
                 case 1:
                     // Get albums list
                     //!!$album_ids = Catalog::get_albums();
                     //!!list($maxCount, $album_ids) = self::_slice($album_ids, $start, $count);
                     $album_ids = Catalog::get_albums($count, $start);
                     list($maxCount, $album_ids) = array(999999, $album_ids);
                     foreach ($album_ids as $album_id) {
                         $album = new Album($album_id);
                         $album->format();
                         $mediaItems[] = self::_itemAlbum($album, $parent);
                     }
                     break;
                 case 2:
                     // Get album's songs list
                     $album = new Album($pathreq[1]);
                     if ($album->id) {
                         $song_ids = $album->get_songs();
                         list($maxCount, $song_ids) = self::_slice($song_ids, $start, $count);
                         foreach ($song_ids as $song_id) {
                             $song = new Song($song_id);
                             $song->format();
                             $mediaItems[] = self::_itemSong($song, $parent);
                         }
                     }
                     break;
             }
             break;
         case 'songs':
             switch (count($pathreq)) {
                 case 1:
                     // Get songs list
                     $catalogs = Catalog::get_catalogs();
                     foreach ($catalogs as $catalog_id) {
                         $catalog = Catalog::create_from_id($catalog_id);
                         $songs = $catalog->get_songs();
                         list($maxCount, $songs) = self::_slice($songs, $start, $count);
                         foreach ($songs as $song) {
                             $song->format();
                             $mediaItems[] = self::_itemSong($song, $parent);
                         }
                     }
                     break;
             }
             break;
         case 'playlists':
             switch (count($pathreq)) {
                 case 1:
                     // Get playlists list
                     $pl_ids = Playlist::get_playlists();
                     list($maxCount, $pl_ids) = self::_slice($pl_ids, $start, $count);
                     foreach ($pl_ids as $pl_id) {
                         $playlist = new Playlist($pl_id);
                         $playlist->format();
                         $mediaItems[] = self::_itemPlaylist($playlist, $parent);
                     }
                     break;
                 case 2:
                     // Get playlist's songs list
//.........这里部分代码省略.........
开发者ID:nioc,项目名称:ampache,代码行数:101,代码来源:upnp_api.class.php

示例5: setSectionAll

 public static function setSectionAll($xml, $catalog)
 {
     $artists = Catalog::get_artists(array($catalog->id));
     $xml->addAttribute('allowSync', '1');
     self::setSectionXContent($xml, $catalog);
     $xml->addAttribute('title2', 'All Artists');
     $xml->addAttribute('nocache', '1');
     $xml->addAttribute('viewGroup', 'artist');
     $xml->addAttribute('viewMode', '65592');
     $xml->addAttribute('librarySectionID', $catalog->id);
     $xml->addAttribute('librarySectionUUID', self::uuidFromSubKey($catalog->id));
     foreach ($artists as $artist) {
         self::addArtist($xml, $artist);
     }
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:15,代码来源:plex_xml_data.class.php


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