Scrobbler: Refactor and add MusicBrainz integration

This commit is contained in:
Jonas Kvinge
2023-03-25 14:25:21 +01:00
parent aedbd52e9d
commit fab38f693d
17 changed files with 423 additions and 308 deletions

View File

@@ -1,6 +1,6 @@
/*
* Strawberry Music Player
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
* Copyright 2018-2023, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,49 +24,25 @@
#include <QtGlobal>
#include <QObject>
#include <QString>
#include "core/song.h"
#include "scrobblingapi20.h"
class Application;
class NetworkAccessManager;
class ScrobblerCache;
class LibreFMScrobbler : public ScrobblingAPI20 {
Q_OBJECT
public:
explicit LibreFMScrobbler(Application *app, QObject *parent = nullptr);
~LibreFMScrobbler() override;
static const char *kName;
static const char *kSettingsGroup;
NetworkAccessManager *network() const override { return network_; }
ScrobblerCache *cache() const override { return cache_; }
private:
static const char *kAuthUrl;
static const char *kApiUrl;
static const char *kCacheFile;
QString settings_group_;
QString auth_url_;
QString api_url_;
QString api_key_;
QString secret_;
Application *app_;
NetworkAccessManager *network_;
ScrobblerCache *cache_;
bool enabled_;
bool subscriber_;
QString username_;
QString session_key_;
bool submitted_;
Song song_playing_;
quint64 timestamp_;
};
#endif // LIBREFMSCROBBLER_H