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

IPTV Manager support #1674

Merged
merged 24 commits into from
May 1, 2023
Merged

Conversation

landgenoot
Copy link
Contributor

@landgenoot landgenoot commented Feb 4, 2023

Functional description

image

Adds support for IPTV Manager, so that we can zap through the live streams of Retrospect and browse the EPG.

Reasoning

IPTV Manager was created with this use case in mind:

IPTV Manager was designed with add-on developers in mind. We wanted to make it as easy as possible to integrate your existing channels and EPG information with IPTV Manager.

Technical description

For every channel, there can be two optional functions create_iptv_streams and create_iptv_epg. When IPTV Manager is enabled in the Retrospect settings, these functions are called (if existent) and should respond respond with a JSON-STREAMS and JSON-EPG. The JSON's should contain URI's with a playvideo action. For every channel, a separate channel group is created in Kodi TV.

Tasks & Activities

  • Implement IPTV Manager settings
  • Implement IPTV Manager endpoints
  • Implement reference implementation create_iptv_streams for NPO
  • Implement reference implementation create_iptv_epg for NPO
  • Check other Channels actively for create_iptv_streams and create_iptv_epg
  • Verify Pickle / action URL implementation with @basrieter (I am not sure if I am using store_id correctly?)
  • Add Genre to EPG items
  • Add Image to EPG items
  • Check if stream for EPG is available on beforehand
  • Create group for every Retrospect Channel

Feel free to come up with any other tasks.

resolves #1673

@landgenoot landgenoot marked this pull request as ready for review February 5, 2023 09:34
@landgenoot
Copy link
Contributor Author

landgenoot commented Feb 5, 2023

Some points open for discussion:

  1. Why does a pickle need a parent and a store_id?
  2. pickler.store_media_items() is called on every refresh, is this desirable or are we creating a huge database of pickles under the hood?
  3. Check if program is available seems to be impossible, because we can only check it during refresh, not during runtime.
  4. Are we using a code formatter / styleguide?
  5. The original broadcast date can also be passed to IPTV Manager, but this will show only the broadcast year in the title of every item.
  6. I created an extra helper function safeget() in JsonHelper to avoid key errors when information is not available.
  7. Sometimes I needed to clear the PVR guide data during development, but I am not sure if this fixes itself if we are only refreshing once per day.

@basrieter
Copy link
Collaborator

I am rather busy now, so I am not ignore you, but I just need to find some time to look into this PR.

@landgenoot
Copy link
Contributor Author

I totally understand. No worries!

Copy link
Collaborator

@basrieter basrieter left a comment

Choose a reason for hiding this comment

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

Thanks for this! Looks like a good start. I had some comments.

Still in doubt how to make it more straighforward for other channels to also provide this kind of info. What if 10 channels provide EPG. How long would it take to fetch all of that EPG data.

resources/lib/helpers/jsonhelper.py Outdated Show resolved Hide resolved
resources/settings.xml Show resolved Hide resolved
resources/lib/actions/iptvmanageraction.py Outdated Show resolved Hide resolved
resources/language/resource.language.en_gb/strings.po Outdated Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Outdated Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Outdated Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Outdated Show resolved Hide resolved
channels/channel.nos/nos2010/chn_nos2010.py Outdated Show resolved Hide resolved
@basrieter
Copy link
Collaborator

BTW: if you rebase, the unittests should be working again.

@landgenoot
Copy link
Contributor Author

Thank you for your review! I will process your feedback next Monday.

Still in doubt how to make it more straighforward for other channels to also provide this kind of info. What if 10 channels provide EPG. How long would it take to fetch all of that EPG data.

I think a JSON-EPG is as straightforwarded as you can get.

I tried to parse the menu items before using process_folder_list and that worked, however each channel uses it's own menu structure.

10 channels should not be an issue, as it is a background process.

@basrieter
Copy link
Collaborator

Could you rebase on master?

@landgenoot
Copy link
Contributor Author

Thanks Bas!

Btw, there is an issue with IPTV Manager / IPTV Simple. So IPTV Simple needs to be downgraded in order to get it to work. Will see if I can also fix that one.

@basrieter
Copy link
Collaborator

I will most likely do a quick release tonight and then focus on this PR. Still recovering but I can at least type with both hands again.

@basrieter
Copy link
Collaborator

@landgenoot Were you able to have a look at my comments?

@landgenoot
Copy link
Contributor Author

Hi Bas, yes. Thanks!

However, IPTV manager is still broken. So I need to find some time to fix that one first. Now this PR is not working at all.
Do you prefer to release this one first?

@basrieter
Copy link
Collaborator

Hi Bas, yes. Thanks!

However, IPTV manager is still broken. So I need to find some time to fix that one first. Now this PR is not working at all. Do you prefer to release this one first?

Can you let me know when it's fixed again? So I can test some stuff.

Also: I just removed Python 2 from Retrospect. So you might want to do a rebase.

@basrieter
Copy link
Collaborator

You can ignore the "Kodi via Zip" tests.

Copy link
Collaborator

@basrieter basrieter left a comment

Choose a reason for hiding this comment

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

it all look good. Just a minor suggestion for the JsonHelper to prevent duplicate code.

resources/lib/helpers/jsonhelper.py Show resolved Hide resolved
@basrieter
Copy link
Collaborator

basrieter commented Apr 30, 2023

...and please ignore the 1 code smell from SonarCloud.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@landgenoot
Copy link
Contributor Author

landgenoot commented May 1, 2023

Hi Bas,

Thank you for your comments, I think all should be fixed now.
However, the issue in IPTV Manager won't be fixed in the near feature as this requires a change in the Kodi API.

The workaround is to rename the settings file after automatic configuration.

My apologies for not complying to the git commit message convention with Added / Modified. I totally forgot.

@landgenoot landgenoot requested a review from basrieter May 1, 2023 06:22
@basrieter basrieter merged commit 8c7c40f into retrospect-addon:master May 1, 2023
basrieter added a commit that referenced this pull request May 1, 2023
@basrieter
Copy link
Collaborator

Thanks for you effort @landgenoot. Hopefully the IPTV Manager will fix the issue with the settings.

@rwynands
Copy link

Does this work yet? I downloaded IPTV manager and IPTV Simple Client, but I see nothing in Channels or Channel Guide. Is there something else I need to do?

@basrieter
Copy link
Collaborator

It does but perhaps this workaround is still needed add-ons/service.iptv.manager#107

@rwynands
Copy link

Het navigeren naar de folder met user data lukt niet zelfs als ik hidden files zichtbaar maak in de settings. Ik krijg de folder niet te zien vanuit de IPTV simple settings, zpadet ik er niet naar kan verwijze in local path.

@basrieter
Copy link
Collaborator

basrieter commented Aug 31, 2023

Dit is meer een IPTV issue dan een Retrospect issue. Wellicht kunnen zij je verder helpen?

@rwynands
Copy link

Ik zal daar verder kijken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPTV Manager integration
3 participants