Fix UpdateMusic() call after adding/removing song
This commit is contained in:
parent
b97a0ef111
commit
fe5db351e1
@ -827,8 +827,8 @@ QStandardItem* VkService::AppendAlbumList(QStandardItem* parent, bool myself) {
|
|||||||
|
|
||||||
if (myself) {
|
if (myself) {
|
||||||
item = new QStandardItem(QIcon(":vk/discography.png"), tr("My Albums"));
|
item = new QStandardItem(QIcon(":vk/discography.png"), tr("My Albums"));
|
||||||
// TODO(Ivan Leontiev): Do this better. We have incomplete MusicOwner instance
|
// TODO(Ivan Leontiev): Do this better. We have incomplete MusicOwner
|
||||||
// for logged in user.
|
// instance for logged in user.
|
||||||
owner.setId(UserID());
|
owner.setId(UserID());
|
||||||
my_albums_item_ = item;
|
my_albums_item_ = item;
|
||||||
} else {
|
} else {
|
||||||
@ -885,8 +885,8 @@ QStandardItem* VkService::AppendMusic(QStandardItem* parent, bool myself) {
|
|||||||
|
|
||||||
if (myself) {
|
if (myself) {
|
||||||
item = new QStandardItem(QIcon(":vk/my_music.png"), tr("My Music"));
|
item = new QStandardItem(QIcon(":vk/my_music.png"), tr("My Music"));
|
||||||
// TODO(Ivan Leontiev): Do this better. We have incomplete MusicOwner instance
|
// TODO(Ivan Leontiev): Do this better. We have incomplete MusicOwner
|
||||||
// for logged in user.
|
// instance for logged in user.
|
||||||
owner.setId(UserID());
|
owner.setId(UserID());
|
||||||
my_music_item_ = item;
|
my_music_item_ = item;
|
||||||
} else {
|
} else {
|
||||||
@ -971,8 +971,8 @@ void VkService::FindThisArtist() {
|
|||||||
void VkService::AddToMyMusic() {
|
void VkService::AddToMyMusic() {
|
||||||
SongId id = ExtractIds(selected_song_.url());
|
SongId id = ExtractIds(selected_song_.url());
|
||||||
auto reply = audio_provider_->addToLibrary(id.audio_id, id.owner_id);
|
auto reply = audio_provider_->addToLibrary(id.audio_id, id.owner_id);
|
||||||
connect(reply, SIGNAL(resultReady(QVariant)), this,
|
NewClosure(reply, SIGNAL(resultReady(QVariant)), this,
|
||||||
SLOT(UpdateMusic(my_music_item_)));
|
SLOT(UpdateMusic(QStandardItem*)), my_music_item_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VkService::AddToMyMusicCurrent() {
|
void VkService::AddToMyMusicCurrent() {
|
||||||
@ -986,8 +986,8 @@ void VkService::RemoveFromMyMusic() {
|
|||||||
SongId id = ExtractIds(selected_song_.url());
|
SongId id = ExtractIds(selected_song_.url());
|
||||||
if (id.owner_id == UserID()) {
|
if (id.owner_id == UserID()) {
|
||||||
auto reply = audio_provider_->removeFromLibrary(id.audio_id, id.owner_id);
|
auto reply = audio_provider_->removeFromLibrary(id.audio_id, id.owner_id);
|
||||||
connect(reply, SIGNAL(resultReady(QVariant)), this,
|
NewClosure(reply, SIGNAL(resultReady(QVariant)), this,
|
||||||
SLOT(UpdateMusic(my_music_item_)));
|
SLOT(UpdateMusic(QStandardItem*)), my_music_item_);
|
||||||
} else {
|
} else {
|
||||||
qLog(Error) << "Tried to delete song that not owned by user (" << UserID()
|
qLog(Error) << "Tried to delete song that not owned by user (" << UserID()
|
||||||
<< selected_song_.url();
|
<< selected_song_.url();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user