plex_assistant
plex_assistant copied to clipboard
Jump forward/back with variable amount
When using other video apps with Google Assistant, it's very easy to simply say "Jump forward 10 minutes" or "Rewind 1 minute" and the video will move to the specific position. Not only that Plex assistant can't do this but it also has a bug that starts playing a different movie/show. Plex assistant doesn't just ignore the time specified in that command but messes up the playing media.
It'll be great if we can specify any number of seconds or minutes (I don't think hours would be practical) to rewind/forward whatever media is playing. At the very least, if somebody specifies a time, please just ignore it and do the default amount of time set on the UI.
Here are some logs describing the problem:
21-02-11 16:02:13 DEBUG (SyncWorker_4) [custom_components.plex_assistant.const] IFTTT Call: play Wonder Woman
2021-02-11 16:02:13 DEBUG (SyncWorker_3) [custom_components.plex_assistant.const] Command: play Wonder Woman
2021-02-11 16:02:13 DEBUG (SyncWorker_3) [custom_components.plex_assistant.const] Processed Command: media = wonder woman, device = *****
2021-02-11 16:02:14 DEBUG (SyncWorker_3) [custom_components.plex_assistant.const] Device: *****
2021-02-11 16:02:14 DEBUG (SyncWorker_3) [custom_components.plex_assistant.const] Media: <Movie:25383:Wonder-Woman>
2021-02-11 16:02:46 DEBUG (SyncWorker_4) [custom_components.plex_assistant.const] IFTTT Call: forward 2 minutes
2021-02-11 16:02:46 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Command: forward 2 minutes
2021-02-11 16:02:46 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Processed Command: media = fast forward 2 minutes, device = *****
2021-02-11 16:02:46 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Device: *****
2021-02-11 16:02:47 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Media: <Movie:42190:Creed-II>
2021-02-11 16:03:07 DEBUG (SyncWorker_0) [custom_components.plex_assistant.const] IFTTT Call: jump forward 3 minutes
2021-02-11 16:03:07 DEBUG (SyncWorker_1) [custom_components.plex_assistant.const] Command: jump forward 3 minutes
2021-02-11 16:03:07 DEBUG (SyncWorker_1) [custom_components.plex_assistant.const] Processed Command: media = jump fast forward 3 minutes, device = *****
2021-02-11 16:03:07 DEBUG (SyncWorker_1) [custom_components.plex_assistant.const] Device: *****
2021-02-11 16:03:11 DEBUG (SyncWorker_1) [custom_components.plex_assistant.const] Media: <Movie:119:Rambo-III>
I'm a beginner with python, but I'm willing to take a look at the code and provide a PR to introduce/fix this issue. Unless somebody beats me to it
Not really and issue, this is more a feature request. You're giving commands that just don't exist yet and since there is no logic to handle it, plex assistant is trying to find a media item named whatever you're saying.
The jump forward, jump back commands have a set time that is configurable in the options. Doing this with variable times with speech commands is on my list, but not implemented yet. The only commands that will work with Plex Assistant are the ones listed in the readme.
You're correct, it's more of a feature request. But there's an issue with replacing the command. I have setup the following keywords to be replaced: "forward":"fast forward", "rewind":"jump back"
. When using forward, the same problem as before happens:
2021-02-11 18:56:16 DEBUG (SyncWorker_1) [custom_components.plex_assistant.const] IFTTT Call: jump forward
2021-02-11 18:56:16 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Command: jump forward
2021-02-11 18:56:16 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Processed Command: media = jump fast forward, device = *****
2021-02-11 18:56:16 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Device: *****
2021-02-11 18:56:17 DEBUG (SyncWorker_2) [custom_components.plex_assistant.const] Media: <Movie:11236:Star-Wars>
I can open a new issue to track this specific problem if you prefer.
Your config is wrong. You're saying "jump forward" and it is doing what you've asked it to do, which is replace the word "forward" with "fast forward" so it becomes "jump fast forward".
I assume you want to say "fast forward" and "rewind". This is what it should look like:
"fast forward":"jump forward", "rewind":"jump back"
I was under the impression that I could use both original and replaced commands. In the case of "jump back", I can either say "jump back" or "rewind" and both will do the same. I want to be able to say "fast forward" or "forward" and expect both to work. I guess this is not the intention of the code, rather a literal replacement. In my case, I'll have to choose either "forward" or "fast forward" but I can't have both. I have people that prefer one over the other and I was hoping to cater to both groups of people. Perhaps, instead of a replacement, aliases would accomplish this better.
The issues here are trying to keep configuration easy for the user, the two advanced options have to be entered as strings ATM since I'm working with the current limitations of HA's UI configuration (which should be improved in some time), and keeping this all working within all currently supported languages.
Using aliases would be nice for sure and when the UI allows for more complex configuration I'll go that route, but currently I don't have great options. I moved config to the UI and rewrote Plex Assistant to be more accessible since many of my support questions came from people who have just started using HA and haven't had to mess with YAML or people looking for a solution to control Plex with Google Assistant and have never used HA.
I totally understand. I also noticed that you don't have localizations for Spanish. So, I'm in the process of doing them so I can submit a PR 😄
I'm surprised it took this long for someone to add Spanish, I figured it would have been one of the first translations I got. It's supported by IFTTT as well, so that's a plus.
Speaking of translations: Since you're going in there to add a new language, it's not a far jump to modify the English localization to you own liking. Would solve your "forward" being replaced issue, but would just require an edit when there's an update.
In the next major update I'll be adding more phrases for things. One of them will be adding jump forward
, fast forward
, or forward
for the seek ahead commands and jump back
or rewind
for the seek back commands. So no need to edit the file yourself once released.