PR for Services API Adding GetKeyBindList and PutKeyBind to Myth Services#120
Open
mitchcapper wants to merge 1 commit into
Open
PR for Services API Adding GetKeyBindList and PutKeyBind to Myth Services#120mitchcapper wants to merge 1 commit into
mitchcapper wants to merge 1 commit into
Conversation
Contributor
Author
e37738c to
ba92ba3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds two service API calls GetKeyBindList and PutKeyBind. The code here is largely modeled after the existing GetSettingList/PutSetting and storageGroupDir / storageGroupDirList code.
This is to make working with the new Frontend/SendKey function easier, so you can determine what key is mapped to what, and adjust key bindings. It doesn't notify/reload the frontend (but neither does MythWeb).
There is at least two major items for review/comment:
-PutSetting only returns true if it has changed the key binding. It returns false if the key binding is invalid, or if it is already set to that key. I could just have it always return true without checking if any rows are updated, or if we want to be very correct I could first do a select on the key to make sure it exists, and return true as long as it exists.
-I merged jumppoints and key bindings together (from a function point of view). Jumppoints now show up as Context=JumpPoint. Its a hack but it avoids having to make two more functions and more round trips for a client trying to get all the current binds. If it is felt two more functions is better I can split it.
-Also I debated added an IsAlive type option to only return keybindings for hosts that are active (when hosts are not specified) I don't feel this is really needed however.