Skip to content

Commit

Permalink
Merge pull request #119 from OpenVoiceOS/release-0.1.0a1
Browse files Browse the repository at this point in the history
Release 0.1.0a1
  • Loading branch information
JarbasAl authored Sep 17, 2024
2 parents 85205c6 + a374300 commit c819709
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
38 changes: 3 additions & 35 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,12 @@
# Changelog

## [0.0.9a2](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.0.9a2) (2024-09-10)
## [0.1.0a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.1.0a1) (2024-09-17)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.0.9a1...0.0.9a2)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.0.10...0.1.0a1)

**Merged pull requests:**

- chore:semver\_versioning [\#116](https://github.com/OpenVoiceOS/ovos-bus-client/pull/116) ([JarbasAl](https://github.com/JarbasAl))

## [0.0.9a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.0.9a1) (2024-09-10)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/V0.0.9...0.0.9a1)

**Breaking changes:**

- refactor/remove\_stt+tts\_prefs [\#91](https://github.com/OpenVoiceOS/ovos-bus-client/pull/91) ([JarbasAl](https://github.com/JarbasAl))

**Implemented enhancements:**

- feat/blacklist\_from\_session [\#98](https://github.com/OpenVoiceOS/ovos-bus-client/pull/98) ([JarbasAl](https://github.com/JarbasAl))
- feat/track\_speaking+recording\_per\_session [\#93](https://github.com/OpenVoiceOS/ovos-bus-client/pull/93) ([JarbasAl](https://github.com/JarbasAl))
- feat/add\_units\_to\_session [\#90](https://github.com/OpenVoiceOS/ovos-bus-client/pull/90) ([JarbasAl](https://github.com/JarbasAl))
- feat/targeted OCP queries [\#88](https://github.com/OpenVoiceOS/ovos-bus-client/pull/88) ([NeonJarbas](https://github.com/NeonJarbas))

**Fixed bugs:**

- fix/KeyError [\#105](https://github.com/OpenVoiceOS/ovos-bus-client/pull/105) ([JarbasAl](https://github.com/JarbasAl))
- fix/ocp\_missing\_context [\#104](https://github.com/OpenVoiceOS/ovos-bus-client/pull/104) ([JarbasAl](https://github.com/JarbasAl))
- fix/ocp\_api\_context [\#103](https://github.com/OpenVoiceOS/ovos-bus-client/pull/103) ([JarbasAl](https://github.com/JarbasAl))
- fix/ocp\_uris [\#102](https://github.com/OpenVoiceOS/ovos-bus-client/pull/102) ([JarbasAl](https://github.com/JarbasAl))
- hotfix/StreamPlugin [\#100](https://github.com/OpenVoiceOS/ovos-bus-client/pull/100) ([JarbasAl](https://github.com/JarbasAl))
- Update error handling to reduce unhandled exceptions [\#96](https://github.com/OpenVoiceOS/ovos-bus-client/pull/96) ([NeonDaniel](https://github.com/NeonDaniel))
- Update setup.py to resolve version automation bug [\#95](https://github.com/OpenVoiceOS/ovos-bus-client/pull/95) ([NeonDaniel](https://github.com/NeonDaniel))

**Merged pull requests:**

- chore:semver\_automations [\#114](https://github.com/OpenVoiceOS/ovos-bus-client/pull/114) ([JarbasAl](https://github.com/JarbasAl))
- deprecation warnings [\#111](https://github.com/OpenVoiceOS/ovos-bus-client/pull/111) ([JarbasAl](https://github.com/JarbasAl))
- refactor/handle\_new\_SEIs [\#97](https://github.com/OpenVoiceOS/ovos-bus-client/pull/97) ([JarbasAl](https://github.com/JarbasAl))
- Update imports to support ovos-utils~=0.0.x with compat. warnings [\#94](https://github.com/OpenVoiceOS/ovos-bus-client/pull/94) ([NeonDaniel](https://github.com/NeonDaniel))
- feat:ovos.common\_play.search.populate event [\#118](https://github.com/OpenVoiceOS/ovos-bus-client/pull/118) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
34 changes: 30 additions & 4 deletions ovos_bus_client/apis/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,22 @@ def queue(self, tracks: list, source_message: Optional[Message] = None):
self.bus.emit(source_message.forward('ovos.common_play.playlist.queue',
{'tracks': tracks}))

@_ensure_message_kwarg()
def populate_search_results(self, tracks: list,
replace: bool = True,
sort_by_conf: bool = True,
source_message: Optional[Message] = None):
"""populate search results in OCP with new tracks
Args:
tracks: track dict or list of track dicts (OCP result style)
replace: if False, extend existing search, if True replace current search results
source_message: bus message that triggered this action
"""
tracks = self.norm_tracks(tracks)
self.bus.emit(source_message.forward('ovos.common_play.search.populate',
{"playlist": [t.as_dict for t in tracks],
"replace": replace, "sort_by_conf": sort_by_conf}))

@_ensure_message_kwarg()
def play(self, tracks: list, utterance=None, source_message: Optional[Message] = None):
"""Start playback.
Expand All @@ -353,12 +369,22 @@ def play(self, tracks: list, utterance=None, source_message: Optional[Message] =
source_message: bus message that triggered this action
"""
tracks = self.norm_tracks(tracks)

utterance = utterance or ''
tracks = [t.as_dict for t in tracks]
playlist = tracks
disambiguation = []
try:
from ovos_utils.ocp import Playlist, MediaEntry, PluginStream, dict2entry
if isinstance(tracks[0], Playlist):
playlist = tracks[0]
disambiguation = tracks
except ImportError as e:
LOG.warning("can't handle Playlist results properly, please update ovos-utils to >= 0.1.0")

media = playlist[0]
self.bus.emit(source_message.forward('ovos.common_play.play',
{"media": tracks[0],
"playlist": tracks,
{"media": media.as_dict,
"playlist": [t.as_dict for t in playlist],
"disambiguation": [t.as_dict for t in disambiguation],
"utterance": utterance}))

@_ensure_message_kwarg()
Expand Down
6 changes: 3 additions & 3 deletions ovos_bus_client/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_BUILD = 10
VERSION_ALPHA = 0
VERSION_MINOR = 1
VERSION_BUILD = 0
VERSION_ALPHA = 1
# END_VERSION_BLOCK

0 comments on commit c819709

Please sign in to comment.