From 80686b70631927d4d34595221456e72aee9d2837 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 15 May 2013 13:06:16 -0400 Subject: [PATCH 1/5] add parameter parsing to airtime-liquidsoap script. -Allow us to prevent running as daemon --- python_apps/pypo/airtime-liquidsoap | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/python_apps/pypo/airtime-liquidsoap b/python_apps/pypo/airtime-liquidsoap index 0812bd47d..def0aaae1 100755 --- a/python_apps/pypo/airtime-liquidsoap +++ b/python_apps/pypo/airtime-liquidsoap @@ -1,11 +1,38 @@ #!/bin/bash -e +debug="f" + +showhelp () { + echo "Usage: airtime-liquidsoap [options] +--help|-h Displays usage information. +--debug|-d Print error messages to console" +} + +set -- $(getopt -l help,debug "hd" "$@") +while [ $# -gt 0 ] +do + case "$1" in + (-h|--help) showhelp; exit 0;; + (-d|--debug) debug="t";; + + (--) shift; break;; + (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;; + (*) break;; + esac + shift +done + + virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/" . ${virtualenv_bin}activate export HOME="/var/tmp/airtime/pypo/" api_client_path="/usr/lib/airtime/" -ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d" +if [ $debug = "t" ]; then + ls_path="/usr/bin/airtime-liquidsoap --verbose -f" +else + ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d" +fi ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq" export PYTHONPATH=${api_client_path} From ba3703b556db859c42c758038ea16c7370592974 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 15 May 2013 13:10:56 -0400 Subject: [PATCH 2/5] Revert "CC-5126:" This reverts commit a2b500729c8a6a826b313868bcc8eefac196aaa0. --- python_apps/media-monitor2/media/monitor/metadata.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_apps/media-monitor2/media/monitor/metadata.py b/python_apps/media-monitor2/media/monitor/metadata.py index d5dba3b51..09cec0750 100644 --- a/python_apps/media-monitor2/media/monitor/metadata.py +++ b/python_apps/media-monitor2/media/monitor/metadata.py @@ -45,6 +45,8 @@ airtime2mutagen = { "MDATA_KEY_URL" : "website", "MDATA_KEY_ISRC" : "isrc", "MDATA_KEY_COPYRIGHT" : "copyright", + "MDATA_KEY_CUE_IN" : "cuein", + "MDATA_KEY_CUE_OUT" : "cueout", } From 4a82fe2e52ac0bfa9471d4ad73bb2c8c860f247d Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 15 May 2013 13:13:37 -0400 Subject: [PATCH 3/5] Revert "CC-5126: Media Monitor: Exception happens when cuein value is 00:00:00" This reverts commit 9ad42b2b2cb7b1d9f50e252ee1a70986ffaf1b1e. --- .../media-monitor2/media/metadata/definitions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python_apps/media-monitor2/media/metadata/definitions.py b/python_apps/media-monitor2/media/metadata/definitions.py index 1e40c79f3..621449dd6 100644 --- a/python_apps/media-monitor2/media/metadata/definitions.py +++ b/python_apps/media-monitor2/media/metadata/definitions.py @@ -19,6 +19,16 @@ def load_definitions(): t.depends('length') t.translate(lambda k: format_length(k['length'])) + with md.metadata('MDATA_KEY_CUE_IN') as t: + t.default(u'0.0') + t.depends('cuein') + t.translate(lambda k: format_length(k['cuein'])) + + with md.metadata('MDATA_KEY_CUE_OUT') as t: + t.default(u'0.0') + t.depends('cueout') + t.translate(lambda k: format_length(k['cueout'])) + with md.metadata('MDATA_KEY_MIME') as t: t.default(u'') t.depends('mime') From 8545803dbf9b39ef46446f0c45a6668845814104 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 15 May 2013 13:19:29 -0400 Subject: [PATCH 4/5] CC-5126: Media Monitor: Exception happens when cuein value is 00:00:00 -slightly better way of not writing cue-in/cue-out --- python_apps/media-monitor2/media/monitor/metadata.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_apps/media-monitor2/media/monitor/metadata.py b/python_apps/media-monitor2/media/monitor/metadata.py index 09cec0750..bf5eb7333 100644 --- a/python_apps/media-monitor2/media/monitor/metadata.py +++ b/python_apps/media-monitor2/media/monitor/metadata.py @@ -49,6 +49,8 @@ airtime2mutagen = { "MDATA_KEY_CUE_OUT" : "cueout", } +#doesn't make sense for us to write these values to a track's metadata +mutagen_do_not_write = ["MDATA_KEY_CUE_IN", "MDATA_KEY_CUE_OUT"] # Some airtime attributes are special because they must use the mutagen object # itself to calculate the value that they need. The lambda associated with each @@ -113,7 +115,8 @@ class Metadata(Loggable): song_file = mutagen.File(path, easy=True) exceptions = [] # for bad keys for airtime_k, airtime_v in md.iteritems(): - if airtime_k in airtime2mutagen: + if airtime_k in airtime2mutagen and \ + airtime_k not in mutagen_do_not_write: # The unicode cast here is mostly for integers that need to be # strings if airtime_v is None: continue From 658fd82e1f3c1ee48bd28941e75c919cadd9917b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 15 May 2013 13:55:21 -0400 Subject: [PATCH 5/5] version number change necessary for nightly build scripts --- gen-snapshot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen-snapshot.sh b/gen-snapshot.sh index 682069e34..41e38cd22 100755 --- a/gen-snapshot.sh +++ b/gen-snapshot.sh @@ -2,7 +2,7 @@ # Script for generating nightly Airtime snapshot packages # Run from the directory containg the files checked out from git -VERSION=2.3.0~$(date "+%Y%m%d") +VERSION=2.4.0~$(date "+%Y%m%d") BUILDDEST=/tmp/airtime-${VERSION}/ DEBDIR=`pwd`/debian @@ -23,7 +23,7 @@ cd ${BUILDDEST} || exit # Set the version of the snapshot package -sed -i "1s:(2.3.0-1):(${VERSION}):g" debian/changelog +sed -i "1s:(2.4.0-1):(${VERSION}):g" debian/changelog # FIXES for 2.3.0 #############