Skip to content

Commit

Permalink
https://github.com/OpenVoiceOS/ovos-utils/pull/257
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jun 21, 2024
1 parent 85dbf3f commit 5f80727
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ovos_workshop/backwards_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,22 @@ class PluginStream:
image: str = ""
skill_icon: str = ""

def extract_uri(self, video=True) -> str:
from ovos_plugin_manager.ocp import load_stream_extractors
xtract = load_stream_extractors()
meta = xtract.extract_stream(f"{self.extractor_id}//{self.stream}",
video=video)
return meta["uri"]

def extract_media_entry(self, video=True) -> MediaEntry:
from ovos_plugin_manager.ocp import load_stream_extractors
xtract = load_stream_extractors()
meta = xtract.extract_stream(f"{self.extractor_id}//{self.stream}",
video=video)
kwargs = {k: v for k, v in meta.items()
if k in inspect.signature(MediaEntry).parameters}
return MediaEntry(**kwargs)

@property
def infocard(self) -> dict:
"""
Expand Down

0 comments on commit 5f80727

Please sign in to comment.