change logging of skipped chapters and fix error list
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
This commit is contained in:
parent
7fb45b96f7
commit
ae42a19aed
2 changed files with 12 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,6 +9,7 @@ downloads/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
chaps.txt
|
chaps.txt
|
||||||
|
mangas.txt
|
||||||
.idea/
|
.idea/
|
||||||
venv
|
venv
|
||||||
|
|
||||||
|
|
|
@ -164,10 +164,13 @@ class MangaDLP:
|
||||||
return_infos = self.archive_chapter(return_infos["chapter_path"])
|
return_infos = self.archive_chapter(return_infos["chapter_path"])
|
||||||
error_chapters.append(return_infos.get("error"))
|
error_chapters.append(return_infos.get("error"))
|
||||||
skipped_chapters.append(return_infos.get("skipped"))
|
skipped_chapters.append(return_infos.get("skipped"))
|
||||||
|
# check if chapter was skipped
|
||||||
|
try:
|
||||||
|
return_infos["skipped"]
|
||||||
|
# chapter was not skipped
|
||||||
|
except KeyError:
|
||||||
# done with chapter
|
# done with chapter
|
||||||
print("INFO: Done with chapter")
|
print("INFO: Done with chapter\n")
|
||||||
print("-----------------------------------------\n")
|
|
||||||
|
|
||||||
# done with manga
|
# done with manga
|
||||||
print(f"{print_divider}")
|
print(f"{print_divider}")
|
||||||
|
@ -176,6 +179,10 @@ class MangaDLP:
|
||||||
skipped_chapters = list(filter(None, skipped_chapters))
|
skipped_chapters = list(filter(None, skipped_chapters))
|
||||||
if len(skipped_chapters) >= 1:
|
if len(skipped_chapters) >= 1:
|
||||||
print(f"INFO: Skipped chapters:\n{', '.join(skipped_chapters)}")
|
print(f"INFO: Skipped chapters:\n{', '.join(skipped_chapters)}")
|
||||||
|
# filter error list
|
||||||
|
error_chapters = list(filter(None, error_chapters))
|
||||||
|
if len(error_chapters) >= 1:
|
||||||
|
print(f"INFO: Chapters with errors:\n{', '.join(error_chapters)}")
|
||||||
print(f"{print_divider}\n")
|
print(f"{print_divider}\n")
|
||||||
|
|
||||||
# once called per chapter
|
# once called per chapter
|
||||||
|
|
Loading…
Reference in a new issue