not use watchdog. as wip

This commit is contained in:
Qing 2023-01-08 21:59:26 +08:00
parent bfb69347c2
commit 65d8af8fc9
2 changed files with 7 additions and 5 deletions

View File

@ -122,11 +122,13 @@ class FileManager(FileSystemEventHandler):
@property @property
def media_names(self): def media_names(self):
return self.image_dir_filenames # return self.image_dir_filenames
return self._media_names(self.root_directory)
@property @property
def output_media_names(self): def output_media_names(self):
return self.output_dir_filenames return self._media_names(self.output_dir)
# return self.output_dir_filenames
@staticmethod @staticmethod
def _media_names(directory: Path): def _media_names(directory: Path):

View File

@ -109,10 +109,10 @@ def medias(tab):
response = make_response(jsonify(thumb.media_names), 200) response = make_response(jsonify(thumb.media_names), 200)
else: else:
response = make_response(jsonify(thumb.output_media_names), 200) response = make_response(jsonify(thumb.output_media_names), 200)
response.last_modified = thumb.modified_time[tab] # response.last_modified = thumb.modified_time[tab]
# response.cache_control.no_cache = True # response.cache_control.no_cache = True
# response.cache_control.max_age = 0 # response.cache_control.max_age = 0
response.make_conditional(request) # response.make_conditional(request)
return response return response
@ -374,7 +374,7 @@ def main(args):
app.config["THUMBNAIL_MEDIA_ROOT"] = args.input app.config["THUMBNAIL_MEDIA_ROOT"] = args.input
app.config["THUMBNAIL_MEDIA_THUMBNAIL_ROOT"] = os.path.join(args.output_dir, 'lama_cleaner_thumbnails') app.config["THUMBNAIL_MEDIA_THUMBNAIL_ROOT"] = os.path.join(args.output_dir, 'lama_cleaner_thumbnails')
thumb.output_dir = Path(args.output_dir) thumb.output_dir = Path(args.output_dir)
thumb.start() # thumb.start()
# try: # try:
# while True: # while True:
# time.sleep(1) # time.sleep(1)