feat: check tv ervery hour and download backdrop image

This commit is contained in:
Simon Ding
2024-07-19 10:22:46 +08:00
parent a52e1c6277
commit b9a418754b
3 changed files with 75 additions and 9 deletions

View File

@@ -159,6 +159,15 @@ func (c *Client) GetMediaWatchlist(mediaType media.MediaType) []*ent.Media {
return list
}
func (c *Client) GetEpisode(seriesId, seasonNum, episodeNum int) (*ent.Episode, error) {
return c.ent.Episode.Query().Where(episode.MediaID(seriesId), episode.SeasonNumber(seasonNum),
episode.EpisodeNumber(episodeNum)).First(context.TODO())
}
func (c *Client) UpdateEpiode(episodeId int, name, overview string) error {
return c.ent.Episode.Update().Where(episode.ID(episodeId)).SetTitle(name).SetOverview(overview).Exec(context.TODO())
}
type MediaDetails struct {
*ent.Media
Episodes []*ent.Episode `json:"episodes"`