forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-05-08 06:17:50 +02:00
parent 9541e3db47
commit eafc895724
1 changed files with 4 additions and 1 deletions

View File

@ -228,7 +228,10 @@ def api_comment(v):
if image == "": return {"error":"Image upload failed"}
if v.admin_level > 2 and level == 1:
if parent_post.id == 37696:
num = int(sorted(os.listdir('files/assets/images/rDrama/sidebar'))[-1].split('.webp')[0]) + 1
li = os.listdir('files/assets/images/rDrama/sidebar')
li = [int(x.split('.webp')[0]) for x in li]
li = sorted(li)
num = li[[-1]] + 1
print(num)
filename = f'files/assets/images/rDrama/sidebar/{num}.webp'
copyfile(oldname, filename)