Use archives instead of go-unarr

This commit is contained in:
Milan Nikolic
2026-06-22 22:07:40 +02:00
parent f555f09e59
commit 3a627d92e1
9 changed files with 1145 additions and 163 deletions
+1 -12
View File
@@ -11,7 +11,6 @@ import (
"github.com/fvbommel/sortorder"
"github.com/gen2brain/go-fitz"
"github.com/gen2brain/go-unarr"
)
// coverArchive extracts cover from archive.
@@ -31,17 +30,7 @@ func (c *Converter) coverArchive(fileName string) (image.Image, error) {
cover := c.coverName(images)
archive, err := unarr.NewArchive(fileName)
if err != nil {
return nil, fmt.Errorf("coverArchive: %w", err)
}
defer archive.Close()
if err = archive.EntryFor(cover); err != nil {
return nil, fmt.Errorf("coverArchive: %w", err)
}
data, err := archive.ReadAll()
data, err := c.archiveFile(fileName, cover)
if err != nil {
return nil, fmt.Errorf("coverArchive: %w", err)
}