From 10d28055613a7f2bb1ca3a4d96988ea7c9b7db3f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 16 Aug 2020 00:07:42 +0200 Subject: Random shuffle recommendations --- src/QuickMedia.cpp | 6 ++++-- 1 file 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) { -- cgit v1.2.3