Index: includes/programs.php
===================================================================
--- includes/programs.php	(revision 9646)
+++ includes/programs.php	(working copy)
@@ -261,6 +261,7 @@
     var $is_movie;
 
     var $timestretch;
+    var $playgroup;
 
     var $credits = array();
 
@@ -333,7 +334,8 @@
             $this->recpriority     = $data[36];
             $this->airdate         = date('Y-m-d', $data[37]);
             $this->hasairdate      = $data[38];
-            $this->timestretch     = $data[39];
+            $this->playgroup       = $data[39];
+            $this->timestretch     = '';            # Not printed by ToStringList() 
             $this->recpriority2    = $data[40];
         // Assign the program flags
             $this->has_commflag = ($progflags & 0x01) ? true : false;    // FL_COMMFLAG  = 0x01
Index: includes/recording_schedules.php
===================================================================
--- includes/recording_schedules.php	(revision 9646)
+++ includes/recording_schedules.php	(working copy)
@@ -143,6 +143,7 @@
     var $findid;
     var $transcoder;
     var $parentid;
+    var $playgroup;
 
     var $texttype;
     var $channel;
@@ -251,7 +252,7 @@
     // Update the type, in case it changed
         $this->type = $new_type;
     // Update the record
-        $result = mysql_query('REPLACE INTO record (recordid,type,chanid,starttime,startdate,endtime,enddate,search,title,subtitle,description,profile,recpriority,category,maxnewest,inactive,maxepisodes,autoexpire,startoffset,endoffset,recgroup,dupmethod,dupin,station,seriesid,programid,autocommflag,findday,findtime,findid,autotranscode,transcoder,parentid,tsdefault,autouserjob1,autouserjob2,autouserjob3,autouserjob4) values ('
+        $result = mysql_query('REPLACE INTO record (recordid,type,chanid,starttime,startdate,endtime,enddate,search,title,subtitle,description,profile,recpriority,category,maxnewest,inactive,maxepisodes,autoexpire,startoffset,endoffset,recgroup,dupmethod,dupin,station,seriesid,programid,autocommflag,findday,findtime,findid,autotranscode,transcoder,parentid,tsdefault,autouserjob1,autouserjob2,autouserjob3,autouserjob4,playgroup) values ('
                                 .escape($this->recordid, true)             .','
                                 .escape($this->type)                       .','
                                 .escape($this->chanid)                     .','
@@ -289,7 +290,8 @@
                                 .escape($this->autouserjob1)               .','
                                 .escape($this->autouserjob2)               .','
                                 .escape($this->autouserjob3)               .','
-                                .escape($this->autouserjob4)               .')')
+                                .escape($this->autouserjob4)               .','
+				.escape($this->playgroup)                  .')')
             or trigger_error('SQL Error: '.mysql_error(), FATAL);
     // Get the id that was returned
         $recordid = mysql_insert_id();
@@ -512,4 +514,31 @@
         echo '</select>';
     }
 
+/**
+ * prints a <select> of the various playback groups available
+/**/
+    function playgroup_select($this_playgroup, $name = 'playgroup', $js = '', $id = '')
+    {
+        static $playgroups = array();
+        if(!sizeof($playgroups))
+        {
+            $res = mysql_query('SELECT name FROM playgroup');
+            while($row = mysql_fetch_row($res))
+                $playgroups[$row[0]] = $row[0];
+            mysql_free_result($res);
+        }
 
+        echo "<select name=\"$name\"";
+        if(strlen($js))
+           echo " onchange=\"$js\" id=\"playgroup_$id\" name=\"playgroup_$id\"";
+        echo ">\n";
+        foreach($playgroups as $playgroup)
+        {
+            echo "\t<option value=\"" . html_entities($playgroup) . '"';
+            if($this_playgroup == $playgroup)
+                echo ' SELECTED';
+            echo '>' . html_entities($playgroup) . "</option>\n";
+        }
+        echo "</select>\n";
+        return;
+    }
Index: modules/_shared/lang/English_GB.lang
===================================================================
--- modules/_shared/lang/English_GB.lang	(revision 9646)
+++ modules/_shared/lang/English_GB.lang	(working copy)
@@ -244,6 +244,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
 "Please search for something."
 "plot"
Index: modules/_shared/lang/French.lang
===================================================================
--- modules/_shared/lang/French.lang	(revision 9646)
+++ modules/_shared/lang/French.lang	(working copy)
@@ -347,6 +347,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Nous vous pr&eacute;venons que modifier les touches sans savoir ce que vous fa&icirc;tes peut s&eacute;rieusement endomager le fonctionnement de MythTV
 "Please search for something."
Index: modules/_shared/lang/Spanish.lang
===================================================================
--- modules/_shared/lang/Spanish.lang	(revision 9646)
+++ modules/_shared/lang/Spanish.lang	(working copy)
@@ -427,6 +427,7 @@
     Gente
 "People Search"
     Búsqueda gente
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Tenga cuidado al alterar esta tabla sin saber lo que hace, puede romper el funcionamiento de MythTV
 "Please search for something."
