diff --git a/server/resources.go b/server/resources.go index a1ce6c8..ae4d7eb 100644 --- a/server/resources.go +++ b/server/resources.go @@ -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, diff --git a/ui/lib/providers/welcome_data.dart b/ui/lib/providers/welcome_data.dart index 22f68e1..6eb332e 100644 --- a/ui/lib/providers/welcome_data.dart +++ b/ui/lib/providers/welcome_data.dart @@ -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 download(String link) async {