mirror of https://gitlab.com/bashrc2/epicyon
Copy file if not image
parent
f5097eafbd
commit
b091349c9b
10
media.py
10
media.py
|
@ -95,7 +95,7 @@ def attachMedia(baseDir: str,httpPrefix: str,domain: str,port: int, \
|
||||||
|
|
||||||
if fileExtension=='jpeg':
|
if fileExtension=='jpeg':
|
||||||
fileExtension='jpg'
|
fileExtension='jpg'
|
||||||
if fileExtension=='mpeg':
|
if mediaType=='audio' and fileExtension=='mpeg':
|
||||||
fileExtension='mp3'
|
fileExtension='mp3'
|
||||||
|
|
||||||
if port:
|
if port:
|
||||||
|
@ -119,9 +119,11 @@ def attachMedia(baseDir: str,httpPrefix: str,domain: str,port: int, \
|
||||||
attachmentJson['blurhash']=getImageHash(imageFilename)
|
attachmentJson['blurhash']=getImageHash(imageFilename)
|
||||||
postJson['attachment']=[attachmentJson]
|
postJson['attachment']=[attachmentJson]
|
||||||
|
|
||||||
if baseDir and mediaType=='image':
|
if baseDir:
|
||||||
removeMetaData(imageFilename,mediaFilename)
|
if mediaType=='image':
|
||||||
#copyfile(imageFilename,mediaFilename)
|
removeMetaData(imageFilename,mediaFilename)
|
||||||
|
else:
|
||||||
|
copyfile(imageFilename,mediaFilename)
|
||||||
|
|
||||||
return postJson
|
return postJson
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue