azuravian / playnite-animatedgiffixer

Converts animated gifs into static png and lets you select which frame to keep (from a selection of 12).
Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

Failed to execute menu action #1

Open ccrowles opened 9 months ago

ccrowles commented 9 months ago

As per title, when I right-click on a game cover and select "Fix animated gifs" I get this error:

Screenshot_2024-02-18_15-15-29_983

Not sure what I'm doing wrong?

azuravian commented 3 months ago

Sorry for the lateness in responding. I started a new job earlier this year and have been crazy busy. What operating system are you running?

ccrowles commented 3 months ago

Hi! Thanks for replying, dw I understand we all have a life and things can be hectic :) Also congrats for the new job!

About your question, I'm running Windows 10, I just updated the addon (cause I saw you pushed an update) but the issue is still there.

Other info: image image

azuravian commented 3 months ago

Hmmm, this is a weird one. Could you run it again and after getting the error, open both the extension log and playnite log (from main menu in Playnite) and copy and paste the last 10 or so lines from each? Alternatively, if you want to just send me copies of the logs, that's fine too.

ccrowles commented 3 months ago

Sure!

Extensions log:

SuccessStory#SteamAchievements:GetAchievements() - IsLocal : False, IsManual : False, HasApiKey: True, SteamIsPrivate: False
30-07 09:06:23.250|INFO |SuccessStory#StoreApi:Expired cookies
30-07 09:06:25.691|INFO |SuccessStory#SteamAchievements:Old
30-07 09:06:26.211|INFO |SuccessStory#PluginDatabaseObject`4:No achievements find for A Space For The Unbound Demo - 5016f282-3e2a-4add-baa6-ddea36b853dd
30-07 09:06:26.217|INFO |SuccessStory#PluginDatabaseObject`4:Task Refresh() - 00:03.04 for 1/1 items
30-07 09:06:33.604|INFO |Animated_Gif_Fixer_5fs3sd1fs6a8k#PS:Fix Animated Gifs - Found executable Path via registry in "C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe".

Playnite log:

30-07 09:06:29.114|DEBUG|Downloader:Downloading string content from https://raw.githubusercontent.com/darklinkpower/PlayniteExtensionsCollection/master/manifests/Generic_SaveFileView.yaml using UTF8 encoding.
30-07 09:06:29.283|DEBUG|Downloader:Downloading string content from https://raw.githubusercontent.com/azuravian/playnite-animatedgiffixer/main/manifests/Generic_AnimatedGifFixer.yaml using UTF8 encoding.
30-07 09:06:29.535|DEBUG|Downloader:Downloading string content from https://raw.githubusercontent.com/darklinkpower/PlayniteExtensionsCollection/master/manifests/Generic_LogOpen.yaml using UTF8 encoding.
30-07 09:06:29.772|DEBUG|Downloader:Downloading string content from https://raw.githubusercontent.com/darklinkpower/PlayniteExtensionsCollection/master/manifests/Generic_SteamTrailers.yaml using UTF8 encoding.
30-07 09:06:30.001|DEBUG|Downloader:Downloading string content from https://github.com/eminaguil/eMixedNite/raw/main/InstallerManifest/eminaguil_eMixedNite_DesktopTheme.yml using UTF8 encoding.
30-07 09:06:30.217|DEBUG|Downloader:Downloading string content from https://github.com/darklinkpower/Stardust/raw/master/Manifests/Installer_Manifest.yaml using UTF8 encoding.
30-07 09:06:33.643|ERROR|GameMenu:Game menu extension action failed.
System.Management.Automation.CmdletInvocationException: 404 Not Found

nginx ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
   at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Playnite.Scripting.PowerShell.PowerShellRuntime.InvokeFunction(String name, List`1 arguments) in C:\projects\playnite\source\Playnite\Scripting\PowerShell\PowerShell.cs:line 277
   at Playnite.Scripting.PowerShell.PowerShellScript.InvokeFunction(String functionName, List`1 arguments) in C:\projects\playnite\source\Playnite\Scripting\PowerShell\PowerShellScript.cs:line 208
   at Playnite.DesktopApp.Controls.GameMenu.<>c__DisplayClass31_2.<AddExtensionItems>b__0(GameMenuItemActionArgs a) in C:\projects\playnite\source\Playnite.DesktopApp\Controls\Menus\GameMenu.cs:line 616
   at Playnite.DesktopApp.Controls.GameMenu.<>c__DisplayClass31_3.<AddExtensionItems>b__1(Object _, RoutedEventArgs __) in C:\projects\playnite\source\Playnite.DesktopApp\Controls\Menus\GameMenu.cs:line 662

I copied a bit more than the last 10 lines of the playnite log, cause I thought they might be useful since I saw mentions of AnimatedGifFixer in them.

azuravian commented 3 months ago

