From ad2685624cf233456623c5fa34083412df53873c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 16 Jun 2022 14:43:20 +0200 Subject: Soundcloud: fix title and download link not updating when changing video, fix text y offset after mgl update --- src/plugins/Lbry.cpp | 5 +++-- src/plugins/MediaGeneric.cpp | 2 +- src/plugins/Peertube.cpp | 2 +- src/plugins/Soundcloud.cpp | 9 +++++++-- src/plugins/Youtube.cpp | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Lbry.cpp b/src/plugins/Lbry.cpp index 92532cb..069bd89 100644 --- a/src/plugins/Lbry.cpp +++ b/src/plugins/Lbry.cpp @@ -395,9 +395,10 @@ namespace QuickMedia { return ""; } - PluginResult LbryVideoPage::load(std::string &title, std::string&, double &duration, std::vector&, std::string &err_str) { + PluginResult LbryVideoPage::load(const SubmitArgs &args, std::string &title, std::string&, double &duration, std::vector&, std::string &err_str) { streaming_url.clear(); - title = this->title; + title = args.title; + //title = this->title; duration = 0.0; return video_get_stream_url(this, url, streaming_url, err_str); } diff --git a/src/plugins/MediaGeneric.cpp b/src/plugins/MediaGeneric.cpp index c1044b0..4ff55da 100644 --- a/src/plugins/MediaGeneric.cpp +++ b/src/plugins/MediaGeneric.cpp @@ -224,7 +224,7 @@ namespace QuickMedia { return video_url; } - PluginResult MediaGenericVideoPage::load(std::string&, std::string&, double &duration, std::vector&, std::string &err_msg) { + PluginResult MediaGenericVideoPage::load(const SubmitArgs&, std::string&, std::string&, double &duration, std::vector&, std::string &err_msg) { video_url.clear(); duration = 0.0; if(!search_page->video_custom_handler) { diff --git a/src/plugins/Peertube.cpp b/src/plugins/Peertube.cpp index a9620f2..4e19f1a 100644 --- a/src/plugins/Peertube.cpp +++ b/src/plugins/Peertube.cpp @@ -370,7 +370,7 @@ namespace QuickMedia { } // TODO: Media chapters - PluginResult PeertubeVideoPage::load(std::string &title, std::string &channel_url, double &duration, std::vector&, std::string &err_str) { + PluginResult PeertubeVideoPage::load(const SubmitArgs&, std::string &title, std::string &channel_url, double &duration, std::vector&, std::string &err_str) { Json::Value json_root; std::string err_msg; DownloadResult download_result = download_json(json_root, server + "/api/v1/videos/" + url, {}, true, &err_msg); diff --git a/src/plugins/Soundcloud.cpp b/src/plugins/Soundcloud.cpp index e088f73..bc89448 100644 --- a/src/plugins/Soundcloud.cpp +++ b/src/plugins/Soundcloud.cpp @@ -477,8 +477,13 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult SoundcloudAudioPage::load(std::string &title, std::string&, double &duration, std::vector&, std::string&) { - title = this->title; + PluginResult SoundcloudAudioPage::load(const SubmitArgs &args, std::string &title, std::string&, double &duration, std::vector&, std::string&) { + SoundcloudTrack *track = static_cast(args.extra.get()); + if(track) + permalink_url = track->permalink_url; + + title = args.title; + //title = this->title; duration = 0.0; return PluginResult::OK; } diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 65db3b1..7722f5d 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -2413,7 +2413,7 @@ namespace QuickMedia { return PluginResult::OK; } - PluginResult YoutubeVideoPage::load(std::string &title, std::string &channel_url, double &duration, std::vector &chapters, std::string &err_str) { + PluginResult YoutubeVideoPage::load(const SubmitArgs&, std::string &title, std::string &channel_url, double &duration, std::vector &chapters, std::string &err_str) { std::string video_id; if(!youtube_url_extract_id(url, video_id)) { fprintf(stderr, "Failed to extract youtube id from %s\n", url.c_str()); -- cgit v1.2.3