Index: modules/_shared/lang/Danish.lang
===================================================================
--- modules/_shared/lang/Danish.lang	(revision 9646)
+++ modules/_shared/lang/Danish.lang	(working copy)
@@ -374,6 +374,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Bemærk at ved at ændre i denne tabel uden at vide hvad du laver, kan du ødelægge mythtvs funktioner.
 "Please search for something."
Index: modules/_shared/lang/Swedish.lang
===================================================================
--- modules/_shared/lang/Swedish.lang	(revision 9646)
+++ modules/_shared/lang/Swedish.lang	(working copy)
@@ -431,6 +431,7 @@
     Person
 "People Search"
     Sök person
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     OBS! Genom att ändra dessa inställningar utan att veta vad du gör kan du allvarligt störa MythTVs funktionalitet.
 "Please search for something."
Index: modules/_shared/lang/Dutch.lang
===================================================================
--- modules/_shared/lang/Dutch.lang	(revision 9646)
+++ modules/_shared/lang/Dutch.lang	(working copy)
@@ -430,6 +430,7 @@
     Personen
 "People Search"
     Personen zoeken
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Waarschuwing! Als u niet weet wat u doet, kan het veranderen van deze tabel de werking van MythTV ernstig verstoren.
 "Please search for something."
Index: modules/_shared/lang/German.lang
===================================================================
--- modules/_shared/lang/German.lang	(revision 9646)
+++ modules/_shared/lang/German.lang	(working copy)
@@ -427,6 +427,7 @@
     Leute
 "People Search"
     Suche nach Darsteller
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Achtung! Falls diese Tabelle ohne das nötige Hintergrundwissen verändert wird, könnte MythTVs Funktionalität nachhaltig gestört werden.
 "Please search for something."
Index: modules/_shared/lang/Japanese.lang
===================================================================
--- modules/_shared/lang/Japanese.lang	(revision 9646)
+++ modules/_shared/lang/Japanese.lang	(working copy)
@@ -399,6 +399,7 @@
     ピープル
 "People Search"
     ピープルサーチ
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     設定項目の意味がわからないときは変更しないでください。MythTVが正常に動作しなくなります。
 "Please search for something."
Index: modules/_shared/lang/English.lang
===================================================================
--- modules/_shared/lang/English.lang	(revision 9646)
+++ modules/_shared/lang/English.lang	(working copy)
@@ -234,6 +234,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
 "Please search for something."
 "plot"
Index: modules/_shared/lang/Czech.lang
===================================================================
--- modules/_shared/lang/Czech.lang	(revision 9646)
+++ modules/_shared/lang/Czech.lang	(working copy)
@@ -295,6 +295,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
 "Please search for something."
 "plot"
Index: modules/_shared/lang/Finnish.lang
===================================================================
--- modules/_shared/lang/Finnish.lang	(revision 9646)
+++ modules/_shared/lang/Finnish.lang	(working copy)
@@ -414,6 +414,7 @@
 "People"
 "People Search"
     Haku Nimellä
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
     Varoitus: Näiden asetusten muokkaus voi haitata MythTV:n toimintaa.
 "Please search for something."
Index: modules/_shared/lang/Slovenian.lang
===================================================================
--- modules/_shared/lang/Slovenian.lang	(revision 9646)
+++ modules/_shared/lang/Slovenian.lang	(working copy)
@@ -341,6 +341,7 @@
 "Past Year"
 "People"
 "People Search"
+"Playback Group"
 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
 "Please search for something."
     Prosim poiščite kaj
Index: modules/tv/schedules_custom.php
===================================================================
--- modules/tv/schedules_custom.php	(revision 9646)
+++ modules/tv/schedules_custom.php	(working copy)
@@ -100,6 +100,7 @@
             $schedule->findday       = $_POST['findday'];
             $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
             $schedule->transcoder    = $_POST['transcoder'];
