Skip to content

Commit

Permalink
Merge pull request #631 from ArjixGamer/patch-29
Browse files Browse the repository at this point in the history
sort search results by year for shiro & animefrenzy
  • Loading branch information
AbdullahM0hamed committed Feb 14, 2021
2 parents b7e0d35 + 97520cb commit 11faa53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion anime_downloader/sites/animefrenzy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ def search(cls, query):
title=i['name'],
url='https://animefrenzy.org/anime/' + i['slug'],
poster='https://moo.yare.wtf/' + i['image'],
meta={'year': i['year']},
meta_info={
'version_key_dubbed': '(Sub)' if i['language'] == 'subbed' else '(Dub)' # noqa
}
)
for i in results
]
search_results = sorted(search_results, key=lambda x: len(x.title))
search_results = sorted(search_results, key=lambda x: int(x.meta['year']))
return search_results
else:
return []
Expand Down
3 changes: 2 additions & 1 deletion anime_downloader/sites/shiro.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ def search(cls, query):
title=i['name'],
url='https://shiro.is/anime/' + i['slug'],
poster='https://ani-cdn.api-web.site/' + i['image'],
meta={'year': i['year']},
meta_info={
'version_key_dubbed': '(Sub)' if i['language'] == 'subbed' else '(Dub)' # noqa
}
)
for i in results
]
search_results = sorted(search_results, key=lambda x: len(x.title))
search_results = sorted(search_results, key=lambda x: int(x.meta['year']))
return search_results
else:
return []
Expand Down

0 comments on commit 11faa53

Please sign in to comment.