aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-25 20:19:45 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-25 20:19:45 +0100
commit1aec2bb2708b1b9597e06a7e6324a7dadf73bb80 (patch)
tree6e3639725d65f08514cc86aeb0ef198362b4837d /src
parentcf19ee36c326f89ebd1835a8dbdae07e56fb4043 (diff)
Download audio files before playing them if they are non-streamable as well
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 39b4c30..3b687dd 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1738,7 +1738,7 @@ namespace QuickMedia {
bool video_url_is_local = false;
if(download_if_streaming_fails) {
- Path video_cache_dir = get_cache_dir().join("video");
+ Path video_cache_dir = get_cache_dir().join("media");
Path video_path = video_cache_dir;
SHA256 sha256;
sha256.add(video_url.data(), video_url.size());
@@ -1905,7 +1905,10 @@ namespace QuickMedia {
if(video_player->get_time_in_file(&time_in_file) != VideoPlayer::Error::OK)
time_in_file = 0.0;
- std::string clipboard = video_url + "&t=" + std::to_string((int)time_in_file);
+ std::string clipboard = video_url;
+ if((int)time_in_file > 0)
+ clipboard += "&t=" + std::to_string((int)time_in_file);
+
sf::Clipboard::setString(sf::String::fromUtf8(clipboard.begin(), clipboard.end()));
} else {
sf::Clipboard::setString(sf::String::fromUtf8(video_url.begin(), video_url.end()));
@@ -4177,7 +4180,7 @@ namespace QuickMedia {
bool prev_no_video = no_video;
no_video = is_audio;
// TODO: Add title
- video_content_page(video_page.get(), *selected_url, "No title", message_type == MessageType::VIDEO);
+ video_content_page(video_page.get(), *selected_url, "No title", message_type == MessageType::VIDEO || message_type == MessageType::AUDIO);
no_video = prev_no_video;
redraw = true;
return true;