Skip to content

Commit 02c0ede

Browse files
committed
Improve the display order
for the case extra files in the directory
1 parent cec907e commit 02c0ede

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

comiclib/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def extract_archive(id: str, force: bool = True, db: Session = Depends(get_db)):
285285
return JSONResponse({"operation": "", "error": "This ID doesn't exist on the server.", "success": 0}, status.HTTP_400_BAD_REQUEST)
286286
path = Path(settings.content) / a.path
287287
if path.is_dir():
288-
pages = [f"./api/archives/{id}/page?path="+quote(p.name, safe='') for p in ordered(path.iterdir()) if is_image(p)]
288+
pages = [f"./api/archives/{id}/page?path="+quote(p.name, safe='') for p in ordered(filter(is_image, path.iterdir()))]
289289
elif ArchiveFile.support_formats.fullmatch(path.name):
290290
with ArchiveFile(path) as z:
291291
pages = [f"./api/archives/{id}/page?path="+quote(filename, safe='') for filename in ordered(map(lambda z_info: z_info.filename, filter(lambda z_info: not z_info.is_dir() and is_image(z_info.filename), z.infolist())))]

0 commit comments

Comments
 (0)