This commit is contained in:
cwx committed 2023-02-14 04:42:54 +08:00
1 parent 3c8d44f909
commit f6f6b41c5f
2 files changed
+4 -34

No files matched your search

+3 -33
View File
@@ -420,44 +420,14 @@ class comicInfo():
@classmethod
def updateComicDate(cls,date=None):
data = {}
update_at = cls.str_update_at
if date != None:
update_at = date
comic_name = cls.str_comic_name
update_path = pathStr.base_comic_update()
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
if os.path.exists(update_path):
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
data[comic_name] = update_at
with open(update_path,"w") as fs:
fs.write(json.dumps(data))
fs.close()
dbUtils.setComic(cls.str_comic_name, update_at, "update")
@classmethod
def isUpdateComic(cls):
is_update = True
data = {}
c_update_at = cls.str_update_at
comic_name = cls.str_comic_name
update_path = pathStr.base_comic_update()
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
try:
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
except:
data = {}
comic_update = data.get(comic_name)
if comic_name != None and comic_update == c_update_at:
is_update = False
return is_update
return dbUtils.query(cls.str_comic_name, cls.str_update_at,"update")
@classmethod
def comicChapterDownload(cls,imgs,names):