Ticket #1223: mythweb.channum.diff

File mythweb.channum.diff, 7.5 KB (added by Robert Tsai <rtsai1111>, 18 years ago)
  • includes/programs.php

     
    124124                                   "&frac12;", "")) AS starstring,
    125125                         IFNULL(programrating.system, "") AS rater,
    126126                         IFNULL(programrating.rating, "") AS rating,
    127                          oldrecorded.recstatus
     127                         oldrecorded.recstatus,channel.channum
    128128                  FROM program
    129129                       LEFT JOIN programrating USING (chanid, starttime)
    130130                       LEFT JOIN oldrecorded
    131                                  ON LENGTH(IFNULL(oldrecorded.seriesid, "")) > 0
    132                                     AND LENGTH(IFNULL(oldrecorded.programid, "")) > 0
    133                                     AND oldrecorded.programid = program.programid
    134                                     AND oldrecorded.seriesid  = program.seriesid
     131                                 ON oldrecorded.programid = program.programid
     132                                    AND oldrecorded.seriesid = program.seriesid
     133                                    AND (oldrecorded.recstatus = -3
     134                                        OR ((LENGTH(IFNULL(oldrecorded.seriesid, "")) > 0
     135                                        AND LENGTH(IFNULL(oldrecorded.programid, "")) > 0)))
     136                       LEFT JOIN channel ON program.chanid = channel.chanid
    135137                 WHERE';
    136138    // Only loading a single channel worth of information
    137139        if ($chanid > 0)
     
    166168            if (!$data['chanid'])
    167169                continue;
    168170        // This program has already been loaded, and is attached to a recording schedule
    169             if ($Scheduled_Recordings[$data['chanid']][$data['starttime_unix']]) {
    170                 $program =& $Scheduled_Recordings[$data['chanid']][$data['starttime_unix']][0];
     171            if ($Scheduled_Recordings[$data['channum']][$data['starttime_unix']]) {
     172                $program =& $Scheduled_Recordings[$data['channum']][$data['starttime_unix']][0];
    171173            }
    172174        // Otherwise, create a new instance of the program
    173175            else {
     
    299301            #$this->inputid        = $data[19];
    300302            $this->recpriority     = $data[20];
    301303            $this->recstatus       = $data[21];
    302             $this->conflicting     = ($this->recstatus == 'Conflict');   # conflicts with another scheduled recording?
    303             $this->recording       = ($this->recstatus == 'WillRecord'); # scheduled to record?
    304304            $this->recordid        = $data[22];
    305305            $this->rectype         = $data[23];
    306306            $this->dupin           = $data[24];
     
    366366            }
    367367        }
    368368    // Turn recstatus into a word
    369         if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus])
     369        if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus]) {
    370370            $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus];
     371            $this->conflicting = ($this->recstatus == 'Conflict');   # conflicts with another scheduled recording?
     372            $this->recording   = ($this->recstatus == 'WillRecord'); # scheduled to record?
     373        }
    371374    // No longer a null column, so check for blank entries
    372375        if ($this->airdate == '0000-00-00')
    373376            $this->airdate = NULL;
  • includes/channels.php

     
    3232            $sql = 'SELECT * FROM channel WHERE';
    3333        $sql .= ' channel.visible=1';
    3434    // Group and sort
    35         $sql .= ' GROUP BY channel.chanid ORDER BY '
     35        $sql .= ' GROUP BY channel.channum ORDER BY '
    3636                .(sortby_channum ? '' : 'channel.callsign, ')
    3737                .'(channel.channum + 0), channel.chanid';
    3838    // Query
  • includes/recording_schedules.php

     
    7777        if ($key === 'offset') {
    7878            list($Num_Conflicts, $Num_Scheduled) = $program;
    7979        }
    80     // Normal entry:  $Scheduled_Recordings[chanid][starttime][]
     80    // Normal entry:  $Scheduled_Recordings[channum][starttime][]
    8181        else {
    82             $Scheduled_Recordings[$program[4]][$program[11]][] =& new Program($program);
     82            $Scheduled_Recordings[$program[5]][$program[11]][] =& new Program($program);
    8383        }
    8484    }
    8585
  • modules/tv/upcoming.php

     
    7676// Parse the list of scheduled recordings
    7777    global $Scheduled_Recordings;
    7878    $all_shows = array();
    79     foreach ($Scheduled_Recordings as $chanid => $shows) {
     79    foreach ($Scheduled_Recordings as $channum => $shows) {
    8080    // Now the shows in this channel
    8181        foreach ($shows as $starttime => $show_group) {
    82         // Skip things we've already recorded (or missed)
    83             if ($starttime <= time() && $show->recstatus != 'Recording')
    84                 continue;
    8582        // Parse each show group
    8683            foreach ($show_group as $key => $show) {
     84            // Skip things we've already recorded (or missed)
     85                if ($starttime <= time() && $show->recstatus != 'Recording')
     86                    continue;
    8787            // Make sure this is a valid show (ie. skip in-progress recordings and other junk)
    88                 if (!$chanid || $show->length < 1)
     88                if (!$channum || $show->length < 1)
    8989                    continue;
    9090            // Skip scheduled shows?
    9191                if (in_array($show->recstatus, array('WillRecord', 'ForceRecord'))) {
     
    107107                    continue;
    108108                }
    109109            // Assign a reference to this show to the various arrays
    110                 $all_shows[] =& $Scheduled_Recordings[$chanid][$starttime][$key];
     110                $all_shows[] =& $Scheduled_Recordings[$channum][$starttime][$key];
    111111            }
    112112        }
    113113    }
  • modules/tv/detail.php

     
    179179// Parse the list of scheduled recordings for possible conflicts
    180180    global $Scheduled_Recordings;
    181181    $conflicting_shows = array();
    182     foreach ($Scheduled_Recordings as $chanid => $shows) {
     182    foreach ($Scheduled_Recordings as $channum => $shows) {
    183183    // Now the shows in this channel
    184184        foreach ($shows as $starttime => $show_group) {
    185185        // Clearly not a match
     
    191191                if ($show->chanid == $program->chanid && $show->starttime == $program->starttime)
    192192                    continue;
    193193            // Make sure this is a valid show (ie. skip in-progress recordings and other junk)
    194                 if (!$chanid || $show->length < 1)
     194                if (!$channum || $show->length < 1)
    195195                    continue;
    196196            // Not a conflict
    197197                if ($show->endtime < $program->starttime)
    198198                    continue;
    199199            // Assign a reference to this show to the various arrays
    200                 $conflicting_shows[] =& $Scheduled_Recordings[$chanid][$starttime][$key];
     200                $conflicting_shows[] =& $Scheduled_Recordings[$channum][$starttime][$key];
    201201            }
    202202        }
    203203    }