Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVR] PVR Addon API 4.0.0 #8005

Merged
merged 7 commits into from Sep 14, 2015
Merged

[PVR] PVR Addon API 4.0.0 #8005

merged 7 commits into from Sep 14, 2015

Conversation

ksooo
Copy link
Member

@ksooo ksooo commented Sep 10, 2015

This PR contains cleanup changes for the PVR Addon API, including the related Kodi core changes

Remove parameter bDeleteScheduled from function DeleteTimer

  • Rational: Parameter is not needed, functionality can easily be implemented in Kodi core
  • Core changes: Implement "on delete of a child of a repeating timer offer to delete the repeating timer including all children or just the child. Requested by @da-anda in [PVR] Series recordings #7079 and in the forum. Remove "on delete of a repeating timer offer to keep the children of that timer". Functionality was considered senseless by several users in the forum. ;-)

Introduce constant PVR_TIMER_NO_CLIENT_INDEX

  • Rational: Magic numbers "everywhere" in the core and in the addons, signed/unsigned problems, bugs (-1 vs. 0 as null value)
  • Core changes: No functional changes. Use the new constant instead of magic numbers. Change data types signed<->unsigned to align Kodi core and PVR Addon API data types.

Changed type of PVR_TIMER.iEpgUid to unsigned int. Introduce constant PVR_TIMER_NO_EPG_UID

  • Rational: EPG event ids in PVR_RECORDING and EPG_TAG are represented as unsigned int, but in PVR_TIMER as int. Magic numbers "everywhere" in the core and in the addons, signed/unsigned problems, bugs (-1 vs. 0 as null value).
  • Core changes: No functional changes. Use the new constant instead of magic numbers. Change data types signed<->unsigned to align Kodi core and PVR Addon API data types.

Please note that this PR does not solve all "magic number" problems we have with the current API and that it is not my attention to achieve this with this PR. So, please, refrain from pulling in other problems, not related to PVR_TIMER.iClientIndex and PVR_TIMER.iEpgUid, into this PR. ;-)

I will open PRs for bumping all PVR addons to version 4.0.0, including the necessary code changes, the next days.

@metaron-uk, @ryangribble, @janbar, for your information, feedback welcome.
@Jalle19 mind doing the review?

@ksooo ksooo added API change Component: PVR v16 Jarvis Type: Fix non-breaking change which fixes an issue labels Sep 10, 2015
@ksooo
Copy link
Member Author

ksooo commented Sep 11, 2015

Silence means agreement? ;-)

@ryangribble
Copy link
Contributor

Proposed code changes are good with me... I tend to agree with @metaron-uk point about the comment

@metaron-uk
Copy link
Contributor

I've a working prototype of pvr.mythtv working against your pvr-api-4-0-0 branch.
Want me to do the mythtv add-on support PR?

@ksooo
Copy link
Member Author

ksooo commented Sep 11, 2015

@@ -51,7 +51,7 @@ CEpgInfoTag::CEpgInfoTag(void) :
m_iSeriesNumber(0),
m_iEpisodeNumber(0),
m_iEpisodePart(0),
m_iUniqueBroadcastID(-1),
m_iUniqueBroadcastID(0),

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@metaron-uk
Copy link
Contributor

@ksooo, I know you didn't want other things in this change, but I've got frustrated that strEpisodeName isn't part of the PVR_TIMER structure. I dropped it from the 3.0.0 API changes, but now I've changed my mind. As you're updating the API again, could this be added now?

Reasons

  1. The current behaviour means if you want EpisodeName for a subordinate timer in the timer list view (pretty much essential IMO), you have to squeeze it into strTitle field in the client which breaks the 'Find similar' search feature.
  2. The skin has control over the subtitle presentation format for recordings and EPG. Currently the client has for the recordings list (but not the EPG info presented immediately below it)
  3. Just getting the info from the EPG tag for the list view doesn't work too well either as EPG data won't necessarily be available more than 3 days into the future...

The mythtv client also tries to squeeze season/episode number into the title field as well, so I'd suggest adding these at the same time (although maybe not include them in the skin yet)

(Happy to do a commit for this and the associated confluence change for you to cherry-pick if you agree)

Will take a look at https://github.com/ksooo/pvr.mythtv/tree/pvr-api-4-0-0

@janbar
Copy link
Contributor

janbar commented Sep 11, 2015

@ksooo, good for me.
@metaron-uk, not agree, the episode name is part of epg tag or recording, so nothing to do with timer record which is already linked with epg tag. So no need to add this field.

@metaron-uk
Copy link
Contributor

