![]() |
Planned API changes for Series Recordings - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136) +---- Thread: Planned API changes for Series Recordings (/showthread.php?tid=227026) |
Planned API changes for Series Recordings - ksooo - 2015-05-15 Hi PVR add-on developers, Just wanted to give you all a heads up for a bigger PVR API change aiming to finally officially support series recordings in Kodi: https://github.com/xbmc/xbmc/pull/7079 This will bring official series support to Kodi PVR, including a simple and consistent user interface. I consider the API final, but if I forgot something important, this is the right time to let me know. With this PR all the hand crafted series recording support (including own dialogs and stuff) that might be built in into your add-on should become obsolete. Is planned to merge this PR early after isengard branch has been created. I want to ask you all for preparing the required changes in the add-ons you maintain. It is definitely more than just a one liner, but it's worth the effort, I think. - Kai. RE: Planned API changes for Series Recordings - metaron - 2015-06-10 I believe we all want the PVR API changes to be merged as soon as possible (i.e. once Isenguard is branched). Tweaks to Kodi's PVR core which don't affect the API can be worked on later. Skin issues can be worked on later. Changes to the detail for particular Addons that don't require API changes can be worked on later. The immediate objective is therefore to freeze an API which supports the desired new features, with sufficient flexibility so addon maintainers can start implementing without needing further API changes. To be sure PR7079 is ready, I suggest we ask the following questions: Q: What are the 'legacy' features we want to keep & why? A1: Standard 'Timer' based recordings (this channel, at this time, for this long) - All backends do this. Backwards compatabiltiy. A2: Repeating 'Timer' based recordings (this channel, at this time, for this long, on these days) - Fallback. Doesn't need a good EPG. A3: Timeshift Q: What are the desired new features & why? A1: EPG Based Once recording (Find and record 'the optimum' upcoming showing of the selected episode) A2: EPG Based Series recording (Find and record all distinct episodes of this show, using 'optimum' settings) A3: EPG Based 'Advanced Search' recording (e.g. Find and record all films with 'Carry Grant' in them or 'Terminator' in the title) A4: A means to adjust 'back end specific' settings (avoiding attribute mapping issues with different backends) Q: What API changes do we need to support these new desired features? A1: A means to determine if a PVR client supports the new timer types A2: A means to instruct a PVR client to add a new timer of the requested type A3: A means to know when EPG timers will actually record, including conflicts and metadata. A4: A means to edit both 'legacy' and EPG based timers after creation A5: A means to edit 'back end specific' timer settings after timer creation This assumes the following responsibilities: Kodi PVR core: KK1: Presentation of Timers and associated metadata. KK2: Requesting New Timers. Deleting Timers. Activating/Deactivating (manging conflicts). KK3: Editing Timers. KK4: Definition of 'essential timer settings' and presentable timer metadata. KK5: Definition of supportable 'Timer Types'? PVR Clients: PC1: Translation of New & Delete Timer requests into 'backend speak' for each supported 'timer type'. PC2: Translation of upcoming recordings and associated timers into 'Kodi speak'. PC3: Translation of 'essential timer settings' between 'kodi speak' and 'backend speak'. PC4: Formatting back-end specific settings / options for kodi-core to present to the user for editing PC5: Translating 'backend speak' timer metadata into 'kodi speak'. Back-End: BE1: Converting timers into upcoming recordings using the settings requested by the PVR client. BE2: Informing the PVR client of upcoming recordings and timer metadata. To give some context to these comments, I'm a long term mythtv user who just played with Ksooo's latest tvheadend prototype and 'skimmed' the code. I plan to look at specifics in detail in the next few days and to make separate comments, but am sure there are others with a much better grip on the proposed API (and CPP in general) than I have. Given this and the 'urgency' it is probably better to ask the question and see what others think. My questions are:
I can only apologize ksooo, I would much rather have posted this at 13:45 on 2015-05-15. RE: Planned API changes for Series Recordings - scarecrow420 - 2015-06-11 I've been keeping an eye on it all and participating in the github discussion. From our perspective (pvr.wmc) this is fantastic and seems to cover all the bases. We are ready and willing to build our side of the changes once merged, or perhaps starting now if the changes are getting to the finalised state Planned API changes for Series Recordings - ksooo - 2015-06-11 I will supply PRs for all PVR add-ons the very next days. These PRs will ensure compatibility and minimalistic support for API 1.9.7. To leverage the new features possible due to the new API each add-on must be adapted by the respective owners, though. Short: if the maintainer does nothing, almost all stays the same for the add-on wrt functionality, and (hopefully) nothing gets broken. RE: Planned API changes for Series Recordings - metaron - 2015-06-12 When I schedule a new recording (at present using mythweb), I usually do the following:
If I understand correctly, while this new API will allow the first step and 1/2 of the second, unless I misunderstand, I will still have to find the recording rule in mythtv later and tweak the 'autoexpire' 'recording group' and 'no of recordings to keep' settings and if I want my 'record once' rule to choose to record on ITV1, IVT1+1 or ITV HD automatically, I will have to turn off the 'this channel only' flag as well, which may well confuse the pvr.mythtv client and kodi when it tries to classify the timer type for display later. While the API makes it simple for a PVR client to decide if it wants to support a pre-defined feature like 'folder names' or 'storage priority', adding extra options like 'recording group' or 'no of recordings to keep' won't be possible without changing the API, which will require the PVR core to change and then possibly all the addons as well (i.e. a long release cycle with a lot of interested parties). My suggestion is that other than a few essential core timer variables, which should be kept to a minimum, most of the settings for advanced EPG timers should be presented to the user by the PVR client using a callback mechanism. e.g. bSettingsChanged = PresentExtraTimerSettingsForAdjustment (PVR_CLIENT iClient, PVR_TIMER iTimer); If I understand correctly the timer settings dialog uses a 'generic' dialog which is simply populated with a list of 'settings' to change. If the responsibility for choosing these settings falls to the PVR client, each addon maintainer is free to choose those settings which best map to the selected backend features which the user base wants access to. They could even make this set of displayed settings 'configurable' on the addon settings pages. I can see that the timer options which work well for tvheadend don't work well for mythtv (at least for my use cases). I suspect that when you look at the other supported PVR clients in detail, there will be other 'must have' settings which don't map well to those already 'pre-defined'. If this API is added now, when each addon maintainer implements the new EPG based types, they can implement the callback. The existing settings mechanism can be used until an addon says it supports the 'settings callback'. When it does, that gets used instead. Planned API changes for Series Recordings - ksooo - 2015-06-12 Your suggestions do not conflict with what is planned for J******, thus imo can be added in a next step. The good thing about open-source is that everybody is invited to contribute the respective code. RE: Planned API changes for Series Recordings - metaron - 2015-06-13 Sounds like something worth the effort to me :-). Github login here we come... Planned API changes for Series Recordings - ksooo - 2015-06-13 Cool. Go ahead. I will happy to assist. RE: Planned API changes for Series Recordings - metaron - 2015-06-15 @ksooo I've had closer look at your code and what would be required to implement my stated objectives (above) in the mythtv client. I've come to the conclusion there are only two things missing.
The options seem to be:
I plan to prototyping the following changes for your consideration: Folder List: New ''PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDER_LIST" (with a filler function provided by the addon) This would be a simple alternative to freetext folder entry. I would prefer to set up a list of folders in advance (in the addon settings pages or via the backend) as I don't have a keyboard attached to my TV. Lifetime: This is a bit more complex. I note that @ryangribble commented regarding pvr.wmc (https://github.com/xbmc/xbmc/pull/7079): Quote:And for lifetime we can do keep until watched/keep until space needed /keep recent etcSeems there are several different philosophies out there.
I would propose a list which like the 'Any Time' toggle controls the display while allowing the user to select from supported options. A lifetime in days or number of recordings is then presented as a spinner below where appropriate. New "PVR_TIMER_TYPE_SUPPORTS_KEEP_FOREVER" New "PVR_TIMER_TYPE_SUPPORTS_KEEP_MOST_RECENT" (new number of recordings spinner / reuse 'days' spinner?) New "PVR_TIMER_TYPE_SUPPORTS_KEEP_FIRST_SHOWN" (new number of recordings spinner / reuse 'days' spinner?) New "PVR_TIMER_TYPE_SUPPORTS_KEEP_UNTIL_WATCHED" New "PVR_TIMER_TYPE_SUPPORTS_KEEP_UNTIL_DISK_FULL" Existing "PVR_TIMER_TYPE_SUPPORTS_LIFETIME" (existing 'days' spinner) - Maybe rename this "PVR_TIMER_TYPE_SUPPORTS_KEEP_LIFETIME"? Are there any other recording expiration philosophies out there which ought to be catered for? I accept this has almost certainly missed the boat for this PR (imho this is part of the 20% in the 80-20 rule), but maybe it will make a later revision before Jxxxxx hits the streets if I can get it working quickly enough... Planned API changes for Series Recordings - ksooo - 2015-06-15 Regarding lifetime: API already allows to completely redefine values and semantics. from my point of view we already have all that is needed. => https://github.com/xbmc/xbmc/blob/0aab86a39d5a70be2854d772fbdcd872123a4bfa/xbmc/addons/include/xbmc_pvr_types.h#L331 Planned API changes for Series Recordings - ksooo - 2015-06-15 Regarding recording folder list: your suggestion fita nicely in the existing API concept. We would need to define a new timer type attribute plus add API support for letting the add-on define own values for this attribute (exactly like we already did for lifetime), finally implement that attribute in the timer settings dialog. Then, the add-on can fill the respective data. That's it. Nothing really complicated. ;-) If I find the time I will add this to the existing PR, but cannot promise anything. RE: Planned API changes for Series Recordings - metaron - 2015-06-15 (2015-06-15, 18:24)ksooo Wrote: Regarding lifetime: API already allows to completely redefine values and semantics. from my point of view we already have all that is needed. => https://github.com/xbmc/xbmc/blob/0aab86a39d5a70be2854d772fbdcd872123a4bfa/xbmc/addons/include/xbmc_pvr_types.h#L331I don't see how yet, but I'll take your word for it. This looked like the more difficult one to me anyhow ![]() (2015-06-15, 18:43)ksooo Wrote: Regarding recording folder list: your suggestion fita nicely in the existing API concept. We would need to define a new timer type attribute plus add API support for letting the add-on define own values for this attribute (exactly like we already did for lifetime), finally implement that attribute in the timer settings dialog. Then, the add-on can fill the respective data. That's it. Nothing really complicated. ;-)I'll have a go and send you a PR based on the 'pvr-series-recordings' branch in the next couple of days. From an API perspective it looks like a copy of the "prevent duplicate episodes" method with a different name (or at least a pick and mix from the other methods), so I should be able to cope ![]() Planned API changes for Series Recordings - ksooo - 2015-06-15 Okay, go ahead. RE: Planned API changes for Series Recordings - metaron - 2015-06-17 @ksooo and other interested parties, the promised pull request can be found at: https://github.com/ksooo/xbmc/pull/2 I also worked out how Lifetime could be tweaked to allow non-integer settings - so no more doubts there! On closer examination the API looks easily extensible and flexible enough to cope with almost anything the clients can throw at it. Excellent work! The only minor comment I have is that the order of the settings seems to be fixed in the 'Timer Settings' dialog, but maybe that's for the best. It appears any 'lists' or 'skips' need to be pushed onto TimerTypes in the order defined in GUIDialogPVRTimerSettings.cpp. Unless this is 'skinnable' in some way, it looks as if, should someone decide during Jxxxx development that 'Recording Group' should come before 'Lifetime' for example, clients would have to be re-written to change the order in which they push their lists. Personally I think I could live with this limitation, but there may be others who disagree. Planned API changes for Series Recordings - ksooo - 2015-06-17 The order of the timer attributes is hard coded in the timer settings dialog and cannot be changed by the add-on in any way. |