Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source being null prevents library sync #659

Closed
Nightchanger opened this issue Dec 7, 2024 · 11 comments · Fixed by #663 or #667
Closed

Source being null prevents library sync #659

Nightchanger opened this issue Dec 7, 2024 · 11 comments · Fixed by #663 or #667
Assignees
Labels
app:playnite-web-plugin Playnite plugin used to publish MQTT messages to be used by library-updater bug Something isn't working released

Comments

@Nightchanger
Copy link

image

@github-project-automation github-project-automation bot moved this to Needs Triage 🗃️ in Playnite-Web Dec 7, 2024
@andrew-codes
Copy link
Owner

What sources do you have in your Playnite library? You can check the extension.log file to see if any errors were logged by the plugin. The extenions.log file can be found in Playnite's application directory.

@andrew-codes
Copy link
Owner

I think there is a legitimate error in the plugin that was recently introduced. I thought it was introduced and then resolved, but this does not appear to be the case.

For more context: a game's source may not always be set within Playnite. This is often the case with emulators or manually added games. In the case a source is not set, it defaults to Emulator as the source and creates this new source on the fly to be used (as it is not in Playnite proper). This is why I thought it was resolved by using a default "Emulator" source when the underlying value is null.

I'll have to investigate this further to see where this is breaking down. I certainly think it is a bug in the plugin.

@andrew-codes andrew-codes added bug Something isn't working app:playnite-web-plugin Playnite plugin used to publish MQTT messages to be used by library-updater labels Dec 9, 2024
@Shayviri
Copy link

Shayviri commented Dec 9, 2024

When I have the error, I do not see any error in the extension.log file. However, in the playnite.log file I have this:
|ERROR|MainMenu:Main menu extension action failed.
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)
at PlayniteWeb.Models.Game.<>c.b__21_0(Game g) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 57
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at PlayniteWeb.Models.Game.d__21.MoveNext() in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 57
at System.Linq.Enumerable.d__172.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at PlayniteWeb.Models.Game..ctor(IEnumerable1 playniteGames, IEnumerable1 defaultPlatforms, GameSource defaultSource) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 41
at PlayniteWeb.PlayniteWeb.<>c__DisplayClass36_0.b__1(IGrouping2 groupedByName) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 198 at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at PlayniteWeb.PlayniteWeb.SyncLibrary() in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 198
at PlayniteWeb.PlayniteWeb.SyncLibraryFromMenu(MainMenuItemActionArgs args) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 188

sorry for the format but there are some " ` " in the error that make this weird formating

I don't know if this helps

@andrew-codes
Copy link
Owner

This is very helpful! Thank you!

@andrew-codes andrew-codes changed the title Trying to find the reason why it doesn't work when trying to sync my library Source being null prevents library sync Dec 9, 2024
@andrew-codes andrew-codes self-assigned this Dec 9, 2024
@github-project-automation github-project-automation bot moved this from Needs Triage 🗃️ to Done ✅ in Playnite-Web Dec 9, 2024
@andrew-codes
Copy link
Owner

@Shayviri , @Nightchanger , can you wipe your database and try the latest dev build of both the app and the Plugin, then report back if this resolves the issue?

Thanks!

@andrew-codes andrew-codes reopened this Dec 9, 2024
@github-project-automation github-project-automation bot moved this from Done ✅ to Ready 📝 in Playnite-Web Dec 9, 2024
@Shayviri
Copy link

Shayviri commented Dec 9, 2024

I updated my docker with the :dev tag and installed the plugin you gave (v4.0.2). And I still have the same error:

|ERROR|MainMenu:Main menu extension action failed.
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at PlayniteWeb.Models.Game.get_Name() dans D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 31 at PlayniteWeb.Models.Game.<GetReleases>d__22.MoveNext() in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 67 at System.Linq.Enumerable.<SelectManyIterator>d__172.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at PlayniteWeb.Models.Game..ctor(IEnumerable1 playniteGames, IEnumerable1 defaultPlatforms, GameSource defaultSource) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\Models\Game.cs:line 44 at PlayniteWeb.PlayniteWeb.<>c__DisplayClass36_0.<SyncLibrary>b__1(IGrouping2 groupedByName) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 200
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at PlayniteWeb.PlayniteWeb.SyncLibrary() in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 200
at PlayniteWeb.PlayniteWeb.SyncLibraryFromMenu(MainMenuItemActionArgs args) in D:\a\playnite-web\playnite-web\apps\PlayniteWebPlugin\src\PlayniteWeb.cs:line 188
at Playnite.DesktopApp.Controls.MainMenu.<>c__DisplayClass17_2.b__1(Object _, RoutedEventArgs __) in C:\projects\playnite\source\Playnite.DesktopApp\Controls\Menus\MainMenu.cs:line 380

I am sorry, I think the last line was missing in the previous error I gave you

@andrew-codes
Copy link
Owner

This is very helpful. The second error is at a different location in the code and gives me a new lead. I apologize for having you be the tester. I can't reproduce it locally and don't what data in Playnite is required to reproduce it. I'll follow up soon with a new builds to try. Thanks again!

@andrew-codes
Copy link
Owner

@Shayviri , @Nightchanger , try the latest dev app and this Plugin version: https://github.com/andrew-codes/playnite-web/actions/runs/12243037521/artifacts/2295901727. Drop the database, retry, and report back. You may see more logs if there are any games that cannot be processed. Before it may have errored out, now it will produce a warning in the extension.log file. Thanks!

@Shayviri
Copy link

Shayviri commented Dec 10, 2024

Hi, I tried with the new plugin and the latest dev app, and it worked!
I checked the extension log and indeed there are warnings for some games like:
|WARN |PlayniteWeb#Game:Game Minecraft All the Mods 10 - ATM10 has no source. These will be published with the source Emulator.

When I launch one of those game, the playnite web doesn't throw an error anymore, but instead says:
playnite-web/game-db-updater/handler/persistGameReleaseState Received game release state for topic playnite/playnite/response/game/state with payload {"release":null,"state":"launching"}
playnite-web/game-db-updater/handler/persistGameReleaseState Release is null; aborting

@andrew-codes
Copy link
Owner

That's great news! 😁 I'll close this issue and cut a release.

github-actions bot pushed a commit that referenced this issue Dec 10, 2024
## [10.0.2](v10.0.1...v10.0.2) (2024-12-10)

### Bug Fixes

* library sync errors for games w/o a source ([#663](#663)) ([ecc60e2](ecc60e2)), closes [#659](#659)
* remember me auth sessions expires in 1 year ([#666](#666)) ([e100330](e100330)), closes [#546](#546)
* signout works as expected ([#665](#665)) ([b4e0197](b4e0197)), closes [#662](#662)
Copy link

🎉 This issue has been resolved in version 10.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-project-automation github-project-automation bot moved this from Ready 📝 to Done ✅ in Playnite-Web Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:playnite-web-plugin Playnite plugin used to publish MQTT messages to be used by library-updater bug Something isn't working released
Projects
Archived in project
3 participants