forked from rDrama/rDrama
sfd
parent
206a4c81a2
commit
9541e3db47
|
@ -228,14 +228,14 @@ def api_comment(v):
|
||||||
if image == "": return {"error":"Image upload failed"}
|
if image == "": return {"error":"Image upload failed"}
|
||||||
if v.admin_level > 2 and level == 1:
|
if v.admin_level > 2 and level == 1:
|
||||||
if parent_post.id == 37696:
|
if parent_post.id == 37696:
|
||||||
num = int(os.listdir('files/assets/images/rDrama/sidebar')[-1].split('.webp')[0]) + 1
|
num = int(sorted(os.listdir('files/assets/images/rDrama/sidebar'))[-1].split('.webp')[0]) + 1
|
||||||
print(num)
|
print(num)
|
||||||
filename = f'files/assets/images/rDrama/sidebar/{num}.webp'
|
filename = f'files/assets/images/rDrama/sidebar/{num}.webp'
|
||||||
copyfile(oldname, filename)
|
copyfile(oldname, filename)
|
||||||
process_image(v.patron, filename, 400)
|
process_image(v.patron, filename, 400)
|
||||||
print(num)
|
print(num)
|
||||||
elif parent_post.id == 37697:
|
elif parent_post.id == 37697:
|
||||||
num = int(os.listdir('files/assets/images/rDrama/banners')[-1].split('.webp')[0]) + 1
|
num = int(sorted(os.listdir('files/assets/images/rDrama/banners'))[-1].split('.webp')[0]) + 1
|
||||||
filename = f'files/assets/images/rDrama/banners/{num}.webp'
|
filename = f'files/assets/images/rDrama/banners/{num}.webp'
|
||||||
copyfile(oldname, filename)
|
copyfile(oldname, filename)
|
||||||
process_image(v.patron, filename)
|
process_image(v.patron, filename)
|
||||||
|
|
Loading…
Reference in New Issue