Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:legacy_cps #21

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ocp_pipeline/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,8 @@ def _execute_query(self, phrase: str,
LOG.debug(f'Returning {len(results)} search results')
return results

def select_best(self, results: list, message: Message) -> Union[MediaEntry, Playlist, PluginStream]:
@staticmethod
def select_best(results: list, message: Message) -> Union[MediaEntry, Playlist, PluginStream]:

sess = SessionManager.get(message)

Expand Down Expand Up @@ -1122,7 +1123,7 @@ def handle_legacy_cps(self, message: Message):
utt = message.data["query"]
res = self.mycroft_cps.search(utt)
if res:
best = self.select_best([r[0] for r in res], message)
best = OCPPipelineMatcher.select_best([r[0] for r in res], message)
if best:
callback = [r[1] for r in res if r[0].uri == best.uri][0]
self.mycroft_cps.skill_play(skill_id=best.skill_id,
Expand Down
Loading