aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-03 03:54:00 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-03 03:54:00 +0200
commit3f0421bea6b37d81d2d66c001b0fac2df91dd702 (patch)
tree560faf05481ba106aec6c79d478d018d02385c52 /src/QuickMedia.cpp
parentbab24cdda37e93bf87e487d22056361efaf90d50 (diff)
Show youtube play fail reason in notification, more items below correct width!
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 2157a4d..1b48743 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -2254,7 +2254,7 @@ namespace QuickMedia {
more_items_above_rect.setSize(sf::Vector2f(window_size.x, more_items_height));
more_items_below_rect.setPosition(sf::Vector2f(0.0f, window_size.y - more_items_height));
- more_items_below_rect.setSize(sf::Vector2f(window_size.y, more_items_height));
+ more_items_below_rect.setSize(sf::Vector2f(window_size.x, more_items_height));
}
if(tab_associated_data[selected_tab].fetching_next_page_running) {
@@ -2815,12 +2815,13 @@ namespace QuickMedia {
audio_url.clear();
has_embedded_audio = true;
+ std::string err_str;
const int num_retries = is_youtube ? 3 : 1;
bool load_successful = false;
for(int i = 0; i < num_retries; ++i) {
bool cancelled = false;
TaskResult load_result = run_task_with_loading_screen([&]() {
- if(video_page->load(new_title, channel_url, media_chapters) != PluginResult::OK)
+ if(video_page->load(new_title, channel_url, media_chapters, err_str) != PluginResult::OK)
return false;
std::string ext;
@@ -2880,7 +2881,7 @@ namespace QuickMedia {
}
if(!load_successful) {
- show_notification("QuickMedia", "Failed to load media", Urgency::CRITICAL);
+ show_notification("QuickMedia", "Failed to load media" + (err_str.empty() ? "" : ", error: " + err_str), Urgency::CRITICAL);
current_page = previous_page;
go_to_previous_page = true;
return;
@@ -4420,7 +4421,7 @@ namespace QuickMedia {
more_items_above_rect.setSize(sf::Vector2f(window_size.x, more_items_height));
more_items_below_rect.setPosition(sf::Vector2f(0.0f, window_size.y - more_items_height));
- more_items_below_rect.setSize(sf::Vector2f(window_size.y, more_items_height));
+ more_items_below_rect.setSize(sf::Vector2f(window_size.x, more_items_height));
}
//comment_input.update();
@@ -7163,12 +7164,13 @@ namespace QuickMedia {
bool load_successful = false;
const int largest_monitor_height = get_largest_monitor_height(disp);
+ std::string err_str;
for(int i = 0; i < 3; ++i) {
- task_result = run_task_with_loading_screen([this, &youtube_video_page, &filename, &video_url, &audio_url, &video_content_length, &audio_content_length, largest_monitor_height, &cancelled]{
+ task_result = run_task_with_loading_screen([&]{
std::string channel_url;
std::vector<MediaChapter> chapters;
filename.clear();
- if(youtube_video_page->load(filename, channel_url, chapters) != PluginResult::OK)
+ if(youtube_video_page->load(filename, channel_url, chapters, err_str) != PluginResult::OK)
return false;
std::string ext;
@@ -7218,7 +7220,7 @@ namespace QuickMedia {
}
if(!load_successful) {
- show_notification("QuickMedia", "Download failed", Urgency::CRITICAL);
+ show_notification("QuickMedia", "Download failed" + (err_str.empty() ? "" : ", error: " + err_str), Urgency::CRITICAL);
exit_code = 1;
return;
}