The acId parameter of delAudioClipFromPlaylist method have been changed
to plElGunid - gunid of deleted playlistElement.
This commit is contained in:
parent
1d00e4587d
commit
47d38718ae
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.44 $
|
Version : $Revision: 1.45 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -35,7 +35,7 @@ require_once "BasicStor.php";
|
||||||
* LiveSupport file storage module
|
* LiveSupport file storage module
|
||||||
*
|
*
|
||||||
* @author $Author: tomas $
|
* @author $Author: tomas $
|
||||||
* @version $Revision: 1.44 $
|
* @version $Revision: 1.45 $
|
||||||
* @see BasicStor
|
* @see BasicStor
|
||||||
*/
|
*/
|
||||||
class GreenBox extends BasicStor{
|
class GreenBox extends BasicStor{
|
||||||
|
@ -485,10 +485,8 @@ class GreenBox extends BasicStor{
|
||||||
* @param token string, playlist access token
|
* @param token string, playlist access token
|
||||||
* @param acId string, local ID of added file
|
* @param acId string, local ID of added file
|
||||||
* @param sessid string, session ID
|
* @param sessid string, session ID
|
||||||
* <span style="color:red">
|
|
||||||
* @param fadeIn string, optional, in time format hh:mm:ss.ssssss
|
* @param fadeIn string, optional, in time format hh:mm:ss.ssssss
|
||||||
* @param fadeOut string, dtto
|
* @param fadeOut string, dtto
|
||||||
* </span>
|
|
||||||
* @return string, generated playlistElement gunid
|
* @return string, generated playlistElement gunid
|
||||||
*/
|
*/
|
||||||
function addAudioClipToPlaylist($token, $acId, $sessid,
|
function addAudioClipToPlaylist($token, $acId, $sessid,
|
||||||
|
@ -606,14 +604,16 @@ class GreenBox extends BasicStor{
|
||||||
* Remove audioclip from playlist
|
* Remove audioclip from playlist
|
||||||
*
|
*
|
||||||
* @param token string, playlist access token
|
* @param token string, playlist access token
|
||||||
* @param acId int, local id of deleted audioClip
|
* <span style="color:red">
|
||||||
|
* @param plElGunid string, global id of deleted playlistElement
|
||||||
|
* </span>
|
||||||
* @param sessid string, session ID
|
* @param sessid string, session ID
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function delAudioClipFromPlaylist($token, $acId, $sessid)
|
function delAudioClipFromPlaylist($token, $plElGunid, $sessid)
|
||||||
{
|
{
|
||||||
$acGunid = $this->_gunidFromId($acId);
|
# $acGunid = $this->_gunidFromId($acId);
|
||||||
if(PEAR::isError($acGunid)) return $acGunid;
|
# if(PEAR::isError($acGunid)) return $acGunid;
|
||||||
$plGunid = $this->_gunidFromToken($token, 'download');
|
$plGunid = $this->_gunidFromToken($token, 'download');
|
||||||
if(PEAR::isError($plGunid)) return $plGunid;
|
if(PEAR::isError($plGunid)) return $plGunid;
|
||||||
if(is_null($plGunid)){
|
if(is_null($plGunid)){
|
||||||
|
@ -644,13 +644,13 @@ class GreenBox extends BasicStor{
|
||||||
if(PEAR::isError($plElArr)){ return $plElArr; }
|
if(PEAR::isError($plElArr)){ return $plElArr; }
|
||||||
$found = FALSE;
|
$found = FALSE;
|
||||||
foreach($plElArr as $el){
|
foreach($plElArr as $el){
|
||||||
$acArr = $pl->md->getMetadataEl('audioClip', $el['mid']);
|
$plElGunidArr = $pl->md->getMetadataEl('id', $el['mid']);
|
||||||
if(PEAR::isError($acArr)){ return $acArr; }
|
if(PEAR::isError($plElGunidArr)){ return $plElGunidArr; }
|
||||||
$storedAcMid = $acArr[0]['mid'];
|
|
||||||
$acGunidArr = $pl->md->getMetadataEl('id', $storedAcMid);
|
|
||||||
if(PEAR::isError($acGunidArr)){ return $acGunidArr; }
|
|
||||||
// select playlist element to remove
|
// select playlist element to remove
|
||||||
if($acGunidArr[0]['value'] == $acGunid){
|
if($plElGunidArr[0]['value'] == $plElGunid){
|
||||||
|
$acArr = $pl->md->getMetadataEl('audioClip', $el['mid']);
|
||||||
|
if(PEAR::isError($acArr)){ return $acArr; }
|
||||||
|
$storedAcMid = $acArr[0]['mid'];
|
||||||
$acLenArr = $pl->md->getMetadataEl('playlength', $storedAcMid);
|
$acLenArr = $pl->md->getMetadataEl('playlength', $storedAcMid);
|
||||||
if(PEAR::isError($acLenArr)){ return $acLenArr; }
|
if(PEAR::isError($acLenArr)){ return $acLenArr; }
|
||||||
$acLen = $acLenArr[0]['value'];
|
$acLen = $acLenArr[0]['value'];
|
||||||
|
@ -683,6 +683,12 @@ class GreenBox extends BasicStor{
|
||||||
if(PEAR::isError($r)){ return $r; }
|
if(PEAR::isError($r)){ return $r; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!$found){
|
||||||
|
return PEAR::raiseError(
|
||||||
|
"GreenBox::delAudioClipFromPlaylist: playlistElement not found".
|
||||||
|
" ($plElGunid)"
|
||||||
|
);
|
||||||
|
}
|
||||||
// correct total length:
|
// correct total length:
|
||||||
$newPlLen = $this->_secsToPlTime(
|
$newPlLen = $this->_secsToPlTime(
|
||||||
$this->_plTimeToSecs($plLen) - $this->_plTimeToSecs($acLen)
|
$this->_plTimeToSecs($plLen) - $this->_plTimeToSecs($acLen)
|
||||||
|
|
Loading…
Reference in New Issue