aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-26 17:33:33 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-26 17:33:33 +0100
commit8fc6edc4033c04de3cdc6a400976a019a35694b7 (patch)
tree446627137ce186516a5f5cfa6e59b72831fcb820 /plugins
parentda827778f8c5d2f0cfc56b297099ba58454c38ed (diff)
Soundcloud: autoplay next song in list
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Page.hpp3
-rw-r--r--plugins/Soundcloud.hpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp
index f1ef893..803b9e6 100644
--- a/plugins/Page.hpp
+++ b/plugins/Page.hpp
@@ -100,6 +100,7 @@ namespace QuickMedia {
public:
VideoPage(Program *program) : Page(program) {}
virtual PageTypez get_type() const override { return PageTypez::VIDEO; }
+ virtual bool autoplay_next_item() { return false; }
virtual BodyItems get_related_media(const std::string &url, std::string &channel_url) { (void)url; (void)channel_url; return {}; }
virtual std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) { (void)program; (void)search_delay; return nullptr; }
virtual std::unique_ptr<Page> create_comments_page(Program *program) { (void)program; return nullptr; }
@@ -108,5 +109,7 @@ namespace QuickMedia {
// Return nullptr if the service doesn't support channels page
virtual std::unique_ptr<LazyFetchPage> create_channels_page(Program *program, const std::string &channel_url) = 0;
virtual std::string get_url() = 0;
+ virtual std::string url_get_playable_url(const std::string &url) { return url; }
+ virtual bool video_should_be_skipped(const std::string &url) { return false; }
};
} \ No newline at end of file
diff --git a/plugins/Soundcloud.hpp b/plugins/Soundcloud.hpp
index 4962c04..0d73d36 100644
--- a/plugins/Soundcloud.hpp
+++ b/plugins/Soundcloud.hpp
@@ -47,9 +47,12 @@ namespace QuickMedia {
public:
SoundcloudAudioPage(Program *program, const std::string &url) : VideoPage(program), url(url) {}
const char* get_title() const override { return ""; }
+ bool autoplay_next_item() override { return true; }
std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *, const std::string &, const std::string &) override { return nullptr; }
std::unique_ptr<LazyFetchPage> create_channels_page(Program *, const std::string &) override { return nullptr; }
std::string get_url() override { return url; }
+ std::string url_get_playable_url(const std::string &url) override;
+ bool video_should_be_skipped(const std::string &url) override { return url == "track"; }
private:
std::string url;
};