From fc2c23be8a0c1c4d4524e6a99c59eb587fa84848 Mon Sep 17 00:00:00 2001 From: Codenift Date: Wed, 18 Sep 2019 10:04:43 -0400 Subject: [PATCH 1/5] Updated jquery.cookie to js.cookie --- .../plugins/PageLayoutInitPlugin.php | 4 +- .../public/js/airtime/dashboard/dashboard.js | 54 +++--- airtime_mvc/public/js/airtime/login/login.js | 2 +- airtime_mvc/public/js/cookie/jquery.cookie.js | 72 -------- airtime_mvc/public/js/cookie/js.cookie.js | 163 ++++++++++++++++++ 5 files changed, 193 insertions(+), 102 deletions(-) delete mode 100644 airtime_mvc/public/js/cookie/jquery.cookie.js create mode 100644 airtime_mvc/public/js/cookie/js.cookie.js diff --git a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php index f6a46be5d..ee9d50218 100644 --- a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php +++ b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php @@ -91,7 +91,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract $userType = ""; } $view->headScript()->appendScript("var userType = '$userType';"); - + // Dropzone also accept file extensions and doesn't correctly extract certain mimetypes (eg. FLAC - try it), // so we append the file extensions to the list of mimetypes and that makes it work. $mimeTypes = FileDataHelper::getAudioMimeTypeArray(); @@ -181,7 +181,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract ->appendFile($baseUrl . 'js/qtip/jquery.qtip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/sprintf/sprintf-0.7-beta1.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') - ->appendFile($baseUrl . 'js/cookie/jquery.cookie.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') + ->appendFile($baseUrl . 'js/cookie/js.cookie.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript') diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 5ceadf6a2..add9cfa98 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -41,7 +41,7 @@ var nextSongPrepare = true; var nextShowPrepare = true; function secondsTimer(){ - /* This function constantly calls itself every 'uiUpdateInterval' + /* This function constantly calls itself every 'uiUpdateInterval' * micro-seconds and is responsible for updating the UI. */ if (localRemoteTimeOffset !== null){ var date = new Date(); @@ -59,7 +59,7 @@ function newSongStart(){ if (nextSong.type == 'track') { currentSong = nextSong; nextSong = null; - } + } } function nextShowStart(){ @@ -83,13 +83,13 @@ function updateProgressBarValue(){ var songPercentDone = 0; var scheduled_play_div = $("#scheduled_play_div"); var scheduled_play_line_to_switch = scheduled_play_div.parent().find(".line-to-switch"); - + if (currentSong !== null){ var songElapsedTime = 0; songPercentDone = (approximateServerTime - currentSong.songStartPosixTime)/currentSong.songLengthMs*100; songElapsedTime = approximateServerTime - currentSong.songStartPosixTime; if (songPercentDone < 0) { - songPercentDone = 0; + songPercentDone = 0; //currentSong = null; } else if (songPercentDone > 100) { songPercentDone = 100; @@ -211,12 +211,12 @@ function calculateTimeToNextSong() { if (approximateServerTime === null) { return; } - + if (newSongTimeoutId !== null) { /* We have a previous timeout set, let's unset it */ clearTimeout(newSongTimeoutId); newSongTimeoutId = null; - } + } var diff = nextSong.songStartPosixTime - approximateServerTime; if (diff < 0) diff=0; @@ -233,7 +233,7 @@ function calculateTimeToNextShow() { /* We have a previous timeout set, let's unset it */ clearTimeout(newShowTimeoutId); newShowTimeoutId = null; - } + } var diff = nextShow[0].showStartPosixTime - approximateServerTime; if (diff < 0) diff=0; @@ -256,7 +256,7 @@ function parseItems(obj){ calcAdditionalData(nextSong); calculateTimeToNextSong(); } - + currentShow = new Array(); if (obj.currentShow.length > 0) { calcAdditionalShowData(obj.currentShow); @@ -269,7 +269,7 @@ function parseItems(obj){ nextShow = obj.nextShow; calculateTimeToNextShow(); } - + var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime); var date = new Date(); @@ -281,7 +281,7 @@ function parseSourceStatus(obj){ var master_div = $("#master_dj_div"); var live_li = live_div.parent(); var master_li = master_div.parent(); - + if(obj.live_dj_source == false){ live_li.find(".line-to-switch").attr("class", "line-to-switch off"); live_div.removeClass("ready"); @@ -289,7 +289,7 @@ function parseSourceStatus(obj){ live_li.find(".line-to-switch").attr("class", "line-to-switch on"); live_div.addClass("ready"); } - + if(obj.master_dj_source == false){ master_li.find(".line-to-switch").attr("class", "line-to-switch off"); master_div.removeClass("ready"); @@ -300,43 +300,43 @@ function parseSourceStatus(obj){ } function parseSwitchStatus(obj){ - + if(obj.live_dj_source == "on"){ live_dj_on_air = true; }else{ live_dj_on_air = false; } - + if(obj.master_dj_source == "on"){ master_dj_on_air = true; }else{ master_dj_on_air = false; } - + if(obj.scheduled_play == "on"){ scheduled_play_on_air = true; }else{ scheduled_play_on_air = false; } - + var scheduled_play_switch = $("#scheduled_play.source-switch-button"); var live_dj_switch = $("#live_dj.source-switch-button"); var master_dj_switch = $("#master_dj.source-switch-button"); - + scheduled_play_switch.find("span").html(obj.scheduled_play); if(scheduled_play_on_air){ scheduled_play_switch.addClass("active"); }else{ scheduled_play_switch.removeClass("active"); } - + live_dj_switch.find("span").html(obj.live_dj_source); if(live_dj_on_air){ live_dj_switch.addClass("active"); }else{ live_dj_switch.removeClass("active"); } - + master_dj_switch.find("span").html(obj.master_dj_source) if(master_dj_on_air){ master_dj_switch.addClass("active"); @@ -351,7 +351,7 @@ function controlOnAirLight(){ onAirOffIterations = 0; } else if (onAirOffIterations < 20) { //if less than 4 seconds have gone by (< 20 executions of this function) - //then keep the ON-AIR light on. Only after at least 3 seconds have gone by, + //then keep the ON-AIR light on. Only after at least 3 seconds have gone by, //should we be allowed to turn it off. This is to stop the light from temporarily turning //off between tracks: CC-3725 onAirOffIterations++; @@ -364,7 +364,7 @@ function controlSwitchLight(){ var live_li= $("#live_dj_div").parent(); var master_li = $("#master_dj_div").parent(); var scheduled_play_li = $("#scheduled_play_div").parent(); - + if((scheduled_play_on_air && scheduled_play_source) && !live_dj_on_air && !master_dj_on_air){ scheduled_play_li.find(".line-to-on-air").attr("class", "line-to-on-air on"); live_li.find(".line-to-on-air").attr("class", "line-to-on-air off"); @@ -385,8 +385,8 @@ function controlSwitchLight(){ } function getScheduleFromServer(){ - $.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", - dataType:"json", + $.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", + dataType:"json", success:function(data){ parseItems(data.entries); parseSourceStatus(data.source_status); @@ -440,7 +440,7 @@ function setSwitchListener(ele){ function kickSource(ele){ var sourcename = $(ele).attr('id'); - + $.get(baseUrl+"Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){ if(data.error){ alert(data.error); @@ -458,7 +458,7 @@ function init() { secondsTimer(); setupQtip(); - + $('.listen-control-button').click(function() { if (stream_window == null || stream_window.closed) stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=158'); @@ -490,15 +490,15 @@ $(document).ready(function() { if ($('.errors').length === 0) { setCurrentUserPseudoPassword(); } - + $('body').on('click','#current-user', function() { $.ajax({ url: baseUrl+'user/edit-user/format/json' }); }); - + $('body').on('click', '#cu_save_user', function() { - $.cookie("airtime_locale", $('#cu_locale').val(), {path: '/'}); + Cookies.set('airtime_locale', $('#cu_locale').val(), {path: '/'}); }); // When the 'Listen' button is clicked we set the width diff --git a/airtime_mvc/public/js/airtime/login/login.js b/airtime_mvc/public/js/airtime/login/login.js index 8c17106ed..a0a15f0cc 100644 --- a/airtime_mvc/public/js/airtime/login/login.js +++ b/airtime_mvc/public/js/airtime/login/login.js @@ -4,6 +4,6 @@ $(window).load(function() { $(document).ready(function() { $("#submit").click(function() { - $.cookie("airtime_locale", $("#locale").val(), {path: '/'}); + Cookies.set('airtime_locale', $('#locale').val(), {path: '/'}); }); }); diff --git a/airtime_mvc/public/js/cookie/jquery.cookie.js b/airtime_mvc/public/js/cookie/jquery.cookie.js deleted file mode 100644 index d151b7f31..000000000 --- a/airtime_mvc/public/js/cookie/jquery.cookie.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! - * jQuery Cookie Plugin v1.3 - * https://github.com/carhartl/jquery-cookie - * - * Copyright 2011, Klaus Hartl - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/GPL-2.0 - */ -(function ($, document, undefined) { - - var pluses = /\+/g; - - function raw(s) { - return s; - } - - function decoded(s) { - return decodeURIComponent(s.replace(pluses, ' ')); - } - - var config = $.cookie = function (key, value, options) { - - // write - if (value !== undefined) { - options = $.extend({}, config.defaults, options); - - if (value === null) { - options.expires = -1; - } - - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setDate(t.getDate() + days); - } - - value = config.json ? JSON.stringify(value) : String(value); - - return (document.cookie = [ - encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } - - // read - var decode = config.raw ? raw : decoded; - var cookies = document.cookie.split('; '); - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('='); - if (decode(parts.shift()) === key) { - var cookie = decode(parts.join('=')); - return config.json ? JSON.parse(cookie) : cookie; - } - } - - return null; - }; - - config.defaults = {}; - - $.removeCookie = function (key, options) { - if ($.cookie(key) !== null) { - $.cookie(key, null, options); - return true; - } - return false; - }; - -})(jQuery, document); \ No newline at end of file diff --git a/airtime_mvc/public/js/cookie/js.cookie.js b/airtime_mvc/public/js/cookie/js.cookie.js new file mode 100644 index 000000000..1d83ea447 --- /dev/null +++ b/airtime_mvc/public/js/cookie/js.cookie.js @@ -0,0 +1,163 @@ +/*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +;(function (factory) { + var registeredInModuleLoader; + if (typeof define === 'function' && define.amd) { + define(factory); + registeredInModuleLoader = true; + } + if (typeof exports === 'object') { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function decode (s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init (converter) { + function api() {} + + function set (key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? + converter.write(value, key) : + encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + + key = encodeURIComponent(String(key)) + .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) + .replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + function get (key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || + decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + api.get = function (key) { + return get(key, false /* read as raw */); + }; + api.getJSON = function (key) { + return get(key, true /* read as json */); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); \ No newline at end of file From 2e23238f2c39872c313c46b1aa84e5c7c84c4171 Mon Sep 17 00:00:00 2001 From: Codenift Date: Fri, 20 Sep 2019 00:29:31 -0400 Subject: [PATCH 2/5] JS Cookie update --- .../plugins/PageLayoutInitPlugin.php | 2 +- .../public/js/airtime/dashboard/dashboard.js | 2 +- airtime_mvc/public/js/cookie/jquery.cookie.js | 72 -------- airtime_mvc/public/js/cookie/js.cookie.js | 163 ++++++++++++++++++ 4 files changed, 165 insertions(+), 74 deletions(-) delete mode 100644 airtime_mvc/public/js/cookie/jquery.cookie.js create mode 100644 airtime_mvc/public/js/cookie/js.cookie.js diff --git a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php index 444f82f96..bbb538fdd 100644 --- a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php +++ b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php @@ -183,7 +183,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract ->appendFile($baseUrl . 'js/qtip/jquery.qtip.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/sprintf/sprintf-0.7-beta1.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') - ->appendFile($baseUrl . 'js/cookie/jquery.cookie.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') + ->appendFile($baseUrl . 'js/cookie/js.cookie.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript') ->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript') diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 5a894d82a..1b4d1c468 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -517,7 +517,7 @@ $(document).ready(function() { }); $('body').on('click', '#cu_save_user', function() { - $.cookie("airtime_locale", $('#cu_locale').val(), {path: '/'}); + Cookies.set('airtime_locale', $('#cu_locale').val(), {path: '/'}); }); // When the 'Listen' button is clicked we set the width diff --git a/airtime_mvc/public/js/cookie/jquery.cookie.js b/airtime_mvc/public/js/cookie/jquery.cookie.js deleted file mode 100644 index d151b7f31..000000000 --- a/airtime_mvc/public/js/cookie/jquery.cookie.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! - * jQuery Cookie Plugin v1.3 - * https://github.com/carhartl/jquery-cookie - * - * Copyright 2011, Klaus Hartl - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/GPL-2.0 - */ -(function ($, document, undefined) { - - var pluses = /\+/g; - - function raw(s) { - return s; - } - - function decoded(s) { - return decodeURIComponent(s.replace(pluses, ' ')); - } - - var config = $.cookie = function (key, value, options) { - - // write - if (value !== undefined) { - options = $.extend({}, config.defaults, options); - - if (value === null) { - options.expires = -1; - } - - if (typeof options.expires === 'number') { - var days = options.expires, t = options.expires = new Date(); - t.setDate(t.getDate() + days); - } - - value = config.json ? JSON.stringify(value) : String(value); - - return (document.cookie = [ - encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), - options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE - options.path ? '; path=' + options.path : '', - options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' - ].join('')); - } - - // read - var decode = config.raw ? raw : decoded; - var cookies = document.cookie.split('; '); - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('='); - if (decode(parts.shift()) === key) { - var cookie = decode(parts.join('=')); - return config.json ? JSON.parse(cookie) : cookie; - } - } - - return null; - }; - - config.defaults = {}; - - $.removeCookie = function (key, options) { - if ($.cookie(key) !== null) { - $.cookie(key, null, options); - return true; - } - return false; - }; - -})(jQuery, document); \ No newline at end of file diff --git a/airtime_mvc/public/js/cookie/js.cookie.js b/airtime_mvc/public/js/cookie/js.cookie.js new file mode 100644 index 000000000..1d83ea447 --- /dev/null +++ b/airtime_mvc/public/js/cookie/js.cookie.js @@ -0,0 +1,163 @@ +/*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +;(function (factory) { + var registeredInModuleLoader; + if (typeof define === 'function' && define.amd) { + define(factory); + registeredInModuleLoader = true; + } + if (typeof exports === 'object') { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function decode (s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init (converter) { + function api() {} + + function set (key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? + converter.write(value, key) : + encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + + key = encodeURIComponent(String(key)) + .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) + .replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + function get (key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || + decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + api.get = function (key) { + return get(key, false /* read as raw */); + }; + api.getJSON = function (key) { + return get(key, true /* read as json */); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); \ No newline at end of file From b411d6d6f25c780706d8a9ebd5feee977ad43f3b Mon Sep 17 00:00:00 2001 From: Codenift Date: Fri, 20 Sep 2019 03:09:41 -0400 Subject: [PATCH 3/5] Added option to set media type for tracks. --- airtime_mvc/application/configs/constants.php | 1 + .../upgrade_sql/airtime_2.5.18/upgrade.sql | 1 + airtime_mvc/application/forms/EditAudioMD.php | 28 ++++++ .../application/forms/SmartBlockCriteria.php | 21 +++-- airtime_mvc/application/models/Block.php | 79 ++++++++-------- airtime_mvc/application/models/StoredFile.php | 5 +- .../models/airtime/map/CcFilesTableMap.php | 1 + .../models/airtime/om/BaseCcFiles.php | 55 +++++++++++ .../models/airtime/om/BaseCcFilesPeer.php | 27 +++--- .../models/airtime/om/BaseCcFilesQuery.php | 35 ++++++- .../application/services/HistoryService.php | 43 ++++----- airtime_mvc/application/upgrade/Upgrades.php | 13 +++ .../library/get-file-metadata.ajax.phtml | 1 + airtime_mvc/build/schema.xml | 1 + airtime_mvc/build/sql/schema.sql | 1 + .../public/js/airtime/library/library.js | 7 +- .../js/airtime/playlist/smart_blockbuilder.js | 91 ++++++++++--------- 17 files changed, 281 insertions(+), 129 deletions(-) create mode 100644 airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.18/upgrade.sql diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index a56a908b5..29157c556 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -83,6 +83,7 @@ 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('MDATA_KEY_MEDIA_TYPE' , 'media_type'); define('UI_MDATA_VALUE_FORMAT_FILE' , 'File'); define('UI_MDATA_VALUE_FORMAT_STREAM' , 'live stream'); diff --git a/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.18/upgrade.sql b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.18/upgrade.sql new file mode 100644 index 000000000..20fdd2dc4 --- /dev/null +++ b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.18/upgrade.sql @@ -0,0 +1 @@ +ALTER TABLE cc_files ADD COLUMN media_type VARCHAR(4); \ No newline at end of file diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php index 62a83f66c..ecc1ec135 100644 --- a/airtime_mvc/application/forms/EditAudioMD.php +++ b/airtime_mvc/application/forms/EditAudioMD.php @@ -74,6 +74,34 @@ class Application_Form_EditAudioMD extends Zend_Form $owner_id->setMultiOptions($user_options); $this->addelement($owner_id); + // Add media type dropdown + $media_type_options = array(); + $media_types = array( + '' => '--- Select Media Type ---', + 'MUS' => 'Music (MUS)', + 'SID' => 'Station ID (SID)', + 'INT' => 'Intro (INT)', + 'OUT' => 'Outro (OUT)', + 'SWP' => 'Sweeper (SWP)', + 'JIN' => 'Jingle (JIN)', + 'PRO' => 'Promo (PRO)', + 'SHO' => 'Shout Out (SHO)', + 'NWS' => 'News (NWS)', + 'COM' => 'Commercial (COM)', + 'ITV' => 'Interview (ITV)', + 'VTR' => 'Voice Tracking (VTR)', + ); + + foreach ($media_types as $key => $mt) { + $media_type_options[$key] = $mt; + } + + $media_type = new Zend_Form_Element_Select('media_type'); + $media_type->class = 'input_text'; + $media_type->setLabel(_('Media Type:')); + $media_type->setMultiOptions($media_type_options); + $this->addelement($media_type); + // Description field $description = new Zend_Form_Element_Textarea('description'); $description->class = 'input_text'; diff --git a/airtime_mvc/application/forms/SmartBlockCriteria.php b/airtime_mvc/application/forms/SmartBlockCriteria.php index e539c551c..ac55947f2 100644 --- a/airtime_mvc/application/forms/SmartBlockCriteria.php +++ b/airtime_mvc/application/forms/SmartBlockCriteria.php @@ -42,7 +42,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm "track_title" => "s", "track_number" => "n", "info_url" => "s", - "year" => "n" + "year" => "n", + "media_type" => "s" ); private function getCriteriaOptions($option = null) @@ -77,7 +78,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm "track_number" => _("Track Number"), "utime" => _("Uploaded"), "info_url" => _("Website"), - "year" => _("Year") + "year" => _("Year"), + "media_type" => _("Media Type") ); } @@ -183,18 +185,18 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm public function init() { } - + /* * converts UTC timestamp citeria into user timezone strings. */ private function convertTimestamps(&$criteria) { $columns = array("utime", "mtime", "lptime"); - + foreach ($columns as $column) { - + if (isset($criteria[$column])) { - + foreach ($criteria[$column] as &$constraint) { // convert to appropriate timezone timestamps only if the modifier is not a relative time if (!in_array($constraint['modifier'], array('before','after','between'))) { @@ -246,7 +248,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $bl = new Application_Model_Block($p_blockId); $storedCrit = $bl->getCriteriaGrouped(); Logging::info($storedCrit); - + //need to convert criteria to be displayed in the user's timezone if there's some timestamp type. self::convertTimestamps($storedCrit["crit"]); @@ -470,7 +472,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $sort->setValue($storedCrit["sort"]["value"]); } $this->addElement($sort); - + $limit = new Zend_Form_Element_Select('sp_limit_options'); $limit->setAttrib('class', 'sp_input_select') ->setDecorators(array('viewHelper')) @@ -721,7 +723,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm "sample_rate" => "DbSampleRate", "track_title" => "DbTrackTitle", "track_number" => "DbTrackNumber", - "year" => "DbYear" + "year" => "DbYear", + "media_type" => "DbMediaType" ); // things we need to check diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index f40945742..3d3b273bb 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -85,7 +85,8 @@ class Application_Model_Block implements Application_Model_LibraryEditable "sample_rate" => "DbSampleRate", "track_title" => "DbTrackTitle", "track_number" => "DbTrackNumber", - "year" => "DbYear" + "year" => "DbYear", + "media_type" => "DbMediaType" ); public function __construct($id=null, $con=null) @@ -232,12 +233,12 @@ SQL; foreach ($rows as &$row) { $clipSec = Application_Common_DateHelper::playlistTimeToSeconds($row['length']); - + $row['trackSec'] = $clipSec; - + $row['cueInSec'] = Application_Common_DateHelper::playlistTimeToSeconds($row['cuein']); $row['cueOutSec'] = Application_Common_DateHelper::playlistTimeToSeconds($row['cueout']); - + $trackoffset = $row['trackoffset']; $offset += $clipSec; $offset -= $trackoffset; @@ -254,7 +255,7 @@ SQL; $fades = $this->getFadeInfo($row['position']); $row['fadein'] = $fades[0]; $row['fadeout'] = $fades[1]; - + // format the cues in format 00:00:00(.0) // we need to add the '.0' for cues and not fades // because propel takes care of this for us @@ -488,7 +489,7 @@ SQL; Logging::info("Adding to block"); Logging::info("at position {$pos}"); } - + foreach ($p_items as $ac) { //Logging::info("Adding audio file {$ac[0]}"); try { @@ -677,7 +678,7 @@ SQL; return array($fadeIn, $fadeOut); } - + /* * create a crossfade from item in cc_playlist_contents with $id1 to item $id2. * @@ -688,11 +689,11 @@ SQL; public function createCrossfade($id1, $fadeOut, $id2, $fadeIn, $offset) { $this->con->beginTransaction(); - + if (!isset($offset)) { $offset = Application_Model_Preference::GetDefaultCrossfadeDuration(); } - + try { if (isset($id1)) { $this->changeFadeInfo($id1, null, $fadeOut); @@ -700,9 +701,9 @@ SQL; if (isset($id2)) { $this->changeFadeInfo($id2, $fadeIn, null, $offset); } - + $this->con->commit(); - + } catch (Exception $e) { $this->con->rollback(); throw $e; @@ -746,20 +747,20 @@ SQL; ':fade_in' => $fadeIn, ':clip_length' => $clipLength ); - + $result = Application_Common_Database::prepareAndExecute($sql, $params, 'column'); if ($result) { //"Fade In can't be larger than overall playlength."; $fadeIn = $clipLength; } $row->setDbFadein($fadeIn); - + if (!is_null($offset)) { $row->setDbTrackOffset($offset); Logging::info("Setting offset {$offset} on item {$id}"); $row->save($this->con); } - + } if (!is_null($fadeOut)) { @@ -768,7 +769,7 @@ SQL; ':fade_out' => $fadeOut, ':clip_length' => $clipLength ); - + $result = Application_Common_Database::prepareAndExecute($sql, $params, 'column'); if ($result) { //"Fade Out can't be larger than overall playlength."; @@ -909,7 +910,7 @@ SQL; $row->setDbCuein($cueIn); $row->setDBCliplength($cliplength); - + } elseif (!is_null($cueOut)) { if ($cueOut === "") { @@ -1016,8 +1017,8 @@ SQL; public static function getBlockCount() { $sql = 'SELECT count(*) as cnt FROM cc_playlist'; - - $res = Application_Common_Database::prepareAndExecute($sql, array(), + + $res = Application_Common_Database::prepareAndExecute($sql, array(), Application_Common_Database::COLUMN); return $res; @@ -1064,7 +1065,7 @@ SQL; CcBlockQuery::create()->findPKs($p_ids)->delete(); $updateIsPlaylistFlag = true; } - + if ($updateIsPlaylistFlag) { // update is_playlist flag in cc_files Application_Model_StoredFile::setIsPlaylist( @@ -1163,7 +1164,7 @@ SQL; $blockType = $data['etc']['sp_type'] == 0 ? 'dynamic':'static'; $this->saveType($blockType); $this->storeCriteriaIntoDb($data); - + // if the block is dynamic, put null to the length // as it cannot be calculated if ($blockType == 'dynamic') { @@ -1208,7 +1209,7 @@ SQL; if (isset($d['sp_criteria_extra'])) { $extra = $d['sp_criteria_extra']; } if (isset($d['sp_criteria_datetime_select'])) { $datetimeunit = $d['sp_criteria_datetime_select']; } if (isset($d['sp_criteria_extra_datetime_select'])) {$extradatetimeunit = $d['sp_criteria_extra_datetime_select'];} - + if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { // if the date isn't relative we want to convert the value to a specific UTC date if (!(in_array($modifier,array('before','after','between')))) { @@ -1220,7 +1221,7 @@ SQL; } } - + $qry = new CcBlockcriteria(); $qry->setDbCriteria($field) ->setDbModifier($d['sp_criteria_modifier']) @@ -1228,7 +1229,7 @@ SQL; ->setDbBlockId($this->id); if (isset($d['sp_criteria_extra'])) { - + if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { // if the date isn't relative we want to convert the value to a specific UTC date if (!(in_array($modifier,array('before','after','between')))) { @@ -1239,7 +1240,7 @@ SQL; } } - + $qry->setDbExtra($extra); } // save the criteria group so separation via new modifiers AND can be preserved vs. lumping @@ -1269,8 +1270,8 @@ SQL; ->setDbValue($p_criteriaData['etc']['sp_limit_value']) ->setDbBlockId($this->id) ->save(); - - + + // insert repeat track option $qry = new CcBlockcriteria(); $qry->setDbCriteria("repeat_tracks") @@ -1347,11 +1348,11 @@ SQL; // this moves the pointer to the first element in the collection $files->getFirst(); $iterator = $files->getIterator(); - + $isBlockFull = false; - + while ($iterator->valid()) { - + $id = $iterator->current()->getDbId(); $fileLength = $iterator->current()->getCueLength(); $length = Application_Common_DateHelper::calculateLengthInSeconds($fileLength); @@ -1384,15 +1385,15 @@ SQL; $iterator->next(); } - + $sizeOfInsert = count($insertList); - + // if block is not full and repeat_track is check, fill up more // additionally still don't overflow the limit while (!$isBlockFull && $repeat == 1 && $sizeOfInsert > 0) { Logging::debug("adding repeated tracks."); Logging::debug("total time = " . $totalTime); - + $randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert)); // this will also allow the overflow of tracks so that time limited smart blocks will schedule until they // are longer than the time limit rather than never scheduling past the time limit @@ -1412,7 +1413,7 @@ SQL; $totalItems++; } } - + if ((!is_null($limit['items']) && $limit['items'] == count($insertList)) || $totalItems > 500 || $totalTime > $limit['time']) { break; } @@ -1460,7 +1461,8 @@ SQL; "track_number" => _("Track Number"), "utime" => _("Uploaded"), "info_url" => _("Website"), - "year" => _("Year") + "year" => _("Year"), + "media_type" => _("Media Type") ); $modifierOptions = array( @@ -1559,7 +1561,8 @@ SQL; "track_number" => _("Track Number"), "utime" => _("Uploaded"), "info_url" => _("Website"), - "year" => _("Year") + "year" => _("Year"), + "media_type" => _("Media Type") ); $modifierOptions = array( @@ -1796,7 +1799,7 @@ SQL; $limits['items'] = null; } } - + $repeatTracks = 0; $overflowTracks = 0; @@ -1865,9 +1868,9 @@ SQL; SELECT distinct(file_id) FROM cc_blockcontents SQL; - + $files = Application_Common_Database::prepareAndExecute($sql, array()); - + $real_files = array(); foreach ($files as $f) { $real_files[] = $f['file_id']; diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 8e8211378..ac0736278 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -54,7 +54,8 @@ class Application_Model_StoredFile "cuein" => "DbCueIn", "cueout" => "DbCueOut", "description" => "DbDescription", - "artwork" => "DbArtwork" + "artwork" => "DbArtwork", + "media_type" => "DbMediaType" ); function __construct($file, $con) { @@ -672,7 +673,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", "artwork" ); + "cuein", "cueout", "description", "artwork", "media_type" ); } public static function searchLibraryFiles($datatables) diff --git a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php index e68a15637..325d59151 100644 --- a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php @@ -112,6 +112,7 @@ class CcFilesTableMap extends TableMap $this->addColumn('filesize', 'DbFilesize', 'INTEGER', true, null, 0); $this->addColumn('description', 'DbDescription', 'VARCHAR', false, 512, null); $this->addColumn('artwork', 'DbArtwork', 'VARCHAR', false, 512, null); + $this->addColumn('media_type', 'DbMediaType', 'VARCHAR', false, 4, null); // validators } // initialize() diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php index 7cf46f514..7dca9e23a 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php @@ -294,6 +294,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent */ protected $artwork; + /** + * The value for the media_type field. + * @var string + */ + protected $media_type; + /** * The value for the artist_url field. * @var string @@ -1193,6 +1199,17 @@ abstract class BaseCcFiles extends BaseObject implements Persistent return $this->artwork; } + /** + * Get the [media_type] column value. + * + * @return string + */ + public function getDbMediaType() + { + + return $this->media_type; + } + /** * Get the [artist_url] column value. * @@ -1875,6 +1892,26 @@ abstract class BaseCcFiles extends BaseObject implements Persistent return $this; } // setDbArtwork() + /** + * Set the value of [media_type] column. + * + * @param string $v new value + * @return CcFiles The current object (for fluent API support) + */ + public function setDbMediaType($v) + { + if ($v !== null && is_numeric($v)) { + $v = (string) $v; + } + + if ($this->media_type !== $v) { + $this->media_type = $v; + $this->modifiedColumns[] = CcFilesPeer::MEDIA_TYPE; + } + + return $this; + } // setDbMediaType() + /** * Set the value of [artist_name] column. * @@ -3304,6 +3341,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $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->media_type = ($row[$startcol + 73] !== null) ? (string) $row[$startcol + 73] : null; $this->resetModified(); $this->setNew(false); @@ -3944,6 +3982,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent if ($this->isColumnModified(CcFilesPeer::ARTWORK)) { $modifiedColumns[':p' . $index++] = '"artwork"'; } + if ($this->isColumnModified(CcFilesPeer::MEDIA_TYPE)) { + $modifiedColumns[':p' . $index++] = '"media_type"'; + } $sql = sprintf( 'INSERT INTO "cc_files" (%s) VALUES (%s)', @@ -4174,6 +4215,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent case '"artwork"': $stmt->bindValue($identifier, $this->artwork, PDO::PARAM_STR); break; + case '"media_type"': + $stmt->bindValue($identifier, $this->media_type, PDO::PARAM_STR); + break; } } $stmt->execute(); @@ -4608,6 +4652,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent case 72: return $this->getDbArtwork(); break; + case 73: + return $this->getDbMediaType(); + break; default: return null; break; @@ -4710,6 +4757,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $keys[70] => $this->getDbFilesize(), $keys[71] => $this->getDbDescription(), $keys[72] => $this->getDbArtwork(), + $keys[73] => $this->getDbMediaType(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -5003,6 +5051,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent case 72: $this->setDbArtwork($value); break; + case 73: + $this->setDbMediaType($value); + break; } // switch() } @@ -5100,6 +5151,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent 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]]); + if (array_key_exists($keys[73], $arr)) $this->setDbMediaType($arr[$keys[73]]); } /** @@ -5184,6 +5236,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent 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); + if ($this->isColumnModified(CcFilesPeer::MEDIA_TYPE)) $criteria->add(CcFilesPeer::MEDIA_TYPE, $this->media_type); return $criteria; } @@ -5319,6 +5372,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $copyObj->setDbFilesize($this->getDbFilesize()); $copyObj->setDbDescription($this->getDbDescription()); $copyObj->setDbArtwork($this->getDbArtwork()); + $copyObj->setDbMediaType($this->getDbMediaType()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of @@ -7721,6 +7775,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $this->filesize = null; $this->description = null; $this->artwork = null; + $this->media_type = 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 8b61968b2..635d6a99a 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php @@ -251,6 +251,9 @@ abstract class BaseCcFilesPeer /** the column name for the artwork field */ const ARTWORK = 'cc_files.artwork'; + /** the column name for the media_type field */ + const MEDIA_TYPE = 'cc_files.media_type'; + /** The default string format for model objects of the related table **/ const DEFAULT_STRING_FORMAT = 'YAML'; @@ -270,12 +273,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', '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, ) + 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', 'DbMediaType', ), + 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', 'dbMediaType', ), + 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, CcFilesPeer::MEDIA_TYPE, ), + 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', 'MEDIA_TYPE', ), + 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', 'media_type', ), + 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, 73, ) ); /** @@ -285,12 +288,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, '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_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, 'DbMediaType' => 73, ), + 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, 'dbMediaType' => 73, ), 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, ) + 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, 'MEDIA_TYPE' => 73, ), + 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, 'media_type' => 73, ), + 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, 73, ) ); /** @@ -437,6 +440,7 @@ abstract class BaseCcFilesPeer $criteria->addSelectColumn(CcFilesPeer::FILESIZE); $criteria->addSelectColumn(CcFilesPeer::DESCRIPTION); $criteria->addSelectColumn(CcFilesPeer::ARTWORK); + $criteria->addSelectColumn(CcFilesPeer::MEDIA_TYPE); } else { $criteria->addSelectColumn($alias . '.id'); $criteria->addSelectColumn($alias . '.name'); @@ -511,6 +515,7 @@ abstract class BaseCcFilesPeer $criteria->addSelectColumn($alias . '.filesize'); $criteria->addSelectColumn($alias . '.description'); $criteria->addSelectColumn($alias . '.artwork'); + $criteria->addSelectColumn($alias . '.media_type'); } } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php index 6c5afc688..f026dee8a 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php @@ -79,6 +79,7 @@ * @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 orderByDbMediaType($order = Criteria::ASC) Order by the media_type column * * @method CcFilesQuery groupByDbId() Group by the id column * @method CcFilesQuery groupByDbName() Group by the name column @@ -153,6 +154,7 @@ * @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 groupByDbMediaType() Group by the media_type 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 @@ -277,6 +279,7 @@ * @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 CcFiles findOneByDbMediaType(string $media_type) Return the first CcFiles filtered by the media_type 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 @@ -351,6 +354,7 @@ * @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 + * @method array findByDbMediaType(string $media_type) Return CcFiles objects filtered by the media_type column * * @package propel.generator.airtime.om */ @@ -458,7 +462,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", "artwork" 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", "media_type" FROM "cc_files" WHERE "id" = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -1970,6 +1974,35 @@ abstract class BaseCcFilesQuery extends ModelCriteria return $this->addUsingAlias(CcFilesPeer::ARTWORK, $dbArtwork, $comparison); } + /** + * Filter the query on the media_type column + * + * Example usage: + * + * $query->filterByDbMediaType('fooValue'); // WHERE media_type = 'fooValue' + * $query->filterByDbMediaType('%fooValue%'); // WHERE media_type LIKE '%fooValue%' + * + * + * @param string $dbMediaType 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 filterByDbMediaType($dbMediaType = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbMediaType)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbMediaType)) { + $dbMediaType = str_replace('*', '%', $dbMediaType); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(CcFilesPeer::MEDIA_TYPE, $dbMediaType, $comparison); + } + /** * Filter the query on the artist_url column * diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index 4ac58e2ed..9fb1d3108 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -516,41 +516,41 @@ class Application_Service_HistoryService return $filteredShows; } - + public function insertWebstreamMetadata($schedId, $startDT, $data) { - + $this->con->beginTransaction(); - + try { - + $item = CcScheduleQuery::create()->findPK($schedId, $this->con); - + //TODO figure out how to combine these all into 1 query. $showInstance = $item->getCcShowInstances($this->con); $show = $showInstance->getCcShow($this->con); - + $webstream = $item->getCcWebstream($this->con); - + $metadata = array(); $metadata["showname"] = $show->getDbName(); $metadata[MDATA_KEY_TITLE] = $data->title; $metadata[MDATA_KEY_CREATOR] = $webstream->getDbName(); - + $history = new CcPlayoutHistory(); $history->setDbStarts($startDT); $history->setDbEnds(null); $history->setDbInstanceId($item->getDbInstanceId()); - + foreach ($metadata as $key => $val) { $meta = new CcPlayoutHistoryMetaData(); $meta->setDbKey($key); $meta->setDbValue($val); - + $history->addCcPlayoutHistoryMetaData($meta); } - + $history->save($this->con); - + $this->con->commit(); } catch (Exception $e) { @@ -586,36 +586,36 @@ class Application_Service_HistoryService $itemEnd = $item->getDbEnds(null); $recordStart = $item->getDbStarts(null); $recordEnd = ($instanceEnd < $itemEnd) ? $instanceEnd : $itemEnd; - + //first check if this is a duplicate // (caused by restarting liquidsoap) - + $prevRecord = CcPlayoutHistoryQuery::create() ->filterByDbStarts($recordStart) ->filterByDbEnds($recordEnd) ->filterByDbFileId($fileId) ->findOne($this->con); - + if (empty($prevRecord)) { - + $history = new CcPlayoutHistory(); $history->setDbFileId($fileId); $history->setDbStarts($recordStart); $history->setDbEnds($recordEnd); $history->setDbInstanceId($item->getDbInstanceId()); - + foreach ($metadata as $key => $val) { $meta = new CcPlayoutHistoryMetaData(); $meta->setDbKey($key); $meta->setDbValue($val); - + $history->addCcPlayoutHistoryMetaData($meta); } - + $history->save($this->con); $this->con->commit(); - } - } + } + } } catch (Exception $e) { $this->con->rollback(); @@ -1126,6 +1126,7 @@ class Application_Service_HistoryService array("name"=> MDATA_KEY_TRACKNUMBER, "label"=> _("Track"), "type"=> TEMPLATE_INT), array("name"=> MDATA_KEY_CONDUCTOR, "label"=> _("Conductor"), "type"=> TEMPLATE_STRING), array("name"=> MDATA_KEY_LANGUAGE, "label"=> _("Language"), "type"=> TEMPLATE_STRING), + array("name"=> MDATA_KEY_MEDIA_TYPE, "label"=> _("Media Type"), "type"=> TEMPLATE_STRING), ); return $fileMD; diff --git a/airtime_mvc/application/upgrade/Upgrades.php b/airtime_mvc/application/upgrade/Upgrades.php index b8b822421..acd97daf5 100644 --- a/airtime_mvc/application/upgrade/Upgrades.php +++ b/airtime_mvc/application/upgrade/Upgrades.php @@ -507,6 +507,19 @@ class AirtimeUpgrader2517 extends AirtimeUpgrader } } +class AirtimeUpgrader2518 extends AirtimeUpgrader +{ + protected function getSupportedSchemaVersions() { + return array( + '2.5.17' + ); + } + + public function getNewVersion() { + return '2.5.18'; + } +} + class AirtimeUpgrader300alpha extends AirtimeUpgrader { protected function getSupportedSchemaVersions() { diff --git a/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml index 31d873803..e2102af55 100644 --- a/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml +++ b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml @@ -26,6 +26,7 @@ foreach ($this->md as $key => &$value) { md["MDATA_KEY_ARTWORK"]);?> md["MDATA_KEY_ARTWORK_DATA"]);?> md["MDATA_KEY_LANGUAGE"]);?> +md["MDATA_KEY_MEDIA_TYPE"]);?> md["MDATA_KEY_FILEPATH"]);?> diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index acf54453b..5e0121291 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -85,6 +85,7 @@ + diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index a148a56da..d1a6c1412 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -97,6 +97,7 @@ CREATE TABLE "cc_files" "filesize" INTEGER DEFAULT 0 NOT NULL, "description" VARCHAR(512), "artwork" VARCHAR(512), + "media_type" VARCHAR(4), PRIMARY KEY ("id") ); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 38a675e81..420e318a7 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -54,7 +54,8 @@ var AIRTIME = (function(AIRTIME) { "owner_id" : "s", "info_url" : "s", "replay_gain" : "n", - "artwork" : "s" + "artwork" : "s", + "media_type" : "s" }; if (AIRTIME.library === undefined) { @@ -591,6 +592,7 @@ var AIRTIME = (function(AIRTIME) { /* Cue Out */ { "sTitle" : $.i18n._("Cue Out") , "mDataProp" : "cueout" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" }, /* Description */ { "sTitle" : $.i18n._("Description") , "mDataProp" : "description" , "bVisible" : false , "sClass" : "library_description" , "sWidth" : "150px" }, /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" }, + /* Media Type */ { "sTitle" : $.i18n._("Type") , "mDataProp" : "media_type" , "bVisible" : false , "sClass" : "library_media_type" , "sWidth" : "60px" }, /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "sClass" : "library_genre" , "sWidth" : "100px" }, /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" }, /* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" }, @@ -615,7 +617,7 @@ var AIRTIME = (function(AIRTIME) { ); } - var colExclude = onDashboard ? [0, 1, 2, 33] : [0, 1, 2]; + var colExclude = onDashboard ? [0, 1, 2, 34] : [0, 1, 2]; /* ############################################ DATATABLES @@ -1597,6 +1599,7 @@ var validationTypes = { "track_number" : "i", "info_url" : "s", "artwork" : "s", + "media_type" : "s", "year" : "i" }; diff --git a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js index fddf6ca34..d69da00b5 100644 --- a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js +++ b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js @@ -8,7 +8,7 @@ function setSmartBlockEvents() { /********** ADD CRITERIA ROW **********/ form.find('#criteria_add').live('click', function(){ - + var div = $('dd[id="sp_criteria-element"]').children('div:visible:last'); if (div.length == 0) { @@ -26,7 +26,7 @@ function setSmartBlockEvents() { div.find('.db-logic-label').text('and').css('display', 'table'); div.removeClass('search-row-or').addClass('search-row-and'); - + div = div.next().show(); div.children().removeAttr('disabled'); @@ -45,11 +45,11 @@ function setSmartBlockEvents() { } }); - + /********** ADD MODIFIER ROW **********/ form.find('a[id^="modifier_add"]').live('click', function(){ var criteria_value = $(this).siblings('select[name^="sp_criteria_field"]').val(); - + //make new modifier row var newRow = $(this).parent().clone(), @@ -63,13 +63,13 @@ function setSmartBlockEvents() { if (newRow.children().hasClass('errors sp-errors')) { newRow.find('span[class="errors sp-errors"]').remove(); } - + //hide the critieria field select box newRowCrit.addClass('sp-invisible'); - + //keep criteria value the same newRowCrit.val(criteria_value); - + //reset all other values newRowMod.val('0'); newRowVal.val(''); @@ -78,12 +78,12 @@ function setSmartBlockEvents() { disableAndHideDateTimeDropdown(newRowVal); disableAndHideExtraDateTimeDropdown(newRowVal); sizeTextBoxes(newRowVal, 'sp_extra_input_text', 'sp_input_text'); - + //remove the 'criteria add' button from new modifier row newRow.find('#criteria_add').remove(); $(this).parent().after(newRow); - + // remove extra spacing from previous row newRow.prev().removeClass('search-row-and').addClass('search-row-or'); @@ -93,7 +93,7 @@ function setSmartBlockEvents() { removeButtonCheck(); groupCriteriaRows(); }); - + /********** REMOVE ROW **********/ form.find('a[id^="criteria_remove"]').live('click', function(){ var curr = $(this).parent(); @@ -128,10 +128,10 @@ function setSmartBlockEvents() { for (var i=0; i 0 && index < 26) { - + /* If the current row's criteria field is hidden we know it is * a modifier row */ @@ -444,7 +444,7 @@ function reindexElements() { index++; modIndex = 0; } - + $(div).find('select[name^="sp_criteria_field"]').attr('name', 'sp_criteria_field_'+index+'_'+modIndex); $(div).find('select[name^="sp_criteria_field"]').attr('id', 'sp_criteria_field_'+index+'_'+modIndex); $(div).find('select[name^="sp_criteria_modifier"]').attr('name', 'sp_criteria_modifier_'+index+'_'+modIndex); @@ -464,7 +464,7 @@ function reindexElements() { function buttonClickAction(clickType, url){ var data = $('.active-tab .smart-block-form').serializeArray(), obj_id = $('.active-tab .obj_id').val(); - + enableLoadingIcon(); $.post(url, {format: "json", data: data, obj_id: obj_id, obj_type: "block", modified: AIRTIME.playlist.getModified() @@ -499,7 +499,7 @@ function setupUI() { shuffleButton.addClass('ui-state-disabled'); shuffleButton.attr('disabled', 'disabled'); } - + if (activeTab.find('.obj_type').val() == 'block') { if (playlist_type == "1") { shuffleButton.removeAttr("disabled"); @@ -514,7 +514,7 @@ function setupUI() { //sortable.children().hide(); } } - + $(".playlist_type_help_icon").qtip({ content: { text: $.i18n._("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.")+"

