a
This commit is contained in:
@@ -95,6 +95,8 @@ func (c *Controller) ServeScrobble(r *http.Request) *spec.Response {
|
||||
if err := scrobbleStatsUpdatePodcastEpisode(c.dbc, id.Value); err != nil {
|
||||
return spec.NewError(0, "error updating stats: %v", err)
|
||||
}
|
||||
default:
|
||||
return spec.NewError(10, "can't scrobble type %s", id.Type)
|
||||
}
|
||||
|
||||
if scrobbleTrack.Track == "" {
|
||||
|
||||
@@ -29,6 +29,9 @@ func Locate(dbc *db.DB, id specid.ID) (Result, error) {
|
||||
case specid.PodcastEpisode:
|
||||
var pe db.PodcastEpisode
|
||||
return &pe, dbc.Preload("Podcast").Where("id=? AND status=?", id.Value, db.PodcastEpisodeStatusCompleted).Find(&pe).Error
|
||||
case specid.InternetRadioStation:
|
||||
var irs db.InternetRadioStation
|
||||
return &irs, dbc.Where("id=?", id.Value).Find(&irs).Error
|
||||
default:
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user