@@ -507,7 +507,7 @@ func (c *client) GetHistory(id int) *ent.History {
507
507
}
508
508
509
509
func (c * client ) DeleteHistory (id int ) error {
510
- err := c .ent .History .Update ().Where (history .ID (id )).SetStatus (history .StatusRemoved ).Exec (context .Background ())
510
+ err := c .ent .History .Update ().Where (history .ID (id )).SetStatus (history .StatusRemoved ).Exec (context .Background ())
511
511
return err
512
512
}
513
513
@@ -534,7 +534,7 @@ func (c *client) SetEpisodeStatus(id int, status episode.Status) error {
534
534
535
535
func (c * client ) IsEpisodeDownloadingOrDownloaded (id int ) bool {
536
536
ep , _ := c .GetEpisodeByID (id )
537
- his := c .ent .History .Query ().Where (history .MediaID (ep .MediaID ),history .SeasonNum (ep .SeasonNumber ), history .StatusEQ (history .StatusRemoved ), history .StatusNEQ (history .StatusFail )).AllX (context .Background ())
537
+ his := c .ent .History .Query ().Where (history .MediaID (ep .MediaID ), history .SeasonNum (ep .SeasonNumber ), history .StatusNEQ (history .StatusRemoved ), history .StatusNEQ (history .StatusFail )).AllX (context .Background ())
538
538
for _ , h := range his {
539
539
if len (h .EpisodeNums ) == 0 { //season pack download
540
540
return true
@@ -751,8 +751,7 @@ func (c *client) GetTmdbApiKey() string {
751
751
return k
752
752
}
753
753
754
-
755
- func (c * client ) AddTorrent2Blacklist (hash , name string , mediaId int ) error {
754
+ func (c * client ) AddTorrent2Blacklist (hash , name string , mediaId int ) error {
756
755
count := c .ent .Blacklist .Query ().Where (blacklist .TorrentHash (hash ), blacklist .MediaID (mediaId )).CountX (context .TODO ())
757
756
if count > 0 { //already exist
758
757
log .Infof ("torrent %s already in blacklist" , hash )
@@ -766,4 +765,4 @@ func (c *client) GetTorrentBlacklist() (ent.Blacklists, error) {
766
765
}
767
766
func (c * client ) DeleteTorrentBlacklist (id int ) error {
768
767
return c .ent .Blacklist .DeleteOneID (id ).Exec (context .Background ())
769
- }
768
+ }
0 commit comments