Favorites URL Based on Kodi Channel Number
#1
I would like to add channels to my favorites and play them using a URL based on what the assigned channel number in Kodi is.

For instance, right now FOX (which is Channel 1 in Kodi) shows up in the log as:

"pvr://channels/tv/All channels/pvr.wmc_32537.pvr"
The 32537 number must have been assigned from Server WMC, and is not consistent when used with different antenna's/different WMC setups.

Ideally, I could do something like:
pvr://channels/tv/All channels/pvr.wmc_1.pvr
or:
pvr://channels/tv/All TV channels/1.pvr

This would always play the first channel in Kodi, regardless of what the Server WMC backend number is.

Is that possible?
Reply
#2
Embarrassingly, I am not sure how kodi forms those channel address type strings that show up in the kodi log (like the one you show). We do give kodi a channel id (uint) but I have never checked to see if that's the number embedded in the 'pvr.wmc_****.pvr' string - but I suppose it makes sense that it would be. We get this value from the wmc epg so it shouldn't vary based on different wmc setups. If you want to see if the value embedded in the pvr.wmc_****.pvr string is the same as the channel id we send kodi post the serverwmc (pastebin) log after playing the channel listed in your post.
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply
#3
Interesting, thanks for the info and for the help - I really appreciate it!

I've attached logs for two separate WMC setups below (both Intel NUC i3 - Windows 8.1 Media Center machines with the same config, using the same channel), and it looks like they are passing along different ID's. However, the Channel ID's between Kodi and ServerWMC do seem consistent.

Setup #1
Setup 1 - Kodi Log
15:35:47 T:3556 DEBUG: Loading settings for pvr://channels/tv/All channels/pvr.wmc_32537.pvr
15:35:47 T:3556 DEBUG: CPlayerCoreFactory::GetPlayers(pvr://channels/tv/All channels/pvr.wmc_32537.pvr)
Setup 1 - ServerWMC Log
2015/06/30 11:49:26.845 LiveRemuxStream> started remux thread: 'KTVUDT-2.1:32537'

Setup #2
Setup 2 - Kodi Log
15:45:43 T:2440 DEBUG: Loading settings for pvr://channels/tv/All channels/pvr.wmc_1772834.pvr
15:45:43 T:2440 DEBUG: CPlayerCoreFactory::GetPlayers(pvr://channels/tv/All channels/pvr.wmc_1772834.pvr)
Setup 2 - ServerWMC Log
2015/06/30 09:17:40.530 LiveRemuxStream> started remux thread: 'KTVUDT-2.1:1772834'
Reply
#4
Thanks for that, I guess that answers it. I am surprised that the two different wmc computers use different internal IDs for the same channel. Are they using the same tuner too (i.e. a network tuner)? Why do you have separate wmcs running and not a centralized server? Please explain your setup.

And I guess more to the point, what would making the ids consistent across your two computers accomplish?
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply
#5
It's a bit of a complicated setup, but basically I am maintaining my non-tech savvy parents/family/friends cordcutting setups alongside mine. These are different computers in different ZIP codes, which might be why WMC assigns different ID's (though it is the same exact USB Tuner, same broadcast tower, channel numbers, ect.)

I'm keeping them completely in sync with a Dropbox server, so if I update anything on my computer it updates theirs automatically. I'm using the TV Guide addon and have every stream linked to the guide via favorites. The only thing that won't work are the ServerWMC channels, as it is trying to play the channel using my unique internal ID's.

Super narrow use case, I know - But I'd love a consistent way to be able to call up a channel that would work with all setups accessing that channel.

Would it be possible to pass along a URL with the station name instead, like:
pvr://channels/tv/All channels/pvr.wmc_KTVUDT/2.1.pvr

or use the channel order from the backend:
pvr://channels/tv/All channels/pvr.wmc_1.pvr

Thank You!
Reply
#6
Complicated setup!

Again, we don't form those strings, kodi does. But I suppose we could have an option to base the channel ID we give kodi off the channel number rather than the actual epg channel id. I think kodi will only accept unsigned integers for these ids so we can't use <channel>.<subchannel> (like 2.1), but maybe we could just scale it and pass 210 instead. Would that work?
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply
#7
That would be absolutely perfect.

I really appreciate your input and willingness to help out - Thank you so much!
Reply
#8
I put up a test build and pm'd you a link. Let me know what happens.
Windows Media Center PVR addon (pvr.wmc) and server backend (ServerWMC)
http://bit.ly/serverwmc
Reply
#9
Works perfectly on both machines - Also makes the Favorites/Kodi Log easier to read as the Channel Number is now included.

Thank You!
Reply

Logout Mark Read Team Forum Stats Members Help
Favorites URL Based on Kodi Channel Number0