diff options
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r-- | src/QuickMedia.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index a17b721..3789cc1 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -3160,6 +3160,16 @@ namespace QuickMedia { audio_url.clear(); has_embedded_audio = true; + SubmitArgs submit_args; + if(parent_body) { + BodyItem *selected = parent_body->get_selected(); + submit_args.title = selected->get_title(); + submit_args.url = selected->url; + submit_args.thumbnail_url = selected->thumbnail_url; + submit_args.userdata = selected->userdata; + submit_args.extra = selected->extra; + } + std::string err_str; const int num_retries = is_youtube ? 3 : 1; bool load_successful = false; @@ -3167,7 +3177,7 @@ namespace QuickMedia { bool cancelled = false; TaskResult load_result = run_task_with_loading_screen([&]() { video_duration = 0.0; - if(video_page->load(new_title, channel_url, video_duration, media_chapters, err_str) != PluginResult::OK) + if(video_page->load(submit_args, new_title, channel_url, video_duration, media_chapters, err_str) != PluginResult::OK) return false; if(video_duration > 0.001) @@ -4183,7 +4193,7 @@ namespace QuickMedia { window.draw(chapter_text_background); auto text_bounds = chapter_text.get_bounds(); - chapter_text.set_position(vec2f_floor(window_size.x * 0.5f - text_bounds.size.x * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.7f)); + chapter_text.set_position(vec2f_floor(window_size.x * 0.5f - text_bounds.size.x * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.55f)); window.draw(chapter_text); window.display(); @@ -4986,7 +4996,7 @@ namespace QuickMedia { time_left_text.set_position(time_left_bg.get_position() + mgl::vec2f( std::floor(time_left_bg.get_size().x * 0.5f - time_left_text.get_bounds().size.x * 0.5f), - std::floor(time_left_bg.get_size().y * 0.5f - time_left_text.get_bounds().size.y * 0.5f))); + std::floor(time_left_bg.get_size().y * 0.5f - time_left_text.get_bounds().size.y * 0.6f))); window.draw(time_left_text); } } @@ -7589,7 +7599,8 @@ namespace QuickMedia { std::vector<MediaChapter> chapters; filename.clear(); double duration; - if(youtube_video_page->load(filename, channel_url, duration, chapters, err_str) != PluginResult::OK) + SubmitArgs submit_args; + if(youtube_video_page->load(submit_args, filename, channel_url, duration, chapters, err_str) != PluginResult::OK) return false; std::string ext; @@ -8003,7 +8014,7 @@ namespace QuickMedia { body_size.y -= Tabs::get_shade_height(); save_button.set_position(window_size.to_vec2f() - mgl::vec2f(save_button.get_width(), save_button.get_height()) - mgl::vec2f(bottom_panel_padding, bottom_panel_padding)); cancel_button.set_position(save_button.get_position() - mgl::vec2f(cancel_button.get_width() + bottom_panel_spacing, 0.0f)); - file_name_label.set_position(mgl::vec2f(bottom_panel_spacing, std::floor(window_size.y - bottom_panel_padding - file_name_entry.get_height() * 0.5f - file_name_label.get_bounds().size.y * 0.5f - 5.0f * get_config().scale))); + file_name_label.set_position(mgl::vec2f(bottom_panel_spacing, std::floor(window_size.y - bottom_panel_padding - file_name_entry.get_height() * 0.5f - file_name_label.get_bounds().size.y * 0.5f - 1.0f * get_config().scale))); file_name_entry.set_position(mgl::vec2f(file_name_label.get_position().x + file_name_label.get_bounds().size.x + bottom_panel_spacing, window_size.y - file_name_entry.get_height() - bottom_panel_padding)); file_name_entry.set_max_width(std::floor(cancel_button.get_position().x - bottom_panel_spacing - file_name_label.get_bounds().size.x - bottom_panel_spacing - bottom_panel_spacing)); bottom_panel_background.set_position(mgl::vec2f(0.0f, window_size.y - std::floor(bottom_panel_padding * 2.0f + file_name_entry.get_height()))); |