Compare commits

...

2 Commits

Author SHA1 Message Date
root
e47a3c187b Merge branch 'master' of https://muxi.at/git/diez/unusualarchive 2023-05-16 21:56:08 +02:00
root
2f2cb45947 fixed import thumbnail 2023-05-16 21:55:05 +02:00

View File

@ -54,10 +54,9 @@ for filename in os.listdir(folder_path):
with open(os.path.join(folder_path, filename), 'rb') as f: with open(os.path.join(folder_path, filename), 'rb') as f:
video.file.save(filename, f) video.file.save(filename, f)
filepath = find_image_file("V"+str(id), folder_path) #filepath = find_image_file("V"+str(id), folder_path)
if filepath and os.path.exists(filepath): with open(filepath, 'rb') as f:
with open(filepath, 'rb') as f: video.thumbnail.save(filename, f)
video.thumbnail.save(filename, f)
# Save the Video object to the database # Save the Video object to the database
video.save() video.save()