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

change season/episode infolabels for specials #17408

Merged
merged 1 commit into from
Mar 2, 2020
Merged

Conversation

ronie
Copy link
Member

@ronie ronie commented Feb 26, 2020

the PR removes the odd season/episode numbering we use in infolabels for episodes that are specials.

before:

ListItem.Season:
ListItem.Episode: S1

after:

ListItem.Season: 0
ListItem.Episode: 1

(the same change applies to VideoPlayer.Season / VideoPlayer.Episode)

fixes #17402

for skinners / addon devs it's much easier to work with those infolabels this way.

@razzeee razzeee merged commit 3375a26 into xbmc:master Mar 2, 2020
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Mar 2, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Mar 4, 2020
change season/episode infolabels for specials
@emveepee
Copy link
Contributor

@razzeee , @ronie , @ksooo This is impacting PVR recordings. The documentation says S0+E0 is ok for invalid for PVR Recordings but they are now displayed as S0 because of the = test
https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/guiinfo/VideoGUIInfo.cpp#L236

@ronie
Copy link
Member Author

ronie commented Mar 10, 2020

i'm not really familiar with pvr, can you please point me to this documentation?

@emveepee
Copy link
Contributor

i'm not really familiar with pvr, can you please point me to this documentation?

https://codedocs.xyz/AlwinEsch/kodi/struct_p_v_r___r_e_c_o_r_d_i_n_g.html#afe2e4edaf0b7589e5a464a543b7f1cda

@ronie
Copy link
Member Author

ronie commented Mar 10, 2020

thanx!

i've only now found out that PVR uses their own code for season / episode infolabels:

case VIDEOPLAYER_EPISODE:
case LISTITEM_EPISODE:
if (epgTag->EpisodeNumber() > 0)
{
if (epgTag->SeriesNumber() == 0) // prefix episode with 'S'
strValue = StringUtils::Format("S%i", epgTag->EpisodeNumber());
else
strValue = StringUtils::Format("%i", epgTag->EpisodeNumber());
return true;
}
return false;

case VIDEOPLAYER_SEASON:
case LISTITEM_SEASON:
if (epgTag->SeriesNumber() > 0)
{
strValue = StringUtils::Format("%i", epgTag->SeriesNumber());
return true;
}
return false;

since i haven't touched that part, i wonder how this PR could have an effect on PVR...

@emveepee
Copy link
Contributor

emveepee commented Mar 10, 2020

It is cosmetic but looks odd on non-series PVR recordings. I expect the problem is worse for addons that use legacy code and memset the API returns.

s0

I do have another concern about how this might cause user confusion when it is properly used on a special when there is no Episode name.

@ksooo
Copy link
Member

ksooo commented Mar 11, 2020

PVR has own code part for EPG, but uses videoinfotag code path for recordings. Thus, changes in the video path can affect recordings.

@ksooo
Copy link
Member

ksooo commented Mar 11, 2020

The documentation says S0+E0 is ok for invalid for PVR Recordings but they are now displayed as S0 because of the = test

I suggest to change PVR API to not allow 0/0 to signal "not available" any longer. This means, to update the API documentation and to adapt all PVR add-ons.

As I'm not available for doing this during the next couple of months due to time constraints, somebody else would have to step up.

@emveepee
Copy link
Contributor

emveepee commented Mar 11, 2020

I suggest to change PVR API to not allow 0/0 to signal "not available" any longer. This means, to update the API documentation and to adapt all PVR add-ons.

As I'm not available for doing this during the next couple of months due to time constraints, somebody else would have to step up.

@ksooo is that feasible without knowing what the backend is sending? I checked pvr.hts and I see

  /* season/episode (tvh 4.3+) */
  rec.iSeriesNumber = recording.GetSeason();
  rec.iEpisodeNumber = recording.GetEpisode();

Rather than adding a condition to each PVR could we not just modify how they are copied https://github.com/xbmc/xbmc/blob/master/xbmc/pvr/recordings/PVRRecording.cpp#L78 to

if (recording.iSeriesNumber!=0 || recording.iEpisodeNumber!=0)
{
    m_iSeason = recording.iSeriesNumber;
    m_iEpisode = recording.iEpisodeNumber;
}

Also is memset required on any of the PVR types functions at this time? If not I could flag issues on the official addons that still use them (like mine) to remove it.

@ksooo
Copy link
Member

ksooo commented Mar 11, 2020

is that feasible without knowing what the backend is sending? I checked pvr.hts and I see

It is feasible for the maintainer of the soon, yes. If there is no maintainer, the add-on will die, former or later.

Rather than adding a condition to each PVR could we not just modify how they are copied

We should fix the route cause, which is bad API design here, not hack around the actual problem, just because the latter is less effort.

Also is memset required on any of the PVR types functions at this time?

If the addon creates the struct, then it must initialize its members - 'memset' works for this, although better approach is 'TYPE foo = {};' - so there is no need to file issues for add-ons still using memset.

@emveepee
Copy link
Contributor

Rather than adding a condition to each PVR could we not just modify how they are copied

We should fix the route cause, which is bad API design here, not hack around the actual problem, just because the latter is less effort.

Sorry I misunderstand your first comment I thought you wanted someone other than the maintainer to make this change. The recent update to pvr.hts shows how difficult that would be.

My comments about memset were more about how to factor this change in with PR1645 looming but now I see that likely won't be a Matrix issues anyway. I think we can close this discussion here as I opened a PR for your recommendation.

Maven85 pushed a commit to Maven85/kodi that referenced this pull request May 5, 2020
change season/episode infolabels for specials
@ronie ronie deleted the SE-special branch July 29, 2020 00:07
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 3, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 4, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 5, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 6, 2020
change season/episode infolabels for specials
Maven85 pushed a commit to Maven85/kodi that referenced this pull request Aug 7, 2020
change season/episode infolabels for specials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change: GUI Component: GUI engine Type: Improvement non-breaking change which improves existing functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xbmc.getInfoLabel('VideoPlayer.Season') and xbmc.getInfoLabel('VideoPlayer.Episode') Not Integers for Specials
4 participants