diff --git a/main.go b/main.go index 04c9fa3..0b1f84e 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,6 @@ type AcquisitionFeed struct { type CatalogFeed atom.Feed -const catalogType = "application/atom+xml;profile=opds-catalog" const acquisitionType = "application/atom+xml;profile=opds-catalog;kind=acquisition" const navegationType = "application/atom+xml;profile=opds-catalog;kind=navigation" @@ -130,17 +129,11 @@ func writeCatalogFeed(w io.Writer, u *url.URL) error { } for _, fi := range fis { - isAcquisition, _ := isAcquisitionFeed(filepath.Join(abs_path, fi.Name())) - - var linkType string - if linkType = catalogType; isAcquisition { - linkType = acquisitionType - } link := atom.Link{ Rel: "subsection", Title: fi.Name(), Href: filepath.Join(u.EscapedPath(), url.PathEscape(fi.Name())), - Type: linkType, + Type: acquisitionType, } entry := &atom.Entry{ ID: filepath.Join(u.Path, fi.Name()), @@ -169,7 +162,7 @@ func writeAcquisitionFeed(w io.Writer, u *url.URL) error { feed.Link = []atom.Link{{ Rel: "start", Href: "/", - Type: "application/atom+xml;profile=opds-catalog;kind=navigation", + Type: navegationType, }} abs_path := filepath.Join(dirRoot, u.Path) @@ -191,6 +184,7 @@ func writeAcquisitionFeed(w io.Writer, u *url.URL) error { rel = "http://opds-spec.org/image/thumbnail" } link := atom.Link{ + Title: fi.Name(), Rel: rel, Type: mime_type, Href: filepath.Join(u.EscapedPath(), url.PathEscape(fi.Name())),