Awesome, do you get this error on every game you try, or is there one particular game that gives it. If so, which game is it?

ccrowles commented 3 months ago

Every game!

azuravian commented 2 months ago

OK, I'm going to try some things on my end, but before I do, can you test something for me? Try running Playnite as admin and see if you get the same error.

ccrowles commented 2 months ago

I tried, but even when running it as admin I get the same error. image Specifically, this time I tried it with "A Space for the Unbound" demo, with the steam store as info.

I've also attached the extension log and playnite log just in case: playnite.log extensions.log

azuravian commented 2 months ago

OK, thanks, that shoots down that idea. I'm going through the code and adding better logs. I know it's detecting your ImageMagick install successfully, but I'm bad about logging, so I'm gonna fix that. Rather than release directly, I'll probably just send you a replacement file to let you test first.

azuravian commented 2 months ago

OK, replace your "AnimatedGifFixer.psm1" file with this file (you will need to change the extension from txt to psm1). The file is found in your Playnite directory under "Extensions\AnimatedGifFixer".

After you've replaced it and restarted Playnite (or hit F12 within Playnite), try again. You will likely still get an error, but should have more info in the extension logs for me to track it down.

AnimatedGifFixer.txt

ccrowles commented 2 months ago

Done, and yep, same error. Here are the logs: playnite.log extensions.log

azuravian commented 2 months ago

Ok, that's helpful. I see what file it's getting stuck on, and I am also getting a 404 on that file. You mentioned getting it on everything you tried. By any chance, are all of them Demos?

ccrowles commented 2 months ago

~~... they may have been all demos, I'm double-checking. For now it's working on every non-demo I've been trying that had gifs that needed a fix, but it also works on some demos (Everholm demo, for now).~~

OH! I may have found the issue. All the gifs that appear with an error mark on Playnite also give that error on animated gif fixer. I just tried it with the Conquistadorio demo, and:

https://gofile.io/d/bzj5fP

(Sorry, it was a bit too big and wouldn't let me upload directly in github)

The weird thing is that on the Conquistadorio page all the gifs work properly.

azuravian commented 2 months ago

Yeah, the gifs that show with an x are that way because the link is pointing to an image that doesn't exist. I've got a couple of fixes I'm looking at. One will be to check for 404 errors and report to the user at the end that some number of images could not be processed because they don't exist.

The other fix, though, may be more helpful. If you look at the link for the first image in "A Space for the Unbound Demo" you'll notice that it is using the following url:

"https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/1268090/extras/ASFTU_Ronda.gif?t=1600670718"

The part between apps and extras is the app id for that game on steam. In this case, it is 1268090, which is specific to the demo. The app id for the full version of the game is 1201270 and that image exists if I change the app id in the url to that of the full game.

I'm looking at finding a method to determine the full game app id from the demo app id and checking any image that gives a 404 to see if the full app id has the same image. I'll let you know when I have a new version for you to test.

ccrowles commented 2 months ago

Ok, thank you so much!

azuravian commented 2 months ago

OK, I've got another file for you to test. Let me know how this one works. Use the same instructions from https://github.com/azuravian/playnite-animatedgiffixer/issues/1#issuecomment-2308334747

AnimatedGifFixer.txt

ccrowles commented 2 months ago

Thanks! Ok I've tried it on some demos that had the gif errors:

Logs: extensions.log playnite.log

Also some days ago I noticed that after fixing gifs of a lot of games (going at them one by one) it started giving me another error every time I tried, even for gifs that did not had the "x" error blank image. So I tried restarting playnite, and it worked. The "non-x" gifs were able to get processed by AnimatedGifFixer again. It also re-happened after fixing another bunch of games' gifs, then I restarted again, and it got fixed again. So this time I tried restarting playnite too, even though the error was the usual one and not the one that got fixed by restarting. And these are the results:

It didn't fix the 2nd gif though, I noticed it after it said it got completed.

image I tried going back at it and clicking "fix animated gifs" for that demo again, but this time it got stuck for a long time and then Playnite literally crashed. Here are the logs after I reopened it after the crash: extensions.log playnite.log

Second (forced) restart (the one after the crash): tried again with Enelia Dawn of Madness demo, Playnite got stuck again for a long while and then crashed again.

Then I reopened it, and closed it again properly.

Third (manual) restart: I gave up on that game, tried on the Obscura demo but it gave me the usual error after getting stuck for a long time.

I'm gonna do more tries later in the day probably, but meanwhile I might as well send this wall of text.

azuravian commented 2 months ago

OK, I wondered if that might happen. The command I'm using to check steam pages sometimes fails with a time out. When it does, I have it log that and skip to the next step, which then gives you the error. Trying to figure out how I can get a redirect page in Powershell within Playnite without it hanging/timing out. Outside of Playnite it all works fine.