feat: episode status

This commit is contained in:
Simon Ding
2024-07-15 14:41:49 +08:00
parent 68897e85f9
commit 9a3a4addeb
15 changed files with 288 additions and 50 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"polaris/db"
"polaris/ent"
"polaris/ent/episode"
"polaris/ent/history"
"polaris/log"
"polaris/pkg/torznab"
@@ -123,6 +124,7 @@ func (s *Server) searchAndDownload(seriesId, seasonNum, episodeNum int) (*string
Status: history.StatusRunning,
Saved: torrent.Save(),
})
s.db.SetEpisodeStatus(ep.ID, episode.StatusDownloading)
if err != nil {
return nil, errors.Wrap(err, "save record")
}