Omit the colon when there's no episode title.
[pyTivo/TheBayer.git] / plugins / admin / templates / npl.tmpl
bloba4898db513b713efe6fc7ad7d4443d80d223f25c
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
2 <html>\r
3 <head>\r
4   <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">\r
5   <title>pyTivo - ToGo</title>\r
6 </head>\r
7 <body style="background-color: rgb(250, 250, 250);">\r
8 \r
9 #if $tivoIP != ''\r
10     #set $tname = $tivoIP\r
11     #for $tsn in $tivos\r
12         #if $tivoIP == $tivos[$tsn]\r
13             #set $tname = $tivo_names[$tsn]\r
14         #end if\r
15     #end for\r
16 <p align="center"><font size="6">pyTivo - ToGo - $tname</font></p>\r
17 #else\r
18 <p align="center"><font size="6">pyTivo - ToGo</font></p>\r
19 #end if\r
20 <table style="border: 1px solid rgb(220, 220, 220);background-color: rgb(255, 255, 255);text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="4">\r
21   <tbody>\r
22     <tr>\r
23       <td>\r
24       <form method="get" action="/TiVoConnect">\r
25       <input type="hidden" name="Command" value="NPL">\r
26       <input type="hidden" name="Container" value="$(container)">\r
27       <select name="TiVo">\r
28           #for $tsn in $tivos\r
29                   #if $tsn != ''\r
30                  <option value="$tivos[$tsn]">$tivo_names[$tsn]</option>\r
31               #end if\r
32           #end for\r
33       </select>\r
34           &nbsp;<input value="View Now Playing List" type="submit">\r
35           </form>\r
36           </td>\r
37     </tr>\r
38     <tr>\r
39       <td>\r
40       <div>\r
41       #if $tivoIP != ''\r
42           <!-- If TiVoIP is present then we should display a NPL -->\r
43                   #if $ItemStart > 0\r
44                         #set $Offset = -($ItemStart + 1)\r
45                         #if $Offset < -($shows_per_page+1)\r
46                            #set $Offset = -($shows_per_page+1)\r
47                         #end if\r
48                         <a href="/TiVoConnect?Command=NPL&Container=$quote($container)&TiVo=$tivoIP&AnchorItem=$FirstAnchor&AnchorOffset=$Offset&Folder=$folder">Previous Page</a>\r
49                   #end if\r
50                   <table>\r
51                   #if $folder != ''\r
52                         <!-- We are in a subfolder, offer the option to return to NPL -->\r
53                         <tr><td colspan=5><a href="/TiVoConnect?Command=NPL&Container=$quote($container)&TiVo=$tivoIP">Back to Now Playing List</a></td></tr>\r
54                   #end if\r
55                   #set $i = 0\r
56                   <!-- i variable is used to alternate colors of row -->\r
57                   <!-- loop through passed data printing row for each show or folder -->\r
58                   #for $row in $data\r
59                           #set $i += 1\r
60                           #if $i%2\r
61                                 <tr style="background-color: rgb(250, 250, 250);">\r
62                           #else\r
63                                 <tr>\r
64                           #end if\r
65                           #if $row['ContentType'] == 'x-tivo-container/folder'\r
66                             <!-- This is a folder -->\r
67                                 <td></td>\r
68                                 <td><a href='/TiVoConnect?Command=NPL&Container=$quote($container)&Folder=$(row["UniqueId"])&TiVo=$tivoIP'>$row['Title'] </a></td>\r
69                                 <td NOWRAP align="center">$(row["TotalItems"]) Items</td>\r
70                                 <td NOWRAP align="center">$row["LastChangeDate"]</td>\r
71                                 <td></td>\r
72                           #else\r
73                             <!-- This is a show -->\r
74                                 #if 'Icon' in $row\r
75                                     <!-- Display small table with color similar to TiVo colored circles -->\r
76                                         #if $row['Icon'] == 'urn:tivo:image:expires-soon-recording'\r
77                                                 <td><table><tr><td height=18 width=8 bgcolor='yellow'> </td></tr></table></td>\r
78                                         #else if $row['Icon'] == 'urn:tivo:image:expired-recording'\r
79                                                 <td><table><tr><td height=18 width=8 bgcolor='yellow'><b> ! </b></td></tr></table></td>\r
80                                         #else if $row['Icon'] == 'urn:tivo:image:save-until-i-delete-recording'\r
81                                                 <td><table><tr><td height=18 width=8 bgcolor='green'></td></tr></table></td>                            \r
82                                         #else\r
83                                                 <td width=8></td>\r
84                                         #end if\r
85                                 #else\r
86                                     <!-- No Icon listed in XML sheet -->\r
87                                         <td width=4></td>\r
88                                 #end if\r
89                                 <td width=*>\r
90                                         #if $row['EpisodeTitle']\r
91                                         <b>$row['Title']: $row['EpisodeTitle']</b><br>\r
92                                         #else\r
93                                         <b>$row['Title']</b><br>\r
94                                         #end if\r
95                                         <small>$row['Description']  \r
96                                         $row['SourceChannel'] $row['SourceStation']</small>\r
97                                 </td>\r
98                                 <td NOWRAP align="center">$row['SourceSize'] <br>\r
99                                 $row['Duration']\r
100                                 </td>\r
101                                 <td NOWRAP align="center">$row['CaptureDate']</td>\r
102                                 #if 'CopyProtected' in $row and $row['CopyProtected'] == 'Yes'\r
103                                         <td>CopyProtected</td>\r
104                                 #else if 'Url' in $row\r
105                                         <td NOWRAP>\r
106                                         #if $unquote($row['Url']) in $status\r
107                                                 #set $this_status = $status[$unquote($row['Url'])]\r
108                                                 #if $this_status['running'] and $this_status['rate'] != ""\r
109                                                         Transfering - $this_status['rate'] KB/s<br>\r
110                                                         <a href="/TiVoConnect?Command=ToGoStop&Container=$quote($container)&Url=$(row['Url'])&TiVo=$tivoIP&Redirect=NPL">Stop Transfer</a>\r
111                                                 #elif $this_status['running'] and $this_status['rate'] == ""\r
112                                                         Initiating Transfer.<br>\r
113                                                         Please Wait\r
114                                                 #elif $this_status['error']\r
115                                                         Error - $this_status['error']<br>\r
116                                                         <a href="/TiVoConnect?Command=ToGo&Container=$quote($container)&Url=$(row['Url'])&TiVo=$tivoIP&Redirect=NPL">Try Transfer Again.</a>\r
117                                                 #elif $this_status['finished']\r
118                                                         Transfer Complete!\r
119                                                 #else\r
120                                                         Transfer Stopped<br>\r
121                                                         <a href="/TiVoConnect?Command=ToGo&Container=$quote($container)&Url=$(row['Url'])&TiVo=$tivoIP&Redirect=NPL">Try Transfer Again.</a>\r
122                                                 #end if\r
123                                         #else\r
124                                                 <a href="/TiVoConnect?Command=ToGo&Container=$quote($container)&Url=$(row['Url'])&TiVo=$tivoIP&Redirect=NPL">Transfer This.</a>\r
125                                         #end if\r
126                                         </td>\r
127                                 #else\r
128                                     <!-- No URL was in links url in XML -->\r
129                                         <td></td>\r
130                                 #end if\r
131                           #end if\r
132                           </tr>\r
133                   #end for\r
134                   </table>\r
135                   #if ($TotalItems - $ItemCount) > ($ItemStart + 1)\r
136                      #set $Offset = $shows_per_page - 1\r
137                      <a href="/TiVoConnect?Command=NPL&Container=$quote($container)&TiVo=$tivoIP&AnchorItem=$FirstAnchor&AnchorOffset=$Offset&Folder=$folder">Next Page</a>\r
138                   #end if\r
139           #else\r
140                   <!-- No TiVo IP Provided so display instructions -->\r
141                   <form method="get" action="/TiVoConnect">\r
142                   <input type="hidden" name="Command" value="SaveNPL">\r
143                   <input type="hidden" name="Container" value="$container">\r
144                   <table align='right' style="border: 1px solid rgb(220, 220, 220);">\r
145                   <tr><td colspan=2 align='center'><b>ToGo Settings</b></td></tr>\r
146                   <tr><td>MAK:</td><td><input type='text' name="tivo_mak" value="$tivo_mak"></td></tr>\r
147                   <tr><td>Save Path:</td><td><input type='text' name="togo_path" value="$togo_path"></td></tr>\r
148                   <tr><td colspan=2 align="center"><input type="submit" value="Save Settings"></td></tr>\r
149                   </table></form>\r
150                   \r
151                   <h2>Instructions</h2>\r
152                   \r
153                   <b>Required Settings:</b><br>\r
154                   In order to view the shows on your TiVo, pyTivo needs to know your Media Access Key.  Enter this information above and \r
155                   click save.  This information is stored on your computer and is never passed outside of your network.<br><br>\r
156                   \r
157                   In order to download shows from your TiVo, pyTivo needs to know the destination directory to save the files to.  \r
158                   Enter this information above and click save.<br><br>\r
159                   \r
160                   <b>To View Your TiVo</b><br>\r
161                   Select the desired TiVo based on the TiVo Service Number and click "View Now Playing List"<br><br>\r
162                   \r
163                   <b>My TiVo is Not Listed</b><br>\r
164                   pyTivo builds a list of TiVos on the network based on the TiVos that contact pyTivo.  If pyTivo has been running less \r
165                   than 5 minutes your TiVo may not have contacted pyTivo yet.  To force a connection open your Now Playing List on your \r
166                   TiVo.  If your TiVo is still not listed in pyTivo - ToGo please confirm that your TiVo is able to connect to the pyTivo \r
167                   server.<br><br>\r
168                   \r
169                   <b>To Download a Show</b><br>\r
170                   Find your desired show in the list and click Transfer Now.  The transfer will begin momentarily.  Note: TiVo can only \r
171                   transfer 1 show at a time.<br><br>\r
172                   \r
173                   <b>I get an Error 503</b><br>\r
174                   TiVo can only tranfer one file at a time.  If you receive this error wait a few minutes and try the transfer again.<br><br>\r
175                   \r
176                   <b>What will the name of my transferred show be</b><br>\r
177                   The name will be the show title followed by a hyphen and a unique number.  This prevents accidental overwriting and may \r
178                   allow for resuming transfers in the future**. This is not yet supported<br><br>.\r
179           #end if\r
180       </div>\r
181       </td>\r
182     </tr>\r
183   </tbody>\r
184 </table>\r
185 </body>\r
186 </html>\r