mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-28 13:37:43 +08:00
feat: no result consider ok
This commit is contained in:
@@ -59,12 +59,12 @@ func (c *Client) DownloadEpisodeTorrent(r1 torznab.Result, seriesId, seasonNum,
|
|||||||
dir := fmt.Sprintf("%s/Season %02d/", series.TargetDir, seasonNum)
|
dir := fmt.Sprintf("%s/Season %02d/", series.TargetDir, seasonNum)
|
||||||
|
|
||||||
history, err := c.db.SaveHistoryRecord(ent.History{
|
history, err := c.db.SaveHistoryRecord(ent.History{
|
||||||
MediaID: seriesId,
|
MediaID: seriesId,
|
||||||
EpisodeID: ep.ID,
|
EpisodeID: ep.ID,
|
||||||
SourceTitle: r1.Name,
|
SourceTitle: r1.Name,
|
||||||
TargetDir: dir,
|
TargetDir: dir,
|
||||||
Status: history.StatusRunning,
|
Status: history.StatusRunning,
|
||||||
Size: r1.Size,
|
Size: r1.Size,
|
||||||
//Saved: torrent.Save(),
|
//Saved: torrent.Save(),
|
||||||
Link: magnet,
|
Link: magnet,
|
||||||
DownloadClientID: dlc.ID,
|
DownloadClientID: dlc.ID,
|
||||||
@@ -104,8 +104,8 @@ func (c *Client) SearchAndDownload(seriesId, seasonNum, episodeNum int) (*string
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
tmdb 校验获取的资源名,如果用资源名在tmdb搜索出来的结果能匹配上想要的资源,则认为资源有效,否则无效
|
tmdb 校验获取的资源名,如果用资源名在tmdb搜索出来的结果能匹配上想要的资源,则认为资源有效,否则无效
|
||||||
解决名称过于简单的影视会匹配过多资源的问题, 例如:梦魇绝镇 FROM
|
解决名称过于简单的影视会匹配过多资源的问题, 例如:梦魇绝镇 FROM
|
||||||
*/
|
*/
|
||||||
var r1 *torznab.Result
|
var r1 *torznab.Result
|
||||||
for _, r := range res { //
|
for _, r := range res { //
|
||||||
@@ -117,8 +117,9 @@ func (c *Client) SearchAndDownload(seriesId, seasonNum, episodeNum int) (*string
|
|||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
if len(se.Results) == 0 {
|
if len(se.Results) == 0 {
|
||||||
log.Debugf("tmdb search no result: %s", r.Name)
|
log.Debugf("tmdb search no result, consider this torrent ok: %s", r.Name) //because tv name parse is not accurate
|
||||||
continue
|
r1 = &r
|
||||||
|
break
|
||||||
}
|
}
|
||||||
series := c.db.GetMediaDetails(seriesId)
|
series := c.db.GetMediaDetails(seriesId)
|
||||||
|
|
||||||
@@ -162,12 +163,12 @@ func (c *Client) DownloadMovie(m *ent.Media, link, name string, size int, indexe
|
|||||||
go func() {
|
go func() {
|
||||||
ep, _ := c.db.GetMovieDummyEpisode(m.ID)
|
ep, _ := c.db.GetMovieDummyEpisode(m.ID)
|
||||||
history, err := c.db.SaveHistoryRecord(ent.History{
|
history, err := c.db.SaveHistoryRecord(ent.History{
|
||||||
MediaID: m.ID,
|
MediaID: m.ID,
|
||||||
EpisodeID: ep.ID,
|
EpisodeID: ep.ID,
|
||||||
SourceTitle: name,
|
SourceTitle: name,
|
||||||
TargetDir: m.TargetDir,
|
TargetDir: m.TargetDir,
|
||||||
Status: history.StatusRunning,
|
Status: history.StatusRunning,
|
||||||
Size: size,
|
Size: size,
|
||||||
//Saved: torrent.Save(),
|
//Saved: torrent.Save(),
|
||||||
Link: magnet,
|
Link: magnet,
|
||||||
DownloadClientID: dlc.ID,
|
DownloadClientID: dlc.ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user