kodi-pvr / pvr.hdhomerun

Kodi's HDHomeRun client addon
GNU General Public License v2.0
20 stars 24 forks source link

Kodi Logical Channel Number and HDHomeRun Lineup mismatch #31

Closed clarkis117 closed 7 years ago

clarkis117 commented 7 years ago

Currently when using the this pvr addon, the channel numbers are being assigned by logical order and not the channel numbers presented by HDHomeRun in lineup.html or lineup.json.

I wondering if there's a way to get Kodi to use the channel numbers presented in the HDHomeRun’s lineup.html or lineup.json.

broyuken commented 7 years ago

I second this, I am having the same issue. For example I have a channel which is numbered on the hdhomerun itself as channel 502, however the number assigned in Kodi is 7, with the name 8 FOX, etc. I don't have this issue with NextPVR, only with the HDHR PVR addon.

image

clarkis117 commented 7 years ago

Kodi's PVR add-on system already has support for using channel numbers from the PVR backend, via the “Use Channel Numbers from backend setting”. I think the proper way to move forward with this issue, is to implement that setting using the lineup.json data.

broyuken commented 7 years ago

Any update on getting this updated to work correctly?

FourEyedPanda commented 7 years ago

This really needs to be fixed. I took a look at the code and it looks like you guys set iChannelNum as i++ starting at i = 1 when it should be the GuideNumber in the JSON given by HDHomeRun.

iChannelNumber is set here:

pvrChannel.iChannelNumber = jsonChannel["_ChannelNumber"].asUInt();

which _ChannelNumber is just i++:

        jsonChannel["_ChannelNumber"] = nChannelNumber++;
        guideNumberSet.insert(jsonChannel["GuideNumber"].asString());

I am not too familiar with the code but, I would think it should be as easy as changing it to:

        jsonChannel["_ChannelNumber"] = jsonChannel["GuideNumber"].asString();
        guideNumberSet.insert(jsonChannel["GuideNumber"].asString());

This was just based off a quick look and I am not entirely sure as I am not familiar with this at all. It is just based off a quick look at the database and some searching through the source code so please excuse me and disregard if I am entirely wrong. With Krypton the PVR is actually starting to become usable and this really needs to be resolved.

zcsizmadia commented 7 years ago

Done (See Pull request #32). Only master branch (Krypton) got updated. Please remember to enable "Use channel numbers from backend" in PVR settings.

image

@phiyuku I encourage you you participate in the development if you feel something must be fixed urgently. I would like to remind you, that most of us do this development as a hobby.

clarkis117 commented 7 years ago

@zcsizmadia Thank you for the patch 🥇. I think it is good to remind the other commenters that development on these projects is mainly a hoppy. Given that I’m currently in the process of relocating for a new job, I only had time to log an issue, otherwise I would have provided a patch for it (or at least attempted :) ).

FourEyedPanda commented 7 years ago

@zcsizmadia Thank you a bunch. I really didn't expect it to be fixed this quick. I was going to try that one line code change I pasted before to see if it works later on but, it looks like a bit more than that was needed judging from your pull.

broyuken commented 7 years ago

How do I install this patch? I'm on Kodi 17 RC2, on Windows. I tried copying over the files in the .zip but it didn't seem to work. I still have the same sorting issues.

FourEyedPanda commented 7 years ago

@broyuken Seems like you have to build it yourself. I did this but it seems like there is an issue with "Synchronise channel groups with backend(s), if anyone else here can confirm. While not important and I don't even think HDHomerun Supports channel groups, it does crash if enabled. This did not happen with the out of the box version which is 2.4.4 I believe. Then again it can be my funky build as I had to modify some files and I still got 8 warnings. (I just redid it to try and run through for @broyuken and it created with no errors now weirdly. I will test again but, in the meantime can someone else confirm.)

It could also have been broken between 2.4.4 and now as looking at the pull, nothing seems like it should affect this specific option in Kodi.

I was unable to build it and have it working in Debug as I will get tons of errors so I tweaked the steps from the readme a bit. When I have some time I will fork it and make a pull request but, something so simple it might be be easier for @zcsizmadia to do quickly

Note: You have to have git and cmake installed.

Follow the Readme until the step where you run the cmake -G ... command. Instead of running the one there run:

cmake -G "Visual Studio 14" -DADDONS_TO_BUILD=pvr.hdhomerun -DCMAKE_BUILD_TYPE=Release-DADDON_SRC_PREFIX=%ROOT% -DCMAKE_INSTALL_PREFIX=%ROOT%\xbmc\addons -DCMAKE_USER_MAKE_RULES_OVERRIDE=%ROOT%\xbmc\cmake\scripts\windows\CFlagOverrides.cmake -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=%ROOT%\xbmc\cmake\scripts\windows\CXXFlagOverrides.cmake -DPACKAGE_ZIP=1 %ROOT%\xbmc\cmake\addons

Once you are done with the command above, you can try:

cmake --build . --config Release

I would upload my pvr.hdhomerun folder but, I don't know if that is something @zcsizmadia would allow.

@zcsizmadia : Would it be OK if I upload a copy of my baked files?

zcsizmadia commented 7 years ago

Try the nightly build of Krypton (17.0) or Leia (18.0). The latest PVR addon version for Krypton is 2.4.5, and 3.0.2 for Leia. At one point the addon binary will be updated in the repos and will update itself.

@phiyuku Putting the binaries in is definetly not the preferred way :)

Iif the PVR crashes at start you might need to "Clear data" in PVR Settings/General page. I am not sure if it helps or not.

FourEyedPanda commented 7 years ago

I am using it on Kodi 17-RC2 on Windows and it doesn't work. Just need someone to verify. Maybe the way I build is just bad.

If you Set "Synchronise channel groups with backend(s)" and then hit Clear Data that is when Kodi crashes.

zcsizmadia commented 7 years ago

Did you try the nightly build, instead of RC2?

FourEyedPanda commented 7 years ago

2.4.5 on the nightly works with that option selected. I'll just chalk it up to I'm not sure if I am building it correctly. =)

broyuken commented 7 years ago

I installed the nightly and it works! Thanks for the fix! Any idea if/when this will make it to Krypton RC2 and/or Jarvis?

zcsizmadia commented 7 years ago

It will be part of the final Krypton or RCx version. I was not planning to add it to Jarvis, since Krypton is so close to be released.