Passing the validator

This commit is contained in:
Sinuhe Tellez 2017-03-23 23:26:04 -04:00
parent 79ce7b3c5b
commit 15ba452994
1 changed files with 26 additions and 14 deletions

12
main.go
View File

@ -114,6 +114,11 @@ func writeCatalogFeed(w io.Writer, u *url.URL) error {
feed := &CatalogFeed{ID: u.Path, Title: "Catalog feed in " + u.Path}
feed.Author = &atom.Person{Name: author, Email: authorEmail, URI: authorUri}
feed.Updated = updated
feed.Link = []atom.Link{{
Rel: "start",
Href: "/",
Type: "application/atom+xml;profile=opds-catalog;kind=navigation",
}}
abs_path := filepath.Join(dirRoot, u.Path)
fis, err := ioutil.ReadDir(abs_path)
@ -131,6 +136,7 @@ func writeCatalogFeed(w io.Writer, u *url.URL) error {
ID: filepath.Join(u.Path, fi.Name()),
Title: fi.Name(),
Updated: updated,
Published: updated,
Link: []atom.Link{link},
}
feed.Entry = append(feed.Entry, entry)
@ -150,6 +156,11 @@ func writeAcquisitionFeed(w io.Writer, u *url.URL) error {
feed.Updated = updated
feed.Title = filepath.Base(u.Path)
feed.Author = &atom.Person{Name: author, Email: authorEmail, URI: authorUri}
feed.Link = []atom.Link{{
Rel: "start",
Href: "/",
Type: "application/atom+xml;profile=opds-catalog;kind=navigation",
}}
abs_path := filepath.Join(dirRoot, u.Path)
fis, err := ioutil.ReadDir(abs_path)
@ -160,6 +171,7 @@ func writeAcquisitionFeed(w io.Writer, u *url.URL) error {
ID: u.Path,
Title: filepath.Base(u.Path),
Updated: updated,
Published: updated,
}
for _, fi := range fis {
ext := filepath.Ext(fi.Name())