Ticket #11706: mythweb_default_filters_fix.patch

File mythweb_default_filters_fix.patch, 1.5 KB (added by Karl Newman <SiliconFiend@…>, 12 years ago)

Desist using "newruledefault" values from the recordfilter table, which will cause a new rule to use the filters from the Default recording template.

  • tv/classes/Schedule.php

    old new  
    7575        if (empty($cache)) {
    7676            global $db;
    7777            $cache = $db->query_keyed_list_assoc('filterid',
    78                 'SELECT filterid,description,newruledefault
     78                'SELECT filterid,description
    7979                   FROM recordfilter
    8080               ORDER BY filterid'
    8181               );
     
    8787     *
    8888     * @return an array of the filters for this Schedule.  Array includes
    8989     * a property called "enabled" to indicate if the filter is enabled.
    90      * If this is not a real schedule "enabled" is from the newruledefault
    91      * property
    9290     *
    9391    /**/
    9492    public function recordFilters() {
    9593        $filters = array();
    9694        foreach (Schedule::availableRecordFilters() as $id => $filter) {
    9795            $filters[$id] = $filter;
    98             // if this is a real schedule, use the filter property
    99             if ($this->recordid) {
    100                 $mask = 1 << $id;
    101                 $filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
    102                 // otherwise it's not a real schedule, so use the default value
    103             } else {
    104                 $filters[$id]['enabled'] = $filter['newruledefault'];
    105             }
     96            $mask = 1 << $id;
     97            $filters[$id]['enabled'] = ($this->filter & $mask) == $mask;
    10698        }
    10799        return $filters;
    108100    }