Compare commits

..

2 commits

Author SHA1 Message Date
xenofem 287686da78 fix pdf progress meter when it's not the first collation item 2024-04-23 22:25:10 -04:00
xenofem faa9a30e8b omake 2024-04-23 22:19:06 -04:00

View file

@ -66,7 +66,7 @@ FXLESS_REGEX = re.compile('効果音(な|無)し', re.I)
FRONT_COVER_REGEX = re.compile('(?<!裏)表紙(?!裏)|(?<!back[-_ ])(?<!back)cover|(?<!ura[-_ ])(?<!ura)hyou?sh?i(?![-_ ]?ura)', re.I) FRONT_COVER_REGEX = re.compile('(?<!裏)表紙(?!裏)|(?<!back[-_ ])(?<!back)cover|(?<!ura[-_ ])(?<!ura)hyou?sh?i(?![-_ ]?ura)', re.I)
BACK_COVER_REGEX = re.compile('裏表紙|hyou?sh?i[-_ ]?ura|ura[-_ ]?hyou?sh?i', re.I) BACK_COVER_REGEX = re.compile('裏表紙|hyou?sh?i[-_ ]?ura|ura[-_ ]?hyou?sh?i', re.I)
BONUS_REGEX = re.compile('設定|キャラ|特典|ポスター|bonus', re.I) BONUS_REGEX = re.compile('設定|キャラ|特典|ポスター|bonus', re.I)
EPILOGUE_REGEX = re.compile('after|後日談|おまけ', re.I) EPILOGUE_REGEX = re.compile('after|後日談|おまけ|omake', re.I)
AFTERWORD_REGEX = re.compile('あとがき', re.I) AFTERWORD_REGEX = re.compile('あとがき', re.I)
SPLITS = [ SPLITS = [
{ 'later': TEXTLESS_REGEX }, { 'later': TEXTLESS_REGEX },
@ -552,7 +552,7 @@ class Collator:
file_path = self.dest / f'{idx:04d}.{image["ext"]}' file_path = self.dest / f'{idx:04d}.{image["ext"]}'
with open(file_path, 'wb') as f: with open(file_path, 'wb') as f:
f.write(image["image"]) f.write(image["image"])
count_progress(idx, len(image_extractors), 'pages collated') count_progress(idx - self.index, len(image_extractors), 'pages collated')
self.index += pdf.page_count self.index += pdf.page_count
return True return True