Ticket #3340: 3340_mythweb_update_recgroup_count_v1.diff

File 3340_mythweb_update_recgroup_count_v1.diff, 3.2 KB (added by Nick Morrott <knowledgejunkie@…>, 17 years ago)

Patch to fix recording group count update on Recorded Programmes page

  • mythplugins/mythweb/modules/tv/tmpl/default/recorded.php

     
    7171    file.subtitle   = '<?php echo addslashes($show->subtitle)               ?>';
    7272    file.chanid     = '<?php echo addslashes($show->chanid)                 ?>';
    7373    file.starttime  = '<?php echo addslashes($show->recstartts)             ?>';
    74     file.group      = '<?php echo addslashes(str_replace('%2F', '/', rawurlencode($show->group)))    ?>';
    75     file.filename   = '<?php echo addslashes(str_replace('%2F', '/', rawurlencode($show->filename))) ?>';
     74    file.recgroup   = '<?php echo addslashes(str_replace('%2F', '/', rawurlencode($show->recgroup)))    ?>';
     75    file.filename   = '<?php echo addslashes(str_replace('%2F', '/', rawurlencode($show->filename)))    ?>';
    7676    file.size       = '<?php echo addslashes($show->filesize)               ?>';
    7777    file.length     = '<?php echo addslashes($show->recendts - $show->recstartts) ?>';
    7878    file.autoexpire = <?php echo $show->auto_expire ? 1 : 0                 ?>;
     
    147147        if (rowcount[section] == 0) {
    148148            toggle_vis('breakrow_' + section, 'display');
    149149        }
     150    // Change the recording groups dropdown on the fly.
     151        if (file.recgroup) {
     152        // Decrement the number of episodes for this group
     153            groups[file.recgroup]--;
     154            var group_count = groups[file.recgroup]
     155        // Change the groups dropdown menu on the fly
     156            if (group_count == 0) {
     157                toggle_vis('Group ' + file.recgroup, 'display');
     158            }
     159            else {
     160                var group_text;
     161                group_text = (group_count > 1) ? ' (' + group_count + ' episodes)' : '';
     162                $('Group ' + file.recgroup).innerHTML = file.recgroup + group_text;
     163            }
     164        }
    150165    // Change the recordings dropdown menu on the fly
    151166        if (episode_count == 0) {
    152167            toggle_vis('Title ' + file.title, 'display');
     
    156171            count_text = (episode_count > 1) ? ' (' + episode_count + ' episodes)' : '';
    157172            $('Title ' + file.title).innerHTML = file.title + count_text;
    158173        }
    159     // TODO: test changing the groups dropdown on the fly.
    160     // I can't test it because I haven't set up any recording groups, and probably never will
    161         if (file.group) {
    162         // Decrement the number of episodes for this group
    163             groups[file.group]--;
    164             var group_count = titles[file.title]
    165         // Change the groups dropdown menu on the fly
    166             if (group_count == 0) {
    167                 toggle_vis('Group ' + file.group, 'display');
    168             }
    169             else {
    170                 var count_text;
    171                 group_text = (group_count >1) ? ' (' + group_count + ' episodes)' : '';
    172                 $('Group ' + file.group).innerHTML = file.group + group_text;
    173             }
    174         }
    175174    // Decrement the total number of shows and update the page
    176175        programs_shown--;
    177176        programcount--;