Jump to content

I learned stuff...emby kept crashing and this is why (Plugin Images)


chef

Recommended Posts

chef

This is probably going to seem ridiculous to the experts, but last night emby kept crashing whenever I start playing a tv episode. I couldn't figure it out. I'd start an episode and the main process would quit.

 

After reading the logs I found out that my Facebook plugin was requesting thumb images for items which didn't have thumb images.

2020-04-12 23:48:24.636 Info HttpServer: HTTP GET http://###########/emby/Items/86997/Images/Thumb?maxHeight=1108. UserAgent: facebookplatform/1.0 (+http://developers.facebook.com)
2020-04-12 23:48:24.656 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 4.4.2.0
	Command line: C:\Users\MediaServer\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows NT 6.1.7601 Service Pack 1
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Runtime: file:///C:/Users/MediaServer/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	System.Environment.Version: 3.1.3
	Processor count: 8
	Program data path: C:\Users\MediaServer\AppData\Roaming\Emby-Server\programdata
	Application directory: C:\Users\MediaServer\AppData\Roaming\Emby-Server\system
	MediaBrowser.Common.Extensions.ResourceNotFoundException: MediaBrowser.Common.Extensions.ResourceNotFoundException: 86997 does not have an image of type Thumb
	   at MediaBrowser.Api.Images.ImageService.GetImage(ImageRequest request, Int64 itemId, BaseItem item, Boolean isHeadRequest)
	   at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: Emby.Api
	TargetSite: Void MoveNext()

Took it all down!

 

 

So if you are going to direct a site to request images from emby, what you'd want to do is make sure the image exists, or give a substitution for the image.

 

for example, in a Playback started event args I added a condition which looks for the thumb image and then gives it a primary image if it doesn't exist.

            var type    = e.Item.GetType();
            var item    = type.Name == "Episode" ? LibraryManager.GetItemById(e.Item.Parent.ParentId) : e.Item; //Series Id -- there might be a better way then asking for parent parentId....
            var message = $"{e.Session.UserName} is watching the {type}:  {e.Item.Name} ";
            var image   = type.Name == "Episode" ? item.ImageInfos.ToList().Exists(img => img.Type == ImageType.Thumb) ? "Thumb" : "Primary" : "Primary"; //<--Here ImageInfos!! No thumb, give a primary image (webapp does backdrop substitutions)

now you can add image into a request format like this:

$"{WanAddress}/emby/Items/{item.InternalId}/Images/{image}?maxHeight=1108&maxWidth=800&quality=90"

and image will change based on ImageInfos.

 

Seems stupid, but that is what I learned.

Link to comment
Share on other sites

  • 2 weeks later...
crunchyemby

@@chef - THANK YOU!!! You have verified a problem that I recently discovered myself (4.5.0.6 and 4.5.0.7 beta)... I was going crazy trying to figure out what was causing the crash. Nothing is written to the log, on crash, even with "debug" enabled... This gives me hope that I'll be able to track it down. Cheers!

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