more fixes
This commit is contained in:
parent
c0e37de2fe
commit
a60f78a359
@ -563,24 +563,9 @@ void Kodi::activePlayersChanged(const QVariantList &data)
|
|||||||
}
|
}
|
||||||
m_activePlayer = data.first().toMap().value("playerid").toInt();
|
m_activePlayer = data.first().toMap().value("playerid").toInt();
|
||||||
qCDebug(dcKodi) << "Active Player changed:" << m_activePlayer << data.first().toMap().value("type").toString();
|
qCDebug(dcKodi) << "Active Player changed:" << m_activePlayer << data.first().toMap().value("type").toString();
|
||||||
if (data.first().toMap().contains("type")) {
|
emit activePlayerChanged(data.first().toMap().value("type").toString());
|
||||||
emit activePlayerChanged(data.first().toMap().value("type").toString());
|
|
||||||
} else {
|
|
||||||
// Player map doesn't contain type... sometimes... looks like a kodi bug... Assume 1 is video, 2 is music...
|
|
||||||
switch (m_activePlayer) {
|
|
||||||
case 1:
|
|
||||||
emit activePlayerChanged("video");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
emit activePlayerChanged("music");
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
emit activePlayerChanged("picture");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePlayerProperties();
|
updateMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kodi::playerPropertiesReceived(const QVariantMap &properties)
|
void Kodi::playerPropertiesReceived(const QVariantMap &properties)
|
||||||
@ -605,6 +590,9 @@ void Kodi::mediaMetaDataReceived(const QVariantMap &data)
|
|||||||
QVariantMap item = data.value("item").toMap();
|
QVariantMap item = data.value("item").toMap();
|
||||||
|
|
||||||
QString title = item.value("title").toString();
|
QString title = item.value("title").toString();
|
||||||
|
if (title.isEmpty()) { // Fall back to label if not title present
|
||||||
|
title = item.value("label").toString();
|
||||||
|
}
|
||||||
QString artist;
|
QString artist;
|
||||||
QString collection;
|
QString collection;
|
||||||
if (item.value("type").toString() == "song") {
|
if (item.value("type").toString() == "song") {
|
||||||
@ -648,13 +636,15 @@ void Kodi::processNotification(const QString &method, const QVariantMap ¶ms)
|
|||||||
if (method == "Application.OnVolumeChanged") {
|
if (method == "Application.OnVolumeChanged") {
|
||||||
QVariantMap data = params.value("data").toMap();
|
QVariantMap data = params.value("data").toMap();
|
||||||
onVolumeChanged(data.value("volume").toInt(), data.value("muted").toBool());
|
onVolumeChanged(data.value("volume").toInt(), data.value("muted").toBool());
|
||||||
} else if (method == "Player.OnPlay" || method == "Player.OnResume") {
|
} else if (method == "Player.OnPlay" || method == "Player.OnResume" || method == "Player.OnAVStart") {
|
||||||
onPlaybackStatusChanged("Playing");
|
onPlaybackStatusChanged("Playing");
|
||||||
activePlayersChanged(QVariantList() << params.value("data").toMap().value("player"));
|
update();
|
||||||
} else if (method == "Player.OnPause") {
|
} else if (method == "Player.OnPause") {
|
||||||
emit playbackStatusChanged("Paused");
|
onPlaybackStatusChanged("Paused");
|
||||||
|
update();
|
||||||
} else if (method == "Player.OnStop") {
|
} else if (method == "Player.OnStop") {
|
||||||
activePlayersChanged(QVariantList());
|
onPlaybackStatusChanged("Stopped");
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,7 +671,7 @@ void Kodi::processResponse(int id, const QString &method, const QVariantMap &res
|
|||||||
|
|
||||||
if (method == "Player.GetActivePlayers") {
|
if (method == "Player.GetActivePlayers") {
|
||||||
qCDebug(dcKodi) << "Active players changed" << response;
|
qCDebug(dcKodi) << "Active players changed" << response;
|
||||||
emit activePlayersChanged(response.value("result").toList());
|
activePlayersChanged(response.value("result").toList());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,7 +683,7 @@ void Kodi::processResponse(int id, const QString &method, const QVariantMap &res
|
|||||||
|
|
||||||
if (method == "Player.GetItem") {
|
if (method == "Player.GetItem") {
|
||||||
qCDebug(dcKodi) << "Played item received" << response;
|
qCDebug(dcKodi) << "Played item received" << response;
|
||||||
emit mediaMetaDataReceived(response.value("result").toMap());
|
mediaMetaDataReceived(response.value("result").toMap());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user