feat: save hash instead of link, and refactor torrent download

This commit is contained in:
Simon Ding
2025-02-01 14:22:34 +08:00
parent 8b6558b2b5
commit 2821d49673
18 changed files with 463 additions and 236 deletions

View File

@@ -164,7 +164,13 @@ func (s *Server) DownloadTorrent(c *gin.Context) (interface{}, error) {
return s.core.DownloadEpisodeTorrent(res, in.MediaID, in.Season, in.Episode)
} else {
//movie
return s.core.DownloadMovie(m, in.Link, in.Name, in.Size, in.IndexerId)
name := in.Name
if name == "" {
name = m.OriginalName
}
res := torznab.Result{Name: name, Link: in.Link, Size: in.Size, IndexerId: in.IndexerId}
return s.core.DownloadMovie(m, res)
}
}