Skip to content

Commit

Permalink
fix:legacy_cps (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Oct 31, 2024
1 parent baac4eb commit 4f0a7ac
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 4f0a7ac

Please sign in to comment.