mirror of
https://github.com/blacktwin/JBOPS.git
synced 2025-12-11 19:37:18 +00:00
Merge c5eec4ff2e into 4580ca0bc6
This commit is contained in:
commit
236213e448
@ -73,9 +73,12 @@ for library in library_name:
|
|||||||
image_path = u'{}/{}.jpg'.format(movie_path, name)
|
image_path = u'{}/{}.jpg'.format(movie_path, name)
|
||||||
elif child.type == 'show':
|
elif child.type == 'show':
|
||||||
image_path = u'{}/{}.jpg'.format(show_path, name)
|
image_path = u'{}/{}.jpg'.format(show_path, name)
|
||||||
# Check if file already exists
|
|
||||||
if os.path.isfile(image_path):
|
# If the poster file to be written already exists, append an incrementing number to the filename
|
||||||
print("ERROR, %s already exist" % image_path)
|
increment = 0
|
||||||
else:
|
while os.path.isfile(image_path):
|
||||||
# Save to directory
|
increment += 1
|
||||||
urllib.request.urlretrieve(thumb_url, image_path)
|
image_path = u'{}/{}_{}.jpg'.format(os.path.dirname(image_path), name, increment)
|
||||||
|
|
||||||
|
# Save to directory
|
||||||
|
urllib.request.urlretrieve(thumb_url, image_path)
|
||||||
Loading…
Reference in New Issue
Block a user