當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Playlist::delete_track_number方法代碼示例

本文整理匯總了PHP中Playlist::delete_track_number方法的典型用法代碼示例。如果您正苦於以下問題:PHP Playlist::delete_track_number方法的具體用法?PHP Playlist::delete_track_number怎麽用?PHP Playlist::delete_track_number使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist的用法示例。


在下文中一共展示了Playlist::delete_track_number方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _updatePlaylist

 private static function _updatePlaylist($id, $name, $songsIdToAdd = array(), $songIndexToRemove = array(), $public = true)
 {
     $playlist = new Playlist($id);
     $newdata = array();
     $newdata['name'] = !empty($name) ? $name : $playlist->name;
     $newdata['pl_type'] = $public ? "public" : "private";
     $playlist->update($newdata);
     if ($songsIdToAdd) {
         if (!is_array($songsIdToAdd)) {
             $songsIdToAdd = array($songsIdToAdd);
         }
         if (count($songsIdToAdd) > 0) {
             for ($i = 0; $i < count($songsIdToAdd); ++$i) {
                 $songsIdToAdd[$i] = Subsonic_XML_Data::getAmpacheId($songsIdToAdd[$i]);
             }
             $playlist->add_songs($songsIdToAdd);
         }
     }
     if ($songIndexToRemove) {
         if (!is_array($songIndexToRemove)) {
             $songIndexToRemove = array($songIndexToRemove);
         }
         if (count($songIndexToRemove) > 0) {
             foreach ($songIndexToRemove as $track) {
                 $playlist->delete_track_number($track);
             }
             $playlist->regenerate_track_numbers();
         }
     }
 }
開發者ID:bl00m,項目名稱:ampache,代碼行數:30,代碼來源:subsonic_api.class.php

示例2: playlist_remove_song

 /**
  * playlist_remove_song
  * This remove a song from a playlist
  */
 public static function playlist_remove_song($input)
 {
     ob_end_clean();
     $playlist = new Playlist($input['filter']);
     $track = new Playlist($input['track']);
     if (!$playlist->has_access()) {
         echo XML_Data::error('401', T_('Access denied to this playlist.'));
     } else {
         $playlist->delete_track_number($track);
         echo XML_Data::single_string('success');
     }
 }
開發者ID:axelsimon,項目名稱:ampache,代碼行數:16,代碼來源:api.class.php


注:本文中的Playlist::delete_track_number方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。