fix(web): add comic delete UI and fix container Cloudflare bypass for #6
- Add delete button (SVG X, hover-reveal) and confirmation modal to comic cards - Add DELETE /api/comics/delete endpoint with path traversal protection - Fix container downloads: delegate Cloudflare-blocked requests to FlareSolverr (headless Chrome sidecar) instead of retrying with Go HTTP client, whose Linux TCP fingerprint is flagged by Cloudflare even with network_mode: host - Add FlareSolverr service to docker-compose; inject FLARESOLVERR_URL env var - Add diagnostic logging to BatcaveBizMarkup request flow - Trim URL whitespace before storing in download job - Guard Archive() against empty filelist; fix runJob error-check ordering
This commit is contained in:
@@ -29,6 +29,7 @@ func TestArchive(t *testing.T) {
|
||||
c := &Comic{
|
||||
Title: title,
|
||||
LibraryPath: tmpDir,
|
||||
Filelist: []string{"TestComic 001.jpg", "TestComic 002.jpg", "TestComic 003.png"},
|
||||
}
|
||||
|
||||
err := c.Archive()
|
||||
@@ -67,6 +68,7 @@ func TestArchive(t *testing.T) {
|
||||
c := &Comic{
|
||||
Title: title,
|
||||
LibraryPath: tmpDir,
|
||||
Filelist: []string{"page-001.jpg"},
|
||||
}
|
||||
|
||||
err := c.Archive()
|
||||
@@ -86,11 +88,9 @@ func TestArchive(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("handles empty directory", func(t *testing.T) {
|
||||
t.Run("creates nothing when filelist is empty", func(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
title := "EmptyComic"
|
||||
comicDir := filepath.Join(tmpDir, title)
|
||||
os.MkdirAll(comicDir, os.ModePerm)
|
||||
|
||||
c := &Comic{
|
||||
Title: title,
|
||||
@@ -102,9 +102,9 @@ func TestArchive(t *testing.T) {
|
||||
t.Fatalf("Archive() unexpected error: %v", err)
|
||||
}
|
||||
|
||||
archivePath := filepath.Join(comicDir, title+".cbz")
|
||||
if _, err := os.Stat(archivePath); os.IsNotExist(err) {
|
||||
t.Fatalf("expected archive %s to exist even if empty", archivePath)
|
||||
archivePath := filepath.Join(tmpDir, title, title+".cbz")
|
||||
if _, err := os.Stat(archivePath); !os.IsNotExist(err) {
|
||||
t.Fatalf("expected no archive to be created for empty filelist")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user