Fixed bug with image upload

This commit is contained in:
Krateng 2020-01-25 05:10:36 +01:00
parent 23e076f93a
commit c6deb15437
3 changed files with 6 additions and 6 deletions

View File

@ -48,7 +48,7 @@ Also neat: You can use your **custom artist or track images**.
3) Download Maloja with the command `pip install malojaserver`. Make sure to use the correct python version (Use `pip3` if necessary).
4) (Recommended) Put your server behind a reverse proxy for SSL encryption.
4) (Recommended) Put your server behind a reverse proxy for SSL encryption. Make sure that you're proxying to the IPv6 address unless you changed your settings to use IPv4. If you're running Maloja in a container, make sure to expose port 32400 (or whichever port you have chosen in your settings).
### Update

View File

@ -7,7 +7,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,2,3
version = 2,2,4
versionstr = ".".join(str(n) for n in version)

View File

@ -409,8 +409,8 @@ def set_image(b64,**keys):
b64 = base64.b64decode(b64)
filename = "webupload" + str(int(datetime.datetime.now().timestamp())) + "." + type
for folder in get_all_possible_filenames(**keys):
if os.path.exists(folder):
with open(os.path.join(folder,filename),"wb") as f:
if os.path.exists(datadir(folder)):
with open(datadir(folder,filename),"wb") as f:
f.write(b64)
# set as current picture in rotation
@ -419,8 +419,8 @@ def set_image(b64,**keys):
return
folder = get_all_possible_filenames(**keys)[0]
os.makedirs(folder)
with open(os.path.join(folder,filename),"wb") as f:
os.makedirs(datadir(folder))
with open(datadir(folder,filename),"wb") as f:
f.write(b64)
# set as current picture in rotation