-
Notifications
You must be signed in to change notification settings - Fork 6
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
drop the need to extend_timeout
#62
Comments
I agree this is unclean, but it was the way original mycroft common play did (where OCP was born from) I'm in favor of refactoring this one, but I'd like to keep the extend_timeout functionality around, OCP settings allows users to disable or limit this extension to protect against bad skills |
Then we have to ensure CPSkills are actually doing this. I'm running into problems with only 3(!) skills around (tunein, youtube, news). And if more and more News stations are dripping in, this only gets worse. Tunein is naturally sending only a handful. Besides, those have also to cap the |
I'm hawking on this. what if in OVOSCommonPlaybackSkill Class (#) we for handler in self._search_handlers:
...
# handler might return a generator or a list
if isinstance(results, list):
# inject skill id in individual results, will be needed later
# for proper playback handling
for idx, r in enumerate(results):
results[idx]["skill_id"] = self.skill_id
self.bus.emit(message.response({"phrase": search_phrase,
"skill_id": self.skill_id,
"skill_name": self.name,
"thumbnail": self.skill_icon,
"results": results,
"timeout": self.search_timeout})) making |
so instead of a bool we return an int for timeout, where 0 would be equivalent to |
you mean instead of a separate message that carries the amount and searching true. Where's the problem? |
This is a common message that is consumed by
handle_skill_response
during an active search:(
searching
is always False no matter if a skill is searching)to extend the timeout you need to
self.extend_timeout()
in a CPSkill which is sendingto trigger the respective cases
ovos-ocp-audio-plugin/ovos_plugin_common_play/ocp/search.py
Lines 157 to 170 in fced5de
While i see the potential goal to give the skill the freedom to extend to their liking (btw no skill is actually doing that - resulting in a problem when using
OCPQuery().wait()
), i don't like that implementation. It feels clumsy sending a search with"searching": False
just to need another message to send the timeout amount with"searching": True
cluttering the bus in the process.The text was updated successfully, but these errors were encountered: