diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-08-16 00:07:42 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-16 00:07:42 +0200 |
commit | 10d28055613a7f2bb1ca3a4d96988ea7c9b7db3f (patch) | |
tree | 9d239556cf9c7dd9a07202eb645df29801a570ed | |
parent | 4147fb8935ae1d8ad96ba3d384f762c242c53b47 (diff) |
Random shuffle recommendations
-rw-r--r-- | src/QuickMedia.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index cdd2176..f35b35d 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -457,10 +457,12 @@ namespace QuickMedia { body_item->thumbnail_url = "https://img.youtube.com/vi/" + recommended_item_id + "/hqdefault.jpg"; body_items.push_back(std::move(body_item)); - // We dont want more than 30 recommendations - if(body_items.size() == 30) + // We dont want more than 150 recommendations + if(body_items.size() == 150) break; } + + std::random_shuffle(body_items.begin(), body_items.end()); } static Path get_video_history_filepath(Plugin *plugin) { |