diff --git a/ovos_core/intent_services/ocp_service.py b/ovos_core/intent_services/ocp_service.py index 5e25a7be5a0..3de663080f1 100644 --- a/ovos_core/intent_services/ocp_service.py +++ b/ovos_core/intent_services/ocp_service.py @@ -11,7 +11,7 @@ from ovos_bus_client.util import wait_for_reply from ovos_classifiers.skovos.classifier import SklearnOVOSClassifier from ovos_classifiers.skovos.features import ClassifierProbaVectorizer, KeywordFeaturesVectorizer -from ovos_plugin_manager.ocp import load_stream_extractors, available_extractors +from ovos_plugin_manager.ocp import available_extractors from ovos_utils import classproperty from ovos_utils.gui import is_gui_connected, is_gui_running from ovos_utils.log import LOG @@ -26,11 +26,11 @@ try: from ovos_utils.ocp import MediaType, PlaybackType, PlaybackMode, PlayerState, OCP_ID, \ - MediaEntry, Playlist, MediaState, TrackState, dict2entry + MediaEntry, Playlist, MediaState, TrackState, dict2entry, PluginStream from ovos_bus_client.apis.ocp import OCPInterface, OCPQuery except ImportError: from ovos_workshop.backwards_compat import MediaType, PlaybackType, PlaybackMode, PlayerState, OCP_ID, \ - MediaEntry, Playlist, MediaState, TrackState, dict2entry + MediaEntry, Playlist, MediaState, TrackState, dict2entry, PluginStream from ovos_bus_client.apis.ocp import OCPInterface as _OIF, OCPQuery as _OQ @@ -982,15 +982,22 @@ def select_best(self, results: list, message: Message) -> MediaEntry: # Legacy Audio subsystem API def legacy_play(self, results: List[MediaEntry], phrase="", message: Optional[Message] = None): - xtract = load_stream_extractors() - # for legacy audio service we need to do stream extraction here - # we also need to filter video results - results = [xtract.extract_stream(r.uri, video=False)["uri"] - for r in results - if r.playback == PlaybackType.AUDIO - or r.media_type in OCPQuery.cast2audio] - - self.legacy_api.play(results, utterance=phrase) + res = [] + for r in results: + if not (r.playback == PlaybackType.AUDIO or r.media_type in OCPQuery.cast2audio): + # we need to filter video results + continue + if isinstance(r, Playlist): + # get internal entries from the playlist + for e in r.entries: + res.append(e.uri) + elif isinstance(r, MediaEntry): + res.append(r.uri) + elif isinstance(r, PluginStream): + # for legacy audio service we need to do stream extraction here + res.append(r.extract_uri(video=False)) + + self.legacy_api.play(res, utterance=phrase) player = self.get_player(message) player.player_state = PlayerState.PLAYING diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 635b415c04a..2c2e4515048 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -12,7 +12,7 @@ ovos-plugin-manager<0.1.0, >=0.0.25 ovos-config~=0.0,>=0.0.13a8 ovos-lingua-franca>=0.4.7 ovos-backend-client~=0.1.0 -ovos-workshop>=0.0.16a39 +ovos-workshop>=0.0.16a40 # provides plugins and classic machine learning framework ovos-classifiers<0.1.0, >=0.0.0a53