CC-3290: A file should be removed from playlists if it is removed

through the interface

- fixed
This commit is contained in:
James 2012-01-31 16:12:11 -05:00
parent 5d02581d38
commit 4ffe79a286
2 changed files with 5 additions and 4 deletions

View File

@ -168,7 +168,7 @@ class LibraryController extends Zend_Controller_Action
return; return;
} }
$res = $file->delete(); $res = $file->delete(true);
if (PEAR::isError($res)) { if (PEAR::isError($res)) {
$this->view->message = $res->getMessage(); $this->view->message = $res->getMessage();

View File

@ -303,7 +303,7 @@ class Application_Model_StoredFile {
* *
* @return void|PEAR_Error * @return void|PEAR_Error
*/ */
public function delete() public function delete($deleteFromPlaylist=false)
{ {
if ($this->exists()) { if ($this->exists()) {
if ($this->getFormat() == 'audioclip') { if ($this->getFormat() == 'audioclip') {
@ -314,8 +314,9 @@ class Application_Model_StoredFile {
} }
} }
// don't delete from the playslist. We might want to put a flag if($deleteFromPlaylist){
//Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId()); Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId());
}
// set file_exists falg to false // set file_exists falg to false
$this->_file->setDbFileExists(false); $this->_file->setDbFileExists(false);