Move functions out of daemon

This commit is contained in:
bashrc committed 2021-06-07 18:55:25 +01:00
1 parent 84d6e50820
commit 54f4e290f3
2 files changed
+38 -32

No files matched your search

+25
View File
@@ -283,3 +283,28 @@ def archiveMedia(baseDir: str, archiveDirectory: str, maxWeeks=4) -> None:
# archive to /dev/null
rmtree(os.path.join(baseDir + '/media', weekDir))
break
def pathIsImage(path: str) -> bool:
if path.endswith('.png') or \
path.endswith('.jpg') or \
path.endswith('.gif') or \
path.endswith('.svg') or \
path.endswith('.avif') or \
path.endswith('.webp'):
return True
return False
def pathIsVideo(path: str) -> bool:
if path.endswith('.ogv') or \
path.endswith('.mp4'):
return True
return False
def pathIsAudio(path: str) -> bool:
if path.endswith('.ogg') or \
path.endswith('.mp3'):
return True
return False