Skip to content

Commit

Permalink
Fix for using filename mask with existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavion committed Jan 27, 2016
1 parent efd71b0 commit 0c5307e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tvstreamrecord.py
Expand Up @@ -978,13 +978,15 @@ def doRecord(self):
except Exception as ex:
pass

fn = fn + self.ext
fn = config.cfg_recordpath + fn
# Check, if destination file already exists
fn_check = fn + self.ext
num = 1
#print (fn)
while fileexists(fn) and num<127:
fn = config.cfg_recordpath + config.cfg_record_mask.replace("%date%", dateholder).replace("%title%", titleholder) + ("_%s" % num) + self.ext
while fileexists(fn_check) and num<127:
fn_check = fn + ("_%s" % num) + self.ext
num += 1
fn = fn_check
# End check
if streamtype in fftypes:
delta = total(tDiff(self.bis, datetime.now()))
deltasec = '%d' % delta
Expand Down

0 comments on commit 0c5307e

Please sign in to comment.