fix kodi playback states with new kodi version
parent
bea46cb954
commit
2443cf2701
|
|
@ -313,9 +313,9 @@ void DevicePluginKodi::onPlaybackStatusChanged(const QString &playbackStatus)
|
|||
Device *device = m_kodis.value(kodi);
|
||||
device->setStateValue(kodiPlaybackStatusStateTypeId, playbackStatus);
|
||||
// legacy events
|
||||
if (playbackStatus == "PLAYING") {
|
||||
if (playbackStatus == "Playing") {
|
||||
emit emitEvent(Event(kodiOnPlayerPlayEventTypeId, device->id()));
|
||||
} else if (playbackStatus == "PAUSED") {
|
||||
} else if (playbackStatus == "Paused") {
|
||||
emit emitEvent(Event(kodiOnPlayerPauseEventTypeId, device->id()));
|
||||
} else {
|
||||
emit emitEvent(Event(kodiOnPlayerStopEventTypeId, device->id()));
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void Kodi::activePlayersChanged(const QVariantList &data)
|
|||
qCDebug(dcKodi()) << "active players changed" << data.count();
|
||||
m_activePlayerCount = data.count();
|
||||
if (m_activePlayerCount == 0) {
|
||||
emit playbackStatusChanged("STOPPED");
|
||||
emit playbackStatusChanged("Stopped");
|
||||
return;
|
||||
}
|
||||
int activePlayer = data.first().toMap().value("playerid").toInt();
|
||||
|
|
@ -222,9 +222,9 @@ void Kodi::playerPropertiesReceived(const QVariantMap &properties)
|
|||
qCDebug(dcKodi()) << "player props received" << properties;
|
||||
if (m_activePlayerCount > 0) {
|
||||
if (properties.value("speed").toDouble() > 0) {
|
||||
emit playbackStatusChanged("PLAYING");
|
||||
emit playbackStatusChanged("Playing");
|
||||
} else {
|
||||
emit playbackStatusChanged("PAUSED");
|
||||
emit playbackStatusChanged("Paused");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ void KodiJsonHandler::processNotification(const QString &method, const QVariantM
|
|||
if (method == "Application.OnVolumeChanged") {
|
||||
QVariantMap data = params.value("data").toMap();
|
||||
emit volumeChanged(data.value("volume").toInt(), data.value("muted").toBool());
|
||||
} else if (method == "Player.OnPlay") {
|
||||
emit playbackStatusChanged("PLAYING");
|
||||
} else if (method == "Player.OnPlay" || method == "Player.OnResume") {
|
||||
emit playbackStatusChanged("Playing");
|
||||
} else if (method == "Player.OnPause") {
|
||||
emit playbackStatusChanged("PAUSED");
|
||||
emit playbackStatusChanged("Paused");
|
||||
} else if (method == "Player.OnStop") {
|
||||
emit playbackStatusChanged("STOPPED");
|
||||
emit playbackStatusChanged("Stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue