From 032ac2eb98f02dd18da7b642917635c81ba43cf6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 2 Jun 2020 00:56:57 +0200 Subject: 4chan: clear related video list when previewing new video, fix cursor being hidden over video --- src/plugins/Fourchan.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp index e65835a..06728fe 100644 --- a/src/plugins/Fourchan.cpp +++ b/src/plugins/Fourchan.cpp @@ -552,11 +552,11 @@ namespace QuickMedia { BodyItems Fourchan::get_related_media(const std::string &url) { BodyItems body_items; - auto it = cached_media_urls.begin(); - for(; it != cached_media_urls.end(); ++it) { - if(url == *it) - break; - } + auto it = std::find(cached_media_urls.begin(), cached_media_urls.end(), url); + if(it == cached_media_urls.end()) + return body_items; + + ++it; for(; it != cached_media_urls.end(); ++it) { auto body_item = std::make_unique(""); body_item->url = *it; -- cgit v1.2.3