From 2854dd40e04bf2f754d3163e68a8fb62d785001d Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 2 Nov 2012 16:54:49 -0400 Subject: [PATCH 1/2] CC-4663: Smart Blocks -> Deleting a track in smart block from library gives error -fixed -tracks with undefined mime type were not handled properly --- airtime_mvc/public/js/airtime/library/spl.js | 48 +++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index e79678201..1b5e765a4 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -369,29 +369,33 @@ var AIRTIME = (function(AIRTIME){ $.each($("div .big_play"), function(index, value){ if ($(value).attr('blockId') === undefined) { var mime = $(value).attr("data-mime-type"); - if (isAudioSupported(mime)) { - $(value).bind("click", openAudioPreview); - } else { - $(value).attr("class", "big_play_disabled dark_class"); - $(value).qtip({ - content: 'Your browser does not support playing this file type: "'+ mime +'"', - show: 'mouseover', - hide: { - delay: 500, - fixed: true - }, - style: { - border: { - width: 0, - radius: 4 + //If mime is undefined it is likely because the file was + //deleted from the library. This case is handled in mod.onReady() + if (mime !== undefined) { + if (isAudioSupported(mime)) { + $(value).bind("click", openAudioPreview); + } else { + $(value).attr("class", "big_play_disabled dark_class"); + $(value).qtip({ + content: 'Your browser does not support playing this file type: "'+ mime +'"', + show: 'mouseover', + hide: { + delay: 500, + fixed: true }, - classes: "ui-tooltip-dark ui-tooltip-rounded" - }, - position: { - my: "left bottom", - at: "right center" - }, - }) + style: { + border: { + width: 0, + radius: 4 + }, + classes: "ui-tooltip-dark ui-tooltip-rounded" + }, + position: { + my: "left bottom", + at: "right center" + }, + }) + } } } else { if ($(value).attr('blocktype') === 'dynamic') { From 106b18bf30f544fc261cbe2d53781ab5e7592eb1 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 2 Nov 2012 17:49:32 -0400 Subject: [PATCH 2/2] CC-4637: Media Library: Item will be removed from Playlist if it's removed from Library -fixed --- airtime_mvc/application/controllers/LibraryController.php | 2 +- airtime_mvc/application/models/StoredFile.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index 353d131f8..5bd5949de 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -321,7 +321,7 @@ class LibraryController extends Zend_Controller_Action if (isset($file)) { try { - $res = $file->delete(true); + $res = $file->delete(); } catch (FileNoPermissionException $e) { $message = $noPermissionMsg; } catch (Exception $e) { diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 2bd6470ea..51693f46d 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -335,7 +335,7 @@ SQL; * @param boolean $p_deleteFile * */ - public function delete($deleteFromPlaylist=false) + public function delete() { $filepath = $this->getFilePath(); @@ -359,9 +359,6 @@ SQL; Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data); } - if ($deleteFromPlaylist) { - Application_Model_Playlist::DeleteFileFromAllPlaylists($this->getId()); - } // set file_exists falg to false $this->_file->setDbFileExists(false); $this->_file->save();