Skip to content

Commit

Permalink
Fix autoplay option passed to librespot (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
riiga authored May 19, 2023
1 parent b052ce0 commit bedb0d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/spotifyclient/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ void SpotifyClient::Runner::start(const QString &username, const QString &passwo

if (SpotifyClient::Helper::supportsAutoplay(path))
{
arguments.append(QStringLiteral("--autoplay"));
const auto librespotVersion = SpotifyClient::Helper::version(path);
// If version 0.4.x or older
if (librespotVersion.contains(QRegularExpression("([0]\\.[0-4]\\.[0-9])")))
{
arguments.append(QStringLiteral("--autoplay"));
}
}
}
else if (clientType == lib::client_type::spotifyd)
Expand Down
1 change: 1 addition & 0 deletions src/spotifyclient/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <QInputDialog>
#include <QList>
#include <QProcess>
#include <QRegularExpression>
#include <QStringList>

namespace SpotifyClient
Expand Down

0 comments on commit bedb0d1

Please sign in to comment.