Jump to content

Tvheadend plugin for Emby - Beta 1


Recommended Posts

Posted

Make sure you're running the latest version of emby server.

Well, I'm running 3.2.7.0 because 3.3.0.0 is instantly crashing on my ubuntu machine... I'll give you the logfiles soon.

 

By the way I've made a merge request for a fix of the threading issue:

https://github.com/MediaBrowser/Tvheadend/pull/3

Posted (edited)

Ok it seems like the crash with version 3.3.0.0 is caused by the tvheadend plugin. I've tried it with 3.2.7, 3.2.9 and my build. As soon as I configure the plugin and restart the site comes up for few seconds and then emby crashes. Same goes for the latest beta version.

 

edit: It's working up to the beta version 3.2.7.6, so whatever change is causing the crash has to be after that

server-63655212871.txt

server-63655213271.txt

Edited by Gerrit507
Posted

Thanks. And your pull request resolves those?

Posted (edited)

Thanks. And your pull request resolves those?

No sadly it doesn't but it will fix the threading issue. When I was coding it, I didn't even knew that the issue with new version was related with the tvheadend plugin. There had to be some change in the server, which is causing incompatibility with the tvheadend plugin. Sadly the logs are not very helpful. If I had to guess I would blame the new recording section on the homescreen.

Edited by Gerrit507
Posted

Ok the problem is likely that the plugin is attempting to establish a connection in the LiveTVService constructor, that ultimately traces to here:

https://github.com/MediaBrowser/Tvheadend/blob/master/TVHeadEnd/HTSConnectionHandler.cs#L64

 

I have always advised against doing any work in the constructor such as that. Another class should be added to the project that implements IServerEntryPoint, and call the init method during IServerEntryPoint.Run.

 

I've deleted all recordings from tvheadend and then updated emby to 3.3.0.0 and it's not crashing anymore. So the issue was definetly related to the recordings.

 

Do you think your suggestion would fix that?

Posted

No, ignore my suggestion. It's not doing what I thought it was, so that's why i deleted the posting.

Posted

No, ignore my suggestion. It's not doing what I thought it was, so that's why i deleted the posting.

Ok, nervermind.

 

I'm just testing around and as soon as I have a recording in tvheadend, then run the sync in emby and enter the recording section, emby is crashing. When I delete the recording it's fine again. Still nothing useful in the logs.

 

I'm clueles at the moment...

Posted

Sice ~3.2.15 (when the recordindings going to a a seperate link on the main page) i have not had recordings. tvheadend recordings/other/ is empty.

maybe related to the crash entry in my log?

Posted

Sice ~3.2.15 (when the recordindings going to a a seperate link on the main page) i have not had recordings. tvheadend recordings/other/ is empty.

maybe related to the crash entry in my log?

The new recording section was a change in the server, not in the plugin. When I was able to reach the recordings, it also had only an empty Others folder.

michael_stonebridge
Posted

I've just reinstalled Emby and switched to the Docker version and I'm unable to get the logos. The logos were working fine before.

 

The message I get when I try to view the thumbnail from Emby is "Unauthorized"

 

Same here. Channel-Icons point to ``/emby/Items/<hash>/Images/Primary``, but those URL give Internal Server Errors (500) or Unauthorized (401).

 

Is there a way to rebuild all channels? I can't force it to redowload the channel logos.

 

It would be great if Emby would follow some sort of versioning guidelines. At this point even minor releases can change routines that are exposed to plugins. It would be great to keep those stable between major releases.

Posted

Same here. Channel-Icons point to ``/emby/Items/<hash>/Images/Primary``, but those URL give Internal Server Errors (500) or Unauthorized (401).

 

Is there a way to rebuild all channels? I can't force it to redowload the channel logos.

 

It would be great if Emby would follow some sort of versioning guidelines. At this point even minor releases can change routines that are exposed to plugins. It would be great to keep those stable between major releases.

Same issue here. I've recently added some new logos but they are not showing up. The logs say that the plugin is calling GetChannelImage but not GetChannelImageUrl, this might be the issue.

michael_stonebridge
Posted

Same issue here. I've recently added some new logos but they are not showing up. The logs say that the plugin is calling GetChannelImage but not GetChannelImageUrl, this might be the issue.

 

Great catch! For me the logos are not stored in the metadata folder of Emby (for example metadata/livetv/<hash>/metadata/poster.png). If I add the logo manually, then it works. So does not seem to be a permission issue, but rather still a problem of the plugin not fetching the logo.

Posted

Are recordings still blank? Is so can you provide a server log from trying to access them? Thanks.

Posted (edited)

Are recordings still blank? Is so can you provide a server log from trying to access them? Thanks.

 

