mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-21 11:17:30 +08:00
fix: movie content
This commit is contained in:
@@ -217,10 +217,14 @@ func (s *Server) SearchAvailableMovies(c *gin.Context) (interface{}, error) {
|
||||
if len(res) == 0 {
|
||||
return nil, fmt.Errorf("no resource found")
|
||||
}
|
||||
ss := strings.Split(movieDetail.AirDate, "-")[0]
|
||||
year, _ := strconv.Atoi(ss)
|
||||
|
||||
var searchResults []TorznabSearchResult
|
||||
for _, r := range res {
|
||||
|
||||
if !strings.Contains(r.Name, strconv.Itoa(year)) && !strings.Contains(r.Name, strconv.Itoa(year+1)) && !strings.Contains(r.Name, strconv.Itoa(year-1)) {
|
||||
continue //not the same movie, if year is not correct
|
||||
}
|
||||
searchResults = append(searchResults, TorznabSearchResult{
|
||||
Name: r.Name,
|
||||
Size: r.Size,
|
||||
|
||||
@@ -208,7 +208,7 @@ class MovieTorrentResource
|
||||
if (rsp.code != 0) {
|
||||
throw rsp.message;
|
||||
}
|
||||
return (resp.data as List).map((v) => TorrentResource.fromJson(v)).toList();
|
||||
return (rsp.data as List).map((v) => TorrentResource.fromJson(v)).toList();
|
||||
}
|
||||
|
||||
Future<void> download(String link) async {
|
||||
|
||||
Reference in New Issue
Block a user