Jump to content

Tvheadend plugin for Emby - Beta 1


Tolotos

Recommended Posts

Yes I was aware you can do that and it works great with the schedules direct etc however I would not be able to share scheduled recordings between Kodi (Directly connected to Tvheadend) & android app (connected to tvheadend) and emby.

 

That was the main reason for using the tvheadend plugin. I don't want to use the HDHomerun Kodi apps as they don't integrate probably with Kodi hence the use of Tvheadend.

Link to comment
Share on other sites

Tolotos

Version 1.0.6140.39002 is in the catalog now.

It has removed usage of the GDI system.

This broke the delivery for some channel icon using picons - but users without GDI can now use the plugin.

 

-- Tolotos

Link to comment
Share on other sites

Any thoughts on why the channels are out of order in Emby while the channel numbers are ok in both TVH and Emby?

 

Thanks.

 

 

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

chattojimnow

hi i am running emby on synology and have usb hdtv card running via tvheadend 4.0,

can someone first explain what is a picons is and how i configure it last thing i need to get to work

 

I want to know do i add a url to the channel path or is there a folder im to fill and rename the icons in for it to work little confused but love to have it fully functioning with icons etc

Link to comment
Share on other sites

Hi,

 

I ended up having to rebuild emby from scratch as I got a weird bug where added a recording folder with existing items in causing thousands of new library folders to appear which I could not delete. I tried deleting the libaray.db etc (Linux); anyway I reinstalled TVheadend plugin and the icons appeared.

 

I'm testing NextPVR on a separate windows VM just for the LiveTV/Recordings but might end up running emby on that too as the Linux version still suffers from the CLOSE_WAIT connections. Would I be wrong in thinking that it is more mature on the Windows platform as it seems to be coded primarily for Windows hence the need for Mono.

 

The only reason I don't use the built in HDHomerun support is syncing Recordings/Schedules with Kodi would be a problem, are there any plans to release a Emby PVR plugin for Kodi so it is all synced? Would solve all my issues :D

Link to comment
Share on other sites

We works like to. In the meantime why not just use the built in recording anyway and then point kodi to your recording folder as a library?

Link to comment
Share on other sites

Hi,

 

How can I make Emby refresh the channel names from TVH?

There was a reorg of channels in Spain, with some of them changing their names. I already made the changes in TVH (name, icon) but in Emby I still see them with their old names.

The icons I already saw that I need to delete Emby's image cache but I couldn't find a way yet to refresh the channel names.

 

Thanks!

 

PS: I managed to get the channels listed in the correct order in the Guide by unchecking the "Place favourite channels at the beginning" option even when I have no channels tagged as favourite. However in the Channels view they are still displayed in the wrong order. Any ideas? Only a couple of channel names and icons were changed in TVH I didn't touch the channel numbers at all.

Edited by fc7
Link to comment
Share on other sites

gstuartj

How can I make Emby refresh the channel names from TVH?

 

Yeah, refreshing the guide, etc won't update the channel names/numbers for some reason. I found a workaround for updating the channel names, but you're not going to like it.

 

What you need to do is delete every channel in TVHeadend, except for one. If you delete all the channels, this won't work. Restart Emby and refresh the guide, waiting for it to finish. Then, you need to re-add all your services as channels in TVHeadend, updating the channel names to be correct. Repeat the guide refresh after everything is correct, and the channels will update in Emby.

 

You can streamline a bit by making a copy of your TVH config, deleting the channels, then restoring the old config after a refresh. That way you only have to make changes to the specific channels that need updating.

Link to comment
Share on other sites

Yeah, refreshing the guide, etc won't update the channel names/numbers for some reason. I found a workaround for updating the channel names, but you're not going to like it.

 

What you need to do is delete every channel in TVHeadend, except for one. If you delete all the channels, this won't work. Restart Emby and refresh the guide, waiting for it to finish. Then, you need to re-add all your services as channels in TVHeadend, updating the channel names to be correct. Repeat the guide refresh after everything is correct, and the channels will update in Emby.

 

