aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/QuickMedia.cpp1
-rw-r--r--src/VideoPlayer.cpp6
-rw-r--r--src/plugins/Fourchan.cpp10
3 files changed, 10 insertions, 7 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index e2922c7..644c644 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1605,6 +1605,7 @@ namespace QuickMedia {
current_page = Page::VIDEO_CONTENT;
std::string prev_content_url = content_url;
content_url = selected_item->attached_content_url;
+ watched_videos.clear();
video_content_page();
content_url = std::move(prev_content_url);
} else {
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 08ecc7e..b88789d 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -73,12 +73,14 @@ namespace QuickMedia {
std::string wid_arg = "--wid=";
wid_arg += parent_window_str;
+ // TODO: Resume playback if the last video played matches the first video played next time QuickMedia is launched
args.insert(args.end(), { "mpv", "--keep-open=yes", /*"--keep-open-pause=no",*/ input_ipc_server_arg.c_str(),
- "--no-config", "--no-input-default-bindings", "--input-vo-keyboard=no", "--no-input-cursor",
- "--cache-secs=120", "--demuxer-max-bytes=40M", "--demuxer-max-back-bytes=20M",
+ "--no-config", "--no-input-default-bindings", "--input-vo-keyboard=no",
+ "--demuxer-max-bytes=40M", "--demuxer-max-back-bytes=20M",
"--no-input-terminal",
"--no-osc",
"--profile=gpu-hq",
+ "--no-resume-playback",
/*"--vo=gpu", "--hwdec=auto",*/
wid_arg.c_str(), "--", path, nullptr });
if(exec_program_async(args.data(), &video_process_id) != 0)
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;