diff options
-rw-r--r-- | src/Body.cpp | 2 | ||||
-rw-r--r-- | src/plugins/Peertube.cpp | 21 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 1117f5b..1b300c5 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -1268,7 +1268,7 @@ namespace QuickMedia { sf::Vector2f content_size = to_vec2f(thumbnail_size); sf::Vector2f loading_icon_size(loading_icon.getTexture()->getSize().x, loading_icon.getTexture()->getSize().y); auto new_loading_icon_size = clamp_to_size(loading_icon_size, content_size); - loading_icon.setPosition(pos + pos_offset + sf::Vector2f(card_padding_x, card_padding_y) + to_vec2f(card_max_image_size) * 0.5f); + loading_icon.setPosition(pos + pos_offset + sf::Vector2f(card_padding_x, card_padding_y) + sf::Vector2f(card_max_image_size.x, content_size.y) * 0.5f); loading_icon.setScale(get_ratio(loading_icon_size, new_loading_icon_size)); loading_icon.setRotation(elapsed_time_sec * 400.0); window.draw(loading_icon); diff --git a/src/plugins/Peertube.cpp b/src/plugins/Peertube.cpp index dd789d4..3b74871 100644 --- a/src/plugins/Peertube.cpp +++ b/src/plugins/Peertube.cpp @@ -29,6 +29,21 @@ namespace QuickMedia { PluginResult PeertubeInstanceSelectionPage::lazy_fetch(BodyItems &result_items) { result_items.push_back(create_instance_selection_item("tube.midov.pl", "https://tube.midov.pl")); result_items.push_back(create_instance_selection_item("videos.lukesmith.xyz", "https://videos.lukesmith.xyz")); + result_items.push_back(create_instance_selection_item("peertube.se", "https://peertube.se")); + result_items.push_back(create_instance_selection_item("bittube.video", "https://bittube.video")); + result_items.push_back(create_instance_selection_item("video.nobodyhasthe.biz", "https://video.nobodyhasthe.biz")); + result_items.push_back(create_instance_selection_item("libre.tube", "https://libre.tube")); + result_items.push_back(create_instance_selection_item("open.tube", "https://open.tube")); + result_items.push_back(create_instance_selection_item("runtube.re", "https://runtube.re")); + result_items.push_back(create_instance_selection_item("tube.kenfm.de", "https://tube.kenfm.de")); + result_items.push_back(create_instance_selection_item("tcode.kenfm.de", "https://tcode.kenfm.de")); + result_items.push_back(create_instance_selection_item("tube.querdenken-711.de", "https://tube.querdenken-711.de")); + result_items.push_back(create_instance_selection_item("peertube.rage.lol", "https://peertube.rage.lol")); + result_items.push_back(create_instance_selection_item("gegenstimme.tv", "https://gegenstimme.tv")); + result_items.push_back(create_instance_selection_item("tv.poa.st", "https://tv.poa.st")); + result_items.push_back(create_instance_selection_item("libre.video", "https://libre.video")); + result_items.push_back(create_instance_selection_item("gorf.tube", "https://gorf.tube")); + result_items.push_back(create_instance_selection_item("neogenesis.tv", "https://neogenesis.tv")); return PluginResult::OK; } @@ -95,6 +110,8 @@ namespace QuickMedia { body_item->url = short_uuid_json.asString(); else if(name_json.isString() && host_json.isString()) body_item->url = name_str + "@" + host_json.asString(); + else if(uuid_json.isString()) + body_item->url = uuid_json.asString(); else return nullptr; } @@ -221,8 +238,10 @@ namespace QuickMedia { DownloadResult result = page->download_json(json_root, url, {}, true, &err_msg); if(result != DownloadResult::OK) return download_result_to_plugin_result(result); + // Return OK because some versions of peertube doesn't support video-playlists api (or is it not enabled for the instance?) and in such cases it returns + // an empty string if(!json_root.isObject()) - return PluginResult::ERR; + return PluginResult::OK; std::string err_str; if(handle_error(json_root, err_str)) { |