Fix streamlink "choose" option if user has a default quality in config

Fixes #146
This commit is contained in:
Rasmus Karlsson 2017-12-17 16:34:01 +01:00
parent 151ff057a6
commit 912b9b89b3

View file

@ -360,12 +360,9 @@ void Split::doOpenStreamlink()
QProcess *p = new QProcess(); QProcess *p = new QProcess();
// my god that signal though // my god that signal though
QObject::connect(p, static_cast<void (QProcess::*)(int)>(&QProcess::finished), this, QObject::connect(p, static_cast<void (QProcess::*)(int)>(&QProcess::finished), this,
[path, channel, p](int exitCode) { [path, channel, p](int) {
if (exitCode > 0) {
return;
}
QString lastLine = QString(p->readAllStandardOutput()); QString lastLine = QString(p->readAllStandardOutput());
lastLine = lastLine.trimmed().split('\n').last(); lastLine = lastLine.trimmed().split('\n').last().trimmed();
if (lastLine.startsWith("Available streams: ")) { if (lastLine.startsWith("Available streams: ")) {
QStringList options; QStringList options;
QStringList split = QStringList split =
@ -385,7 +382,7 @@ void Split::doOpenStreamlink()
QualityPopup::showDialog(channel, path, options); QualityPopup::showDialog(channel, path, options);
} }
}); });
p->start(path, {"twitch.tv/" + channel}); p->start(path, {"twitch.tv/" + channel, "--default-stream=KKona"});
} }
} }