Jump to content
mickle026

TMDB Corrupt Image Fix Plugin for Windows 10

Recommended Posts

mickle026
Posted (edited)

NO LIABILITY IS ACCEPTED AT ALL, so USE AT YOUR OWN RISK.

 

What it does is different to the first posts, the plugin has changed quite a lot

 

 

Fixes broken image links

Removes Corrupt Images - Allows Emby to reload "good" images

Downloads Images

Refreshes Images (But not the text)

 

 

What it doesn't do is check if the actor + movie is valid, only the actor name.

 

If you have 2 or more actors for example named "bob smith"  it might get the wrong image for one of them. 

Also to note there is currently no aspect ratio check.  You might possibly get some landscape images.

 

 

5ed060872dfc9_Untitled.jpg

 

 

If you use it, please post back and let me know if it worked for you.

 

Many thanks

 

 

Latest Version v15

TMDBPeopleFix14.zip

TMDBPeopleFix15.zip

TMDBPeopleFix16.zip

Edited by mickle026
  • Like 4

Share this post


Link to post
Share on other sites
rechigo

Can you create a button that queries the amount of "corrupted" images and returns the amount it finds a dialog or something it so we can have an idea of how many there are?

 

Sent from my Galaxy S10

  • Like 2

Share this post


Link to post
Share on other sites
Happy2Play

I know I manually deleted image urls in my database per previous topics, and searching the log show 28,663 "Fixing Corrupt TMDB Image Path".

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

TMDB have copied most of their images to a new path using the same file names and thousands have similar changes, this is all this plugin fixes at the moment.  It changes all old TMDB paths to the new One even if they have changed filenames too.  So those will remain corrupt.

 

 

However some have completely new filenames like "Joshua Jackson" - he has a completely new entry, his old one exists but the image has a new filename.

 

Rather than just change them all to a new path which is what i currently do I should check if the file exists on the server without downloading it.  If it does change it, if it doesn't then remove it so that scan library picks it up later.

 

What do you think? - Thats without having to query tmdb for the image.

Edited by mickle026

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

Can you create a button that queries the amount of "corrupted" images and returns the amount it finds a dialog or something it so we can have an idea of how many there are?

 

Sent from my Galaxy S10

I can do that internally easy enough but first i need to learn how to pass variables from internal to the page, not figured that out yet.  I can update the page but dont know how to get it from the plugin core to the JS

Edited by mickle026

Share this post


Link to post
Share on other sites
mickle026

I know I manually deleted image urls in my database per previous topics, and searching the log show 28,663 "Fixing Corrupt TMDB Image Path".

So you have good chance a lot will be fixed, probably not all though as some have changed completely.

Share this post


Link to post
Share on other sites
Happy2Play

In theory the only items you should have to look at are items with tmdb url.  All downloaded /metadata/library items should be good and/or any legacy /metadata/people item.

Share this post


Link to post
Share on other sites
mickle026

In theory the only items you should have to look at are items with tmdb url.  All downloaded /metadata/library items should be good and/or any legacy /metadata/people item.

I currently look at them all but dont touch any without a tmdb url.  They remain unaltered.

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

*** UPDATED VERSION ***

 

This version check imdb server if the file exists, (it doesnt download it, so itll do a lot of queries but smaller bandwidth hit), as well as removing corrupt files from the metadata cache.

 

If it does it fixes the link, if it doesn't it removes the link and refreshes. 

Where they dont exist you should now get blank place holders again until the next library scan.

 

There is a corrupt link count button, it will output to the log when its done.

 

It is a bit slower but a lot more accurate.

 

If you already ran the first version of this plugin then invalid link text will have been changed, so the count corrupt wont work for that.  You will need to run the fix to do the http check to fix those that dont work.  I might add that check to the count later ...

 

This plugin might evolve into a check and validate, and redownload images plugin ......we will see.

 

To replace images, Run Replace All Metadata on the library.  Be Aware of any manual edits though ..... Lock them first

 

If you can test and post results, many thanks

Edited by mickle026
  • Like 1

Share this post


