aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-11 17:46:36 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-11 17:46:36 +0200
commit73c11f696ebfa27d0242b5e28486f8b5241a3a32 (patch)
tree691670bf2d0ff81b9df92b50bd6e99756303b45f
parentc96fdcb4d639ae52ad1d2c812a07e5667849fe71 (diff)
Cancel search when entering a new search term
-rw-r--r--TODO1
-rw-r--r--src/QuickMedia.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/TODO b/TODO
index f7ae204..8248225 100644
--- a/TODO
+++ b/TODO
@@ -159,7 +159,6 @@ Ctrl+arrow key to move to previous/next video.
Add keybinding to view file-manager images in fullscreen to preview them. Also add keybinding to create/delete directories.
Completely remove youtube-dl dependency (or at least for downloading videos/music).
Add loading of english subtitles for youtube.
-Cancel search when new search happens.
Update item height when it switches from not being merged with previous to being merged with previous. This happens when loading previous messages in matrix and the message is the top one.
Reload youtube video url if the video is idle for too long. The video url is only valid for a specific amount of time (the valid duration is in the json).
Improve live stream startup time by downloading the video formats in parts instead of the hls manifest?
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 776f70f..046a9a2 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -2042,6 +2042,11 @@ namespace QuickMedia {
idle_active_handler();
}
+ if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::LOADING && associated_data.fetch_type == FetchType::SEARCH && associated_data.fetch_future.valid()) {
+ associated_data.fetch_future.cancel();
+ associated_data.fetch_status = FetchStatus::NONE;
+ }
+
if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::NONE && !associated_data.fetching_next_page_running) {
std::string update_search_text = associated_data.update_search_text;
associated_data.search_text_updated = false;