feat: handle missing photos / pictures
This commit is contained in:
+8
-2
@@ -120,12 +120,18 @@ class Build:
|
|||||||
def __picture_handler(self, id):
|
def __picture_handler(self, id):
|
||||||
self.config.p_build_pictures.mkdir(parents=True, exist_ok=True)
|
self.config.p_build_pictures.mkdir(parents=True, exist_ok=True)
|
||||||
file = f"{id}.svg"
|
file = f"{id}.svg"
|
||||||
shutil.copyfile(self.config.p_data_pictures / file, self.config.p_build_pictures / file)
|
try:
|
||||||
|
shutil.copyfile(self.config.p_data_pictures / file, self.config.p_build_pictures / file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
tqdm.write(f"\033[31mPicture #{id} not found\033[0m")
|
||||||
|
|
||||||
def __photo_handler(self, id):
|
def __photo_handler(self, id):
|
||||||
self.config.p_build_photos.mkdir(parents=True, exist_ok=True)
|
self.config.p_build_photos.mkdir(parents=True, exist_ok=True)
|
||||||
file = f"{id}.jpg"
|
file = f"{id}.jpg"
|
||||||
shutil.copyfile(self.config.p_data_photos / file, self.config.p_build_photos / file)
|
try:
|
||||||
|
shutil.copyfile(self.config.p_data_photos / file, self.config.p_build_photos / file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
tqdm.write(f"\033[31mPhoto #{id} not found\033[0m")
|
||||||
|
|
||||||
# cached
|
# cached
|
||||||
def __build_chapter(self, edition, edition_name, number, chapter, next_chapter=None):
|
def __build_chapter(self, edition, edition_name, number, chapter, next_chapter=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user