Link to post
Share on other sites
neik

@@mickle026, are you able to port this to Linux?

  • Like 1

Share this post


Link to post
Share on other sites
chuckr1958
Posted (edited)

@mickle026 The fix does not appear to work for me. 

 

2020-05-19 10:23:43.610 Info FixerService: --------------- FIX CORRUPT PEOPLE IMAGES --------------------
2020-05-19 10:23:43.610 Info FixerService: Metdata Path : 
2020-05-19 10:23:43.610 Error HttpServer: Error processing request
*** Error Report ***
Version: 4.4.2.0
Command line: C:\Users\Chuck\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///C:/Users/Chuck/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
System.Environment.Version: 3.1.3
Processor count: 12
Program data path: C:\Users\Chuck\AppData\Roaming\Emby-Server\programdata
Application directory: C:\Users\Chuck\AppData\Roaming\Emby-Server\system
System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.
   at TMDBPeopleFix.FixerService.Post(FixTMDBPeopleX result)
   at Emby.Server.Implementations.Services.ServiceController.<>c__DisplayClass6_0.<VoidActionDelegate>b__0(Object service, Object request)
   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
   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: TMDBPeopleFix
TargetSite: Void Post(FixTMDBPeopleX)
2020-05-19 10:27:08.288 Info FixerService: --------------- CORRUPT PEOPLE IMAGES  COUNT--------------------
2020-05-19 10:27:08.288 Info FixerService: --------------- Found 47856 entires
2020-05-19 10:27:08.288 Info FixerService: --------------- 28228 were corrupt links
2020-05-19 10:27:08.288 Info FixerService: DEBUG INFO: 9725
2020-05-19 10:27:08.288 Info FixerService: ---------------------------------------------------------------
2020-05-19 10:27:08.288 Info HttpServer: HTTP Response 204 to 10.0.0.109. Time: 5639ms. http://10.0.0.109:8096/emby/CustomFix/CountCorrupt
Edited by chuckr1958

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

@@mickle026, are you able to port this to Linux?

I am looking how to do that..  Long term solution I have a much better idea in the making, i dont know how long it will be but i'm already writing it.

 

