mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
fix: get episode
This commit is contained in:
@@ -260,8 +260,9 @@ func (c *Engine) findEpisodeFilesPreMoving(historyId int) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, id := range episodeIds {
|
for _, id := range episodeIds {
|
||||||
ep, err := c.db.GetEpisode(his.MediaID, his.SeasonNum, id)
|
ep, err := c.db.GetEpisodeByID(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Warnf("query episode error (%d): %v", id, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
task.WalkFunc()(func(path string, info fs.FileInfo) error {
|
task.WalkFunc()(func(path string, info fs.FileInfo) error {
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ func (s *Server) RemoveActivity(c *gin.Context) (interface{}, error) {
|
|||||||
episodeIds := s.core.GetEpisodeIds(his)
|
episodeIds := s.core.GetEpisodeIds(his)
|
||||||
|
|
||||||
for _, id := range episodeIds {
|
for _, id := range episodeIds {
|
||||||
ep, err := s.db.GetEpisode(his.MediaID, his.SeasonNum, id)
|
ep, err := s.db.GetEpisodeByID(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("get episode error: %v", err)
|
log.Warnf("get episode (%d) error: %v", id, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !s.db.IsEpisodeDownloadingOrDownloaded(id) && ep.Status != episode.StatusDownloaded {
|
if !s.db.IsEpisodeDownloadingOrDownloaded(id) && ep.Status != episode.StatusDownloaded {
|
||||||
|
|||||||
Reference in New Issue
Block a user