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] ability to sort channels and epg by the backend order of channels #16558

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

phunkyfish
Copy link
Contributor

Description

Add the ability to sort channels and epg by the backend order of channels. Instead of extending the API I just used the creation order for the value or sort by.

Resolves issue: #16546

Motivation and Context

Allows the preservation of order of the backend pvr if that system does not use channel number based ordering.

How Has This Been Tested?

Using pvr.vuplus and pvr.iptvsimple.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@phunkyfish phunkyfish added Type: Feature non-breaking change which adds functionality Component: PVR v19 Matrix labels Sep 1, 2019
Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, did not went through the whole changes. -1 for two reasons:

  1. implementation breaks PVR object call hierarchy. CPVRChannel and CPVREpgInfoTag must not depend on any of the channel containers.

  2. API needs to be extended to transport the order. One should not rely on creation order.

xbmc/pvr/channels/PVRChannel.cpp Outdated Show resolved Hide resolved
xbmc/pvr/channels/PVRChannel.cpp Outdated Show resolved Hide resolved
xbmc/pvr/epg/EpgInfoTag.cpp Outdated Show resolved Hide resolved
@ksooo
Copy link
Member

ksooo commented Sep 1, 2019

If you need to transfer any channel information to CPVREPGInfoTag, do this via its CPVREpgChannelData member.

If you need the order at the CPVRChannel, introduce a member m_iOrder (or the like) at CPVRChannel.

@ksooo
Copy link
Member

ksooo commented Sep 1, 2019

pvr-component-deps

@phunkyfish
Copy link
Contributor Author

Ok, for point 2) I know what to do.

However for point 1) it’s a bit trickier as both Channel and EpgInfoTag would need to know the current group member that they pertain to without breaking the design. I’ll have to think on that.

@phunkyfish
Copy link
Contributor Author

@ksooo, should now satisfy both rejection points.

Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally okay now. Needs a bit more love, though.

xbmc/SortFileItem.h Outdated Show resolved Hide resolved
xbmc/pvr/channels/PVRChannel.h Outdated Show resolved Hide resolved
xbmc/utils/DatabaseUtils.h Outdated Show resolved Hide resolved
xbmc/pvr/windows/GUIViewStatePVR.cpp Outdated Show resolved Hide resolved
xbmc/pvr/windows/GUIViewStatePVR.cpp Outdated Show resolved Hide resolved
xbmc/pvr/PVRDatabase.cpp Outdated Show resolved Hide resolved
xbmc/pvr/channels/PVRChannel.cpp Outdated Show resolved Hide resolved
xbmc/pvr/epg/EpgChannelData.h Outdated Show resolved Hide resolved
xbmc/pvr/epg/EpgChannelData.cpp Outdated Show resolved Hide resolved
xbmc/pvr/channels/PVRChannelGroup.cpp Outdated Show resolved Hide resolved
@phunkyfish
Copy link
Contributor Author

Jenkins build this please

Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let the nitpicking begin...

xbmc/pvr/channels/PVRChannel.cpp Show resolved Hide resolved
xbmc/pvr/channels/PVRChannelGroup.h Outdated Show resolved Hide resolved
xbmc/pvr/channels/PVRChannelGroup.cpp Outdated Show resolved Hide resolved
@ksooo
Copy link
Member

ksooo commented Sep 2, 2019

[pvr] Allow use genre strings to be set from subtype so genre type (c…

Commit message seems unrelated to this PR. ;-)

@phunkyfish
Copy link
Contributor Author

Commit message seems unrelated to this PR. ;-)

Ya, ran the wrong history command, fixed now.

@ksooo
Copy link
Member

ksooo commented Sep 2, 2019

So, does it still work after all the review induced changes?

@phunkyfish
Copy link
Contributor Author

phunkyfish commented Sep 2, 2019

Yes, why do you think the changes would effect it working?

Did you spot something?

@ksooo
Copy link
Member

ksooo commented Sep 3, 2019

Did you spot something?

No. I was just asking.

@phunkyfish
Copy link
Contributor Author

Cool, tested with iptvsimple and with also with vuplus. Works with both.

@ksooo
Copy link
Member

ksooo commented Sep 3, 2019

From a user's point of view, what would you expect to happen, if you select "Backend order" if the pvr client addon does not fill the new iOrigin field? Nothing? Hmmm... Shouldn't we add a fallback logic to sort by backend channel numbers, then?

@phunkyfish
Copy link
Contributor Author

Yes, that makes sense, agreed. That's the missing piece.

@phunkyfish
Copy link
Contributor Author

phunkyfish commented Sep 3, 2019

It might be simpler in UpdateClientOrder to set it to the backend channel number if iOrder is 0.

EDIT: this won't work as ChannelNumbers are different.

@phunkyfish
Copy link
Contributor Author

Done.

Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done, I'd say.

xbmc/pvr/channels/PVRChannel.cpp Outdated Show resolved Hide resolved
@ksooo
Copy link
Member

ksooo commented Sep 3, 2019

Cool, thx.

@phunkyfish
Copy link
Contributor Author

Ready

Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we go. :-)

@ksooo ksooo merged commit 5ead96b into xbmc:master Sep 3, 2019
@Rechi
Copy link
Member

Rechi commented Sep 3, 2019

@ksooo please always set milestone before or right after merging a PR.

@ksooo ksooo added this to the Matrix 19.0-alpha 1 milestone Sep 3, 2019
@phunkyfish
Copy link
Contributor Author

Woohoo!

@ksooo
Copy link
Member

ksooo commented Sep 3, 2019

Done.

@phunkyfish
Copy link
Contributor Author

phunkyfish commented Sep 3, 2019

Nice work ;)

At some point I'll write a script to automate this process, might make it a little less painful.

@ksooo
Copy link
Member

ksooo commented Sep 3, 2019

That's definitely a good idea.

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: Breaking change fix or feature that will cause existing functionality to change Type: Feature non-breaking change which adds functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants