Documentation
¶
Overview ¶
Package bookpreviews picks a few books to show as covers on each entry of a people, genre, tag, or publisher list. It sits below those packages because pkg/books imports them.
Index ¶
Constants ¶
View Source
const Limit = 3
Limit is the most books an entry previews.
Variables ¶
View Source
var ( // Genres previews the books in each genre. Genres = Source{/* contains filtered or unexported fields */} // Tags previews the books with each tag. Tags = Source{/* contains filtered or unexported fields */} // People previews the books each person wrote, then the books of files // they narrated, so a narrator who wrote nothing still shows covers. People = Source{ // contains filtered or unexported fields } // Publishers previews the books of each publisher's files and its // sub-publishers' files, as a publisher's file count counts both. Publishers = Source{ // contains filtered or unexported fields } )
Functions ¶
This section is empty.
Types ¶
type PreviewBook ¶
type PreviewBook struct {
ID int `json:"id"`
Title string `json:"title"`
CoverCacheKey string `json:"cover_cache_key"`
// The shape the gallery gives this book's cover in its library.
CoverAspect string `json:"cover_aspect" tstype:"ThumbnailAspect"`
}
PreviewBook is a book shown as a cover on a list entry.
type Previews ¶
type Previews map[int][]PreviewBook
Previews holds each entity's preview books, keyed by entity id.
func (Previews) For ¶
func (p Previews) For(entityID int) []PreviewBook
For returns an entity's preview books, an empty slice when it has none so the field serializes as [].
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source selects the books linked to an entity, as rows of (entity_id, book_id, priority) for the entity ids bound to every `?`. Lower priority books come first; within a priority, the newest released, then the newest added.
Click to show internal directories.
Click to hide internal directories.