本文整理汇总了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;
}
示例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);
}
示例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);
}
}
示例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
//.........这里部分代码省略.........
示例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);
}
}