@janbar - then why is it currently squeezed into strTitle in the client (yes I know I did the PR for that...)
screenshot026
This would look pretty wierd if some of the upcoming recordings had 'subtitles' and some didn't.

Forget about season and episode. It's only the close relationship between title and episode title which makes it important to have strEpisodeName here as well imo.

@janbar
Copy link
Contributor

janbar commented Sep 11, 2015

@metaron-uk , i would agree with a new field named "strSubtitle" which is more generic and could be used by other client to show various info. But episode name is too restricted and as i said above it doesn't relate the timer itself (as a timer class).

@metaron-uk
Copy link
Contributor

@janbar: The API names are a bit messed up IMHO.
strEpisodeName really ought to be strSubtitle, iSeriesNumber ought to be iSeasonNumber etc...

@ksooo - what do you think. Should we use Jarvis as an opportunity to sanitize the API variable names (not in this PR!), or do we live with the current variables names for legacy reasons....

@ksooo
Copy link
Member Author

ksooo commented Sep 11, 2015

@ksooo - what do you think. Should we use Jarvis as an opportunity to sanitize the API variable names (not in this PR!), or do we live with the current variables names for legacy reasons....

Although in principal a good idea, we're running out of time for Jarvis, I'm afraid. Merge window for alpha 3 closes Sept 20 and I don't think that there will be another alpha. And in beta phase, API changes are a no go.

@ryangribble
Copy link
Contributor

Ive run tested this and it functions as expected. Thanks for making this change and responding to the feedback in the forum about the previous "preserve children timers" idea not making sense :)

A comment on the latest change:
When deleting a child timer, the message displayed is very large

"You are about to delete a timer that was scheduled by a repeating timer. Do you also want to delete the repeating timer and all timers it has scheduled?

Timer Name"

This not only causes scrolling in the dialog, but the initial state of the dialog already has the text scrolled to the end (so you cant read the start of the sentence for a while).

Personally I still think this question is redundant. Due to the fantatsic hierarchical display of parent/child timers in Kodi now, I think that if a user is deleting a single timer, then just delete the one timer... there is no need to ask them if they wanted to delete the parent timer. If they want to delete the parent timer, they would just go back out one level and then select delete on the parent.

If you feel the question MUST be asked, perhaps we need more succint wording as that length of wording in a dialog breaks user experience, IMO?

PS I have a pvr.wmc PR ready to go for API 4.0, so you wont need to worry about pvr.wmc: kodi-pvr/pvr.wmc#23

@metaron-uk
Copy link
Contributor

When deleting a child timer, the message displayed is very large

I agree the message is a bit long. What about making the title of the dialog 'Timer Name' and removing it from the end of the message. That way the message fits in the box.

 Personally I still think this question is redundant.

I disagree, there are plenty of places a user can delete a timer from which are not so obvious (e.g. EPG view, search results, timers list when not grouped)

@ksooo
Copy link
Member Author

ksooo commented Sep 12, 2015

When deleting a child timer, the message displayed is very large

Yep. Will try to find better (shorter) wording.

What about making the title of the dialog 'Timer Name'

Not a good idea, imo as timer name can be pretty long and scrolling dialog title is really very ugly.

Personally I still think this question is redundant.

I disagree, there are plenty of places a user can delete a timer from which are not so obvious (e.g. EPG view, search results, timers list when not grouped)

Full ack to what metaron-uk said.

#. Message in a dialog when a user wants to delete a repeating timer
#: xbmc/pvr/windows/GUIWindowPVRBase.cpp
msgctxt "#845"
msgid "Are you sure you want to delete this repeating timer, including all timers it has scheduled?"

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@ksooo ksooo force-pushed the pvr-api-4-0-0 branch 2 times, most recently from df089eb to 9a19553 Compare September 14, 2015 09:02
…epeating timer when deleting the repeating timer by the option to delete the repeating timer that scheduled a timer about to delete, if exists.
…X instead. Solve related signed/unsigned problems.
@ksooo
Copy link
Member Author

ksooo commented Sep 14, 2015

jenkins build this please

@ksooo
Copy link
Member Author

ksooo commented Sep 14, 2015

Jenkins build error on LINUX-64 is not related to this PR.

@ksooo
Copy link
Member Author

ksooo commented Sep 14, 2015

All review comments are addressed, all addons are updated. Ready to go...

ksooo added a commit that referenced this pull request Sep 14, 2015
@ksooo ksooo merged commit 1b7ac97 into xbmc:master Sep 14, 2015
@ksooo ksooo deleted the pvr-api-4-0-0 branch September 15, 2015 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change: PVR Component: PVR Type: Fix non-breaking change which fixes an issue v16 Jarvis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants