本文整理汇总了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();
}
}
}
示例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');
}
}