feat(subsonic): support dsub edgecase for queries by decade
* Found a podcast that returns 403 without a UserAgent string so I added one. URL is https://feeds.buzzsprout.com/132359.rss * Fixed lint issues including needed error checking. * DSub swaps fromYear and toYear so swap them back in that case. TBD -- fix the same logic in ServeGetRandomSongs
This commit is contained in:
@@ -115,10 +115,12 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response {
|
||||
case "alphabeticalByName":
|
||||
q = q.Order("right_path")
|
||||
case "byYear":
|
||||
q = q.Where(
|
||||
"tag_year BETWEEN ? AND ?",
|
||||
params.GetOrInt("fromYear", 1800),
|
||||
params.GetOrInt("toYear", 2200))
|
||||
fromYear := params.GetOrInt("fromYear", 1800)
|
||||
toYear := params.GetOrInt("toYear", 2200)
|
||||
if fromYear > toYear {
|
||||
toYear, fromYear = fromYear, toYear
|
||||
}
|
||||
q = q.Where("tag_year BETWEEN ? AND ?", fromYear, toYear)
|
||||
q = q.Order("tag_year")
|
||||
case "byGenre":
|
||||
genre, _ := params.Get("genre")
|
||||
|
||||
@@ -125,10 +125,12 @@ func (c *Controller) ServeGetAlbumListTwo(r *http.Request) *spec.Response {
|
||||
case "alphabeticalByName":
|
||||
q = q.Order("tag_title")
|
||||
case "byYear":
|
||||
q = q.Where(
|
||||
"tag_year BETWEEN ? AND ?",
|
||||
params.GetOrInt("fromYear", 1800),
|
||||
params.GetOrInt("toYear", 2200))
|
||||
fromYear := params.GetOrInt("fromYear", 1800)
|
||||
toYear := params.GetOrInt("toYear", 2200)
|
||||
if fromYear > toYear {
|
||||
toYear, fromYear = fromYear, toYear
|
||||
}
|
||||
q = q.Where("tag_year BETWEEN ? AND ?", fromYear, toYear)
|
||||
q = q.Order("tag_year")
|
||||
case "byGenre":
|
||||
genre, _ := params.Get("genre")
|
||||
|
||||
Reference in New Issue
Block a user