Ticket #1626: set_rule_playgroup.patch

File set_rule_playgroup.patch, 13.7 KB (added by derek@…, 20 years ago)

Allow setting of playback group for recording rules

Line 
1Index: mythweb/includes/recording_schedules.php
2===================================================================
3--- mythweb/includes/recording_schedules.php (revision 9619)
4+++ mythweb/includes/recording_schedules.php (working copy)
5@@ -143,6 +143,7 @@
6 var $findid;
7 var $transcoder;
8 var $parentid;
9+ var $playgroup;
10
11 var $texttype;
12 var $channel;
13@@ -251,7 +252,7 @@
14 // Update the type, in case it changed
15 $this->type = $new_type;
16 // Update the record
17- $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 ('
18+ $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 ('
19 .escape($this->recordid, true) .','
20 .escape($this->type) .','
21 .escape($this->chanid) .','
22@@ -289,7 +290,8 @@
23 .escape($this->autouserjob1) .','
24 .escape($this->autouserjob2) .','
25 .escape($this->autouserjob3) .','
26- .escape($this->autouserjob4) .')')
27+ .escape($this->autouserjob4) .','
28+ .escape($this->playgroup) .')')
29 or trigger_error('SQL Error: '.mysql_error(), FATAL);
30 // Get the id that was returned
31 $recordid = mysql_insert_id();
32@@ -512,4 +514,28 @@
33 echo '</select>';
34 }
35
36+/**
37+ * prints a <select> of the various playback groups available
38+/**/
39+ function playgroup_select($this_playgroup, $name = 'playgroup')
40+ {
41+ static $playgroups = array();
42+ if(!sizeof($playgroups))
43+ {
44+ $res = mysql_query('SELECT name FROM playgroup');
45+ while($row = mysql_fetch_row($res))
46+ $playgroups[$row[0]] = $row[0];
47+ mysql_free_result($res);
48+ }
49
50+ echo "<select name=\"$name\">\n";
51+ foreach($playgroups as $playgroup)
52+ {
53+ echo "\t<option value=\"" . html_entities($playgroup) . '"';
54+ if($this_playgroup == $playgroup)
55+ echo ' SELECTED';
56+ echo '>' . html_entities($playgroup) . "</option>\n";
57+ }
58+ echo "</select>\n";
59+ return;
60+ }
61Index: mythweb/modules/_shared/lang/English_GB.lang
62===================================================================
63--- mythweb/modules/_shared/lang/English_GB.lang (revision 9619)
64+++ mythweb/modules/_shared/lang/English_GB.lang (working copy)
65@@ -244,6 +244,7 @@
66 "Past Year"
67 "People"
68 "People Search"
69+"Playback Group"
70 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
71 "Please search for something."
72 "plot"
73Index: mythweb/modules/_shared/lang/French.lang
74===================================================================
75--- mythweb/modules/_shared/lang/French.lang (revision 9619)
76+++ mythweb/modules/_shared/lang/French.lang (working copy)
77@@ -347,6 +347,7 @@
78 "Past Year"
79 "People"
80 "People Search"
81+"Playback Group"
82 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
83 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
84 "Please search for something."
85Index: mythweb/modules/_shared/lang/Spanish.lang
86===================================================================
87--- mythweb/modules/_shared/lang/Spanish.lang (revision 9619)
88+++ mythweb/modules/_shared/lang/Spanish.lang (working copy)
89@@ -427,6 +427,7 @@
90 Gente
91 "People Search"
92 Búsqueda gente
93+"Playback Group"
94 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
95 Tenga cuidado al alterar esta tabla sin saber lo que hace, puede romper el funcionamiento de MythTV
96 "Please search for something."
97Index: mythweb/modules/_shared/lang/Danish.lang
98===================================================================
99--- mythweb/modules/_shared/lang/Danish.lang (revision 9619)
100+++ mythweb/modules/_shared/lang/Danish.lang (working copy)
101@@ -374,6 +374,7 @@
102 "Past Year"
103 "People"
104 "People Search"
105+"Playback Group"
106 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
107 BemÊrk at ved at Êndre i denne tabel uden at vide hvad du laver, kan du ÞdelÊgge mythtvs funktioner.
108 "Please search for something."
109Index: mythweb/modules/_shared/lang/Swedish.lang
110===================================================================
111--- mythweb/modules/_shared/lang/Swedish.lang (revision 9619)
112+++ mythweb/modules/_shared/lang/Swedish.lang (working copy)
113@@ -431,6 +431,7 @@
114 Person
115 "People Search"
116 Sök person
117+"Playback Group"
118 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
119 OBS! Genom att Àndra dessa instÀllningar utan att veta vad du gör kan du allvarligt störa MythTVs funktionalitet.
120 "Please search for something."
121Index: mythweb/modules/_shared/lang/Dutch.lang
122===================================================================
123--- mythweb/modules/_shared/lang/Dutch.lang (revision 9619)
124+++ mythweb/modules/_shared/lang/Dutch.lang (working copy)
125@@ -430,6 +430,7 @@
126 Personen
127 "People Search"
128 Personen zoeken
129+"Playback Group"
130 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
131 Waarschuwing! Als u niet weet wat u doet, kan het veranderen van deze tabel de werking van MythTV ernstig verstoren.
132 "Please search for something."
133Index: mythweb/modules/_shared/lang/German.lang
134===================================================================
135--- mythweb/modules/_shared/lang/German.lang (revision 9619)
136+++ mythweb/modules/_shared/lang/German.lang (working copy)
137@@ -427,6 +427,7 @@
138 Leute
139 "People Search"
140 Suche nach Darsteller
141+"Playback Group"
142 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
143 Achtung! Falls diese Tabelle ohne das nötige Hintergrundwissen verÀndert wird, könnte MythTVs FunktionalitÀt nachhaltig gestört werden.
144 "Please search for something."
145Index: mythweb/modules/_shared/lang/Japanese.lang
146===================================================================
147--- mythweb/modules/_shared/lang/Japanese.lang (revision 9619)
148+++ mythweb/modules/_shared/lang/Japanese.lang (working copy)
149@@ -399,6 +399,7 @@
150 ピヌプル
151 "People Search"
152 ピヌプルサヌチ
153+"Playback Group"
154 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
155 蚭定項
156目の意味がわからないずきは倉曎しないでください。MythTVが正垞に動䜜しなくなりたす。
157 "Please search for something."
158Index: mythweb/modules/_shared/lang/English.lang
159===================================================================
160--- mythweb/modules/_shared/lang/English.lang (revision 9619)
161+++ mythweb/modules/_shared/lang/English.lang (working copy)
162@@ -234,6 +234,7 @@
163 "Past Year"
164 "People"
165 "People Search"
166+"Playback Group"
167 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
168 "Please search for something."
169 "plot"
170Index: mythweb/modules/_shared/lang/Czech.lang
171===================================================================
172--- mythweb/modules/_shared/lang/Czech.lang (revision 9619)
173+++ mythweb/modules/_shared/lang/Czech.lang (working copy)
174@@ -295,6 +295,7 @@
175 "Past Year"
176 "People"
177 "People Search"
178+"Playback Group"
179 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
180 "Please search for something."
181 "plot"
182Index: mythweb/modules/_shared/lang/Finnish.lang
183===================================================================
184--- mythweb/modules/_shared/lang/Finnish.lang (revision 9619)
185+++ mythweb/modules/_shared/lang/Finnish.lang (working copy)
186@@ -414,6 +414,7 @@
187 "People"
188 "People Search"
189 Haku NimellÀ
190+"Playback Group"
191 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
192 Varoitus: NÀiden asetusten muokkaus voi haitata MythTV:n toimintaa.
193 "Please search for something."
194Index: mythweb/modules/_shared/lang/Slovenian.lang
195===================================================================
196--- mythweb/modules/_shared/lang/Slovenian.lang (revision 9619)
197+++ mythweb/modules/_shared/lang/Slovenian.lang (working copy)
198@@ -341,6 +341,7 @@
199 "Past Year"
200 "People"
201 "People Search"
202+"Playback Group"
203 "Please be warned that by altering this table without knowing what you are doing, you could seriously disrupt mythtv functionality."
204 "Please search for something."
205 Prosim poiščite kaj
206Index: mythweb/modules/tv/schedules_custom.php
207===================================================================
208--- mythweb/modules/tv/schedules_custom.php (revision 9619)
209+++ mythweb/modules/tv/schedules_custom.php (working copy)
210@@ -100,6 +100,7 @@
211 $schedule->findday = $_POST['findday'];
212 $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
213 $schedule->transcoder = $_POST['transcoder'];
214+ $schedule->playgroup = $_POST['playgroup'];
215 // Parse the findtime
216 $schedule->findtime = trim($_POST['findtime']);
217 if ($schedule->findtime) {
218Index: mythweb/modules/tv/schedules_manual.php
219===================================================================
220--- mythweb/modules/tv/schedules_manual.php (revision 9619)
221+++ mythweb/modules/tv/schedules_manual.php (working copy)
222@@ -87,6 +87,7 @@
223 $schedule->findtime = date('H:m:s', $schedule->starttime);
224 $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
225 $schedule->transcoder = $_POST['transcoder'];
226+ $schedule->playgroup = $_POST['playgroup'];
227 // Figure out the title
228 $channel = $Channels[$_POST['channel']];
229 if (strcasecmp($_POST['title'], t('Use callsign')) == 0) {
230Index: mythweb/modules/tv/detail.php
231===================================================================
232--- mythweb/modules/tv/detail.php (revision 9619)
233+++ mythweb/modules/tv/detail.php (working copy)
234@@ -132,6 +132,7 @@
235 $schedule->endoffset = intval($_POST['endoffset']);
236 $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
237 $schedule->transcoder = $_POST['transcoder'];
238+ $schedule->playgroup = $_POST['playgroup'];
239 $schedule->tsdefault = $_POST['timestretch'];
240 // Keep track of the parent recording for overrides
241 if ($_POST['record'] == rectype_override) {
242Index: mythweb/modules/tv/tmpl/default/schedules_custom.php
243===================================================================
244--- mythweb/modules/tv/tmpl/default/schedules_custom.php (revision 9619)
245+++ mythweb/modules/tv/tmpl/default/schedules_custom.php (working copy)
246@@ -160,6 +160,8 @@
247 echo ">$i</option>";
248 }
249 ?></select></dd>
250+ <dt><?php echo t('Playback Group') ?>:</dt>
251+ <dd><?php playgroup_select($schedule->playgroup) ?></dd>
252 <dt><?php echo t('Check for duplicates in') ?>:</dt>
253 <dd><select name="dupin"><?php
254 echo '<option value="1"';
255Index: mythweb/modules/tv/tmpl/default/schedules_manual.php
256===================================================================
257--- mythweb/modules/tv/tmpl/default/schedules_manual.php (revision 9619)
258+++ mythweb/modules/tv/tmpl/default/schedules_manual.php (working copy)
259@@ -113,6 +113,8 @@
260 echo ">$i</option>";
261 }
262 ?></select></dd>
263+ <dt><?php echo t('Playback Group') ?>:</dt>
264+ <dd><?php playgroup_select($schedule->playgroup) ?></dd>
265 <dt><?php echo t('Check for duplicates in') ?>:</dt>
266 <dd><select name="dupin"><?php
267 echo '<option value="1"';
268Index: mythweb/modules/tv/tmpl/default/detail.php
269===================================================================
270--- mythweb/modules/tv/tmpl/default/detail.php (revision 9619)
271+++ mythweb/modules/tv/tmpl/default/detail.php (working copy)
272@@ -371,6 +371,8 @@
273 echo ">$i</option>";
274 }
275 ?></select></dd>
276+ <dt><?php echo t('Playback Group') ?>:</dt>
277+ <dd><?php playgroup_select($schedule->playgroup) ?></dd>
278 <dt><?php echo t('Time Stretch Default') ?>:</dt>
279 <dd>
280 <select name="timestretch">