Merge pull request #1012 from croneter/delete-subs
Delete temporary subtitles on playback stop
This commit is contained in:
commit
feb73b7e47
2 changed files with 14 additions and 0 deletions
|
@ -450,6 +450,7 @@ def _playback_cleanup(ended=False):
|
|||
# As all playback has halted, reset the players that have been active
|
||||
app.PLAYSTATE.active_players = set()
|
||||
app.PLAYSTATE.item = None
|
||||
utils.delete_temporary_subtitles()
|
||||
LOG.info('Finished PKC playback cleanup')
|
||||
|
||||
|
||||
|
|
|
@ -512,6 +512,19 @@ def escape_html(string):
|
|||
return string
|
||||
|
||||
|
||||
def delete_temporary_subtitles():
|
||||
"""
|
||||
Permanently deletes all temporary subtitle files
|
||||
"""
|
||||
for root, _, files in path_ops.walk(v.EXTERNAL_SUBTITLE_TEMP_PATH):
|
||||
for file in files:
|
||||
try:
|
||||
path_ops.remove(path_ops.path.join(root, file))
|
||||
except (OSError, IOError) as err:
|
||||
LOG.error('Could not delete temporary subtitle: %s, %s: %s',
|
||||
root, file, err)
|
||||
|
||||
|
||||
def kodi_sql(media_type=None):
|
||||
"""
|
||||
Open a connection to the Kodi database.
|
||||
|
|
Loading…
Reference in a new issue