I really need to know how to compile this in linux too, I have set up the IDE as "googling" suggests to create platform independant net core output but when I try to console the output for linux my IDE is crashing :(  So I am trying .. just not there yet...

If anyone knows how to do this in windows I'll accept help :)

 

I got it to spew out a .nupkg filewhich I believe is a nuget package, not a linux one ...

Edited by mickle026

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

 

@mickle026 The fix does not appear to work for me. 

 

2020-05-19 10:23:43.610 Info FixerService: --------------- FIX CORRUPT PEOPLE IMAGES --------------------
2020-05-19 10:23:43.610 Info FixerService: Metdata Path : 
2020-05-19 10:23:43.610 Error HttpServer: Error processing request
*** Error Report ***
Version: 4.4.2.0
Command line: C:\Users\Chuck\AppData\Roaming\Emby-Server\system\EmbyServer.dll -noautorunwebapp
Operating system: Microsoft Windows NT 6.2.9200.0
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Runtime: file:///C:/Users/Chuck/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
System.Environment.Version: 3.1.3
Processor count: 12
Program data path: C:\Users\Chuck\AppData\Roaming\Emby-Server\programdata
Application directory: C:\Users\Chuck\AppData\Roaming\Emby-Server\system
System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.
   at TMDBPeopleFix.FixerService.Post(FixTMDBPeopleX result)
   at Emby.Server.Implementations.Services.ServiceController.<>c__DisplayClass6_0.<VoidActionDelegate>b__0(Object service, Object request)
   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
   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: TMDBPeopleFix
TargetSite: Void Post(FixTMDBPeopleX)
2020-05-19 10:27:08.288 Info FixerService: --------------- CORRUPT PEOPLE IMAGES  COUNT--------------------
2020-05-19 10:27:08.288 Info FixerService: --------------- Found 47856 entires
2020-05-19 10:27:08.288 Info FixerService: --------------- 28228 were corrupt links
2020-05-19 10:27:08.288 Info FixerService: DEBUG INFO: 9725
2020-05-19 10:27:08.288 Info FixerService: ---------------------------------------------------------------
2020-05-19 10:27:08.288 Info HttpServer: HTTP Response 204 to 10.0.0.109. Time: 5639ms. http://10.0.0.109:8096/emby/CustomFix/CountCorrupt

 

Try this one, I have dissabled an internal query that might be causing this.  If it still doesnt work pm me the log if there is moreFixerService Info than this and I should be able to see where your machine dropped out and errored and see if I can trap that error and continue.  Thanks

 

Removed as it doesnt fix the error

Edited by mickle026

Share this post


Link to post
Share on other sites
rechigo
Posted (edited)

Plugins use .NET standard which is cross platform, so if you compile the dll on one operating system it'll work for all

 

Sent from my Galaxy S10

Edited by rechigo

Share this post


Link to post
Share on other sites
mickle026

Plugins use .NET standard which is cross platform, so if you compile the dll on one operating system it'll work for all

 

Sent from my Galaxy S10

Didnt know that, so this should work on linux too anyway? - I have no idea what the linux install looks like.

Share this post


Link to post
Share on other sites
rechigo

Yea, I'm pretty sure the path is /var/lib/emby/plugins or /var/lib/emby-server/plugins on linux

 

Just drop the dll in there and restart

 

Sent from my Galaxy S10

Share this post


Link to post
Share on other sites
mickle026

Yea, I'm pretty sure the path is /var/lib/emby/plugins or /var/lib/emby-server/plugins on linux

 

Just drop the dll in there and restart

 

Sent from my Galaxy S10

Slashes might be a thing then, as I replace with backslash not forward slash ....

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

OK

 

Another test, with path support for linux (I think) and I hope a recover from the error reported above, doesnt error on my system

 

Now has clause  below to set new paths with forward slash / rather than backslash.  Still backslash on windows

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))

I have no idea if it'll work on Linux, if the paths are right then it should.  Please test it on a test server first or wait until someone has reproted it working.
 

Edited by mickle026

Share this post


Link to post
Share on other sites
rechigo

Is there a GITHUB or GITLAB repo for this plugin?

 

Sent from my Galaxy S10

Share this post


Link to post
Share on other sites
mickle026

Is there a GITHUB or GITLAB repo for this plugin?

 

Sent from my Galaxy S10

No, I have the code local. I'll send you a pm.

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

#

Edited by mickle026

Share this post


Link to post
Share on other sites
mickle026
Posted (edited)

New version

 

This should now work and get people even if you are not fixing TMDB links - it'll do that if they are corrupt

 

1. Scans People Posters for Movie and Series

2. Fixes any TMBD broken Links - removes people if they are broken.  (Broken People will now be blank)

3.  Removes corrupt blank images from the Metadata storage.

4.  For any Blank images, including the ones created above - It'll check 4 different websites for it and download a photo for the person image.

5.  Updates and Refreshes the thumbnail / Primary image.  Changes should be almost instant as they happen.

 

Should now get images from 4 differernt websites and put them in your local cache, update and refresh your thumbnail.

 

 

Again - I accept no liability if you use this.

 

Report any problems.

 

Zip in Post #1

Edited by mickle026

Share this post


Link to post
Share on other sites
fbrassin

Sorry, i didn't understand if this latest version can be used also with linux.

Share this post


Link to post
Share on other sites
chuckr1958

I have tried the latest version of the fix and it still does not work with my install (Windows 10 Pro).  @@mickle026 has tried over and over with different changes to get it to work but there is no love here.  I just finished editing the actor's images of the movies that begin with "A" but at the rate I am going and the number of actor's per movie, it will take several months to correct.  Should I continue or will it be corrected by some other means?  

Share this post


Link to post
Share on other sites
mickle026

Sorry, i didn't understand if this latest version can be used also with linux.

According to other users, linux should be supported (drop it in plugins and reboot), sorry i cant test it as i dont have linux.

Share this post


Link to post
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...