mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Share the love: Minor corrections
This commit is contained in:
parent
acb75a5099
commit
d9fa56c179
@ -68,12 +68,11 @@ void LoveDialog::showEvent(QShowEvent* e) {
|
||||
|
||||
void LoveDialog::SongRated(float rating) {
|
||||
qLog(Debug) << "LoveDialog::SongRated: rating=" << rating;
|
||||
Song* song = &song_;
|
||||
qLog(Debug) << "LoveDialog::SongRated: isValid=" << song->is_valid() << " id=" << song->id();
|
||||
if (!song->is_valid() || song->id() == -1) return;
|
||||
qLog(Debug) << "LoveDialog::SongRated: isValid=" << song_.is_valid() << " id=" << song_.id();
|
||||
if (!song_.is_valid() || song_.id() == -1) return;
|
||||
|
||||
qLog(Debug) << "LoveDialog::SongRated: song is valid and id is good";
|
||||
song->set_rating(rating);
|
||||
app_->library_backend()->UpdateSongRatingAsync(song->id(), rating);
|
||||
song_.set_rating(rating);
|
||||
app_->library_backend()->UpdateSongRatingAsync(song_.id(), rating);
|
||||
QDialog::accept();
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <QDialog>
|
||||
|
||||
#include "core/song.h"
|
||||
//#include "widgets/lineedit.h"
|
||||
|
||||
class Application;
|
||||
class Ui_LoveDialog;
|
||||
|
@ -1589,8 +1589,8 @@ void MainWindow::ScrobbledRadioStream() {
|
||||
#endif
|
||||
|
||||
void MainWindow::Love() {
|
||||
Playlist* activePlaylist = app_->playlist_manager()->active();
|
||||
PlaylistItemPtr item = activePlaylist->current_item();
|
||||
Playlist* active_playlist = app_->playlist_manager()->active();
|
||||
PlaylistItemPtr item = active_playlist->current_item();
|
||||
if (!item) {
|
||||
// Don't make a big deal about it
|
||||
qLog(Warning) << "Love: nothing playing so can't love it";
|
||||
@ -1598,7 +1598,8 @@ void MainWindow::Love() {
|
||||
}
|
||||
|
||||
if (item->IsLocalLibraryItem()) {
|
||||
Song song = item->Metadata();
|
||||
const Song& song = item->Metadata();
|
||||
if (!song.is_valid() || song.id() == -1) return;
|
||||
love_dialog_->SetSong(song);
|
||||
love_dialog_->show();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user