From 75ea872764ba24fdb93af68cafb815b5f42fe9b7 Mon Sep 17 00:00:00 2001 From: miro Date: Sat, 16 Nov 2024 19:44:36 +0000 Subject: [PATCH 1/3] fix: featured media --- ovos_plugin_common_play/ocp/gui.py | 6 ++---- ovos_plugin_common_play/ocp/search.py | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ovos_plugin_common_play/ocp/gui.py b/ovos_plugin_common_play/ocp/gui.py index ec07f7e..d2981be 100644 --- a/ovos_plugin_common_play/ocp/gui.py +++ b/ovos_plugin_common_play/ocp/gui.py @@ -8,9 +8,7 @@ from ovos_config import Configuration from ovos_utils.events import EventSchedulerInterface from ovos_utils.log import LOG -from ovos_workshop.backwards_compat import (MediaType, Playlist, MediaEntry, PlayerState, LoopState, - PlaybackType, PluginStream, dict2entry) - +from ovos_utils.ocp import MediaState, TrackState, PlaybackType, MediaType, Playlist, PluginStream, PlayerState, LoopState, dict2entry from ovos_plugin_common_play.ocp.constants import OCP_ID from ovos_plugin_common_play.ocp.utils import is_qtav_available @@ -388,7 +386,7 @@ def handle_play_skill_featured_media(self, message): playlist = message.data["playlist"] self.player.playlist.clear() - self.player.media.replace(playlist) + self.player.media.search_playlist.replace(playlist) self.manage_display("disambiguation") diff --git a/ovos_plugin_common_play/ocp/search.py b/ovos_plugin_common_play/ocp/search.py index ab5f226..95f7911 100644 --- a/ovos_plugin_common_play/ocp/search.py +++ b/ovos_plugin_common_play/ocp/search.py @@ -1,12 +1,12 @@ import time +from typing import List, Union from threading import RLock from ovos_bus_client.message import Message from ovos_utils.log import LOG -from ovos_utils.ocp import MediaType +from ovos_utils.ocp import MediaType, Playlist, MediaEntry, PluginStream from ovos_plugin_common_play.ocp.base import OCPAbstractComponent -from ovos_plugin_common_play.ocp.media import Playlist class OCPSearch(OCPAbstractComponent): @@ -19,6 +19,9 @@ def __init__(self, player=None): # OCPMediaPlayer if player: self.bind(player) + def replace(self, new_playlist: List[Union[MediaEntry, PluginStream]]): + self.search_playlist.replace(new_playlist) + def bind(self, player): # OCPMediaPlayer self._player = player self.add_event("ovos.common_play.skills.detach", From d54ed95071abd2497b967e16ea3491b261b59b0b Mon Sep 17 00:00:00 2001 From: miro Date: Sat, 16 Nov 2024 20:38:32 +0000 Subject: [PATCH 2/3] fix: update GUI playlist --- ovos_plugin_common_play/ocp/gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ovos_plugin_common_play/ocp/gui.py b/ovos_plugin_common_play/ocp/gui.py index d2981be..f30bcb8 100644 --- a/ovos_plugin_common_play/ocp/gui.py +++ b/ovos_plugin_common_play/ocp/gui.py @@ -387,6 +387,7 @@ def handle_play_skill_featured_media(self, message): self.player.playlist.clear() self.player.media.search_playlist.replace(playlist) + self.update_search_results() self.manage_display("disambiguation") From 4e0bef7435c54717528851afad88ed6d65766f58 Mon Sep 17 00:00:00 2001 From: miro Date: Sat, 16 Nov 2024 20:42:18 +0000 Subject: [PATCH 3/3] fix: update GUI playlist --- ovos_plugin_common_play/ocp/search.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ovos_plugin_common_play/ocp/search.py b/ovos_plugin_common_play/ocp/search.py index 95f7911..2acf450 100644 --- a/ovos_plugin_common_play/ocp/search.py +++ b/ovos_plugin_common_play/ocp/search.py @@ -1,10 +1,9 @@ import time -from typing import List, Union from threading import RLock from ovos_bus_client.message import Message from ovos_utils.log import LOG -from ovos_utils.ocp import MediaType, Playlist, MediaEntry, PluginStream +from ovos_utils.ocp import MediaType, Playlist from ovos_plugin_common_play.ocp.base import OCPAbstractComponent @@ -19,9 +18,6 @@ def __init__(self, player=None): # OCPMediaPlayer if player: self.bind(player) - def replace(self, new_playlist: List[Union[MediaEntry, PluginStream]]): - self.search_playlist.replace(new_playlist) - def bind(self, player): # OCPMediaPlayer self._player = player self.add_event("ovos.common_play.skills.detach",