add some podcast nit changes and make podcasts mandatory

This commit is contained in:
Alex McGrath
2021-01-11 11:50:44 +00:00
committed by Senan Kelly
parent 9c4286b0e2
commit 37fca3a087
16 changed files with 332 additions and 267 deletions

View File

@@ -128,7 +128,6 @@ type templateData struct {
DefaultListenBrainzURL string
SelectedUser *db.User
//
PodcastsEnabled bool
Podcasts []*db.Podcast
}

View File

@@ -46,10 +46,6 @@ func (c *Controller) ServeHome(r *http.Request) *Response {
c.DB.Table("artists").Count(&data.ArtistCount)
c.DB.Table("albums").Count(&data.AlbumCount)
c.DB.Table("tracks").Count(&data.TrackCount)
data.PodcastsEnabled = c.Podcasts.PodcastBasePath != ""
if data.PodcastsEnabled {
c.DB.Find(&data.Podcasts)
}
// ** begin lastfm box
scheme := firstExisting(
"http", // fallback
@@ -92,6 +88,8 @@ func (c *Controller) ServeHome(r *http.Request) *Response {
for profile := range encode.Profiles() {
data.TranscodeProfiles = append(data.TranscodeProfiles, profile)
}
// ** begin podcasts box
c.DB.Find(&data.Podcasts)
//
return &Response{
template: "home.tmpl",