From b53c9482c2c9bb87a2f10b99482379105a9c0f57 Mon Sep 17 00:00:00 2001 From: James Moon Date: Wed, 20 Apr 2011 12:42:38 -0700 Subject: [PATCH 01/11] CC-2207:Rename 'Schedule Playlist' window to 'Schedule Media' - fixed --- airtime_mvc/public/js/airtime/schedule/schedule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index 85c7dd34c..d1d513626 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -228,7 +228,7 @@ function buildScheduleDialog(json){ dialog.dialog({ autoOpen: false, - title: 'Schedule Playlist', + title: 'Schedule Media', width: 1100, height: 550, modal: true, From 96551e0d916e1a001cd35f707c4913a11d01ad4d Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 20 Apr 2011 16:22:06 -0400 Subject: [PATCH 02/11] CC-2186: Integration of a logger tool -added upgrade support --- install/airtime-upgrade.php | 20 ++++++++++++------- .../upgrades/airtime-1.9/airtime-upgrade.php | 14 +++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 install/upgrades/airtime-1.9/airtime-upgrade.php diff --git a/install/airtime-upgrade.php b/install/airtime-upgrade.php index c1c6436fa..4b5a4600b 100644 --- a/install/airtime-upgrade.php +++ b/install/airtime-upgrade.php @@ -14,13 +14,16 @@ require_once(dirname(__FILE__).'/include/AirtimeInstall.php'); AirtimeInstall::ExitIfNotRoot(); AirtimeInstall::DbConnect(true); -if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) { - $version = "1.7.0"; - echo "Airtime Version: ".$version." ".PHP_EOL; -} -else { - $version = "1.6"; - echo "Airtime Version: ".$version." ".PHP_EOL; +$version = AirtimeInstall::GetAirtimeVersion(); +if (!$version){ + if(AirtimeInstall::DbTableExists('cc_show_rebroadcast') === true) { + $version = "1.7.0"; + echo "Airtime Version: ".$version." ".PHP_EOL; + } + else { + $version = "1.6"; + echo "Airtime Version: ".$version." ".PHP_EOL; + } } echo "******************************** Update Begin *********************************".PHP_EOL; @@ -31,6 +34,9 @@ if(strcmp($version, "1.7.0") < 0) { if(strcmp($version, "1.8.0") < 0) { system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php"); } +if (strcmp($version, "1.9.0") < 0){ + system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php"); +} AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION); diff --git a/install/upgrades/airtime-1.9/airtime-upgrade.php b/install/upgrades/airtime-1.9/airtime-upgrade.php new file mode 100644 index 000000000..99ff40ee5 --- /dev/null +++ b/install/upgrades/airtime-1.9/airtime-upgrade.php @@ -0,0 +1,14 @@ + Date: Wed, 20 Apr 2011 14:10:58 -0700 Subject: [PATCH 03/11] CC-2155:Can open the rebroadcast options without the 'Record'checkbox being selected - fixed --- .../public/js/airtime/schedule/add-show.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index b662ae64c..23e394ef2 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -104,15 +104,17 @@ function setAddShowEvents() { form.find("#add_show_rebroadcast").click(function(){ $(this).blur(); - if($(this).attr('checked') && !form.find("#add_show_repeats").attr('checked')) { - form.find("#add_show_rebroadcast_absolute").show(); - } - else if($(this).attr('checked') && form.find("#add_show_repeats").attr('checked')) { - form.find("#add_show_rebroadcast_relative").show(); - } - else { - form.find("#schedule-record-rebroadcast > fieldset:not(:first-child)").hide(); - } + if(form.find("#add_show_record").attr('checked')){ + if($(this).attr('checked') && !form.find("#add_show_repeats").attr('checked')) { + form.find("#add_show_rebroadcast_absolute").show(); + } + else if($(this).attr('checked') && form.find("#add_show_repeats").attr('checked')) { + form.find("#add_show_rebroadcast_relative").show(); + } + else { + form.find("#schedule-record-rebroadcast > fieldset:not(:first-child)").hide(); + } + } }); form.find("#add_show_repeat_type").change(function(){ From 4b7ea32c7d2e70c7ede54923c08cb48e105fe97e Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 21 Apr 2011 17:23:59 -0400 Subject: [PATCH 04/11] -syntax errors discovered by eclipse --- .../application/views/scripts/form/preferences_general.phtml | 4 ++-- airtime_mvc/application/views/scripts/user/remove-user.phtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 92e7956f4..fa37b59ed 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -36,7 +36,7 @@ ?> element->getElement('streamFormat')->getMultiOptions() as $radio) : ?> @@ -59,7 +59,7 @@ ?> element->getElement('thirdPartyApi')->getMultiOptions() as $radio) : ?> diff --git a/airtime_mvc/application/views/scripts/user/remove-user.phtml b/airtime_mvc/application/views/scripts/user/remove-user.phtml index 845092689..c1d521bb3 100644 --- a/airtime_mvc/application/views/scripts/user/remove-user.phtml +++ b/airtime_mvc/application/views/scripts/user/remove-user.phtml @@ -1,3 +1,3 @@ entries; +echo $this->entries; ?> From a9d6bc3db56b649649426638dbad0dd107e9e07a Mon Sep 17 00:00:00 2001 From: Naomi Date: Thu, 21 Apr 2011 17:37:59 -0400 Subject: [PATCH 05/11] CC-1799 : Live Studio Playout from media library (pytagsfs) starting python script using pyinotify --- python_apps/pytag-fs/MediaMonitor.cfg | 29 +++++++++++++++ python_apps/pytag-fs/MediaMonitor.py | 52 +++++++++++++++++++++++++++ python_apps/pytag-fs/logging.cfg | 22 ++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 python_apps/pytag-fs/MediaMonitor.cfg create mode 100644 python_apps/pytag-fs/MediaMonitor.py create mode 100644 python_apps/pytag-fs/logging.cfg diff --git a/python_apps/pytag-fs/MediaMonitor.cfg b/python_apps/pytag-fs/MediaMonitor.cfg new file mode 100644 index 000000000..e4610b720 --- /dev/null +++ b/python_apps/pytag-fs/MediaMonitor.cfg @@ -0,0 +1,29 @@ +api_client = "airtime" + +# Hostname +base_url = 'localhost' +base_port = 80 + +# where the binary files live +bin_dir = '/usr/lib/airtime/media-monitor' + +# base path to store recordered shows at +base_recorded_files = '/var/tmp/airtime/show-recorder/' + +# where the logging files live +log_dir = '/var/log/airtime/show-recorder' + +# Value needed to access the API +api_key = 'AAA' + +# Path to the base of the API +api_base = 'api' + +# URL to get the version number of the server API +version_url = 'version/api_key/%%api_key%%' + +# URL to get the schedule of shows set to record +show_schedule_url = 'recorded-shows/format/json/api_key/%%api_key%%' + +# URL to upload the recorded show's file to Airtime +upload_file_url = 'upload-recorded/format/json/api_key/%%api_key%%' diff --git a/python_apps/pytag-fs/MediaMonitor.py b/python_apps/pytag-fs/MediaMonitor.py new file mode 100644 index 000000000..2bdf148aa --- /dev/null +++ b/python_apps/pytag-fs/MediaMonitor.py @@ -0,0 +1,52 @@ +import os +import pyinotify +from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent + +# configure logging +try: + logging.config.fileConfig("logging.cfg") +except Exception, e: + print 'Error configuring logging: ', e + sys.exit() + +# loading config file +try: + config = ConfigObj('/etc/airtime/recorder.cfg') +except Exception, e: + print 'Error loading config file: ', e + sys.exit() + +# watched events +mask = pyinotify.ALL_EVENTS + +wm = WatchManager() +wdd = wm.add_watch('/srv/airtime/stor', mask, rec=True) + +class PTmp(ProcessEvent): + def process_IN_CREATE(self, event): + if event.dir : + global wm + wdd = wm.add_watch(event.pathname, mask, rec=True) + #print wdd.keys() + + print "%s: %s" % (event.maskname, os.path.join(event.path, event.name)) + + def process_IN_MODIFY(self, event): + if not event.dir : + print event.path + + print "%s: %s" % (event.maskname, os.path.join(event.path, event.name)) + + def process_default(self, event): + print "%s: %s" % (event.maskname, os.path.join(event.path, event.name)) + +if __name__ == '__main__': + + try: + notifier = Notifier(wm, PTmp(), read_freq=2, timeout=1) + notifier.coalesce_events() + notifier.loop() + except KeyboardInterrupt: + notifier.stop() + + diff --git a/python_apps/pytag-fs/logging.cfg b/python_apps/pytag-fs/logging.cfg new file mode 100644 index 000000000..251fce8d7 --- /dev/null +++ b/python_apps/pytag-fs/logging.cfg @@ -0,0 +1,22 @@ +[loggers] +keys=root + +[handlers] +keys=consoleHandler + +[formatters] +keys=simpleFormatter + +[logger_root] +level=DEBUG +handlers=consoleHandler + +[handler_consoleHandler] +class=StreamHandler +level=DEBUG +formatter=simpleFormatter +args=(sys.stdout,) + +[formatter_simpleFormatter] +format=%(asctime)s %(levelname)s - [%(filename)s : %(funcName)s() : line %(lineno)d] - %(message)s +datefmt= From 3e560bb082d921e8e9ce7167de4710aff3252a17 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 21 Apr 2011 21:50:50 -0400 Subject: [PATCH 06/11] CC-2227: Repeating weekday show -> Add weekend -> first weekend after show does not have new shows -Should be fixed --- airtime_mvc/application/models/Shows.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index ed3f076a2..a0a5ffbd7 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -283,6 +283,7 @@ class Show { $showId = $this->getId(); $sql = "SELECT last_show FROM cc_show_days" ." WHERE show_id = $showId"; + ." ORDER BY last_show DESC"; $endDate = $CC_DBC->GetOne($sql); @@ -367,7 +368,8 @@ class Show { $showId = $this->getId(); $sql = "SELECT first_show FROM cc_show_days" - ." WHERE show_id = $showId"; + ." WHERE show_id = $showId" + ." ORDER BY first_show"; $firstDate = $CC_DBC->GetOne($sql); @@ -661,16 +663,7 @@ class Show { $showId = $ccShow->getDbId(); $show = new Show($showId); - //If show is a new show (not updated), then get - //isRecorded from POST data. Otherwise get it from - //the database since the user is not allowed to - //update this option. - if ($data['add_show_id'] == -1){ - $isRecorded = ($data['add_show_record']) ? 1 : 0; - } else { - $isRecorded = $show->isRecorded(); - } - + $isRecorded = ($data['add_show_record']) ? 1 : 0; if ($data['add_show_id'] != -1){ Show::deletePossiblyInvalidInstances($data, $show, $endDate, $isRecorded, $repeatType); From 6922c4d87c802d29cb2ffd7c1854735d9c4ea269 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Apr 2011 00:55:31 -0400 Subject: [PATCH 07/11] CC-2193: Debian database install fixes --- install/include/AirtimeInstall.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install/include/AirtimeInstall.php b/install/include/AirtimeInstall.php index 00e9aae8e..35a7c5468 100644 --- a/install/include/AirtimeInstall.php +++ b/install/include/AirtimeInstall.php @@ -123,9 +123,9 @@ class AirtimeInstall echo "* Creating Airtime database user".PHP_EOL; - // Create the database user - $command = "sudo -u postgres psql postgres --command \"CREATE USER {$CC_CONFIG['dsn']['username']} " - ." ENCRYPTED PASSWORD '{$CC_CONFIG['dsn']['password']}' LOGIN CREATEDB NOCREATEUSER;\" 2>/dev/null"; + $username = $CC_CONFIG['dsn']['username']; + $password = $CC_CONFIG['dsn']['password']; + $command = "echo \"CREATE USER $username ENCRYPTED PASSWORD '$password' LOGIN CREATEDB NOCREATEUSER;\" | sudo -u postgres psql"; @exec($command, $output, $results); if ($results == 0) { @@ -147,7 +147,9 @@ class AirtimeInstall echo "* Creating Airtime database".PHP_EOL; - $command = "sudo -u postgres createdb {$CC_CONFIG['dsn']['database']} --owner {$CC_CONFIG['dsn']['username']} 2> /dev/null"; + $database = $CC_CONFIG['dsn']['database']; + $username = $CC_CONFIG['dsn']['username']; + $command = "echo \"CREATE DATABASE $database OWNER $username\" | sudo -u postgres psql"; @exec($command, $output, $results); if ($results == 0) { echo "* Database '{$CC_CONFIG['dsn']['database']}' created.".PHP_EOL; From 05ff297cf39ce1dadb9401d2b4cb017a2c0f5e9f Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Apr 2011 00:58:01 -0400 Subject: [PATCH 08/11] CC-2227 repeating weekday show bug -fixed syntax error --- airtime_mvc/application/models/Shows.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index a0a5ffbd7..085ddcec3 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -282,7 +282,7 @@ class Show { $showId = $this->getId(); $sql = "SELECT last_show FROM cc_show_days" - ." WHERE show_id = $showId"; + ." WHERE show_id = $showId" ." ORDER BY last_show DESC"; $endDate = $CC_DBC->GetOne($sql); From cfcd612d471c96ed6e3b8b9ae63e894d3edb25b7 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Apr 2011 01:02:35 -0400 Subject: [PATCH 09/11] -updated version string to 1.9.0-beta --- VERSION | 2 +- airtime_mvc/application/configs/conf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index be6fbdd24..ad191da1e 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ PRODUCT_ID=Airtime -PRODUCT_RELEASE=1.8.0 +PRODUCT_RELEASE=1.9.0-beta diff --git a/airtime_mvc/application/configs/conf.php b/airtime_mvc/application/configs/conf.php index 0c7c39d33..dd20668a6 100644 --- a/airtime_mvc/application/configs/conf.php +++ b/airtime_mvc/application/configs/conf.php @@ -6,7 +6,7 @@ * /etc/airtime/recorder.cfg */ -define('AIRTIME_VERSION', '1.8.0'); +define('AIRTIME_VERSION', '1.9.0-beta'); define('AIRTIME_COPYRIGHT_DATE', '2010-2011'); define('AIRTIME_REST_VERSION', '1.1'); From f1a314aa0af547493e57482f58c79524b4182ac4 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Apr 2011 01:05:47 -0400 Subject: [PATCH 10/11] -update version string number for pypo --- python_apps/api_clients/api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index 1d252aeb0..8a38e682e 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -180,7 +180,7 @@ class AirTimeApiClient(ApiClientInterface): print 'Unable to get Airtime version number.' print return False - elif (version[0:4] != "1.8."): + elif (version[0:4] != "1.9."): if (verbose): print 'Airtime version: ' + str(version) print 'pypo not compatible with this version of Airtime.' From d46f38fa3f4387c0ae860764f6d1ccddbee14e05 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 25 Apr 2011 15:11:01 -0400 Subject: [PATCH 11/11] Merge branch 'devel'