#1701 docs updated (+minor fix)
This commit is contained in:
parent
06f4328e0b
commit
de2fe79833
5 changed files with 51 additions and 73 deletions
|
@ -834,7 +834,10 @@ class BasicStor extends Alib{
|
|||
* (may be empty or ommited only with less then 2 items in
|
||||
* "conditions" field)
|
||||
* </li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)
|
||||
* default sorting by dc:title (+ primary sorting by filetype -
|
||||
* audioclips, playlists, webstreams ...)
|
||||
* </li>
|
||||
* <li>desc : boolean - flag for descending order (optional)</li>
|
||||
* <li>conditions - array of hashes with structure:
|
||||
* <ul>
|
||||
|
|
|
@ -371,7 +371,10 @@ class GreenBox extends BasicStor{
|
|||
* </li>
|
||||
* <li>limit : int - limit for result arrays (0 means unlimited)</li>
|
||||
* <li>offset : int - starting point (0 means without offset)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)
|
||||
* default sorting by dc:title (+ primary sorting by filetype -
|
||||
* audioclips, playlists, webstreams ...)
|
||||
* </li>
|
||||
* <li>desc : boolean - flag for descending order (optional)</li>
|
||||
* <li>conditions - array of hashes with structure:
|
||||
* <ul>
|
||||
|
@ -1247,13 +1250,10 @@ class GreenBox extends BasicStor{
|
|||
*/
|
||||
function doTransportAction($trtok, $action)
|
||||
{
|
||||
// DUMMY
|
||||
return 'pending';
|
||||
/*
|
||||
require_once"Transport.php";
|
||||
$tr =& new Transport($this);
|
||||
return $tr->setTransportRState($action);
|
||||
*/
|
||||
$res = $tr->doTransportAction($trtok, $action);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/* ------------------------ methods for ls-archive-format file transports */
|
||||
|
|
|
@ -304,7 +304,10 @@ class LocStor extends BasicStor{
|
|||
* </li>
|
||||
* <li>limit : int - limit for result arrays (0 means unlimited)</li>
|
||||
* <li>offset : int - starting point (0 means without offset)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)
|
||||
* default sorting by dc:title (+ primary sorting by filetype -
|
||||
* audioclips, playlists, webstreams ...)
|
||||
* </li>
|
||||
* <li>desc : boolean - flag for descending order (optional)</li>
|
||||
* <li>conditions - array of hashes with structure:
|
||||
* <ul>
|
||||
|
|
|
@ -161,67 +161,6 @@ class Transport
|
|||
'expectedchsum', 'realchsum', 'title', 'errmsg'
|
||||
) as $k){
|
||||
$res[$k] = ( isset($trec->row[$k]) ? $trec->row[$k] : NULL );
|
||||
/* merged:
|
||||
// DUMMY
|
||||
switch($trtok){
|
||||
case'123456789abcdeff'; // upload/download
|
||||
return array(
|
||||
'state' => 'finished',
|
||||
'direction' => 'up',
|
||||
'trtype' => 'audioclip',
|
||||
'expectedsize' => 1024,
|
||||
'realsize' => 1024,
|
||||
'expectedchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'realchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'title' => 'DUMMY !',
|
||||
'errmsg' => '',
|
||||
);
|
||||
case'123456789abcdef2'; // upload/download
|
||||
return array(
|
||||
'state' => 'running',
|
||||
'direction' => 'down',
|
||||
'trtype' => 'playlist',
|
||||
'expectedsize' => 1624,
|
||||
'realsize' => 342,
|
||||
'expectedchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'realchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'title' => 'DUMMY playlist - 2',
|
||||
'errmsg' => '',
|
||||
);
|
||||
case'123456789abcdef3'; // upload/download
|
||||
return array(
|
||||
'state' => 'paused',
|
||||
'direction' => 'up',
|
||||
'trtype' => 'audioclip',
|
||||
'expectedsize' => 1024,
|
||||
'realsize' => 322,
|
||||
'expectedchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'realchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'title' => 'kakaoscsiga - 3',
|
||||
'errmsg' => '',
|
||||
);
|
||||
case'123456789abcdef4'; // upload/download
|
||||
return array(
|
||||
'state' => 'running',
|
||||
'direction' => 'up',
|
||||
'trtype' => 'playlist',
|
||||
'expectedsize' => 233,
|
||||
'realsize' => 23,
|
||||
'expectedchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'realchsum' => '12dd9137a855cf600881dd6d3ffa7517',
|
||||
'title' => 'ez egy playlist - 4',
|
||||
'errmsg' => '',
|
||||
);
|
||||
case'123456789abcdefe'; // search
|
||||
return array(
|
||||
'state' => 'finished',
|
||||
);
|
||||
default:
|
||||
return PEAR::raiseError(
|
||||
"Transport::getTransportInfo:".
|
||||
" invalid transport token ($trtok)"
|
||||
);
|
||||
*/
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
@ -252,6 +191,33 @@ class Transport
|
|||
return $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause, resume or cancel transport
|
||||
*
|
||||
* @param trtok: string - transport token
|
||||
* @param action: string - pause | resume | cancel
|
||||
* @return string - resulting transport state
|
||||
*/
|
||||
function doTransportAction($trtok, $action)
|
||||
{
|
||||
$trec = $r = TransportRecord::recall($this, $trtok);
|
||||
if(PEAR::isError($r)){ return $r; }
|
||||
switch($action){
|
||||
case'pause';
|
||||
$newState = 'paused';
|
||||
break;
|
||||
case'resume';
|
||||
$newState = 'waiting';
|
||||
break;
|
||||
case'cancel';
|
||||
$newState = 'closed';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
$res = $trec->setState($newState);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/* ------------- special methods for audioClip/webstream object transport */
|
||||
|
||||
/**
|
||||
|
@ -722,6 +688,7 @@ class Transport
|
|||
case'closed': // excluded in SQL query too, but let check it here
|
||||
case'failed': // -"-
|
||||
case'pending':
|
||||
case'paused':
|
||||
return TRUE;
|
||||
break;
|
||||
case'waiting':
|
||||
|
@ -1282,7 +1249,8 @@ class Transport
|
|||
fname, localfile, expectedsum, expectedsize, url,
|
||||
uid, target
|
||||
FROM {$this->transTable}
|
||||
WHERE $dirCond $targetCond $trtokCond state not in ('closed', 'failed')
|
||||
WHERE $dirCond $targetCond $trtokCond
|
||||
state not in ('closed', 'failed', 'paused')
|
||||
ORDER BY start DESC
|
||||
");
|
||||
if(PEAR::isError($rows)){ return $rows; }
|
||||
|
|
|
@ -2243,7 +2243,10 @@ class XR_LocStor extends LocStor{
|
|||
* </li>
|
||||
* <li>limit : int - limit for result arrays (0 means unlimited)</li>
|
||||
* <li>offset : int - starting point (0 means without offset)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)</li>
|
||||
* <li>orderby : string - metadata category for sorting (optional)
|
||||
* default sorting by dc:title (+ primary sorting by filetype -
|
||||
* audioclips, playlists, webstreams ...)
|
||||
* </li>
|
||||
* <li>desc : boolean - flag for descending order (optional)</li>
|
||||
* <li>conditions : array of struct with fields:
|
||||
* <ul>
|
||||
|
@ -3062,7 +3065,8 @@ class XR_LocStor extends LocStor{
|
|||
* fields:
|
||||
* <ul>
|
||||
* <li> sessid : string - session id </li>
|
||||
* <li> criteria: LS criteria format (see localSearch)</li>
|
||||
* <li> criteria : hash, LS criteria format - see searchMetadata method
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* On success, returns a XML-RPC struct with the following fields:
|
||||
|
@ -3300,7 +3304,7 @@ class XR_LocStor extends LocStor{
|
|||
* </ul>
|
||||
*
|
||||
* On success, returns the same result as searchMetadata with filetype
|
||||
* 'all' and no conditions,
|
||||
* 'all' and no conditions, ordered by filetype and dc:title
|
||||
* i.e. XML-RPC array of structs with fields:
|
||||
* <ul>
|
||||
* <li>cnt : integer - number of inserted files</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue