Add the avility to edit metadata and delete books after submission

This commit is contained in:
Las Zenow 2018-04-07 22:58:59 +00:00
parent de58f0251e
commit 8d126fbe7a
7 changed files with 93 additions and 48 deletions

View file

@ -50,6 +50,30 @@ func (h handler) load(tmpl string, data interface{}) {
}
}
func (h handler) booksInSubmission(bookIDs []string, submissionID string) bool {
submissions, err := h.db.GetSubmission(submissionID)
if err != nil {
return false
}
for _, bookID := range bookIDs {
if bookID == "" {
continue
}
found := false
for _, s := range submissions {
if s.BookID == bookID && !s.Book.Active {
found = true
break
}
}
if !found {
return false
}
}
return true
}
type StatsGatherer struct {
db database.DB
store storage.Store