+            $schedule->playgroup     = $_POST['playgroup'];
         // Parse the findtime
             $schedule->findtime      = trim($_POST['findtime']);
             if ($schedule->findtime) {
Index: modules/tv/schedules_manual.php
===================================================================
--- modules/tv/schedules_manual.php	(revision 9646)
+++ modules/tv/schedules_manual.php	(working copy)
@@ -87,6 +87,7 @@
             $schedule->findtime    = date('H:m:s', $schedule->starttime);
             $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
             $schedule->transcoder  = $_POST['transcoder'];
+            $schedule->playgroup   = $_POST['playgroup'];
         // Figure out the title
             $channel = $Channels[$_POST['channel']];
             if (strcasecmp($_POST['title'], t('Use callsign')) == 0) {
Index: modules/tv/detail.php
===================================================================
--- modules/tv/detail.php	(revision 9646)
+++ modules/tv/detail.php	(working copy)
@@ -132,6 +132,7 @@
             $schedule->endoffset     = intval($_POST['endoffset']);
             $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
             $schedule->transcoder    = $_POST['transcoder'];
+            $schedule->playgroup     = $_POST['playgroup'];
             $schedule->tsdefault     = $_POST['timestretch'];
         // Keep track of the parent recording for overrides
             if ($_POST['record'] == rectype_override) {
Index: modules/tv/tmpl/default/schedules_custom.php
===================================================================
--- modules/tv/tmpl/default/schedules_custom.php	(revision 9646)
+++ modules/tv/tmpl/default/schedules_custom.php	(working copy)
@@ -160,6 +160,8 @@
                         echo ">$i</option>";
                     }
                     ?></select></dd>
+                <dt><?php echo t('Playback Group') ?>:</dt>
+                <dd><?php playgroup_select($schedule->playgroup) ?></dd>
                 <dt><?php echo t('Check for duplicates in') ?>:</dt>
                 <dd><select name="dupin"><?php
                         echo '<option value="1"';
Index: modules/tv/tmpl/default/schedules_manual.php
===================================================================
--- modules/tv/tmpl/default/schedules_manual.php	(revision 9646)
+++ modules/tv/tmpl/default/schedules_manual.php	(working copy)
@@ -113,6 +113,8 @@
                         echo ">$i</option>";
                     }
                     ?></select></dd>
+                <dt><?php echo t('Playback Group') ?>:</dt>
+                <dd><?php playgroup_select($schedule->playgroup) ?></dd>
                 <dt><?php echo t('Check for duplicates in') ?>:</dt>
                 <dd><select name="dupin"><?php
                         echo '<option value="1"';
Index: modules/tv/tmpl/default/detail.php
===================================================================
--- modules/tv/tmpl/default/detail.php	(revision 9646)
+++ modules/tv/tmpl/default/detail.php	(working copy)
@@ -371,6 +371,8 @@
                         echo ">$i</option>";
                     }
                     ?></select></dd>
+                <dt><?php echo t('Playback Group') ?>:</dt>
+                <dd><?php playgroup_select($schedule->playgroup) ?></dd>
                 <dt><?php echo t('Time Stretch Default') ?>:</dt>
                 <dd>
                     <select name="timestretch">
Index: modules/tv/tmpl/default/recorded.php
===================================================================
--- modules/tv/tmpl/default/recorded.php	(revision 9646)
+++ modules/tv/tmpl/default/recorded.php	(working copy)
@@ -68,6 +68,14 @@
                    +'&chanid='+file.chanid+'&starttime='+file.starttime);
     }
 
+    function set_playgroup(id) {
+        var file = files[id];
+        var sel  = get_element('playgroup_' + file.chanid + '.' + file.starttime);
+        submit_url('<?php echo root ?>tv/recorded?ajax&playgroup='+
+                    sel.options[sel.selectedIndex].value+
+                    '&chanid='+file.chanid+'&starttime='+file.starttime);
+    }
+
     function confirm_delete(id, forget_old) {
         var file = files[id];
         if (confirm("<?php echo t('Are you sure you want to delete the following show?') ?>\n\n     "+file.title+": "+file.subtitle)) {
@@ -325,6 +333,9 @@
              name="autoexpire_<?php echo $show->chanid, '.', $show->recstartts ?>"
              <?php if ($show->auto_expire) echo ' CHECKED' ?> onchange="set_autoexpire(<?php echo $row ?>)" />
             </span>
+        <span style="padding-right: 25px"><?php echo strtolower(t('Playback Group')) ?>:&nbsp;
+            <?php playgroup_select($show->playgroup, 'playgroup', "set_playgroup($row)", $show->chanid . '.' . $show->recstartts) ?>
+            </span>
         <?php echo t('has bookmark') ?>:&nbsp;
             <b><?php echo $show->bookmark ? t('Yes') : t('No') ?></b>
         </td>
Index: modules/tv/recorded.php
===================================================================
--- modules/tv/recorded.php	(revision 9646)
+++ modules/tv/recorded.php	(working copy)
@@ -58,18 +58,27 @@
 
 // Auto-expire
     isset($_GET['autoexpire']) or $_GET['autoexpire'] = $_POST['autoexpire'];
-    if (isset($_GET['autoexpire']) && $_GET['chanid'] && $_GET['starttime']) {
+    if (isset($_GET['autoexpire']) && $_GET['chanid'] && $_GET['starttime'])
         $sh = $db->query('UPDATE recorded
                              SET autoexpire = ?
                            WHERE chanid = ? AND starttime = FROM_UNIXTIME(?)',
                          $_GET['autoexpire'] ? 1 : 0,
                          $_GET['chanid'],
                          $_GET['starttime']);
+// Playback group edit
+    isset($_GET['playgroup']) or $_GET['playgroup'] = $_POST['playgroup'];
+    if(isset($_GET['playgroup']) && $_GET['chanid'] && $_GET['starttime'])
+        $sh = $db->query('UPDATE recorded
+                             SET playgroup = ?
+                           WHERE chanid = ? AND starttime = FROM_UNIXTIME(?)',
+                         $_GET['playgroup'],
+                         $_GET['chanid'],
+                         $_GET['starttime']);
+
     // Exit early if we're in AJAX mode.
-        if (isset($_GET['ajax'])) {
-            echo 'success';
-            exit;
-        }
+    if (isset($_GET['ajax'])) {
+        echo 'success';
+        exit;
     }
     else {
         /** @todo need some sort of handler here for the non-ajax stuff */
