Jump to content

[bug report] incorrect/invalid tmdb links cause missing actor pictures and errors in log


aptalca

Recommended Posts

aptalca

Hi, it is my understanding that when new media is scanned to library, the tmdb links are retrieved and stored in db for actor images, but the images are only pulled when they are to be displayed in the gui.

If, by the time the picture is requested to be displayed, the tmdb link is no longer valid and the picture cannot be downloaded, emby logs the following error:

2020-07-08 14:59:27.958 Info HttpClient: GET https://image.tmdb.org/t/p/original/ktuOAyUHM2u2YPPChH8gAArxJ7b.jpg
2020-07-08 14:59:27.984 Error HttpServer: Error processing request
*** Error Report ***
Version: 4.4.3.0
Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3
Operating system: Unix 5.3.0.62
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///app/emby/System.Private.CoreLib.dll
System.Environment.Version: 3.1.2
Processor count: 1
Program data path: /config
Application directory: /app/emby
System.ArgumentException: System.ArgumentException: Unable to determine image file extension from mime type text/html
at MediaBrowser.Providers.Manager.ImageSaver.GetStandardSavePath(BaseItem item, ImageType type, Nullable`1 imageIndex, ReadOnlySpan`1 mimeType, Boolean saveLocally)
at MediaBrowser.Providers.Manager.ImageSaver.GetSavePaths(BaseItem item, ImageType type, Nullable`1 imageIndex, ReadOnlySpan`1 mimeType, Boolean saveLocally)
at MediaBrowser.Providers.Manager.ImageSaver.SaveImage(BaseItem item, LibraryOptions libraryOptions, Stream source, ReadOnlyMemory`1 mimeType, ImageType type, Nullable`1 imageIndex, Nullable`1 saveLocallyWithMedia, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ProviderManager.SaveImage(BaseItem item, String url, ImageType type, Nullable`1 imageIndex, CancellationToken cancellationToken)
at Emby.Server.Implementations.Library.LibraryManager.ConvertImageToLocal(BaseItem item, ItemImageInfo image, Int32 imageIndex, CancellationToken cancellationToken)
at Emby.Drawing.ImageProcessor.ProcessImage(ImageProcessingOptions options, CancellationToken cancellationToken)
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.Providers
TargetSite: System.String GetStandardSavePath(MediaBrowser.Controller.Entities.BaseItem, MediaBrowser.Model.Entities.ImageType, System.Nullable`1[System.Int32], System.ReadOnlySpan`1[System.Char], Boolean)

These missing pictures are not ever auto refreshed, and require the user to manually refresh the metadata or manually search for a picture, in which case, a picture is successfully retrieved from tmdb.

However, when the library is full of such missing pictures (>15,000), manual refresh is not a viable option.

My suggestion is that emby implements a check for the above mentioned error, and if picture retrieval via tmdb link is not successful, it triggers an auto scan of the actor's picture or metadata.

 

PS. There is a community provided addon to search for these invalid links and refresh them, but in my (and some others') experience, it does not work as described in the following forum post: 

 

Link to comment
Share on other sites

Happy2Play

Ideally if images were downloaded instead of being dependent of the online source this would never be a issue.  But at the same time you have to honor the free providers request not to spam their site also.

There will never be a good fix for issues the Providers create.

I personally fixed it myself but deleting every tmdb url  person image in the database whether they were good or bad and refreshed the libraries.

But a new database resolves the issue also. 

Link to comment
Share on other sites

21 minutes ago, Happy2Play said:

I personally fixed it myself but deleting every tmdb url  person image in the database whether they were good or bad and refreshed the libraries.

I'm likely going to go this route as well.

Link to comment
Share on other sites

aptalca
46 minutes ago, Happy2Play said:

Ideally if images were downloaded instead of being dependent of the online source this would never be a issue.  But at the same time you have to honor the free providers request not to spam their site also.

I agree with you and I understand Emby's decision to implement the 2 step process.

But I think Emby can easily mitigate that issue (without changing the current behavior) if they simply implement a check for whether the thumb can be successfully downloaded via the link, and if not, query tmbd, retrieve a new link and use that to download.

Link to comment
Share on other sites

drodner
17 hours ago, Happy2Play said:

Ideally if images were downloaded instead of being dependent of the online source this would never be a issue.  But at the same time you have to honor the free providers request not to spam their site also.

There will never be a good fix for issues the Providers create.

I personally fixed it myself but deleting every tmdb url  person image in the database whether they were good or bad and refreshed the libraries.

But a new database resolves the issue also. 

Can you describe how you go about deleting every tmdb url person image in the database? And then the regular library refresh task gets them all again?

Thanks!

Link to comment
Share on other sites

Happy2Play
5 minutes ago, drodner said:

Can you describe how you go about deleting every tmdb url person image in the database? And then the regular library refresh task gets them all again?

Thanks!

See here for database and I just did a Refresh metadata on my movies library.  I selected replace all but would guess search for missing would work as it would be a missing person image.

Link to comment
Share on other sites

drodner
On 7/13/2020 at 3:02 PM, Happy2Play said:

See here for database and I just did a Refresh metadata on my movies library.  I selected replace all but would guess search for missing would work as it would be a missing person image.

Hi Happy/Luke,

I tried to delete from MediaItems as the linked post indicated but there are Foreign Keys from a few other tables causing the delete to fail. I'm not as familiar with SQLite as I am with SQL Server and I don't know this database structure at all. Is there a way to drop and recreate foreign keys? Or are we going to have to delete records from other tables before I can delete these items from MediaItems?

Thanks,

Darren

Link to comment
Share on other sites

PenkethBoy

yes you have to delete from "linked" tables the id's of the item(s) you want to delete from the mediaitems table

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