Hi,
I’m come across an issue to do with the flow of UI controls within my plugin. I’m currently using the replaceParent property to achieve the desired workflow of the user. However, in one instance it seems that I actually want to replace two parents. Otherwise, when the user presses escape, they don’t go back far enough to the appropriate UI control. Here are some more details…
Function: FilmDetailsMenu
Description: Film Details Page. This page shows the details of the title to the user and allows them to select various actions.
[list]
[]Trailer
[]Rent by post
[]Rate this film
[]Reviews
[/list]
Selecting the “Rent by post” option opens the following page:
Function: RentMenu
Description: Rent Film Page. This allows the user to input the parameters of the rental and make the final decision to add the title to their rental list.
[list]
[]Priority
[]Queue
Rent
[/list]
Selecting either the Priority or Queue options will open up a PopupDirectoryItem which allows the user to select from a number of options. These then return to the original RentMenu function (including the new parameters) which then uses “replaceParent” to simply update the existing page.
If the user enters the RentMenu, then immediately presses exit, they would expect to go back to the FilmDetailsMenu. However, when the user presses the Rent option in the RentMenu, they would also expect to go back to FilmDetailsMenu with some indication that the title had been rented. Since i’m currently only replacing a single parent, i’m finding that the Rent option returns to the appropriate view, however pressing escape means it returns to the previous FilmDetailsMenu. This means I have stacked two of these controls on top of each other.
Sorry about an over complicated scenario but it’s a pain in the ass to resolve. Any thoughts one what I could do? Thanks in advance!
Instead of using replaceParent, it might work better to use noCache=True for the MediaContainer. That way, if a user changes the Priority or Queue options the page will reload to show the change. If the user just escapes instead, they will be returned to the appropriate screen.
Hey, I think I might not have explained the problem correctly. When using the replaceParent, i’ve actually got it such that the user can change the priority and queue and still just escape to cancel the action. However, the problem is when the user presses the “Rent” option. I basically want it to return to the previous control (similar to the user pressing escape) but I want to execute some code (the code to actually add the title to the queue). At the moment, the Rent option points to the MainTitle function that simply displays the title’s details and user actions. Since this replaces the parent of the Rent Option menu, nothing has then replaced the previous MainTitle page in the stack, resulting in two identical pages stacked on top of each other.
Hey Ian,
If I understand correctly...
you start with:
MainTitle --> Rent Option
but after "renting," replaceParent puts you here:
MainTitle --> MainTitle
And you just want to go back to the original DirectoryItem:
MainTitle
Yeah, that’s right. My code currently creates a new TitleMenu passing in some optional parameters which cause the rental to actually occur. But since this new instances replaces it’s parent of the RentMenu, it results in 2 TitleMenu’s being on the stack.
Any thoughts?
MediaContainer()???
[http://dev.plexapp.c...#MediaContainer](http://dev.plexapp.com/docs/Objects.html?MediaContainer#MediaContainer)
It does sound like your plugin is similar to Netflix. While, I guess you can't use the Netflix Plug directly, but the code is available at:
[https://github.com/p.../Netflix.bundle](https://github.com/plexinc-plugins/Netflix.bundle)
Hey,
I appreciate your help on this. I’ve decided to change the workflow slightly and instead of offering the user various options of rental, i’m going to use some defaults (priority:Medium, Queue:Default) and then allow them to easily change it after it’s been added to the queue. This side steps the issue for now. I have looked over the code available on Netflix but since i’m in the UK i’m unable to use it. That’s why I decided to write my own LoveFilm one (the european equivalent). I’ve not got too much left to do on it but I’ve been contacting LoveFilm to request access to additional functionality (it uses the public API instead of scraping). At the moment, it provides a interface to allow searching and the management of user’s rental lists (similar to their iPhone application).
Ian
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.