CC-84: Smart Playlists
- started storing last played time in cc_files - db column (lptime) already existed but was not being used before this - will use this as a criteria for smart playlists
This commit is contained in:
parent
9fcc851523
commit
647de9ed39
3 changed files with 35 additions and 7 deletions
|
@ -349,6 +349,18 @@ class ApiController extends Zend_Controller_Action
|
|||
$schedule_group_id = $this->_getParam("schedule_id");
|
||||
$media_id = $this->_getParam("media_id");
|
||||
$result = Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
|
||||
|
||||
//set a 'last played' timestamp for media item
|
||||
//needed for smart playlists
|
||||
try{
|
||||
$file_id = Application_Model_Schedule::GetFileId($media_id);
|
||||
$file = Application_Model_StoredFile::Recall($file_id);
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$file->setLastPlayedTime($now);
|
||||
}catch(Exception $e){
|
||||
Logging::log($e);
|
||||
}
|
||||
|
||||
echo json_encode(array("status"=>1, "message"=>""));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue