Skip to content

Commit

Permalink
fix postprocessor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yajrendrag committed Nov 14, 2024
1 parent 9cef96b commit c591f05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions source/subtitle_from_audio/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

**<span style="color:#56adda">0.0.16</span>**
- fix post processor cleanup of /tmp/unmanic

**<span style="color:#56adda">0.0.15</span>**
- fix tmp directory

Expand Down
2 changes: 1 addition & 1 deletion source/subtitle_from_audio/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"on_worker_process": 2
},
"tags": "subtitle",
"version": "0.0.15"
"version": "0.0.16"
}
6 changes: 4 additions & 2 deletions source/subtitle_from_audio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,15 @@ def on_postprocessor_task_results(data):

abspath = data.get('source_data').get('abspath')
try:
tmp_audio = '/tmp/unmanic' + os.path.splitext(os.path.basename(abspath))[0] + '.wav'
tmp_audio = '/tmp/unmanic/' + os.path.splitext(os.path.basename(abspath))[0] + '.wav'
except:
logger.debug("temp audio file doesn't exist, so not removing...")
logger.debug("issue building temp audio file path: os.path.splitext(os.path.basename(abspath))[0]: '{}'".format(os.path.splitext(os.path.basename(abspath))))

path = Path(tmp_audio)
if path.is_file():
os.remove(tmp_audio)
else:
logger.debug("temp audio file doesn't exist, so not removing...")

if not data.get('task_processing_success'):
return data
Expand Down

0 comments on commit c591f05

Please sign in to comment.