Skip to content

Commit

Permalink
More placeholders supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavion committed Aug 25, 2018
1 parent a3b8432 commit 6085329
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions js/tvstreamrecord.basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1262,11 +1262,11 @@ $(function() {
alert( $(this).attr('alert') );
myalert = true;
}
} else if ($(this).attr('id')=="cfg_record_mask") {
/*} else if ($(this).attr('id')=="cfg_record_mask") {
if ( value.lastIndexOf("%date%")==-1 && value.lastIndexOf("%title%")==-1) {
alert( $(this).attr('alert') );
myalert = true;
}
}*/
} else if ($(this).attr('id').startsWith('cfg_switch') && $(this).attr('type')!="checkbox") {
value = "null";
} else if ($(this).attr('id').startsWith('cfg_switch')) {
Expand Down
2 changes: 1 addition & 1 deletion synology/INFO
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package="tvstreamrecord"
version="1.3.4"
version="1.3.4b"
maintainer="Pavion"
description="Program to record TV streams. Python required. Server runs at port 8030 (changeable)"
reloadui="yes"
Expand Down
20 changes: 10 additions & 10 deletions tvstreamrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from __future__ import unicode_literals
from __future__ import division

from bottle import CherryPyServer, TEMPLATES
from bottle import CherryPyServer # , TEMPLATES
from bottle import route, run, template, post, request, response
from bottle import static_file, redirect
from datetime import datetime, timedelta, time, date
Expand Down Expand Up @@ -62,7 +62,7 @@ def total(timedelta):
localdate = "%d.%m.%Y"
dayshown = datetime.combine(date.today(), time.min)
shutdown = False
version = '1.3.4'
version = '1.3.4b'

@route('/live/<filename>')
def server_static9(filename):
Expand Down Expand Up @@ -1028,16 +1028,16 @@ def doRecord(self):

fn = config.cfg_record_mask
# Placeholders
fn = fn.replace("%date%", dateholder)
fn = fn.replace("%title%", titleholder)
fn = fn.replace("%month%", datetime.now().strftime("%m"))
fn = fn.replace("%year%", datetime.now().strftime("%Y"))
fn = fn.replace("%day%", datetime.now().strftime("%d"))
fn = fn.replace("%channelid%", idholder)
fn = fn.replace("%channel%", self.myrow[9])
fn = fn.replace("%date%", dateholder).replace("%title%", titleholder)
fn = fn.replace("%month%", datetime.now().strftime("%m")).replace("%year%", datetime.now().strftime("%Y")).replace("%day%", datetime.now().strftime("%d"))
fn = fn.replace("%hour%", datetime.now().strftime("%H")).replace("%minute%", datetime.now().strftime("%M")).replace("%second%", datetime.now().strftime("%S"))
fn = fn.replace("%channelid%", idholder).replace("%channel%", self.myrow[9])
# Placeholders end
for i in range(0, len(ffargs)):
ffargs[i] = ffargs[i].replace("%date%", dateholder).replace("%title%", titleholder).replace("%month%", datetime.now().strftime("%m")).replace("%year%", datetime.now().strftime("%Y")).replace("%day%", datetime.now().strftime("%d")).replace("%channelid%", idholder).replace("%channel%", self.myrow[9])
ffargs[i] = ffargs[i].replace("%date%", dateholder).replace("%title%", titleholder)
ffargs[i] = ffargs[i].replace("%month%", datetime.now().strftime("%m")).replace("%year%", datetime.now().strftime("%Y")).replace("%day%", datetime.now().strftime("%d"))
ffargs[i] = ffargs[i].replace("%hour%", datetime.now().strftime("%H")).replace("%minute%", datetime.now().strftime("%M")).replace("%second%", datetime.now().strftime("%S"))
ffargs[i] = ffargs[i].replace("%channelid%", idholder).replace("%channel%", self.myrow[9])

if "/" in fn or "\\" in fn:
try:
Expand Down
4 changes: 2 additions & 2 deletions views/config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</tbody>
</table>
<font size="0.6em"><sup>*</sup> §For more information regarding ffmpeg and its command line parameters please visit its homepage at§: <a href="http://ffmpeg.org">ffmpeg.org</a></font><br>
<font size="0.6em"><sup>**</sup> §Valid placeholders§: %date%, %title%, %year%, %month%, %day%, %channel%, %channelid%. </font>
<font size="0.6em"><sup>**</sup> §Valid placeholders§: %date%, %title%, %year%, %month%, %day%, %hour%, %minute%, %second%, %channel%, %channelid%. </font>
</div>
<div id="configtabs-4">
<!--Advanced configuration-->
Expand All @@ -122,7 +122,7 @@
<tr><td>§Password-free IPs start with (comma separated, default§: '10.,127.,192.,localhost')</td><td><input type="text" class="text ui-widget-content ui-corner-all" id="cfg_ip_filter" value="" autocomplete="off" /></td></tr>
</tbody>
</table>
<font size="0.6em"><sup>*</sup> §Valid placeholders§: %date%, %title%, %year%, %month%, %day%, %channel%, %channelid%. </font>
<font size="0.6em"><sup>*</sup> §Valid placeholders§: %date%, %title%, %year%, %month%, %day%, %hour%, %minute%, %second%, %channel%, %channelid%. </font>
</div>
</div>
<!--</form>-->
Expand Down

0 comments on commit 6085329

Please sign in to comment.