feat(series): list_pages returns full image_url for the reader
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,7 @@ class SeriesService:
|
||||
SeriesPage.page_number,
|
||||
ImageRecord.sha256,
|
||||
ImageRecord.mime,
|
||||
ImageRecord.path,
|
||||
)
|
||||
.join(ImageRecord, ImageRecord.id == SeriesPage.image_id)
|
||||
.where(SeriesPage.series_tag_id == series_tag_id)
|
||||
@@ -75,6 +76,7 @@ class SeriesService:
|
||||
"image_id": r.image_id,
|
||||
"page_number": r.page_number,
|
||||
"thumbnail_url": thumbnail_url(r.sha256, r.mime),
|
||||
"image_url": f"/images/{r.path.split('/images/', 1)[-1]}",
|
||||
}
|
||||
for r in rows
|
||||
],
|
||||
|
||||
@@ -118,6 +118,7 @@ async def test_list_pages_shape_and_guards(db):
|
||||
assert out["pages"][0]["image_id"] == i1
|
||||
assert out["pages"][0]["page_number"] == 1
|
||||
assert out["pages"][0]["thumbnail_url"]
|
||||
assert out["pages"][0]["image_url"].startswith("/images/")
|
||||
g = await TagService(db).find_or_create("notser", TagKind.general)
|
||||
with pytest.raises(SeriesError):
|
||||
await svc.list_pages(g.id)
|
||||
|
||||
Reference in New Issue
Block a user