Copy file if not image

master
Bob Mottram 2019-08-30 20:01:16 +01:00
parent f5097eafbd
commit b091349c9b
1 changed files with 6 additions and 4 deletions

View File

@ -95,7 +95,7 @@ def attachMedia(baseDir: str,httpPrefix: str,domain: str,port: int, \
if fileExtension=='jpeg':
fileExtension='jpg'
if fileExtension=='mpeg':
if mediaType=='audio' and fileExtension=='mpeg':
fileExtension='mp3'
if port:
@ -119,9 +119,11 @@ def attachMedia(baseDir: str,httpPrefix: str,domain: str,port: int, \
attachmentJson['blurhash']=getImageHash(imageFilename)
postJson['attachment']=[attachmentJson]
if baseDir and mediaType=='image':
if baseDir:
if mediaType=='image':
removeMetaData(imageFilename,mediaFilename)
#copyfile(imageFilename,mediaFilename)
else:
copyfile(imageFilename,mediaFilename)
return postJson