Yes they are, there is only an empty "Others" folder, and for me it crashes the whole server. Don't know about the others. You can see the logs I posted last night but afaik there was nothing helpful in there only that the log stops after getting the recordings.

Great catch! For me the logos are not stored in the metadata folder of Emby (for example metadata/livetv/<hash>/metadata/poster.png). If I add the logo manually, then it works. So does not seem to be a permission issue, but rather still a problem of the plugin not fetching the logo.

2018-02-26 17:55:23.945 Info HttpClient: GET http://192.168.179.11:9981/imagecache/578
2018-02-26 17:55:23.961 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 3.3.0.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Unix 4.13.0.32
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 4
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	MediaBrowser.Model.Net.HttpException: Unauthorized
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Providers.Manager.ProviderManager.<SaveImage>d__33.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Library.LibraryManager.<ConvertImageToLocal>d__191.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Drawing.ImageProcessor.<ProcessImage>d__29.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Api.Images.ImageService.<GetImageResult>d__24.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__74.MoveNext()
	MediaBrowser.Model.Net.HttpException
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsyncInternal>d__20.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.<SendAsync>d__17.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Providers.Manager.ProviderManager.<SaveImage>d__33.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Library.LibraryManager.<ConvertImageToLocal>d__191.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Drawing.ImageProcessor.<ProcessImage>d__29.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Api.Images.ImageService.<GetImageResult>d__24.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__74.MoveNext()
	

There are errors tranlating the tvh logos to local images... I think the issue is that they are accessed without any login information. 

Edited by Gerrit507
Posted

I've created a new user with blank username in tvh, who can access the webinterface from my local network. I can get the channel logos from my web browser without auth prompt. Emby now throws a null pointer exception:

2018-02-26 18:50:13.729 Debug App: ConvertImageToLocal item 1a38f91b-cb89-af6a-ef54-6f150f84efcc - image url: http://192.168.179.11:9981/imagecache/628
2018-02-26 18:50:13.729 Info HttpClient: GET http://192.168.179.11:9981/imagecache/628
2018-02-26 18:50:13.733 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 3.3.0.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Unix 4.13.0.32
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 4
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	System.ArgumentNullException: Value cannot be null.
	Parameter name: mimeType
	   at MediaBrowser.Providers.Manager.ImageSaver.<SaveImage>d__8.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Providers.Manager.ProviderManager.<SaveImage>d__33.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Library.LibraryManager.<ConvertImageToLocal>d__191.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Drawing.ImageProcessor.<ProcessImage>d__29.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Api.Images.ImageService.<GetImageResult>d__24.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__74.MoveNext()
	System.ArgumentNullException
	   at MediaBrowser.Providers.Manager.ImageSaver.<SaveImage>d__8.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Providers.Manager.ProviderManager.<SaveImage>d__33.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Library.LibraryManager.<ConvertImageToLocal>d__191.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Drawing.ImageProcessor.<ProcessImage>d__29.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at MediaBrowser.Api.Images.ImageService.<GetImageResult>d__24.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__74.MoveNext()
Posted

Does that url have a content type response header?

Posted

Does that url have a content type response header?

This is the source code of the url:

<html><head><meta name="viewport" content="width=device-width, minimum-scale=0.1"><title>628 (220×132)</title></head><body style="margin: 0px; background: #0e0e0e;"><img style="-webkit-user-select: none;background-position: 0px 0px, 10px 10px;background-size: 20px 20px;background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);" src="http://192.168.179.11:9981/imagecache/628"></body></html>
Posted

ok well that's not an image file

Posted (edited)

ok well that's not an image file

That's typical tvheadend style :D

 

Here you have a sample of my "picons"

post-191225-0-00098500-1519669070_thumb.png

Edited by Gerrit507
Posted

I'm afraid I don't quite understand? In any event Emby will need a plain image url that returns jpg, png, etc. Does tvheadend have that?

Posted (edited)

I'm afraid I don't quite understand? In any event Emby will need a plain image url that returns jpg, png, etc. Does tvheadend have that?

Well the browser shows it as a plain image at least. I think the issue is that it doesnt come with any file ending. For example my picons are all png but when I open that link and "save as..." it gives me a file without ending, so you'd have to guess what file type it is... :D I don't think that tvheadend has that...

Edited by Gerrit507
Posted

it doesn't need a file extension in the url, just a content-type response header.

Posted

it doesn't need a file extension in the url, just a content-type response header.

Would it need to have a subtype like "image/png" or would "image" suffice? If so, I would just assume image content-type "image" as default in this method.

Posted

No it needs image/png, image/jpeg, etc. We don't try and detect what kind of image it is.

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...