diff -Naur modules.orig/tv/classes/Channel.php modules/tv/classes/Channel.php --- modules.orig/tv/classes/Channel.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/classes/Channel.php 2013-10-22 09:14:14.016782335 -0700 @@ -121,7 +121,7 @@ // Otherwise, grab it from the backend else { // Make the request and store the result - $data = MythBackend::find()->httpRequest('Guide/GetChannelIcon', array('ChanID' => $this->chanid)); + $data = MythBackend::find()->httpRequest('Guide/GetChannelIcon', array('ChanId' => $this->chanid)); if ($data) file_put_contents($this->icon, $data); unset($data); diff -Naur modules.orig/tv/classes/Program.php modules/tv/classes/Program.php --- modules.orig/tv/classes/Program.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/classes/Program.php 2013-10-10 16:39:17.565673627 -0700 @@ -626,7 +626,7 @@ * Revert a show to its default recording schedule settings /**/ public function rec_default() { - $schedule =& Schedule::findAll($this->recordid); + $schedule =& Schedule::find($this->recordid); if ($schedule && ($schedule->type == rectype_override || $schedule->type == rectype_dontrec)) $schedule->delete(); } diff -Naur modules.orig/tv/classes/Schedule.php modules/tv/classes/Schedule.php --- modules.orig/tv/classes/Schedule.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/classes/Schedule.php 2013-12-03 22:29:59.496596489 -0800 @@ -75,7 +75,7 @@ if (empty($cache)) { global $db; $cache = $db->query_keyed_list_assoc('filterid', - 'SELECT filterid,description,newruledefault + 'SELECT filterid,description FROM recordfilter ORDER BY filterid' ); @@ -87,22 +87,14 @@ * * @return an array of the filters for this Schedule. Array includes * a property called "enabled" to indicate if the filter is enabled. - * If this is not a real schedule "enabled" is from the newruledefault - * property * /**/ public function recordFilters() { $filters = array(); foreach (Schedule::availableRecordFilters() as $id => $filter) { $filters[$id] = $filter; - // if this is a real schedule, use the filter property - if ($this->recordid) { - $mask = 1 << $id; - $filters[$id]['enabled'] = ($this->filter & $mask) == $mask; - // otherwise it's not a real schedule, so use the default value - } else { - $filters[$id]['enabled'] = $filter['newruledefault']; - } + $mask = 1 << $id; + $filters[$id]['enabled'] = ($this->filter & $mask) == $mask; } return $filters; } @@ -205,7 +197,7 @@ } // Data is a recordid -- load its contents if (!is_array($data) && $data > 0) { - $data = $db->query_assoc('SELECT *, IF(type='.rectype_always.',-1,chanid) AS chanid, + $data = $db->query_assoc('SELECT *, UNIX_TIMESTAMP(startdate)+TIME_TO_SEC(starttime) AS starttime, UNIX_TIMESTAMP(enddate)+TIME_TO_SEC(endtime) AS endtime FROM record diff -Naur modules.orig/tv/recommended.php modules/tv/recommended.php --- modules.orig/tv/recommended.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/recommended.php 2013-10-08 10:29:14.033236311 -0700 @@ -35,7 +35,7 @@ } - $shows =& load_all_program_data(time(), strtotime('+1 month'), NULL, false, "({$query})", true); + $shows =& load_all_program_data(time(), strtotime('+1 month'), NULL, false, strlen($query) ? "({$query})" : 'FALSE', true); // Load the class for this page require_once tmpl_dir.'recommended.php'; diff -Naur modules.orig/tv/schedules_custom.php modules/tv/schedules_custom.php --- modules.orig/tv/schedules_custom.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/schedules_custom.php 2013-10-10 15:32:17.943545355 -0700 @@ -25,6 +25,9 @@ else $schedule = new Schedule(NULL); +// Load the utility/display functions for scheduling + require_once 'includes/schedule_utils.php'; + // The user tried to update the recording settings - update the database and the variable in memory if (isset($_POST['save'])) { // Which type of recording is this? Make sure an illegal one isn't specified @@ -87,6 +90,10 @@ $schedule->startoffset = intval($_POST['startoffset']); $schedule->endoffset = intval($_POST['endoffset']); $schedule->prefinput = $_POST['prefinput']; + $schedule->inetref = $_POST['inetref']; + $schedule->season = intval($_POST['season']); + $schedule->episode = intval($_POST['episode']); + $schedule->filter = generateFilter(); // Some settings specific to manual recordings (since we have no program to match against) $schedule->chanid = $_POST['channel']; $schedule->station = Channel::find($schedule->chanid)->callsign; @@ -172,9 +179,6 @@ if ($schedule->length < 1) $schedule->length = 120; -// Load the utility/display functions for scheduling - require_once 'includes/schedule_utils.php'; - // Load the class for this page require_once tmpl_dir.'schedules_custom.php'; diff -Naur modules.orig/tv/schedules_manual.php modules/tv/schedules_manual.php --- modules.orig/tv/schedules_manual.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/schedules_manual.php 2013-10-10 15:35:07.201148772 -0700 @@ -23,6 +23,9 @@ else $schedule = new Schedule(NULL); +// Load the utility/display functions for scheduling + require_once 'includes/schedule_utils.php'; + // The user tried to update the recording settings - update the database and the variable in memory if (isset($_POST['save'])) { // Which type of recording is this? Make sure an illegal one isn't specified @@ -72,6 +75,10 @@ $schedule->startoffset = intval($_POST['startoffset']); $schedule->endoffset = intval($_POST['endoffset']); $schedule->prefinput = $_POST['prefinput']; + $schedule->inetref = $_POST['inetref']; + $schedule->season = intval($_POST['season']); + $schedule->episode = intval($_POST['season']); + $schedule->filter = generateFilter(); // Some settings specific to manual recordings (since we have no program to match against) $schedule->chanid = $_POST['channel']; $schedule->station = Channel::find($schedule->chanid)->callsign; @@ -129,9 +136,6 @@ if ($schedule->length < 1) $schedule->length = 120; -// Load the utility/display functions for scheduling - require_once 'includes/schedule_utils.php'; - // Load the class for this page require_once tmpl_dir.'schedules_manual.php'; diff -Naur modules.orig/tv/tmpl/default/schedules.php modules/tv/tmpl/default/schedules.php --- modules.orig/tv/tmpl/default/schedules.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/tmpl/default/schedules.php 2013-12-03 22:34:17.688281539 -0800 @@ -95,9 +95,11 @@ $urlstr = 'recordid='.$schedule->recordid; $css_class = ($schedule->type == rectype_dontrec ? 'deactivated' : 'scheduled'); - // If this is an 'always on any channel' or 'find one' recording w/o a channel, set the channel name to 'Any' - if ($schedule->type == rectype_always || ($schedule->type == rectype_findone && !preg_match('/\\S/', $schedule->channel->channum))) + // If this is an 'always on any channel' or 'find one' recording without the 'This Channel' filter, set the channel name to 'Any' + if (($schedule->type == rectype_always || $schedule->type == rectype_findone) && !($schedule->filter & (1 << 10))) { $schedule->channel->name = '[ '.t('Any').' ]'; + $schedule->channel->channum = 0; + } // A program id counter for popup info if ($_SESSION["show_popup_info"]) { static $program_id_counter = 0; diff -Naur modules.orig/tv/tmpl/lite/schedules.php modules/tv/tmpl/lite/schedules.php --- modules.orig/tv/tmpl/lite/schedules.php 2013-09-15 19:11:23.000000000 -0700 +++ modules/tv/tmpl/lite/schedules.php 2013-12-03 22:34:51.615452755 -0800 @@ -53,9 +53,11 @@ $urlstr = 'recordid='.$schedule->recordid; $css_class = ($schedule->type == rectype_dontrec ? 'deactivated' : 'scheduled'); - // If this is an 'always on any channel' or 'find one' recording w/o a channel, set the channel name to 'Any' - if ($schedule->type == rectype_always || ($schedule->type == rectype_findone && !preg_match('/\\S/', $schedule->channel->channum))) + // If this is an 'always on any channel' or 'find one' recording without the 'This Channel' filter, set the channel name to 'Any' + if (($schedule->type == rectype_always || $schedule->type == rectype_findone) && !($schedule->filter & (1 << 10))) { $schedule->channel->name = '[ '.t('Any').' ]'; + $schedule->channel->channum = 0; + } // Print a dividing row if grouping changes if ($group_field == 'type')