Skip to content

Commit

Permalink
Also handle .ssa, .sub & .idx when fixing filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiro committed Jan 18, 2017
1 parent 890e3d4 commit 3e55ac7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,16 @@ def _double_dot_fix_hack(video_filename):
parts = work_path.rsplit('.', 1)
if len(parts) > 1:
rest = parts[0]
bad = rest + '..' + 'srt'
old = rest + '.es.' + 'srt'
if xbmcvfs.exists(bad):
log(u"%s exists" % bad)
if xbmcvfs.exists(old):
log(u"%s exists, removing" % old)
xbmcvfs.delete(old)
log(u"renaming %s to %s" % (bad, old))
xbmcvfs.rename(bad, old)
for ext in ('srt', 'ssa', 'sub', 'idx'):
bad = rest + '..' + ext
old = rest + '.es.' + ext
if xbmcvfs.exists(bad):
log(u"%s exists" % bad)
if xbmcvfs.exists(old):
log(u"%s exists, removing" % old)
xbmcvfs.delete(old)
log(u"renaming %s to %s" % (bad, old))
xbmcvfs.rename(bad, old)


def _subtitles_setting(name):
Expand Down

0 comments on commit 3e55ac7

Please sign in to comment.