コード例 #1
0
ファイル: module.php プロジェクト: Nall-chan/IPSSqueezeBox
 public function GetPlaylists()
 {
     $ret = $this->SendLMSData(new LMSData('playlists', array(0, 10000, 'tags:u')));
     if ($ret === false) {
         return false;
     }
     $SongInfo = new LSMSongInfo($ret);
     $Playlists = $SongInfo->GetAllSongs();
     foreach ($Playlists as $Key => $Playlist) {
         $raw = @$this->SendLMSData(new LMSData(array('playlists', 'tracks'), array(0, 10000, 'playlist_id:' . $Playlist['Id'], 'tags:d'), true));
         if ($raw === false) {
             trigger_error("Error read Playlist " . $Playlist['Id'] . ".", E_USER_NOTICE);
             $Playlists[$Key]['Playlist'] = $Playlists[$Key]['Playlist'] . " (ERROR ON READ DATA)";
             $Playlists[$Key]['Tracks'] = "";
             $Playlists[$Key]['Duration'] = "";
             continue;
         }
         $SongInfo = new LSMSongInfo($raw);
         $Playlists[$Key]['Tracks'] = $SongInfo->CountAllSongs();
         $Playlists[$Key]['Duration'] = $SongInfo->GetTotalDuration();
     }
     return $Playlists;
 }