You can streamline a bit by making a copy of your TVH config, deleting the channels, then restoring the old config after a refresh. That way you only have to make changes to the specific channels that need updating.

 

OMG no, I don't like that. You are right. :)

But thanks for the tip. I will keep it in my notes in case I'm not able to find any other way.

 

I would ratter mess around with Emby DB until I find the right query....

Link to comment
Share on other sites

gstuartj

OMG no, I don't like that. You are right. :)

But thanks for the tip. I will keep it in my notes in case I'm not able to find any other way.

 

I would ratter mess around with Emby DB until I find the right query....

 

Yup, that will probably be a better route. I was determined to find a method that any user could use, but it's one of those situations where I ended up wasting more time than I would have just finding it in the DB, and it's still overly complex.

Edited by gstuartj
Link to comment
Share on other sites

Tolotos

Hi,

 

some information on channel order.

TVHeadend has a major and a minor number. This is used by some network providers to group the channels. 

Emby has a string as the channel number. The plugin creates <major>DOT<minor> maybe this a reason. 

The other point is sorting a string containing numbers. This result is

1

10

11

12

13

14

15

16

17

18

19

2

20

3

4

5

6

7

8

9

 

Please check if one of this can be the reason for the strange order.

 

The plugin logs all messages got from tvheadend. Please check the lines after "[TVHclient] ChannelDataHelper: Adding channel" for the channel numbers send by TVHeadend.

 

 

-- Tolotos

Link to comment
Share on other sites

Hi,

 

some information on channel order.

TVHeadend has a major and a minor number. This is used by some network providers to group the channels. 

Emby has a string as the channel number. The plugin creates <major>DOT<minor> maybe this a reason. 

The other point is sorting a string containing numbers. This result is

1

10

11

12

13

14

15

16

17

18

19

2

20

3

4

5

6

7

8

9

 

Please check if one of this can be the reason for the strange order.

 

The plugin logs all messages got from tvheadend. Please check the lines after "[TVHclient] ChannelDataHelper: Adding channel" for the channel numbers send by TVHeadend.

 

 

-- Tolotos

 

Thanks for your reply @@Tolotos.

 

I've checked the logs and I was able to confirm that the channel numbers look fine (just the major number, without a dot or a minor number).

 

Moreover the channel and icon url of the next example is updated from TVH. It would be great if the plugin could update Emby with the new information if the channel already exists (like in this case) but the name or the icon were updated in TVH.

Example:


2016-10-28 23:08:53.8703 Info App: [TVHclient] ChannelDataHelper: Adding channel

HTSMessage:
  <dump>
    channelId : 2067476812
    channelNumber : 42
    channelName : GOL
    channelIcon : http://<someurl>/channel-logos/goltv.png
    eventId : 678697
    nextEventId : 678165
    services :
HTSMessage:
  <dump>
    name : HDHomerun/570MHz/GOL
    type : SDTV
  </dump>

,
    tags : 3, 2,
    method : channelUpdate
  </dump>

Thanks.

Link to comment
Share on other sites

Tolotos

Hmm, I get a notification from TVH for every changed channel. But I can send only a "DataSourceChanged" event to emby. As far as I know this will trigger a reread of all information (channels, recodings, programms, ..).

 

@@Luke whould it be possible to trigger the "DataSourceChanged" event and ignore further TVH events until Emby called the "GetChannelsAsync" method?

 

-- Tolotos

Edited by Tolotos
Link to comment
Share on other sites

Well you wouldn't do both of those things at the same time. GetChannels is called by the guide refresh. You trigger DataSourceChanged in order to make the guide refresh immediately.

Link to comment
Share on other sites

Tolotos

Ok, I had a look on the TVH "channel changed" event. It is fired at every new event starting on the channel - this is not usable for a reset of Emby.

@@Luke is this "Reset" possible to call from the configuration page? All channel names, icons, events should be deleted and read fresh though the (resetted possible?) plugin.

Link to comment
Share on other sites

Ok, I had a look on the TVH "channel changed" event. It is fired at every new event starting on the channel - this is not usable for a reset of Emby.

