aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-06-02 00:56:57 +0200
committerdec05eba <dec05eba@protonmail.com>2020-06-02 00:56:57 +0200
commit032ac2eb98f02dd18da7b642917635c81ba43cf6 (patch)
treee976d70483d2314e78a2d855c170f8311d1db024 /src/plugins
parentfe92e3fcf858fc71583cd1a52a25e1f62324f5b8 (diff)
4chan: clear related video list when previewing new video, fix cursor being hidden over video
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Fourchan.cpp10
1 files changed, 5 insertions, 5 deletions
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<BodyItem>("");
body_item->url = *it;