Add delete file helper function

This commit is contained in:
JonnyWong16 2020-05-23 16:02:07 -07:00
parent ef72832e5a
commit 39e1caec0f
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -1270,3 +1270,13 @@ def browse_path(path=None, include_hidden=False, filter_ext=''):
break break
return output return output
def delete_file(file_path):
logger.info("Tautulli Helpers :: Deleting file: %s", file_path)
try:
os.remove(file_path)
return True
except OSError:
logger.error("Tautulli Helpers :: Failed to delete file: %s", file_path)
return False