Export - GET /l/<list>/export?format=csv|txt downloads a list's titles in rank order, one per line, with no header or other fields (CSV gets a UTF-8 BOM for Excel) - Export menu in the list editor and, for the owner, on the public list page; hidden lists stay owner-only Custom lists - New "Custom" category for anything not built in (sports teams, drinks…): owner-named, slug from the title, entries added by hand or from an unfiltered Wikipedia search - Per-list artwork shape (square or tall), stored in a new lists.art column (migration 2) - Art can be uploaded while adding an entry, not only after Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
2.1 KiB
Go
55 lines
2.1 KiB
Go
package store
|
|
|
|
// Category describes one kind of list. The Key is what's stored in the
|
|
// database; everything else is presentation.
|
|
type Category struct {
|
|
Key string `json:"key"`
|
|
Label string `json:"label"` // plural, e.g. "Movies"
|
|
Singular string `json:"singular"` // e.g. "Movie"
|
|
Icon string `json:"icon"` // name of an inline SVG icon
|
|
Aspect string `json:"aspect"` // "poster" (2:3) or "square" (1:1)
|
|
// SubtitleHint labels the free-text subtitle field in the editor.
|
|
SubtitleHint string `json:"subtitleHint"`
|
|
}
|
|
|
|
var Categories = []Category{
|
|
{Key: "movie", Label: "Movies", Singular: "Movie", Icon: "film", Aspect: "poster", SubtitleHint: "Director"},
|
|
{Key: "tv", Label: "TV Shows", Singular: "TV Show", Icon: "tv", Aspect: "poster", SubtitleHint: "Network"},
|
|
{Key: "album", Label: "Albums", Singular: "Album", Icon: "disc", Aspect: "square", SubtitleHint: "Artist"},
|
|
{Key: "song", Label: "Songs", Singular: "Song", Icon: "music", Aspect: "square", SubtitleHint: "Artist"},
|
|
{Key: "game", Label: "Video Games", Singular: "Video Game", Icon: "gamepad", Aspect: "poster", SubtitleHint: "Developer"},
|
|
{Key: "theater", Label: "Theater", Singular: "Show", Icon: "masks", Aspect: "poster", SubtitleHint: "Creators"},
|
|
// Custom lists hold anything else (sports teams, drinks…); the owner
|
|
// names the list and adds entries by hand or from Wikipedia.
|
|
{Key: "custom", Label: "Custom", Singular: "Favorite", Icon: "star", Aspect: "square", SubtitleHint: "Subtitle"},
|
|
}
|
|
|
|
func CategoryByKey(key string) (Category, bool) {
|
|
for _, c := range Categories {
|
|
if c.Key == key {
|
|
return c, true
|
|
}
|
|
}
|
|
return Category{}, false
|
|
}
|
|
|
|
// TheaterProductions are the suggested production labels for theater items.
|
|
// The owner can also type anything else.
|
|
var TheaterProductions = []string{
|
|
"Broadway",
|
|
"Broadway Revival",
|
|
"Off-Broadway",
|
|
"West End",
|
|
"West End Revival",
|
|
"Off-West End",
|
|
"North American Tour",
|
|
"US National Tour",
|
|
"UK & Ireland Tour",
|
|
"Australian Production",
|
|
"International Tour",
|
|
"Regional",
|
|
"Concert / Staged Reading",
|
|
"Filmed / Pro-shot",
|
|
"Original Cast Recording",
|
|
}
|