ginjaninja 624 Posted 6 hours ago Posted 6 hours ago (edited) I wish to make my plugin available to end users on the Webclient, so i have registered a page controller / page just for users with EnableInUserMenu = true, It works fine other than i have to press f5 after every action for non admins. Claude tells me its becuase the Emby page wiring is hard coded to "sendmessagetoadminsessions" and not "sendmessagetousersessions"...but regardless does this make any sense and is there a way to make pages responsive to users. https://github.com/ginjaninja1/ManageComingSoon/tree/main/UI testing on 4.10.0.21 thanks Edited 6 hours ago by ginjaninja
ginjaninja 624 Posted 2 hours ago Author Posted 2 hours ago (edited) 4 hours ago, Luke said: Hi, after what actions? Thanks @Luke, bear with me , becuase i am guessing what matters to investigating this. I have a genericui buttonitem with a command handle "AddToList" public override Task<IPluginUIView> RunCommand(string itemId, string commandId, string data) { if (commandId == "AddToList") { HandleAddToList(); return Task.FromResult<IPluginUIView>(this); } Claude says the smoking gun in is PageControllerHostbase in that it is the something in the chain hardwired to "SendMessageToAdminSessions" // Emby.Web.GenericUI.Control.PageHosts.PageControllerHostBase protected void NotifyPageChangeDelayed(IUIView uiView) { Task.Run(async delegate { await Task.Delay(500).ConfigureAwait(continueOnCapturedContext: false); UIViewInfo data = new UIViewInfo(uiView) { IsPageChangeInfo = true }; await sessionManager.SendMessageToAdminSessions("UIPageInfoChanged", data, CancellationToken.None).ConfigureAwait(continueOnCapturedContext: false); }); } private void CurrentUIViewOnUIViewInfoChanged( object sender, GenericEventArgs<IUIView> e) { if (IsInitialized) { this.UIPageInfoChanged?.Invoke(this, e); UIViewInfo data = new UIViewInfo(e.Argument); sessionManager.SendMessageToAdminSessions( "UIPageInfoChanged", data, CancellationToken.None); } } Edited 2 hours ago by ginjaninja
ginjaninja 624 Posted 55 minutes ago Author Posted 55 minutes ago Woohoo, Claude came good with a bit of finesseing and gave me a solution. https://github.com/ginjaninja1/ManageComingSoon/tree/TestuserpageswithoutcallingUIViewInfoChanged/UI/UserAddMovie Claudes solution was to give me a page which did not rely on UIViewInfoChanged, and every button action has to immediately return a view. Is this close to the intended approach? User facing plugins are supported but you have to be careful with what responsiveness you can expect and avoid RaiseUIViewInfoChanged? Spoiler What was deliberately removed This page has no: RaiseUIViewInfoChanged; UIViewInfoChanged event handling; task event subscriptions; tracker state-change subscriptions; poll timer; refresh timer; detached Task.Run search; progress bar; live task-status display.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now