feat: add "Open in custom player" to toast options (#5880)

This commit is contained in:
nerix
2025-03-05 16:29:28 +01:00
committed by GitHub
parent 54793f1496
commit 72369b1611
9 changed files with 67 additions and 11 deletions
+2 -9
View File
@@ -21,6 +21,7 @@
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "util/Clipboard.hpp"
#include "util/CustomPlayer.hpp"
#include "util/Helpers.hpp"
#include "util/StreamLink.hpp"
#include "widgets/dialogs/QualityPopup.hpp"
@@ -1252,19 +1253,11 @@ void Split::openInStreamlink()
void Split::openWithCustomScheme()
{
QString scheme = getSettings()->customURIScheme.getValue();
if (scheme.isEmpty())
{
return;
}
auto *const channel = this->getChannel().get();
if (auto *const twitchChannel = dynamic_cast<TwitchChannel *>(channel))
{
QDesktopServices::openUrl(QString("%1https://twitch.tv/%2")
.arg(scheme)
.arg(twitchChannel->getName()));
openInCustomPlayer(twitchChannel->getName());
}
}