@@Luke is this "Reset" possible to call from the configuration page? All channel names, icons, events should be deleted and read fresh though the (resetted possible?) plugin.

 

You can have a button trigger DataSourceChanged but I would just not bother when they can run the regular guide refresh.

Link to comment
Share on other sites

@Luke: should a guide refresh also update channel changes like name, number or icon too? Because right now I'm sure that the EPG is updated but not channel properties mentioned above. I changed a channel name and icon in TVH and the plugin is seeing the new values too but then Emby seems to be ignoring them. It will only update the EPG. :(

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

It won't replace existing images, no, b because then any manual customizations done in emby are lost. You would need to delete images in emby to have the next guide refresh pull them again.

Link to comment
Share on other sites

And what about the channel name for example? Because that is not updated either. :(

 

Thanks

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Yea same thing there i'm afraid. You either need to update the channel name in emby, or remove the plugin, refresh the guide to clean the database, then add the plugin back.

Link to comment
Share on other sites

Yea same thing there i'm afraid. You either need to update the channel name in emby, or remove the plugin, refresh the guide to clean the database, then add the plugin back.

I feel I need to apologize here. I didn't even thought that LiveTV was available in metadata editor. :(

 

Checked. Manually renamed and delete the channel images of those that changed using the metadata editor (very simple and easy). Then refreshed the guide and the new icons were pulled from TVH right away. Is not ideal but is was far easier than I thought.

 

Thanks!!

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

  • 2 weeks later...
bionemesis

I was successfully running the Tvheadend plugin against a working docker-based installation of Tvheadend. Unfortunately, the version of Tvheadend I was using wasn't being updated so I switched to a different docker image and started over. Tvheadend works fine and I can stream and view the episode guide from the Tvheadend web UI. At first, I changed the configuration of the Tvheadend plugin and restarted Emby. This didn't seem to change anything as the channels stayed the same. I uninstalled, rebooted, reinstalled, rebooted and also found that the channels were still cached. It wasn't until I changed the configuration to point to a non-existent instance of Tvheadend that it finally stopped showing the old channels. Once I added the new configuration, nothing has changed. The logs show it's connecting to Tvheadend and Tvheadend itself shows the active connection. But no channels are showing up and no episode guide. Logs aren't showing much really, as this is the only mention of TVHclient:

2016-11-13 23:46:51.4619 Info App: [TVHclient] LiveTvService()
2016-11-13 23:46:51.4627 Info App: [TVHclient] HTSConnectionHandler()
2016-11-13 23:46:51.4769 Info App: [TVHclient] HTSConnectionHandler.ensureConnection: Priority was out of range [0-4] - set to 2
2016-11-13 23:46:54.8239 Info App: [TVHclient] HTSConnectionHandler.ensureConnection() : create new HTS-Connection
2016-11-13 23:46:54.8265 Info App: [TVHclient] HTSConnectionHandler.ensureConnection: Used connection parameters: TVH Server = '192.168.1.85'; HTTP Port = '9981'; HTSP Port = '9982'; Web-Root = ''; User = 'tvuser'; Password set = 'True'
2016-11-13 23:46:54.8276 Info App: [TVHclient] HTSConnectionAsync.open: IPEndPoint = '192.168.1.85:9982'; AddressFamily = 'InterNetwork'
2016-11-13 23:46:54.8276 Info App: [TVHclient] HTSConnectionAsync.open: socket connected.
2016-11-13 23:46:54.8394 Info App: [TVHclient] HTSConnectionAsync.authenticate: start
2016-11-13 23:46:54.8711 Info App: [TVHclient] HTSConnectionAsync.authenticate: authenticated = True
2016-11-13 23:46:54.8711 Info App: [TVHclient] HTSConnectionHandler.ensureConnection: connection established True
Link to comment
Share on other sites

bionemesis

Have you tried running the refresh guide operation in the Emby server dashboard?

Thanks for making me feel like an idiot Luke! :) Refresh guide was all it took. Thanks pal, cheers.

 

Sent from my Nexus 6P using Tapatalk

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...