" + @@ -536,7 +536,7 @@ function setupUI() { at: "right center" } }); - + $(".repeat_tracks_help_icon").qtip({ content: { text: sprintf($.i18n._("The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block."), PRODUCT_NAME) @@ -661,7 +661,7 @@ function disableAndHideExtraField(valEle, index) { spanExtra.children('#sp_criteria_extra_'+index).val("").attr("disabled", "disabled"); spanExtra.hide(); console.log('hidden'); - + //make value input larger since we don't have extra field now var criteria_value = $('#sp_criteria_value_'+index); sizeTextBoxes(criteria_value, 'sp_extra_input_text', 'sp_input_text'); @@ -685,15 +685,15 @@ function populateModifierSelect(e, popAllMods) { var criteria_type = getCriteriaOptionType(e), index = getRowIndex($(e).parent()), divs; - + if (popAllMods) { index = index.substring(0, 1); } divs = $(e).parents().find('select[id^="sp_criteria_modifier_'+index+'"]'); - + $.each(divs, function(i, div){ $(div).children().remove(); - + if (criteria_type == 's') { $.each(stringCriteriaOptions, function(key, value){ $(div).append($('') @@ -777,7 +777,7 @@ function appendAddButton() { enabled = rows.find('select[name^="sp_criteria_field"]:enabled'); rows.find('#criteria_add').remove(); - + if (enabled.length > 1) { rows.find('select[name^="sp_criteria_field"]:enabled:last') .siblings('a[id^="criteria_remove"]') @@ -821,7 +821,7 @@ function disableLoadingIcon() { function groupCriteriaRows() { // check whether rows should be "grouped" and shown with an "or" "logic label", or separated by an "and" "logic label" - var visibleRows = $("#sp_criteria-element > div:visible"), + var visibleRows = $("#sp_criteria-element > div:visible"), prevRowGroup = "0"; visibleRows.each(function (index){ @@ -837,7 +837,7 @@ function groupCriteriaRows() { } }); - // ensure spacing below last visible row + // ensure spacing below last visible row $("#sp_criteria-element > div:visible:last").addClass("search-row-and").removeClass("search-row-or"); } @@ -874,7 +874,8 @@ var criteriaTypes = { "track_title" : "s", "track_number" : "n", "info_url" : "s", - "year" : "n" + "year" : "n", + "media_type" : "s" }; var stringCriteriaOptions = { @@ -886,7 +887,7 @@ var stringCriteriaOptions = { "starts with" : $.i18n._("starts with"), "ends with" : $.i18n._("ends with") }; - + var numericCriteriaOptions = { "0" : $.i18n._("Select modifier"), "is" : $.i18n._("is"), From bd328fba717cbc683cfef765b0cdb375024ba0c4 Mon Sep 17 00:00:00 2001 From: Codenift Date: Thu, 10 Oct 2019 01:55:21 -0400 Subject: [PATCH 4/5] Support for macOS Catalina (NFS sync fix) --- Vagrantfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index b8e34a1ef..88b2b041b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -14,7 +14,11 @@ Vagrant.configure("2") do |config| config.vm.network "forwarded_port", guest: 8888, host:8888 # make sure we are using nfs (doesn't work out of the box with debian) - config.vm.synced_folder ".", "/vagrant", type: "nfs" + nfsPath = "." + if Dir.exist?("/System/Volumes/Data") + nfsPath = "/System/Volumes/Data" + Dir.pwd + end + config.vm.synced_folder nfsPath, "/vagrant", type: "nfs" # private network for nfs config.vm.network "private_network", ip: "192.168.10.100" From 339a87900eb6324a68220150006578ed4a8f6257 Mon Sep 17 00:00:00 2001 From: Codenift Date: Thu, 10 Oct 2019 10:07:55 -0400 Subject: [PATCH 5/5] Update Vagrantfile --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 88b2b041b..073ed73dc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,6 +15,7 @@ Vagrant.configure("2") do |config| # make sure we are using nfs (doesn't work out of the box with debian) nfsPath = "." + # Catalina support if Dir.exist?("/System/Volumes/Data") nfsPath = "/System/Volumes/Data" + Dir.pwd end