diff --git a/LICENSE_3RD_PARTY b/LICENSE_3RD_PARTY
index 7096a6f55..0abbe77eb 100644
--- a/LICENSE_3RD_PARTY
+++ b/LICENSE_3RD_PARTY
@@ -22,7 +22,7 @@ Common Non-linked Code
Airtime Web
-----------
Linked code:
- * Zend Framework 1.10.3
+ * Zend Framework 1.10.3
- What is it: Framework for PHP web apps
- Web site: http://framework.zend.com/
- License: New BSD license
@@ -32,7 +32,7 @@ Linked code:
- What is it: PHP library
- Notes: We only use the PEAR base class PEAR_Error, in the "PEAR" PEAR library.
- License: New BSD License
- - Compatible with GPLv3? Yes.
+ - Compatible with GPLv3? Yes.
* Propel ORM
- What is it: Maps DB data into PHP objects
@@ -40,7 +40,7 @@ Linked code:
- License: MIT/Expat License
- Compatible with the GPL: Yes. See http://www.gnu.org/licenses/license-list.html
- * Phing
+ * Phing
- What is it: PHP project build system
- Web site: http://phing.info/trac/
- Note: Only used for development, not needed to run Airtime.
@@ -48,22 +48,27 @@ Linked code:
* PHP-AMQPLIB
- What is it: PHP library to interact with RabbitMQ
- - Web site: https://github.com/tnc/php-amqplib
+ - Web site: https://github.com/tnc/php-amqplib
- License: LGPLv2.1
- Compatible with GPLv3? Yes
* Soundcloud PHP API wrapper
- What is it: PHP library to upload to SoundCloud
- Web site: https://github.com/mptre/php-soundcloud/blob/master/Services/Soundcloud.php
- - License: MIT
+ - License: MIT
- Compatible with the GPL: Yes. See http://www.gnu.org/licenses/license-list.html
+ * getID3()
+ - What is it: PHP script that extracts useful information from MP3s & other multimedia file formats:
+ - Web site: https://github.com/JamesHeinrich/getID3
+ - License: GPLv3
+
Non-linked code:
- * Apache Web Server 2.2
+ * Apache Web Server 2.2
- Web site: http://httpd.apache.org/
- License: Apache 2.0. See http://httpd.apache.org/docs/2.2/license.html
- * PostgreSQL 9.1
+ * PostgreSQL 9.1
- Web site: http://www.postgresql.org/
- License: The PostgreSQL License. See http://www.postgresql.org/about/licence
@@ -71,22 +76,22 @@ Non-linked code:
- Web site: http://www.php.net/
- License: The PHP License. See http://www.php.net/license/3_01.txt
- * jQuery
+ * jQuery
- Web site: http://jquery.com/
- License: MIT and GPL. See http://jquery.org/license
- jQuery components used:
- * Full Calendar
+ * Full Calendar
- Web site: http://arshaw.com/fullcalendar/
- License: Dual licensed under MIT and GPLv2
- * Colorpicker
+ * Colorpicker
- Web site: http://www.eyecon.ro/colorpicker/
- License: Dual licensed under the MIT and GPL licenses.
* Context Menu
- Web site: http://jursza.net/dev/jjmenu/
- - License: MIT [http://www.opensource.org/licenses/mit-license.php]
+ - License: MIT [http://www.opensource.org/licenses/mit-license.php]
* PLUpload
- Web site: http://www.plupload.com
@@ -98,8 +103,8 @@ Non-linked code:
* qtip
- Web site: http://craigsworks.com/projects/qtip/
- - License: MIT
-
+ - License: MIT
+
* TimePicker
- Web site: http://fgelinas.com/code/timepicker/
- License: Dual licensed under the MIT or GPL Version 2 licenses.
@@ -120,7 +125,7 @@ Non-linked code:
Media-Monitor
-------------
Linked code:
- * Mutagen
+ * Mutagen
- What is it: Parser of audio file metadata
- Web site: http://code.google.com/p/mutagen/
- License: GPLv2-only
@@ -129,7 +134,7 @@ Linked code:
- What is it: Python interface to RabbitMQ
- Web site: http://pypi.python.org/pypi/kombu/
- License: New BSD
- - Compatible with GPLv3? Yes.
+ - Compatible with GPLv3? Yes.
* pyinotify
- Python interface to inotify
@@ -155,7 +160,7 @@ Linked code:
- What is it: Python interface to RabbitMQ
- Web site: http://pypi.python.org/pypi/kombu/
- License: New BSD
- - Compatible with GPLv3? Yes.
+ - Compatible with GPLv3? Yes.
Non-linked code:
* Python 2.7
@@ -174,7 +179,7 @@ Linked code:
* Kombu
- Web site: http://pypi.python.org/pypi/kombu/
- License: New BSD
- - Compatible with GPLv3? Yes.
+ - Compatible with GPLv3? Yes.
Non-linked code:
* Python 2.7
diff --git a/airtime_mvc/application/common/FileDataHelper.php b/airtime_mvc/application/common/FileDataHelper.php
index 3cd9c83af..3a8ccdef6 100644
--- a/airtime_mvc/application/common/FileDataHelper.php
+++ b/airtime_mvc/application/common/FileDataHelper.php
@@ -68,4 +68,275 @@ class FileDataHelper {
}
}
+ /**
+ * Gets data URI from artwork file
+ *
+ * @param string $file
+ * @param int $size
+ * @param string $filepath
+ *
+ * @return string Data URI for artwork
+ */
+ public static function getArtworkData($file, $size, $filepath = false)
+ {
+ $baseUrl = Application_Common_HTTPHelper::getStationUrl();
+ $default = $baseUrl . "css/images/no-cover.jpg";
+
+ if ($filepath != false) {
+ $path = $filepath . $file . "-" . $size;
+ if (!file_exists($path)) {
+ $get_file_content = $default;
+ } else {
+ $get_file_content = file_get_contents($path);
+ }
+ } else {
+ $storDir = Application_Model_MusicDir::getStorDir();
+ $path = $storDir->getDirectory() . $file . "-" . $size;
+ if (!file_exists($path)) {
+ $get_file_content = $default;
+ } else {
+ $get_file_content = file_get_contents($path);
+ }
+ }
+ return $get_file_content;
+ }
+
+ /**
+ * Add artwork file
+ *
+ * @param string $analyzeFile
+ * @param string $filename
+ * @param string $importDir
+ * @param string $DbPath
+ *
+ * @return string Path to artwork
+ */
+ public static function saveArtworkData($analyzeFile, $filename, $importDir = null, $DbPath = null)
+ {
+ $getID3 = new \getID3();
+ $getFileInfo = $getID3->analyze($analyzeFile);
+
+ if(isset($getFileInfo['comments']['picture'][0])) {
+
+ $get_img = "";
+ $timestamp = time();
+ $mime = $getFileInfo['comments']['picture'][0]['image_mime'];
+ $Image = 'data:'.$mime.';charset=utf-8;base64,'.base64_encode($getFileInfo['comments']['picture'][0]['data']);
+ $base64 = @$Image;
+
+ if (!file_exists($importDir . "/" . "artwork/")) {
+ if (!mkdir($importDir . "/" . "artwork/", 0777, true)) {
+ Logging::error("Failed to create artwork directory.");
+ throw new Exception("Failed to create artwork directory.");
+ }
+ }
+
+ $path_parts = pathinfo($filename);
+ $file = $importDir . "artwork/" . $path_parts['filename'];
+
+ //Save Data URI
+ if (file_put_contents($file, $base64)) {
+ $get_img = $DbPath . "artwork/". $path_parts['filename'];
+ } else {
+ Logging::error("Could not save Data URI");
+ }
+
+ if ($mime == "image/png") {
+ $ext = 'png';
+ } elseif ($mime == "image/gif") {
+ $ext = 'gif';
+ } elseif ($mime == "image/bmp") {
+ $ext = 'bmp';
+ } else {
+ $ext = 'jpg';
+ }
+
+ if (file_exists($file)) {
+ self::resizeImage($file, $file . '-32.jpg', $ext, 32, 100);
+ self::resizeImage($file, $file . '-64.jpg', $ext, 64, 100);
+ self::resizeImage($file, $file . '-128.jpg', $ext, 128, 100);
+ self::resizeImage($file, $file . '-256.jpg', $ext, 256, 100);
+ self::resizeImage($file, $file . '-512.jpg', $ext, 512, 100);
+ self::imgToDataURI($file . '-32.jpg', $file . '-32');
+ self::imgToDataURI($file . '-64.jpg', $file . '-64');
+ self::imgToDataURI($file . '-128.jpg', $file . '-128');
+ self::imgToDataURI($file . '-256.jpg', $file . '-256');
+ } else {
+ Logging::error("The file $file does not exist");
+ }
+ } else {
+ $get_img = '';
+ }
+ return $get_img;
+ }
+
+ /**
+ * Reset artwork
+ *
+ * @param string $trackid
+ *
+ * @return string $get_img Path to artwork
+ */
+ public static function resetArtwork($trackid)
+ {
+ $file = Application_Model_StoredFile::RecallById($trackid);
+ $md = $file->getMetadata();
+
+ $storDir = Application_Model_MusicDir::getStorDir();
+ $fp = $storDir->getDirectory();
+
+ $dbAudioPath = $md["MDATA_KEY_FILEPATH"];
+ $fullpath = $fp . $dbAudioPath;
+
+ $getID3 = new \getID3();
+ $getFileInfo = $getID3->analyze($fullpath);
+
+ if(isset($getFileInfo['comments']['picture'][0])) {
+
+ $get_img = "";
+ $mime = $getFileInfo['comments']['picture'][0]['image_mime'];
+ $Image = 'data:'.$getFileInfo['comments']['picture'][0]['image_mime'].';charset=utf-8;base64,'.base64_encode($getFileInfo['comments']['picture'][0]['data']);
+ $base64 = @$Image;
+
+ $audioPath = dirname($fullpath);
+ $dbPath = dirname($dbAudioPath);
+ $path_parts = pathinfo($fullpath);
+ $file = $path_parts['filename'];
+
+ //Save Data URI
+ if (file_put_contents($audioPath . "/" . $file, $base64)) {
+ $get_img = $dbPath . "/" . $file;
+ } else {
+ Logging::error("Could not save Data URI");
+ }
+
+ $rfile = $audioPath . "/" . $file;
+
+ if ($mime == "image/png") {
+ $ext = 'png';
+ } elseif ($mime == "image/gif") {
+ $ext = 'gif';
+ } elseif ($mime == "image/bmp") {
+ $ext = 'bmp';
+ } else {
+ $ext = 'jpg';
+ }
+
+ if (file_exists($rfile)) {
+ self::resizeImage($rfile, $rfile . '-32.jpg', $ext, 32, 100);
+ self::resizeImage($rfile, $rfile . '-64.jpg', $ext, 64, 100);
+ self::resizeImage($rfile, $rfile . '-128.jpg', $ext, 128, 100);
+ self::resizeImage($rfile, $rfile . '-256.jpg', $ext, 256, 100);
+ self::resizeImage($rfile, $rfile . '-512.jpg', $ext, 512, 100);
+ self::imgToDataURI($rfile . '-32.jpg', $rfile . '-32');
+ self::imgToDataURI($rfile . '-64.jpg', $rfile . '-64');
+ self::imgToDataURI($rfile . '-128.jpg', $rfile . '-128');
+ self::imgToDataURI($rfile . '-256.jpg', $rfile . '-256');
+ } else {
+ Logging::error("The file $rfile does not exist");
+ }
+ } else {
+ $get_img = "";
+ }
+ return $get_img;
+ }
+
+ /**
+ * Render image
+ * Used in API to render JPEG
+ *
+ * @param string $file
+ */
+ public static function renderImage($file)
+ {
+ $im = @imagecreatefromjpeg($file);
+ header('Content-Type: image/jpeg');
+ $img = $im;
+ imagejpeg($img);
+ imagedestroy($img);
+ }
+
+ /**
+ * Render Data URI
+ * Used in API to render Data URI
+ *
+ * @param string $dataFile
+ */
+ public static function renderDataURI($dataFile)
+ {
+ if($filecontent = file_get_contents($dataFile) !== false){
+ $image = @file_get_contents($dataFile);
+ $image = base64_encode($image);
+ if (!$image || $image === '') {
+ return;
+ }
+ $blob = base64_decode($image);
+ $f = finfo_open();
+ $mime_type = finfo_buffer($f, $blob, FILEINFO_MIME_TYPE);
+ finfo_close($f);
+ header("Content-Type: " . $mime_type);
+ echo $blob;
+ } else {
+ return;
+ }
+ }
+
+ /**
+ * Resize Image
+ *
+ * @param string $orig_filename
+ * @param string $converted_filename
+ * @param string $ext
+ * @param string $size Default: 500
+ * @param string $quality Default: 75
+ *
+ */
+ public static function resizeImage($orig_filename, $converted_filename, $ext, $size=500, $quality=75)
+ {
+ $get_cont = file_get_contents($orig_filename);
+ if ($ext == "png") {
+ $im = @imagecreatefrompng($get_cont);
+ } elseif ($ext == "gif") {
+ $im = @imagecreatefromgif($get_cont);
+ } else {
+ $im = @imagecreatefromjpeg($get_cont);
+ }
+
+ if ($size){
+ $im = imagescale($im , $size);
+ }
+
+ if(!$im) {
+ $im = imagecreatetruecolor(150, 30);
+ $bgc = imagecolorallocate($im, 255, 255, 255);
+ $tc = imagecolorallocate($im, 0, 0, 0);
+ imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
+ imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
+ }
+
+ $img = $im;
+ imagejpeg($img, $converted_filename, $quality);
+ imagedestroy($img);
+ }
+
+ /**
+ * Convert image to Data URI
+ *
+ * @param string $orig_filename
+ * @param string $conv_filename
+ */
+ public static function imgToDataURI($orig_filename, $conv_filename)
+ {
+ $file = file_get_contents($orig_filename);
+ $Image = 'data:image/jpeg;charset=utf-8;base64,'.base64_encode($file);
+ $base64 = @$Image;
+
+ //Save Data URI
+ if (file_put_contents($conv_filename, $base64)) {
+
+ } else {
+ Logging::error("Could not save Data URI");
+ }
+ }
+
}
diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php
index 7e02d1196..a56a908b5 100644
--- a/airtime_mvc/application/configs/constants.php
+++ b/airtime_mvc/application/configs/constants.php
@@ -81,6 +81,8 @@ define('MDATA_KEY_REPLAYGAIN' , 'replay_gain');
define('MDATA_KEY_OWNER_ID' , 'owner_id');
define('MDATA_KEY_CUE_IN' , 'cuein');
define('MDATA_KEY_CUE_OUT' , 'cueout');
+define('MDATA_KEY_ARTWORK' , 'artwork');
+define('MDATA_KEY_ARTWORK_DATA', 'artwork_data');
define('UI_MDATA_VALUE_FORMAT_FILE' , 'File');
define('UI_MDATA_VALUE_FORMAT_STREAM' , 'live stream');
diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php
index 1d070f1f4..ed0e7c852 100644
--- a/airtime_mvc/application/controllers/ApiController.php
+++ b/airtime_mvc/application/controllers/ApiController.php
@@ -26,6 +26,7 @@ class ApiController extends Zend_Controller_Action
"show-tracks",
"show-schedules",
"show-logo",
+ "track",
"stream-m3u"
);
@@ -294,6 +295,20 @@ class ApiController extends Zend_Controller_Action
$result = Application_Model_Schedule::GetPlayOrderRangeOld($limit);
}
+ $stationUrl = Application_Common_HTTPHelper::getStationUrl();
+
+ $previousID = $result["previous"]["metadata"]["id"];
+ $get_prev_artwork_url = $stationUrl . 'api/track?id='. $previousID .'&return=artwork';
+ $result["previous"]["metadata"]["artwork_url"] = $get_prev_artwork_url;
+
+ $currID = $result["current"]["metadata"]["id"];
+ $get_curr_artwork_url = $stationUrl . 'api/track?id='. $currID .'&return=artwork';
+ $result["current"]["metadata"]["artwork_url"] = $get_curr_artwork_url;
+
+ $nextID = $result["previous"]["metadata"]["id"];
+ $get_next_artwork_url = $stationUrl . 'api/track?id='. $nextID .'&return=artwork';
+ $result["previous"]["metadata"]["artwork_url"] = $get_next_artwork_url;
+
// apply user-defined timezone, or default to station
Application_Common_DateHelper::convertTimestampsToTimezone(
$result['currentShow'],
@@ -523,6 +538,103 @@ class ApiController extends Zend_Controller_Action
}
}
+ /**
+ * New API endpoint to display metadata from any single track
+ *
+ * Find metadata to any track imported (eg. id=1&return=json)
+ *
+ * @param int $id track ID
+ * @param string $return json, artwork_data, or artwork
+ *
+ */
+ public function trackAction()
+ {
+ // Disable the view and the layout
+ $this->view->layout()->disableLayout();
+ $this->_helper->viewRenderer->setNoRender(true);
+
+ if (Application_Model_Preference::GetAllow3rdPartyApi() || $this->checkAuth()) {
+
+ $request = $this->getRequest();
+ $trackid = $request->getParam('id');
+ $return = $request->getParam('return');
+
+ if (empty($return)) {
+ throw new ZendActionHttpException($this, 400, "ERROR: No return was given.");
+ }
+
+ if (empty($trackid)) {
+ throw new ZendActionHttpException($this, 400, "ERROR: No ID was given.");
+ }
+
+ $storDir = Application_Model_MusicDir::getStorDir();
+ $fp = $storDir->getDirectory();
+
+ //$this->view->type = $type;
+ $file = Application_Model_StoredFile::RecallById($trackid);
+ $md = $file->getMetadata();
+
+ if ($return === "artwork-data") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderDataURI($fp . $md['MDATA_KEY_ARTWORK']);
+ }
+ }
+ } elseif ($return === "artwork-data-32") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderDataURI($fp . $md['MDATA_KEY_ARTWORK']. '-32');
+ }
+ }
+ } elseif ($return === "artwork") {
+ //default
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-1024.jpg');
+ }
+ }
+ } elseif ($return === "artwork-32") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-32.jpg');
+ }
+ }
+ } elseif ($return === "artwork-64") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-64.jpg');
+ }
+ }
+ } elseif ($return === "artwork-128") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-128.jpg');
+ }
+ }
+ } elseif ($return === "artwork-512") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-512.jpg');
+ }
+ }
+ } elseif ($return === "artwork-1024") {
+ foreach ($md as $key => $value) {
+ if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
+ FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'].'-1024.jpg');
+ }
+ }
+ } elseif ($return === "json") {
+ $data =json_encode($md);
+ echo $data;
+ }
+
+ } else {
+ header('HTTP/1.0 401 Unauthorized');
+ print _('You are not allowed to access this resource. ');
+ exit;
+ }
+ }
+
/**
* API endpoint to provide station metadata
*/
diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php
index 21543e24e..28c5f02bb 100644
--- a/airtime_mvc/application/controllers/LibraryController.php
+++ b/airtime_mvc/application/controllers/LibraryController.php
@@ -392,7 +392,14 @@ class LibraryController extends Zend_Controller_Action
$serialized = array();
//need to convert from serialized jQuery array.
foreach ($js as $j) {
- $serialized[$j["name"]] = $j["value"];
+ //on edit, if no artwork is set and audiofile has image, automatically add it
+ if ($j["name"] == "artwork") {
+ if ($j["value"] == null || $j["value"] == ''){
+ $serialized["artwork"] = FileDataHelper::resetArtwork($file_id);
+ }
+ } else {
+ $serialized[$j["name"]] = $j["value"];
+ }
}
// Sanitize any wildly incorrect metadata before it goes to be validated.
@@ -409,6 +416,9 @@ class LibraryController extends Zend_Controller_Action
$this->view->form = $form;
$this->view->id = $file_id;
$this->view->title = $file->getPropelOrm()->getDbTrackTitle();
+ $this->view->artist_name = $file->getPropelOrm()->getDbArtistName();
+ $this->view->filePath = $file->getPropelOrm()->getDbFilepath();
+ $this->view->artwork = $file->getPropelOrm()->getDbArtwork();
$this->view->html = $this->view->render('library/edit-file-md.phtml');
}
diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php
index 33044b4ec..bf9d0fa63 100644
--- a/airtime_mvc/application/controllers/ScheduleController.php
+++ b/airtime_mvc/application/controllers/ScheduleController.php
@@ -122,7 +122,7 @@ class ScheduleController extends Zend_Controller_Action
$currentUser = $service_user->getCurrentUser();
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
-
+
$start = new DateTime($this->_getParam('start', null), $userTimezone);
$start->setTimezone(new DateTimeZone("UTC"));
$end = new DateTime($this->_getParam('end', null), $userTimezone);
@@ -187,7 +187,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->show_error = true;
return false;
}
-
+
$error = $service_calendar->moveShow($deltaDay, $deltaMin);
if (isset($error)) {
$this->view->error = $error;
@@ -209,7 +209,7 @@ class ScheduleController extends Zend_Controller_Action
$log_vars["params"]["delta day"] = $deltaDay;
$log_vars["params"]["delta minute"] = $deltaMin;
Logging::info($log_vars);
-
+
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
@@ -239,7 +239,7 @@ class ScheduleController extends Zend_Controller_Action
$log_vars["params"] = array();
$log_vars["params"]["instance id"] = $instanceId;
Logging::info($log_vars);
-
+
$service_show = new Application_Service_ShowService();
$showId = $service_show->deleteShow($instanceId, true);
@@ -261,7 +261,7 @@ class ScheduleController extends Zend_Controller_Action
public function clearShowAction()
{
$instanceId = $this->_getParam('id');
-
+
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "schedule/clear-show";
@@ -296,12 +296,14 @@ class ScheduleController extends Zend_Controller_Action
/* Convert all UTC times to localtime before sending back to user. */
$range["schedulerTime"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["schedulerTime"]);
-
+
if (isset($range["previous"])) {
$range["previous"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["previous"]["starts"]);
$range["previous"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["previous"]["ends"]);
}
if (isset($range["current"])) {
+ $get_artwork = FileDataHelper::getArtworkData($range["current"]["metadata"]["artwork"], 256);
+ $range["current"]["metadata"]["artwork_data"] = $get_artwork;
$range["current"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["current"]["starts"]);
$range["current"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["current"]["ends"]);
}
@@ -309,14 +311,14 @@ class ScheduleController extends Zend_Controller_Action
$range["next"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["next"]["starts"]);
$range["next"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["next"]["ends"]);
}
-
+
Application_Common_DateHelper::convertTimestamps(
- $range["currentShow"],
+ $range["currentShow"],
array("starts", "ends", "start_timestamp", "end_timestamp"),
"user"
);
Application_Common_DateHelper::convertTimestamps(
- $range["nextShow"],
+ $range["nextShow"],
array("starts", "ends", "start_timestamp", "end_timestamp"),
"user"
);
@@ -324,7 +326,7 @@ class ScheduleController extends Zend_Controller_Action
//TODO: Add timezone and timezoneOffset back into the ApiController's results.
$range["timezone"] = Application_Common_DateHelper::getUserTimezoneAbbreviation();
$range["timezoneOffset"] = Application_Common_DateHelper::getUserTimezoneOffset();
-
+
$source_status = array();
$switch_status = array();
$live_dj = Application_Model_Preference::GetSourceStatus("live_dj");
@@ -358,7 +360,7 @@ class ScheduleController extends Zend_Controller_Action
return false;
}
-
+
$originalShowId = $show->isRebroadcast();
if (!is_null($originalShowId)) {
try {
@@ -375,7 +377,7 @@ class ScheduleController extends Zend_Controller_Action
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
$originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC"));
$originalDateTime->setTimezone($displayTimeZone);
-
+
$this->view->additionalShowInfo =
sprintf(_("Rebroadcast of show %s from %s at %s"),
$originalShowName,
@@ -461,7 +463,7 @@ class ScheduleController extends Zend_Controller_Action
$log_vars["params"] = array();
$log_vars["params"]["form_data"] = $data;
Logging::info($log_vars);
-
+
$service_showForm = new Application_Service_ShowFormService(
$data["add_show_id"], $data["add_show_instance_id"]);
$service_show = new Application_Service_ShowService(null, $data);
@@ -513,7 +515,7 @@ class ScheduleController extends Zend_Controller_Action
if ($data['add_show_day_check'] == "") {
$data['add_show_day_check'] = null;
}
-
+
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "schedule/edit-show";
@@ -525,12 +527,12 @@ class ScheduleController extends Zend_Controller_Action
list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) =
$service_showForm->preEditShowValidationCheck($data);
-
+
if ($service_showForm->validateShowForms($forms, $data, $validateStartDate,
$originalShowStartDateTime, true, $data["add_show_instance_id"])) {
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
$this->view->showId = $service_show->addUpdateShow($data);
-
+
$this->view->addNewShow = true;
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
} else {
@@ -541,7 +543,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true));
}
//$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
-
+
$this->view->addNewShow = false;
$this->view->action = "edit-show";
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
@@ -551,7 +553,7 @@ class ScheduleController extends Zend_Controller_Action
public function addShowAction()
{
$service_showForm = new Application_Service_ShowFormService(null);
-
+
$js = $this->_getParam('data');
$data = array();
@@ -565,20 +567,20 @@ class ScheduleController extends Zend_Controller_Action
// TODO: move this to js
$data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days');
-
+
if ($data['add_show_day_check'] == "") {
$data['add_show_day_check'] = null;
}
-
+
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "schedule/add-show";
$log_vars["params"] = array();
$log_vars["params"]["form_data"] = $data;
Logging::info($log_vars);
-
+
$forms = $this->createShowFormAction();
-
+
$this->view->addNewShow = true;
if ($data['add_show_start_now'] == "now") {
@@ -597,18 +599,18 @@ class ScheduleController extends Zend_Controller_Action
if ($service_showForm->validateShowForms($forms, $data)) {
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
$this->view->showId = $service_show->addUpdateShow($data);
-
+
//send new show forms to the user
$this->createShowFormAction(true);
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
-
+
Logging::debug("Show creation succeeded");
} else {
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
Logging::debug("Show creation failed");
}
}
-
+
public function createShowFormAction($populateDefaults=false)
{
$service_showForm = new Application_Service_ShowFormService();
@@ -638,7 +640,7 @@ class ScheduleController extends Zend_Controller_Action
public function deleteShowAction()
{
$instanceId = $this->_getParam('id');
-
+
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "schedule/delete-show";
@@ -648,7 +650,7 @@ class ScheduleController extends Zend_Controller_Action
$service_show = new Application_Service_ShowService();
$showId = $service_show->deleteShow($instanceId);
-
+
if (!$showId) {
$this->view->show_error = true;
}
@@ -663,7 +665,7 @@ class ScheduleController extends Zend_Controller_Action
$log_vars["params"] = array();
$log_vars["params"]["instance id"] = $this->_getParam('id');
Logging::info($log_vars);
-
+
$user = Application_Model_User::getCurrentUser();
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
@@ -730,7 +732,7 @@ class ScheduleController extends Zend_Controller_Action
$start = $this->_getParam('startTime');
$end = $this->_getParam('endTime');
$timezone = $this->_getParam('timezone');
-
+
$service_showForm = new Application_Service_ShowFormService();
$result = $service_showForm->calculateDuration($start, $end, $timezone);
@@ -741,10 +743,10 @@ class ScheduleController extends Zend_Controller_Action
public function updateFutureIsScheduledAction()
{
$schedId = $this->_getParam('schedId');
-
+
$scheduleService = new Application_Service_SchedulerService();
$redrawLibTable = $scheduleService->updateFutureIsScheduled($schedId, false);
-
+
$this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable));
}
@@ -762,5 +764,5 @@ class ScheduleController extends Zend_Controller_Action
$this->_helper->json->sendJson($localTime);
}
-
+
}
diff --git a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php
index ee9d50218..bbb538fdd 100644
--- a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php
+++ b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php
@@ -139,6 +139,8 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
$view->headScript()->appendScript("var PRODUCT_NAME = '" . PRODUCT_NAME . "';");
$view->headScript()->appendScript("var USER_MANUAL_URL = '" . USER_MANUAL_URL . "';");
$view->headScript()->appendScript("var COMPANY_NAME = '" . COMPANY_NAME . "';");
+ //Each page refresh or tab open has uniqID, not to be used for security
+ $view->headScript()->appendScript("var UNIQID = '" . uniqid() . "';");
}
protected function _initHeadLink()
diff --git a/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.17/upgrade.sql b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.17/upgrade.sql
new file mode 100644
index 000000000..3d92007aa
--- /dev/null
+++ b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.17/upgrade.sql
@@ -0,0 +1 @@
+ALTER TABLE cc_files ADD COLUMN artwork TYPE character varying(255);
\ No newline at end of file
diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php
index e4e6768f9..62a83f66c 100644
--- a/airtime_mvc/application/forms/EditAudioMD.php
+++ b/airtime_mvc/application/forms/EditAudioMD.php
@@ -2,9 +2,9 @@
class Application_Form_EditAudioMD extends Zend_Form
{
-
+
public function init() {}
-
+
public function startForm($p_id)
{
$baseUrl = Application_Common_OsPath::getBaseDir();
@@ -18,6 +18,17 @@ class Application_Form_EditAudioMD extends Zend_Form
$file_id->setAttrib('class', 'obj_id');
$this->addElement($file_id);
+ // Add artwork hidden field
+ $artwork = new Zend_Form_Element_Hidden('artwork');
+ $artwork->setFilters(array('StringTrim'))
+ ->setValidators(array(
+ new Zend_Validate_StringLength(array('max' => 512))
+ ));
+ $file_id->addDecorator('HtmlTag', array('tag' => 'div', 'style' => 'display:none'));
+ $file_id->removeDecorator('Label');
+ $file_id->setAttrib('class', 'artwork');
+ $this->addElement($artwork);
+
// Add title field
$track_title = new Zend_Form_Element_Text('track_title');
$track_title->class = 'input_text';
diff --git a/airtime_mvc/application/models/Dashboard.php b/airtime_mvc/application/models/Dashboard.php
index 47265a922..4a2c4acaf 100644
--- a/airtime_mvc/application/models/Dashboard.php
+++ b/airtime_mvc/application/models/Dashboard.php
@@ -70,6 +70,7 @@ class Application_Model_Dashboard
*/
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
+ "artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
}
@@ -87,6 +88,7 @@ class Application_Model_Dashboard
}
} else {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
+ "artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"],
"media_item_played"=>$row[0]["media_item_played"],
@@ -110,6 +112,7 @@ class Application_Model_Dashboard
return null;
} else {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
+ "artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
}
@@ -128,6 +131,7 @@ class Application_Model_Dashboard
if ($row[0]["starts"] <= $showInstance->getShowInstanceStart()) {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
+ "artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
} else {
diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php
index 25d692c12..8e8211378 100644
--- a/airtime_mvc/application/models/StoredFile.php
+++ b/airtime_mvc/application/models/StoredFile.php
@@ -53,7 +53,8 @@ class Application_Model_StoredFile
"owner_id" => "DbOwnerId",
"cuein" => "DbCueIn",
"cueout" => "DbCueOut",
- "description" => "DbDescription"
+ "description" => "DbDescription",
+ "artwork" => "DbArtwork"
);
function __construct($file, $con) {
@@ -209,7 +210,7 @@ class Application_Model_StoredFile
if ($dbColumn == "track_title" && (is_null($mdValue) || $mdValue == "")) {
continue;
}
-
+
// Bpm gets POSTed as a string type. With Propel 1.6 this value
// was casted to an integer type before saving it to the db. But
// Propel 1.7 does not do this
@@ -352,8 +353,8 @@ SQL;
return array();
}
}
-
- /**
+
+ /**
* Check if the file (on disk) corresponding to this class exists or not.
* @return boolean true if the file exists, false otherwise.
*/
@@ -415,11 +416,11 @@ SQL;
//Update the user's disk usage
Application_Model_Preference::updateDiskUsage(-1 * $filesize);
-
+
//Explicitly update any playlist's and block's length that contain
//the file getting deleted
self::updateBlockAndPlaylistLength($this->_file->getDbId());
-
+
//delete the file record from cc_files (and cloud_file, if applicable)
$this->_file->delete();
}
@@ -427,7 +428,7 @@ SQL;
/*
* This function is meant to be called when a file is getting
* deleted from the library. It re-calculates the length of
- * all blocks and playlists that contained the deleted file.
+ * all blocks and playlists that contained the deleted file.
*/
private static function updateBlockAndPlaylistLength($fileId)
{
@@ -471,7 +472,7 @@ SQL;
public function getFilePaths()
{
assert($this->_file);
-
+
return $this->_file->getURLsForTrackPreviewOrDownload();
}
@@ -528,7 +529,7 @@ SQL;
{
return $baseUrl."api/get-media/file/".$this->getId();
}
-
+
public function getResourceId()
{
return $this->_file->getResourceId();
@@ -545,7 +546,7 @@ SQL;
}
return $filesize;
}
-
+
public static function Insert($md, $con)
{
// save some work by checking if filepath is given right away
@@ -592,17 +593,17 @@ SQL;
if (isset($p_id)) {
$p_id = intval($p_id);
-
+
$storedFile = CcFilesQuery::create()->findPK($p_id, $con);
if (is_null($storedFile)) {
throw new Exception("Could not recall file with id: ".$p_id);
}
-
+
//Attempt to get the cloud file object and return it. If no cloud
//file object is found then we are dealing with a regular stored
//object so return that
$cloudFile = CloudFileQuery::create()->findOneByCcFileId($p_id);
-
+
if (is_null($cloudFile)) {
return self::createWithFile($storedFile, $con);
} else {
@@ -671,7 +672,7 @@ SQL;
"bit_rate", "sample_rate", "isrc_number", "encoded_by", "label",
"copyright", "mime", "language", "filepath", "owner_id",
"conductor", "replay_gain", "lptime", "is_playlist", "is_scheduled",
- "cuein", "cueout", "description" );
+ "cuein", "cueout", "description", "artwork" );
}
public static function searchLibraryFiles($datatables)
@@ -693,49 +694,49 @@ SQL;
$blSelect[] = "BL.id AS ".$key;
$fileSelect[] = "FILES.id AS $key";
$streamSelect[] = "ws.id AS ".$key;
- }
+ }
elseif ($key === "track_title") {
$plSelect[] = "name AS ".$key;
$blSelect[] = "name AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "name AS ".$key;
- }
+ }
elseif ($key === "ftype") {
$plSelect[] = "'playlist'::varchar AS ".$key;
$blSelect[] = "'block'::varchar AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "'stream'::varchar AS ".$key;
- }
+ }
elseif ($key === "artist_name") {
$plSelect[] = "login AS ".$key;
$blSelect[] = "login AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "login AS ".$key;
- }
+ }
elseif ($key === "owner_id") {
$plSelect[] = "login AS ".$key;
$blSelect[] = "login AS ".$key;
$fileSelect[] = "sub.login AS $key";
$streamSelect[] = "login AS ".$key;
- }
+ }
elseif ($key === "replay_gain") {
$plSelect[] = "NULL::NUMERIC AS ".$key;
$blSelect[] = "NULL::NUMERIC AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "NULL::NUMERIC AS ".$key;
- }
+ }
elseif ($key === "lptime") {
$plSelect[] = "NULL::TIMESTAMP AS ".$key;
$blSelect[] = "NULL::TIMESTAMP AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = $key;
- }
+ }
elseif ($key === "is_scheduled" || $key === "is_playlist") {
$plSelect[] = "NULL::boolean AS ".$key;
$blSelect[] = "NULL::boolean AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "NULL::boolean AS ".$key;
- }
+ }
elseif ($key === "cuein" || $key === "cueout") {
$plSelect[] = "NULL::INTERVAL AS ".$key;
$blSelect[] = "NULL::INTERVAL AS ".$key;
@@ -755,7 +756,7 @@ SQL;
$blSelect[] = $key;
$fileSelect[] = $key;
$streamSelect[] = $key;
- }
+ }
elseif ($key === "year") {
$plSelect[] = "EXTRACT(YEAR FROM utime)::varchar AS ".$key;
$blSelect[] = "EXTRACT(YEAR FROM utime)::varchar AS ".$key;
@@ -768,13 +769,13 @@ SQL;
$blSelect[] = "NULL::int AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "NULL::int AS ".$key;
- }
+ }
elseif ($key === "filepath") {
$plSelect[] = "NULL::VARCHAR AS ".$key;
$blSelect[] = "NULL::VARCHAR AS ".$key;
$fileSelect[] = $key;
$streamSelect[] = "url AS ".$key;
- }
+ }
else if ($key == "mime") {
$plSelect[] = "NULL::VARCHAR AS ".$key;
$blSelect[] = "NULL::VARCHAR AS ".$key;
@@ -828,7 +829,10 @@ SQL;
$displayTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
$utcTimezone = new DateTimeZone("UTC");
-
+
+ $storDir = Application_Model_MusicDir::getStorDir();
+ $fp = $storDir->getDirectory();
+
foreach ($results['aaData'] as &$row) {
$row['id'] = intval($row['id']);
@@ -862,6 +866,9 @@ SQL;
$formatter = new BitrateFormatter($row['bit_rate']);
$row['bit_rate'] = $formatter->format();
+ $get_artwork = FileDataHelper::getArtworkData($row['artwork'], 32, $fp);
+ $row['artwork_data'] = $get_artwork;
+
// for audio preview
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
@@ -874,7 +881,7 @@ SQL;
$len_formatter = new LengthFormatter($row_length);
$row['length'] = $len_formatter->format();
-
+
//convert mtime and utime to localtime
$row['mtime'] = new DateTime($row['mtime'], $utcTimezone);
$row['mtime']->setTimeZone($displayTimezone);
@@ -882,7 +889,7 @@ SQL;
$row['utime'] = new DateTime($row['utime'], $utcTimezone);
$row['utime']->setTimeZone($displayTimezone);
$row['utime'] = $row['utime']->format(DEFAULT_TIMESTAMP_FORMAT);
-
+
//need to convert last played to localtime if it exists.
if (isset($row['lptime'])) {
$row['lptime'] = new DateTime($row['lptime'], $utcTimezone);
@@ -904,16 +911,16 @@ SQL;
}
/**
- * Copy a newly uploaded audio file from its temporary upload directory
- * on the local disk (like /tmp) over to Airtime's "stor" directory,
+ * Copy a newly uploaded audio file from its temporary upload directory
+ * on the local disk (like /tmp) over to Airtime's "stor" directory,
* which is where all ingested music/media live.
- *
+ *
* This is done in PHP here on the web server rather than in airtime_analyzer because
* the airtime_analyzer might be running on a different physical computer than the web server,
* and it probably won't have access to the web server's /tmp folder. The stor/organize directory
- * is, however, both accessible to the machines running airtime_analyzer and the web server
+ * is, however, both accessible to the machines running airtime_analyzer and the web server
* on Airtime Pro.
- *
+ *
* The file is actually copied to "stor/organize", which is a staging directory where files go
* before they're processed by airtime_analyzer, which then moves them to "stor/imported" in the final
* step.
@@ -936,11 +943,11 @@ SQL;
throw new Exception("Failed to create organize directory.");
}
}
-
+
if (chmod($audio_file, 0644) === false) {
Logging::info("Warning: couldn't change permissions of $audio_file to 0644");
}
-
+
// Did all the checks for real, now trying to copy
$audio_stor = Application_Common_OsPath::join($stor, "organize",
$originalFilename);
@@ -976,7 +983,7 @@ SQL;
}
return $audio_stor;
}
-
+
/*
* Pass the file through Liquidsoap and test if it is readable. Return True if readable, and False otherwise.
*/
@@ -1157,7 +1164,7 @@ SQL;
}
/**
- *
+ *
* Updates the is_scheduled flag to false for tracks that are no longer
* scheduled in the future. We do this by checking the difference between
* all files scheduled in the future and all files with is_scheduled = true.
@@ -1171,15 +1178,15 @@ SQL;
$futureScheduledFilesSelectCriteria->add(CcSchedulePeer::ENDS, gmdate(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN);
$stmt = CcSchedulePeer::doSelectStmt($futureScheduledFilesSelectCriteria);
$filesScheduledInFuture = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
-
+
$filesCurrentlySetWithIsScheduledSelectCriteria = new Criteria();
$filesCurrentlySetWithIsScheduledSelectCriteria->addSelectColumn(CcFilesPeer::ID);
$filesCurrentlySetWithIsScheduledSelectCriteria->add(CcFilesPeer::IS_SCHEDULED, true);
$stmt = CcFilesPeer::doSelectStmt($filesCurrentlySetWithIsScheduledSelectCriteria);
$filesCurrentlySetWithIsScheduled = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
-
+
$diff = array_diff($filesCurrentlySetWithIsScheduled, $filesScheduledInFuture);
-
+
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
$selectCriteria = new Criteria();
$selectCriteria->add(CcFilesPeer::ID, $diff, Criteria::IN);
diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php
index 9a7ebd88a..fcc390a46 100644
--- a/airtime_mvc/application/models/airtime/CcFiles.php
+++ b/airtime_mvc/application/models/airtime/CcFiles.php
@@ -146,10 +146,16 @@ class CcFiles extends BaseCcFiles {
self::validateFileArray($fileArray);
+ $storDir = Application_Model_MusicDir::getStorDir();
+ $importedStorageDir = $storDir->getDirectory() . "imported/" . self::getOwnerId() . "/";
+ $importedDbPath = "imported/" . self::getOwnerId() . "/";
+ $artwork = FileDataHelper::saveArtworkData($filePath, $originalFilename, $importedStorageDir, $importedDbPath);
+
$file->fromArray($fileArray);
$file->setDbOwnerId(self::getOwnerId());
$now = new DateTime("now", new DateTimeZone("UTC"));
$file->setDbTrackTitle($originalFilename);
+ $file->setDbArtwork($artwork);
$file->setDbUtime($now);
$file->setDbHidden(true);
$file->save();
@@ -319,13 +325,13 @@ class CcFiles extends BaseCcFiles {
{
$cuein = $this->getDbCuein();
$cueout = $this->getDbCueout();
-
+
$cueinSec = Application_Common_DateHelper::calculateLengthInSeconds($cuein);
$cueoutSec = Application_Common_DateHelper::calculateLengthInSeconds($cueout);
$lengthSec = bcsub($cueoutSec, $cueinSec, 6);
-
+
$length = Application_Common_DateHelper::secondsToPlaylistTime($lengthSec);
-
+
return $length;
}
@@ -342,7 +348,7 @@ class CcFiles extends BaseCcFiles {
return $this->getDbFileExists() && !$this->getDbHidden();
}
- public function reassignTo($user)
+ public function reassignTo($user)
{
$this->setDbOwnerId( $user->getDbId() );
$this->save();
@@ -408,6 +414,21 @@ class CcFiles extends BaseCcFiles {
return Application_Common_OsPath::join($directory, $filepath);
}
+ /**
+ * Returns the artwork's absolute file path stored on disk.
+ */
+ public function getAbsoluteArtworkPath()
+ {
+ $music_dir = Application_Model_MusicDir::getDirByPK($this->getDbDirectory());
+ if (!$music_dir) {
+ throw new Exception("Invalid music_dir for file " . $this->getDbId() . " in database.");
+ }
+ $directory = $music_dir->getDirectory();
+ $filepath = $this->getDbArtwork();
+
+ return Application_Common_OsPath::join($directory, $filepath);
+ }
+
/**
*
* Strips out fields from incoming request data that should never be modified
@@ -495,23 +516,29 @@ class CcFiles extends BaseCcFiles {
{
return is_file($this->getAbsoluteFilePath());
}
-
+
/**
- *
+ *
* Deletes the file from the stor directory on disk.
*/
public function deletePhysicalFile()
{
$filepath = $this->getAbsoluteFilePath();
+ $artworkpath = $this->getAbsoluteArtworkPath();
if (file_exists($filepath)) {
unlink($filepath);
+ // also delete related images (dataURI and jpeg files)
+ foreach (glob("$artworkpath*", GLOB_NOSORT) as $filename) {
+ unlink($filename);
+ }
+ unlink($artworkpath);
} else {
throw new Exception("Could not locate file ".$filepath);
}
}
-
+
/**
- *
+ *
* This function refers to the file's Amazon S3 resource id.
* Returns null because cc_files are stored on local disk.
*/
@@ -519,10 +546,10 @@ class CcFiles extends BaseCcFiles {
{
return null;
}
-
+
public function getCcFileId()
{
return $this->id;
}
-
+
} // CcFiles
diff --git a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php
index a6c91bf09..e68a15637 100644
--- a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php
+++ b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php
@@ -111,6 +111,7 @@ class CcFilesTableMap extends TableMap
$this->addColumn('is_playlist', 'DbIsPlaylist', 'BOOLEAN', false, null, false);
$this->addColumn('filesize', 'DbFilesize', 'INTEGER', true, null, 0);
$this->addColumn('description', 'DbDescription', 'VARCHAR', false, 512, null);
+ $this->addColumn('artwork', 'DbArtwork', 'VARCHAR', false, 512, null);
// validators
} // initialize()
diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php
index 92ce18cf4..7cf46f514 100644
--- a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php
+++ b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php
@@ -288,6 +288,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $info_url;
+ /**
+ * The value for the artwork field.
+ * @var string
+ */
+ protected $artwork;
+
/**
* The value for the artist_url field.
* @var string
@@ -1176,6 +1182,17 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->info_url;
}
+ /**
+ * Get the [artwork] column value.
+ *
+ * @return string
+ */
+ public function getDbArtwork()
+ {
+
+ return $this->artwork;
+ }
+
/**
* Get the [artist_url] column value.
*
@@ -1838,6 +1855,26 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this;
} // setDbTrackTitle()
+ /**
+ * Set the value of [artwork] column.
+ *
+ * @param string $v new value
+ * @return CcFiles The current object (for fluent API support)
+ */
+ public function setDbArtwork($v)
+ {
+ if ($v !== null && is_numeric($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->artwork !== $v) {
+ $this->artwork = $v;
+ $this->modifiedColumns[] = CcFilesPeer::ARTWORK;
+ }
+
+ return $this;
+ } // setDbArtwork()
+
/**
* Set the value of [artist_name] column.
*
@@ -3266,6 +3303,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->is_playlist = ($row[$startcol + 69] !== null) ? (boolean) $row[$startcol + 69] : null;
$this->filesize = ($row[$startcol + 70] !== null) ? (int) $row[$startcol + 70] : null;
$this->description = ($row[$startcol + 71] !== null) ? (string) $row[$startcol + 71] : null;
+ $this->artwork = ($row[$startcol + 72] !== null) ? (string) $row[$startcol + 72] : null;
$this->resetModified();
$this->setNew(false);
@@ -3903,6 +3941,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = '"description"';
}
+ if ($this->isColumnModified(CcFilesPeer::ARTWORK)) {
+ $modifiedColumns[':p' . $index++] = '"artwork"';
+ }
$sql = sprintf(
'INSERT INTO "cc_files" (%s) VALUES (%s)',
@@ -4130,6 +4171,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case '"description"':
$stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
break;
+ case '"artwork"':
+ $stmt->bindValue($identifier, $this->artwork, PDO::PARAM_STR);
+ break;
}
}
$stmt->execute();
@@ -4561,6 +4605,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case 71:
return $this->getDbDescription();
break;
+ case 72:
+ return $this->getDbArtwork();
+ break;
default:
return null;
break;
@@ -4662,6 +4709,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$keys[69] => $this->getDbIsPlaylist(),
$keys[70] => $this->getDbFilesize(),
$keys[71] => $this->getDbDescription(),
+ $keys[72] => $this->getDbArtwork(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -4952,6 +5000,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
case 71:
$this->setDbDescription($value);
break;
+ case 72:
+ $this->setDbArtwork($value);
+ break;
} // switch()
}
@@ -5048,6 +5099,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (array_key_exists($keys[69], $arr)) $this->setDbIsPlaylist($arr[$keys[69]]);
if (array_key_exists($keys[70], $arr)) $this->setDbFilesize($arr[$keys[70]]);
if (array_key_exists($keys[71], $arr)) $this->setDbDescription($arr[$keys[71]]);
+ if (array_key_exists($keys[72], $arr)) $this->setDbArtwork($arr[$keys[72]]);
}
/**
@@ -5131,6 +5183,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::IS_PLAYLIST)) $criteria->add(CcFilesPeer::IS_PLAYLIST, $this->is_playlist);
if ($this->isColumnModified(CcFilesPeer::FILESIZE)) $criteria->add(CcFilesPeer::FILESIZE, $this->filesize);
if ($this->isColumnModified(CcFilesPeer::DESCRIPTION)) $criteria->add(CcFilesPeer::DESCRIPTION, $this->description);
+ if ($this->isColumnModified(CcFilesPeer::ARTWORK)) $criteria->add(CcFilesPeer::ARTWORK, $this->artwork);
return $criteria;
}
@@ -5265,6 +5318,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$copyObj->setDbIsPlaylist($this->getDbIsPlaylist());
$copyObj->setDbFilesize($this->getDbFilesize());
$copyObj->setDbDescription($this->getDbDescription());
+ $copyObj->setDbArtwork($this->getDbArtwork());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@@ -7666,6 +7720,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->is_playlist = null;
$this->filesize = null;
$this->description = null;
+ $this->artwork = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false;
diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php
index f7e2a5fd6..8b61968b2 100644
--- a/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php
+++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php
@@ -248,6 +248,9 @@ abstract class BaseCcFilesPeer
/** the column name for the description field */
const DESCRIPTION = 'cc_files.description';
+ /** the column name for the artwork field */
+ const ARTWORK = 'cc_files.artwork';
+
/** The default string format for model objects of the related table **/
const DEFAULT_STRING_FORMAT = 'YAML';
@@ -267,12 +270,12 @@ abstract class BaseCcFilesPeer
* e.g. CcFilesPeer::$fieldNames[CcFilesPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbImportStatus', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', 'DbIsScheduled', 'DbIsPlaylist', 'DbFilesize', 'DbDescription', ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbImportStatus', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', 'dbIsScheduled', 'dbIsPlaylist', 'dbFilesize', 'dbDescription', ),
- BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID, CcFilesPeer::NAME, CcFilesPeer::MIME, CcFilesPeer::FTYPE, CcFilesPeer::DIRECTORY, CcFilesPeer::FILEPATH, CcFilesPeer::IMPORT_STATUS, CcFilesPeer::CURRENTLYACCESSING, CcFilesPeer::EDITEDBY, CcFilesPeer::MTIME, CcFilesPeer::UTIME, CcFilesPeer::LPTIME, CcFilesPeer::MD5, CcFilesPeer::TRACK_TITLE, CcFilesPeer::ARTIST_NAME, CcFilesPeer::BIT_RATE, CcFilesPeer::SAMPLE_RATE, CcFilesPeer::FORMAT, CcFilesPeer::LENGTH, CcFilesPeer::ALBUM_TITLE, CcFilesPeer::GENRE, CcFilesPeer::COMMENTS, CcFilesPeer::YEAR, CcFilesPeer::TRACK_NUMBER, CcFilesPeer::CHANNELS, CcFilesPeer::URL, CcFilesPeer::BPM, CcFilesPeer::RATING, CcFilesPeer::ENCODED_BY, CcFilesPeer::DISC_NUMBER, CcFilesPeer::MOOD, CcFilesPeer::LABEL, CcFilesPeer::COMPOSER, CcFilesPeer::ENCODER, CcFilesPeer::CHECKSUM, CcFilesPeer::LYRICS, CcFilesPeer::ORCHESTRA, CcFilesPeer::CONDUCTOR, CcFilesPeer::LYRICIST, CcFilesPeer::ORIGINAL_LYRICIST, CcFilesPeer::RADIO_STATION_NAME, CcFilesPeer::INFO_URL, CcFilesPeer::ARTIST_URL, CcFilesPeer::AUDIO_SOURCE_URL, CcFilesPeer::RADIO_STATION_URL, CcFilesPeer::BUY_THIS_URL, CcFilesPeer::ISRC_NUMBER, CcFilesPeer::CATALOG_NUMBER, CcFilesPeer::ORIGINAL_ARTIST, CcFilesPeer::COPYRIGHT, CcFilesPeer::REPORT_DATETIME, CcFilesPeer::REPORT_LOCATION, CcFilesPeer::REPORT_ORGANIZATION, CcFilesPeer::SUBJECT, CcFilesPeer::CONTRIBUTOR, CcFilesPeer::LANGUAGE, CcFilesPeer::FILE_EXISTS, CcFilesPeer::SOUNDCLOUD_ID, CcFilesPeer::SOUNDCLOUD_ERROR_CODE, CcFilesPeer::SOUNDCLOUD_ERROR_MSG, CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME, CcFilesPeer::REPLAY_GAIN, CcFilesPeer::OWNER_ID, CcFilesPeer::CUEIN, CcFilesPeer::CUEOUT, CcFilesPeer::SILAN_CHECK, CcFilesPeer::HIDDEN, CcFilesPeer::IS_SCHEDULED, CcFilesPeer::IS_PLAYLIST, CcFilesPeer::FILESIZE, CcFilesPeer::DESCRIPTION, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'IMPORT_STATUS', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', 'IS_SCHEDULED', 'IS_PLAYLIST', 'FILESIZE', 'DESCRIPTION', ),
- BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'import_status', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', 'is_scheduled', 'is_playlist', 'filesize', 'description', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, )
+ BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbImportStatus', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbSilanCheck', 'DbHidden', 'DbIsScheduled', 'DbIsPlaylist', 'DbFilesize', 'DbDescription', 'DbArtwork', ),
+ BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbImportStatus', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbSilanCheck', 'dbHidden', 'dbIsScheduled', 'dbIsPlaylist', 'dbFilesize', 'dbDescription', 'dbArtwork', ),
+ BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID, CcFilesPeer::NAME, CcFilesPeer::MIME, CcFilesPeer::FTYPE, CcFilesPeer::DIRECTORY, CcFilesPeer::FILEPATH, CcFilesPeer::IMPORT_STATUS, CcFilesPeer::CURRENTLYACCESSING, CcFilesPeer::EDITEDBY, CcFilesPeer::MTIME, CcFilesPeer::UTIME, CcFilesPeer::LPTIME, CcFilesPeer::MD5, CcFilesPeer::TRACK_TITLE, CcFilesPeer::ARTIST_NAME, CcFilesPeer::BIT_RATE, CcFilesPeer::SAMPLE_RATE, CcFilesPeer::FORMAT, CcFilesPeer::LENGTH, CcFilesPeer::ALBUM_TITLE, CcFilesPeer::GENRE, CcFilesPeer::COMMENTS, CcFilesPeer::YEAR, CcFilesPeer::TRACK_NUMBER, CcFilesPeer::CHANNELS, CcFilesPeer::URL, CcFilesPeer::BPM, CcFilesPeer::RATING, CcFilesPeer::ENCODED_BY, CcFilesPeer::DISC_NUMBER, CcFilesPeer::MOOD, CcFilesPeer::LABEL, CcFilesPeer::COMPOSER, CcFilesPeer::ENCODER, CcFilesPeer::CHECKSUM, CcFilesPeer::LYRICS, CcFilesPeer::ORCHESTRA, CcFilesPeer::CONDUCTOR, CcFilesPeer::LYRICIST, CcFilesPeer::ORIGINAL_LYRICIST, CcFilesPeer::RADIO_STATION_NAME, CcFilesPeer::INFO_URL, CcFilesPeer::ARTIST_URL, CcFilesPeer::AUDIO_SOURCE_URL, CcFilesPeer::RADIO_STATION_URL, CcFilesPeer::BUY_THIS_URL, CcFilesPeer::ISRC_NUMBER, CcFilesPeer::CATALOG_NUMBER, CcFilesPeer::ORIGINAL_ARTIST, CcFilesPeer::COPYRIGHT, CcFilesPeer::REPORT_DATETIME, CcFilesPeer::REPORT_LOCATION, CcFilesPeer::REPORT_ORGANIZATION, CcFilesPeer::SUBJECT, CcFilesPeer::CONTRIBUTOR, CcFilesPeer::LANGUAGE, CcFilesPeer::FILE_EXISTS, CcFilesPeer::SOUNDCLOUD_ID, CcFilesPeer::SOUNDCLOUD_ERROR_CODE, CcFilesPeer::SOUNDCLOUD_ERROR_MSG, CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME, CcFilesPeer::REPLAY_GAIN, CcFilesPeer::OWNER_ID, CcFilesPeer::CUEIN, CcFilesPeer::CUEOUT, CcFilesPeer::SILAN_CHECK, CcFilesPeer::HIDDEN, CcFilesPeer::IS_SCHEDULED, CcFilesPeer::IS_PLAYLIST, CcFilesPeer::FILESIZE, CcFilesPeer::DESCRIPTION, CcFilesPeer::ARTWORK, ),
+ BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'IMPORT_STATUS', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'SILAN_CHECK', 'HIDDEN', 'IS_SCHEDULED', 'IS_PLAYLIST', 'FILESIZE', 'DESCRIPTION', 'ARTWORK', ),
+ BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'import_status', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'silan_check', 'hidden', 'is_scheduled', 'is_playlist', 'filesize', 'description', 'artwork', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, )
);
/**
@@ -282,12 +285,12 @@ abstract class BaseCcFilesPeer
* e.g. CcFilesPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbImportStatus' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbSilanCheck' => 66, 'DbHidden' => 67, 'DbIsScheduled' => 68, 'DbIsPlaylist' => 69, 'DbFilesize' => 70, 'DbDescription' => 71, ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbImportStatus' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbSilanCheck' => 66, 'dbHidden' => 67, 'dbIsScheduled' => 68, 'dbIsPlaylist' => 69, 'dbFilesize' => 70, 'dbDescription' => 71, ),
- BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID => 0, CcFilesPeer::NAME => 1, CcFilesPeer::MIME => 2, CcFilesPeer::FTYPE => 3, CcFilesPeer::DIRECTORY => 4, CcFilesPeer::FILEPATH => 5, CcFilesPeer::IMPORT_STATUS => 6, CcFilesPeer::CURRENTLYACCESSING => 7, CcFilesPeer::EDITEDBY => 8, CcFilesPeer::MTIME => 9, CcFilesPeer::UTIME => 10, CcFilesPeer::LPTIME => 11, CcFilesPeer::MD5 => 12, CcFilesPeer::TRACK_TITLE => 13, CcFilesPeer::ARTIST_NAME => 14, CcFilesPeer::BIT_RATE => 15, CcFilesPeer::SAMPLE_RATE => 16, CcFilesPeer::FORMAT => 17, CcFilesPeer::LENGTH => 18, CcFilesPeer::ALBUM_TITLE => 19, CcFilesPeer::GENRE => 20, CcFilesPeer::COMMENTS => 21, CcFilesPeer::YEAR => 22, CcFilesPeer::TRACK_NUMBER => 23, CcFilesPeer::CHANNELS => 24, CcFilesPeer::URL => 25, CcFilesPeer::BPM => 26, CcFilesPeer::RATING => 27, CcFilesPeer::ENCODED_BY => 28, CcFilesPeer::DISC_NUMBER => 29, CcFilesPeer::MOOD => 30, CcFilesPeer::LABEL => 31, CcFilesPeer::COMPOSER => 32, CcFilesPeer::ENCODER => 33, CcFilesPeer::CHECKSUM => 34, CcFilesPeer::LYRICS => 35, CcFilesPeer::ORCHESTRA => 36, CcFilesPeer::CONDUCTOR => 37, CcFilesPeer::LYRICIST => 38, CcFilesPeer::ORIGINAL_LYRICIST => 39, CcFilesPeer::RADIO_STATION_NAME => 40, CcFilesPeer::INFO_URL => 41, CcFilesPeer::ARTIST_URL => 42, CcFilesPeer::AUDIO_SOURCE_URL => 43, CcFilesPeer::RADIO_STATION_URL => 44, CcFilesPeer::BUY_THIS_URL => 45, CcFilesPeer::ISRC_NUMBER => 46, CcFilesPeer::CATALOG_NUMBER => 47, CcFilesPeer::ORIGINAL_ARTIST => 48, CcFilesPeer::COPYRIGHT => 49, CcFilesPeer::REPORT_DATETIME => 50, CcFilesPeer::REPORT_LOCATION => 51, CcFilesPeer::REPORT_ORGANIZATION => 52, CcFilesPeer::SUBJECT => 53, CcFilesPeer::CONTRIBUTOR => 54, CcFilesPeer::LANGUAGE => 55, CcFilesPeer::FILE_EXISTS => 56, CcFilesPeer::SOUNDCLOUD_ID => 57, CcFilesPeer::SOUNDCLOUD_ERROR_CODE => 58, CcFilesPeer::SOUNDCLOUD_ERROR_MSG => 59, CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE => 60, CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME => 61, CcFilesPeer::REPLAY_GAIN => 62, CcFilesPeer::OWNER_ID => 63, CcFilesPeer::CUEIN => 64, CcFilesPeer::CUEOUT => 65, CcFilesPeer::SILAN_CHECK => 66, CcFilesPeer::HIDDEN => 67, CcFilesPeer::IS_SCHEDULED => 68, CcFilesPeer::IS_PLAYLIST => 69, CcFilesPeer::FILESIZE => 70, CcFilesPeer::DESCRIPTION => 71, ),
- BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'IMPORT_STATUS' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'SILAN_CHECK' => 66, 'HIDDEN' => 67, 'IS_SCHEDULED' => 68, 'IS_PLAYLIST' => 69, 'FILESIZE' => 70, 'DESCRIPTION' => 71, ),
- BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'import_status' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'silan_check' => 66, 'hidden' => 67, 'is_scheduled' => 68, 'is_playlist' => 69, 'filesize' => 70, 'description' => 71, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, )
+ BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbImportStatus' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbSilanCheck' => 66, 'DbHidden' => 67, 'DbIsScheduled' => 68, 'DbIsPlaylist' => 69, 'DbFilesize' => 70, 'DbDescription' => 71, 'DbArtwork' => 72, ),
+ BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbImportStatus' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbSilanCheck' => 66, 'dbHidden' => 67, 'dbIsScheduled' => 68, 'dbIsPlaylist' => 69, 'dbFilesize' => 70, 'dbDescription' => 71, 'dbArtwork' => 72, ),
+ BasePeer::TYPE_COLNAME => array (CcFilesPeer::ID => 0, CcFilesPeer::NAME => 1, CcFilesPeer::MIME => 2, CcFilesPeer::FTYPE => 3, CcFilesPeer::DIRECTORY => 4, CcFilesPeer::FILEPATH => 5, CcFilesPeer::IMPORT_STATUS => 6, CcFilesPeer::CURRENTLYACCESSING => 7, CcFilesPeer::EDITEDBY => 8, CcFilesPeer::MTIME => 9, CcFilesPeer::UTIME => 10, CcFilesPeer::LPTIME => 11, CcFilesPeer::MD5 => 12, CcFilesPeer::TRACK_TITLE => 13, CcFilesPeer::ARTIST_NAME => 14, CcFilesPeer::BIT_RATE => 15, CcFilesPeer::SAMPLE_RATE => 16, CcFilesPeer::FORMAT => 17, CcFilesPeer::LENGTH => 18, CcFilesPeer::ALBUM_TITLE => 19, CcFilesPeer::GENRE => 20, CcFilesPeer::COMMENTS => 21, CcFilesPeer::YEAR => 22, CcFilesPeer::TRACK_NUMBER => 23, CcFilesPeer::CHANNELS => 24, CcFilesPeer::URL => 25, CcFilesPeer::BPM => 26, CcFilesPeer::RATING => 27, CcFilesPeer::ENCODED_BY => 28, CcFilesPeer::DISC_NUMBER => 29, CcFilesPeer::MOOD => 30, CcFilesPeer::LABEL => 31, CcFilesPeer::COMPOSER => 32, CcFilesPeer::ENCODER => 33, CcFilesPeer::CHECKSUM => 34, CcFilesPeer::LYRICS => 35, CcFilesPeer::ORCHESTRA => 36, CcFilesPeer::CONDUCTOR => 37, CcFilesPeer::LYRICIST => 38, CcFilesPeer::ORIGINAL_LYRICIST => 39, CcFilesPeer::RADIO_STATION_NAME => 40, CcFilesPeer::INFO_URL => 41, CcFilesPeer::ARTIST_URL => 42, CcFilesPeer::AUDIO_SOURCE_URL => 43, CcFilesPeer::RADIO_STATION_URL => 44, CcFilesPeer::BUY_THIS_URL => 45, CcFilesPeer::ISRC_NUMBER => 46, CcFilesPeer::CATALOG_NUMBER => 47, CcFilesPeer::ORIGINAL_ARTIST => 48, CcFilesPeer::COPYRIGHT => 49, CcFilesPeer::REPORT_DATETIME => 50, CcFilesPeer::REPORT_LOCATION => 51, CcFilesPeer::REPORT_ORGANIZATION => 52, CcFilesPeer::SUBJECT => 53, CcFilesPeer::CONTRIBUTOR => 54, CcFilesPeer::LANGUAGE => 55, CcFilesPeer::FILE_EXISTS => 56, CcFilesPeer::SOUNDCLOUD_ID => 57, CcFilesPeer::SOUNDCLOUD_ERROR_CODE => 58, CcFilesPeer::SOUNDCLOUD_ERROR_MSG => 59, CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE => 60, CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME => 61, CcFilesPeer::REPLAY_GAIN => 62, CcFilesPeer::OWNER_ID => 63, CcFilesPeer::CUEIN => 64, CcFilesPeer::CUEOUT => 65, CcFilesPeer::SILAN_CHECK => 66, CcFilesPeer::HIDDEN => 67, CcFilesPeer::IS_SCHEDULED => 68, CcFilesPeer::IS_PLAYLIST => 69, CcFilesPeer::FILESIZE => 70, CcFilesPeer::DESCRIPTION => 71, CcFilesPeer::DESCRIPTION => 72, ),
+ BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'IMPORT_STATUS' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'SILAN_CHECK' => 66, 'HIDDEN' => 67, 'IS_SCHEDULED' => 68, 'IS_PLAYLIST' => 69, 'FILESIZE' => 70, 'DESCRIPTION' => 71, 'ARTWORK' => 72, ),
+ BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'import_status' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'silan_check' => 66, 'hidden' => 67, 'is_scheduled' => 68, 'is_playlist' => 69, 'filesize' => 70, 'description' => 71, 'artwork' => 72, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, )
);
/**
@@ -433,6 +436,7 @@ abstract class BaseCcFilesPeer
$criteria->addSelectColumn(CcFilesPeer::IS_PLAYLIST);
$criteria->addSelectColumn(CcFilesPeer::FILESIZE);
$criteria->addSelectColumn(CcFilesPeer::DESCRIPTION);
+ $criteria->addSelectColumn(CcFilesPeer::ARTWORK);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.name');
@@ -506,6 +510,7 @@ abstract class BaseCcFilesPeer
$criteria->addSelectColumn($alias . '.is_playlist');
$criteria->addSelectColumn($alias . '.filesize');
$criteria->addSelectColumn($alias . '.description');
+ $criteria->addSelectColumn($alias . '.artwork');
}
}
diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php
index 80fe0a5ba..6c5afc688 100644
--- a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php
+++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php
@@ -78,6 +78,7 @@
* @method CcFilesQuery orderByDbIsPlaylist($order = Criteria::ASC) Order by the is_playlist column
* @method CcFilesQuery orderByDbFilesize($order = Criteria::ASC) Order by the filesize column
* @method CcFilesQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
+ * @method CcFilesQuery orderByDbArtwork($order = Criteria::ASC) Order by the artwork column
*
* @method CcFilesQuery groupByDbId() Group by the id column
* @method CcFilesQuery groupByDbName() Group by the name column
@@ -151,6 +152,7 @@
* @method CcFilesQuery groupByDbIsPlaylist() Group by the is_playlist column
* @method CcFilesQuery groupByDbFilesize() Group by the filesize column
* @method CcFilesQuery groupByDbDescription() Group by the description column
+ * @method CcFilesQuery groupByDbArtwork() Group by the artwork column
*
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@@ -274,6 +276,7 @@
* @method CcFiles findOneByDbIsPlaylist(boolean $is_playlist) Return the first CcFiles filtered by the is_playlist column
* @method CcFiles findOneByDbFilesize(int $filesize) Return the first CcFiles filtered by the filesize column
* @method CcFiles findOneByDbDescription(string $description) Return the first CcFiles filtered by the description column
+ * @method CcFiles findOneByDbArtwork(string $artwork) Return the first CcFiles filtered by the artwork column
*
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
@@ -347,6 +350,7 @@
* @method array findByDbIsPlaylist(boolean $is_playlist) Return CcFiles objects filtered by the is_playlist column
* @method array findByDbFilesize(int $filesize) Return CcFiles objects filtered by the filesize column
* @method array findByDbDescription(string $description) Return CcFiles objects filtered by the description column
+ * @method array findByDbArtwork(string $artwork) Return CcFiles objects filtered by the artwork column
*
* @package propel.generator.airtime.om
*/
@@ -454,7 +458,7 @@ abstract class BaseCcFilesQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
- $sql = 'SELECT "id", "name", "mime", "ftype", "directory", "filepath", "import_status", "currentlyaccessing", "editedby", "mtime", "utime", "lptime", "md5", "track_title", "artist_name", "bit_rate", "sample_rate", "format", "length", "album_title", "genre", "comments", "year", "track_number", "channels", "url", "bpm", "rating", "encoded_by", "disc_number", "mood", "label", "composer", "encoder", "checksum", "lyrics", "orchestra", "conductor", "lyricist", "original_lyricist", "radio_station_name", "info_url", "artist_url", "audio_source_url", "radio_station_url", "buy_this_url", "isrc_number", "catalog_number", "original_artist", "copyright", "report_datetime", "report_location", "report_organization", "subject", "contributor", "language", "file_exists", "soundcloud_id", "soundcloud_error_code", "soundcloud_error_msg", "soundcloud_link_to_file", "soundcloud_upload_time", "replay_gain", "owner_id", "cuein", "cueout", "silan_check", "hidden", "is_scheduled", "is_playlist", "filesize", "description" FROM "cc_files" WHERE "id" = :p0';
+ $sql = 'SELECT "id", "name", "mime", "ftype", "directory", "filepath", "import_status", "currentlyaccessing", "editedby", "mtime", "utime", "lptime", "md5", "track_title", "artist_name", "bit_rate", "sample_rate", "format", "length", "album_title", "genre", "comments", "year", "track_number", "channels", "url", "bpm", "rating", "encoded_by", "disc_number", "mood", "label", "composer", "encoder", "checksum", "lyrics", "orchestra", "conductor", "lyricist", "original_lyricist", "radio_station_name", "info_url", "artist_url", "audio_source_url", "radio_station_url", "buy_this_url", "isrc_number", "catalog_number", "original_artist", "copyright", "report_datetime", "report_location", "report_organization", "subject", "contributor", "language", "file_exists", "soundcloud_id", "soundcloud_error_code", "soundcloud_error_msg", "soundcloud_link_to_file", "soundcloud_upload_time", "replay_gain", "owner_id", "cuein", "cueout", "silan_check", "hidden", "is_scheduled", "is_playlist", "filesize", "description", "artwork" FROM "cc_files" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -1937,6 +1941,35 @@ abstract class BaseCcFilesQuery extends ModelCriteria
return $this->addUsingAlias(CcFilesPeer::INFO_URL, $dbInfoUrl, $comparison);
}
+ /**
+ * Filter the query on the artwork column
+ *
+ * Example usage:
+ *
+ * $query->filterByDbArtwork('fooValue'); // WHERE artwork = 'fooValue'
+ * $query->filterByDbArtwork('%fooValue%'); // WHERE artwork LIKE '%fooValue%'
+ *
+ *
+ * @param string $dbArtwork The value to use as filter.
+ * Accepts wildcards (* and % trigger a LIKE)
+ * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
+ *
+ * @return CcFilesQuery The current query, for fluid interface
+ */
+ public function filterByDbArtwork($dbArtwork = null, $comparison = null)
+ {
+ if (null === $comparison) {
+ if (is_array($dbArtwork)) {
+ $comparison = Criteria::IN;
+ } elseif (preg_match('/[\%\*]/', $dbArtwork)) {
+ $dbArtwork = str_replace('*', '%', $dbArtwork);
+ $comparison = Criteria::LIKE;
+ }
+ }
+
+ return $this->addUsingAlias(CcFilesPeer::ARTWORK, $dbArtwork, $comparison);
+ }
+
/**
* Filter the query on the artist_url column
*
diff --git a/airtime_mvc/application/upgrade/Upgrades.php b/airtime_mvc/application/upgrade/Upgrades.php
index 02887dadc..b8b822421 100644
--- a/airtime_mvc/application/upgrade/Upgrades.php
+++ b/airtime_mvc/application/upgrade/Upgrades.php
@@ -284,7 +284,7 @@ class AirtimeUpgrader254 extends AirtimeUpgrader
{
return '2.5.4';
}
-
+
protected function _runUpgrade()
{
//First, ensure there are no superadmins already.
@@ -350,7 +350,7 @@ class AirtimeUpgrader259 extends AirtimeUpgrader {
'2.5.5'
);
}
-
+
public function getNewVersion() {
return '2.5.9';
}
@@ -494,6 +494,19 @@ class AirtimeUpgrader2516 extends AirtimeUpgrader
}
}
+class AirtimeUpgrader2517 extends AirtimeUpgrader
+{
+ protected function getSupportedSchemaVersions() {
+ return array(
+ '2.5.16'
+ );
+ }
+
+ public function getNewVersion() {
+ return '2.5.17';
+ }
+}
+
class AirtimeUpgrader300alpha extends AirtimeUpgrader
{
protected function getSupportedSchemaVersions() {
@@ -569,7 +582,7 @@ class AirtimeUpgrader300alpha7_1 extends AirtimeUpgrader
return '3.0.0-alpha.7.1';
}
-}
+}
/**
* Class AirtimeUpgrader300alpha7-2
*
diff --git a/airtime_mvc/application/views/scripts/library/edit-file-md.phtml b/airtime_mvc/application/views/scripts/library/edit-file-md.phtml
index e8016aaae..4f09f9db4 100644
--- a/airtime_mvc/application/views/scripts/library/edit-file-md.phtml
+++ b/airtime_mvc/application/views/scripts/library/edit-file-md.phtml
@@ -1,12 +1,27 @@
+artwork, 256); ?>