8000 [Hotfix] Handle recommended ghost works by jilljenn · Pull Request #323 · mangaki/mangaki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Hotfix] Handle recommended ghost works #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mangaki/mangaki/utils/recommendations.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def get_reco_algo(request, algo_name='knn', category='all'):
chrono.save('compute every prediction')

works = Work.objects.in_bulk(best_work_ids)
# Some of the works may have been deleted since the algo backup was created.
ranked_work_ids = [work_id for work_id in best_work_ids if work_id in works]

chrono.save('get bulk')

return {'work_ids': best_work_ids, 'works': works}
return {'work_ids': ranked_work_ids, 'works': works}
0