Fixed issue where zips wouldn't be closed after trying to read comicinfo.xml.
This commit is contained in:
@@ -71,12 +71,14 @@ func Index(w http.ResponseWriter, r *http.Request) {
|
||||
zf, err := zip.OpenReader(path)
|
||||
if err != nil {
|
||||
return nil
|
||||
} else {
|
||||
}
|
||||
|
||||
defer zf.Close()
|
||||
for i := range zf.File {
|
||||
if strings.ToLower(zf.File[i].Name) == "comicinfo.xml" {
|
||||
cif, err := zf.File[i].Open()
|
||||
if err != nil {
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
cib, _ := io.ReadAll(cif)
|
||||
_ = cif.Close()
|
||||
@@ -85,7 +87,6 @@ func Index(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
entry := &opds.Entry{
|
||||
ID: utils.FileBasename(d.Name()),
|
||||
|
||||
Reference in New Issue
Block a user