Kill local cache thumbnails

This commit is contained in:
Nutbuster 2022-11-09 16:42:45 +11:00
parent 7711c6b414
commit e5c9e5ee1a
1 changed files with 1 additions and 51 deletions

View File

@ -3,57 +3,7 @@ label splashscreen:
$ persistent.splashtype = random.randint(0,2000 - 1)
$ renpy.movie_cutscene("images/intros/CaveManonProductions.webm")
python:
#import pygame
CACHE_PATH = config.basedir.replace("\\","/") + "/game/cache/"
if renpy.android:
CACHE_PATH = os.environ['ANDROID_PUBLIC'] + "/cache/"
# (src_image: FactorScale; name: string, ext: string) FactorScale refers to an image scaled using im.FactorScale()
def save_thumb(src_image, name, ext):
final = CACHE_PATH+"thmb_"+name+'.'+ext
if (os.path.exists(final)):
pass
else:
data = src_image.load() #Returns a pygame surface
#pygame.image.save(data, final) #Saves the image to file
#print('O', final)
#save_thumb(NOT_UNLOCKED_COVER,"default","jpg")
path_testing = []
for x in (gallery_dic.items()):
key = x[0]
value = x[1]
#slow, roundabout but it works
if key in path_testing:
pass
else:
for c in CG_PATHS:
#print(c, os.path.basename(c['path']))
if (c['name'] == key):
final_dir = os.path.join(CACHE_PATH, "thmb_"+os.path.normpath(c['path']))
if (os.path.exists(final_dir)):
pass
else:
os.makedirs(final_dir)
path_testing.append(key)
for y in value:
#print(y['cg'])
if type(y['cg']) is Movie:
pass
else:
save_thumb(y['cg'], y['fn'], y['ext'])
pass
if persistent.autoup == 10000:
if persistent.autoup == 10000
python:
UpdateCheck()
if persistent.updateresult != "No new version is available":