mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 11:39:46 +08:00
fix: indexid
This commit is contained in:
3
db/db.go
3
db/db.go
@@ -472,7 +472,8 @@ func (c *Client) SetDefaultStorageByName(name string) error {
|
|||||||
|
|
||||||
func (c *Client) SaveHistoryRecord(h ent.History) (*ent.History, error) {
|
func (c *Client) SaveHistoryRecord(h ent.History) (*ent.History, error) {
|
||||||
return c.ent.History.Create().SetMediaID(h.MediaID).SetEpisodeID(h.EpisodeID).SetDate(time.Now()).
|
return c.ent.History.Create().SetMediaID(h.MediaID).SetEpisodeID(h.EpisodeID).SetDate(time.Now()).
|
||||||
SetStatus(h.Status).SetTargetDir(h.TargetDir).SetSourceTitle(h.SourceTitle).SetSaved(h.Saved).Save(context.TODO())
|
SetStatus(h.Status).SetTargetDir(h.TargetDir).SetSourceTitle(h.SourceTitle).SetIndexerID(h.IndexerID).
|
||||||
|
SetSaved(h.Saved).Save(context.TODO())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SetHistoryStatus(id int, status history.Status) error {
|
func (c *Client) SetHistoryStatus(id int, status history.Status) error {
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ func (c *Client) downloadMovieSingleEpisode(ep *ent.Episode) error {
|
|||||||
Size: r1.Size,
|
Size: r1.Size,
|
||||||
Saved: torrent.Save(),
|
Saved: torrent.Save(),
|
||||||
DownloadClientID: dlc.ID,
|
DownloadClientID: dlc.ID,
|
||||||
|
IndexerID: r1.IndexerId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("save history error: %v", err)
|
log.Errorf("save history error: %v", err)
|
||||||
@@ -336,7 +337,7 @@ func (c *Client) checkSeiesNewSeason(media *ent.Media) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) isSeedRatioLimitReached(indexId int, t pkg.Torrent) (bool) {
|
func (c *Client) isSeedRatioLimitReached(indexId int, t pkg.Torrent) bool {
|
||||||
indexer, err := c.db.GetIndexer(indexId)
|
indexer, err := c.db.GetIndexer(indexId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user