mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-26 02:34:58 +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 {
|
if len(res) == 0 {
|
||||||
return nil, fmt.Errorf("no resource found")
|
return nil, fmt.Errorf("no resource found")
|
||||||
}
|
}
|
||||||
|
ss := strings.Split(movieDetail.AirDate, "-")[0]
|
||||||
|
year, _ := strconv.Atoi(ss)
|
||||||
|
|
||||||
var searchResults []TorznabSearchResult
|
var searchResults []TorznabSearchResult
|
||||||
for _, r := range res {
|
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{
|
searchResults = append(searchResults, TorznabSearchResult{
|
||||||
Name: r.Name,
|
Name: r.Name,
|
||||||
Size: r.Size,
|
Size: r.Size,
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ class MovieTorrentResource
|
|||||||
if (rsp.code != 0) {
|
if (rsp.code != 0) {
|
||||||
throw rsp.message;
|
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 {
|
Future<void> download(String link) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user