Actually scrobble
This commit is contained in:
parent
72f793a002
commit
5e514c42b6
|
@ -265,22 +265,28 @@ void LastFMService::NowPlaying(const Song &song) {
|
||||||
if (!InitScrobbler())
|
if (!InitScrobbler())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scrobbler_->nowPlaying(TrackFromSong(song));
|
last_track_ = TrackFromSong(song);
|
||||||
|
|
||||||
|
lastfm::MutableTrack mtrack(last_track_);
|
||||||
|
mtrack.stamp();
|
||||||
|
|
||||||
|
scrobbler_->nowPlaying(last_track_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LastFMService::Scrobble(const Song& song) {
|
void LastFMService::Scrobble() {
|
||||||
if (!InitScrobbler())
|
if (!InitScrobbler())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scrobbler_->cache(TrackFromSong(song));
|
scrobbler_->cache(last_track_);
|
||||||
|
scrobbler_->submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LastFMService::Love(const Song& song) {
|
void LastFMService::Love() {
|
||||||
lastfm::MutableTrack mtrack(TrackFromSong(song));
|
lastfm::MutableTrack mtrack(last_track_);
|
||||||
mtrack.love();
|
mtrack.love();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LastFMService::Ban(const Song& song) {
|
void LastFMService::Ban() {
|
||||||
lastfm::MutableTrack mtrack(TrackFromSong(song));
|
lastfm::MutableTrack mtrack(last_track_);
|
||||||
mtrack.ban();
|
mtrack.ban();
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,9 @@ class LastFMService : public RadioService {
|
||||||
void Authenticate(const QString& username, const QString& password);
|
void Authenticate(const QString& username, const QString& password);
|
||||||
|
|
||||||
void NowPlaying(const Song& song);
|
void NowPlaying(const Song& song);
|
||||||
void Scrobble(const Song& song);
|
void Scrobble();
|
||||||
void Love(const Song& song);
|
void Love();
|
||||||
void Ban(const Song& song);
|
void Ban();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AuthenticationComplete(bool success);
|
void AuthenticationComplete(bool success);
|
||||||
|
|
|
@ -342,7 +342,7 @@ void MainWindow::UpdateTrackPosition() {
|
||||||
|
|
||||||
if (!playlist_->has_scrobbled() &&
|
if (!playlist_->has_scrobbled() &&
|
||||||
position >= playlist_->scrobble_point()) {
|
position >= playlist_->scrobble_point()) {
|
||||||
radio_model_->GetLastFMService()->Scrobble(playlist_->current_item_metadata());
|
radio_model_->GetLastFMService()->Scrobble();
|
||||||
playlist_->set_scrobbled(true);
|
playlist_->set_scrobbled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,9 @@ const char* Playlist::kSettingsGroup = "Playlist";
|
||||||
Playlist::Playlist(QObject *parent) :
|
Playlist::Playlist(QObject *parent) :
|
||||||
QAbstractListModel(parent),
|
QAbstractListModel(parent),
|
||||||
current_is_paused_(false),
|
current_is_paused_(false),
|
||||||
ignore_sorting_(false),
|
|
||||||
scrobble_point_(-1),
|
scrobble_point_(-1),
|
||||||
has_scrobbled_(false)
|
has_scrobbled_(false),
|
||||||
|
ignore_sorting_(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue