Ticket #848: mythweb.oldrecorded.2.diff

File mythweb.oldrecorded.2.diff, 5.2 KB (added by rtsai1111, 14 years ago)

update patch to svn head, incorporate suggestions, make configurable

  • mythweb/config/conf.php

     
    9292    define('star_character', '♦');    // the character(s) to represent stars with
    9393
    9494/*
     95 
     96    The following constants are defined for TV listings
    9597
     98*/
     99
     100// Enable to also mark TV listings in the "oldrecorded" table. Provides more information,
     101// but may slow down mythweb if "oldrecorded" is very large.
     102    define('tv_listings_mark_old_duplicate', false);
     103
     104/*
     105
    96106    The following constants are defined for the recorded programs page
    97107
    98108*/
  • mythweb/includes/programs.php

     
    115115            trigger_error("load_all_program_data() attempted with an empty \$Channels array", FATAL);
    116116        $these_channels = implode(',', $these_channels);
    117117    // Build the sql query, and execute it
    118         $query = 'SELECT program.*,'
    119                  .' UNIX_TIMESTAMP(program.starttime) AS starttime_unix,'
    120                  .' UNIX_TIMESTAMP(program.endtime) AS endtime_unix,'
    121                  .' CONCAT(repeat('.escape(star_character).', program.stars * '.escape(max_stars).'), IF((program.stars * '.escape(max_stars).' * 10) % 10, "½", "")) AS starstring,'
    122                  .' IFNULL(programrating.system, "") AS rater,'
    123                  .' IFNULL(programrating.rating, "") AS rating'
    124                  .' FROM program LEFT JOIN programrating USING (chanid, starttime)'
    125                  .' WHERE';
     118        $query = 'SELECT program.*'
     119                 .',UNIX_TIMESTAMP(program.starttime) AS starttime_unix'
     120                 .',UNIX_TIMESTAMP(program.endtime) AS endtime_unix'
     121                 .',CONCAT(repeat('.escape(star_character)
     122                 .', program.stars * '.escape(max_stars)
     123                 .'), IF((program.stars * '.escape(max_stars)
     124                 .' * 10) % 10, "½", "")) AS starstring'
     125                 .',IFNULL(programrating.system, "") AS rater'
     126                 .',IFNULL(programrating.rating, "") AS rating';
     127        if (tv_listings_mark_old_duplicate) {
     128            $query .= ',oldrecorded.recstatus'
     129                . ' FROM (program'
     130                . '     LEFT JOIN oldrecorded'
     131                . '     USING (seriesid, programid))';
     132        } else {
     133            $query .= ' FROM program';
     134        }
     135        $query .= ' LEFT JOIN programrating'
     136                . ' USING (chanid, starttime)'
     137                . ' WHERE';
    126138    // Only loading a single channel worth of information
    127139        if ($chanid > 0)
    128140            $query .= ' program.chanid='.escape($chanid);
     
    314326            $this->auto_expire  = ($progflags & 0x04) ? true : false;    // FL_AUTOEXP   = 0x04
    315327            $this->is_editing   = ($progflags & 0x08) ? true : false;    // FL_EDITING   = 0x08
    316328            $this->bookmark     = ($progflags & 0x10) ? true : false;    // FL_BOOKMARK  = 0x10
    317         // Turn recstatus into a word
    318             if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus])
    319                 $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus];
    320329        // Add a generic "will record" variable, too
    321330            $this->will_record = ($this->rectype && $this->rectype != rectype_dontrec) ? true : false;
    322331        }
     
    348357            $this->colorcode               = $data['colorcode'];
    349358            $this->syndicatedepisodenumber = $data['syndicatedepisodenumber'];
    350359            $this->title_pronounce         = $data['title_pronounce'];
     360            $this->recstatus               = $data['recstatus'];
    351361
    352362            if ($program_data['tsdefault']) {
    353363                $this->timestretch = $program_data['tsdefault'];
     
    355365                $this->timestretch = 1.0;
    356366            }
    357367        }
     368
     369    // Turn recstatus into a word
     370        if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus])
     371            $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus];
     372
    358373    // No longer a null column, so check for blank entries
    359374        if ($this->airdate == '0000-00-00')
    360375            $this->airdate = NULL;
  • mythweb/includes/css.php

     
    4747    status.
    4848*/
    4949    function recstatus_class(&$item) {
    50         if ($item->recordid && !strcasecmp(get_class($item), 'program')) {
     50        if ($item->recstatus && !strcasecmp(get_class($item), 'program')) {
    5151            switch ($item->recstatus) {
    5252                case 'ForceRecord':
    5353                    return 'record_override_record';
     
    5959                case 'PreviousRecording':
    6060                case 'CurrentRecording':
    6161                    return 'record_duplicate';
     62                case 'Recorded':
     63                    return 'record_old_duplicate';
    6264                case 'ManualOverride':
    6365                case 'Cancelled':
    6466                    return 'record_override_suppress';