andrew-codes / playnite-web

Self-hosted Playnite companion web app; offering remote control, automation and sharing your library with friends.
GNU Affero General Public License v3.0
38 stars 7 forks source link

"release":null for game coming from custom libraries plugin like MultiMC Library Importer or Riot Games Library #607

Open Shayviri opened 3 weeks ago

Shayviri commented 3 weeks ago

Hello,

I don't know if I am doing something wrong or if it has been already answered. I am sorry if it's the case. I have noticed that when we launch a game with Playnite that come from custom libraries plugin like MultiMC Library Importer or Riot Games Library, the release is null throwing an error:

playnite-web/game-db-updater/handler/persistGameReleaseState Received game release state for topic playnite/playnite/response/game/state with payload {"release":null,"state":"launching"}
TypeError: Cannot read properties of null (reading 'id')
    at /opt/playnite-web-app/server.production.js:963:63048
    at /opt/playnite-web-app/server.production.js:963:64394
    at Array.map (<anonymous>)
    at xu.<anonymous> (/opt/playnite-web-app/server.production.js:963:64387)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

I tried with minecraft and league of legend. I don't know for manual import, though.

Anyway, it is an amazing project, really. I have seen that somebody is working on an HASS integration which is great! I saw this error while trying to control my Playnite instance with HASS too. I hope those projects will grow even more. Thanks for your hard work!

andrew-codes commented 3 weeks ago

I'm out of town but will look into it this upcoming week. I may reach out for additional details to troubleshoot.

Shayviri commented 3 weeks ago

Sure, no problem

Shayviri commented 3 weeks ago

Hi, I will be away of my server in the next 2 weeks, so I will give you as much information as I can now for you to have material to troubleshoot if you want during this time. When I check the number of games reported by Playnite including the hidden games, it shows 342 games. Without hidden games, it's 334. When I look into the mongodb under the database "games" in the collection "release", it shows 315 releases. I guess there are games that are not caught by the playnite web app.

I have 6 minecraft instances, 4 from Prism Launcher that I add with MultiMC Library Importer plugin and 2 from the Xbox app. None are registered in the mongodb, so it's not only a plugin problem. All games added with Riot Games Library plugin (3 games: League of legends, Legends of Runeterra and Valorant) aren't in the mongodb. I didn't add any games manually, so everything come from the regular libraries + the 2 plugins I mentioned.

When I try to check which other games are not caught, I realeased that none of my game coming from xbox app are in the mongodb. I had at some point the xbox pass, but not any more. The games I played before are still in my xbox library which explain why they appear in playnite. However games like for example "Microsoft Solitaire Collection" is part of the xbox library and is in playnite. This is installed, and I can play it, but it doesn't appear in the mongodb. So I guess there are problems with the games coming from xbox library.

Here is the list I get when I check the mongodb under the database 'games' under the collection 'source' in case you need: [{'_id': ObjectId('67256bf5cd75f5e27e60efd7'), 'id': '6fffec81-a8ff-4cd7-8a02-4e620875d2b6', '_type': 'GameSource', 'name': 'EA app'}, {'_id': ObjectId('67256bf5cd75f5e27e60efd8'), 'id': 'b1bc024b-83d5-4cd6-a56d-326eeaeac68f', '_type': 'GameSource', 'name': 'Xbox'}, {'_id': ObjectId('67256bf5cd75f5e27e60efd9'), 'id': 'b23c7d60-4383-4d15-9f22-67936b34456f', '_type': 'GameSource', 'name': 'Battle.net'}, {'_id': ObjectId('67256bf5cd75f5e27e60efda'), 'id': '960c42c5-b84a-4659-9f40-8b93bb2e0a42', '_type': 'GameSource', 'name': 'Steam'}, {'_id': ObjectId('67256bf5cd75f5e27e60efdd'), 'id': '96baeffc-7245-4184-b602-25f470291bbc', '_type': 'GameSource', 'name': 'Epic'}, {'_id': ObjectId('67256bf5cd75f5e27e60f027'), 'id': '771c6d8a-1384-41f1-8db8-2e9fccc29155', '_type': 'GameSource', 'name': 'Riot Games'}, {'_id': ObjectId('67256bf6cd75f5e27e60f0d7'), 'id': '9da2fdf6-21e4-43c4-bfe0-91fce9da9d1d', '_type': 'GameSource', 'name': 'GOG'}]

Let me know if you need more information, I might be able to answer without needing access to the server, and if it is needed I can answer when I come back.

andrew-codes commented 2 weeks ago

Hi @Shayviri , I'm looking into this now. In a recent update, the Playnite Web plugin will no longer publish a release if it cannot decide its platform. I know this seems odd as Playnite already has all the games' platforms, but this is not entirely the case we expect. For example, a Playnite game with a PlayStation source may have multiple platforms, some of which are PlayStation and some may not be. Playnite Web tries to decide the single platform for a given release of a game.

With that said, I think there are a few things happening here and I may need more information to help diagnose and resolve all of them.

Solution for Riot Games to Try

For Riot Games, I have added support for Riot Games for PC platform. I have not released this yet, as I want to ensure the entirety of the problem is resolved. Please do the following:

  1. Download and install the dev build of the plugin found with this direct link.
  2. Drop the games database (we'll address the riot games problem first, then move to the MultiMC one).
  3. Sync Playnite Web
  4. Verify if Riot games show up in the db.release collection.
  5. Report back if any Riot games persisted, if all Riot games persisted, and if not, then what games do not persist (preferably at least one so I can try to spot check for anything I'm missing).

More Info needed for MultiMC library source

I'm not familiar with the MultiMC library plugin/source. A couple of questions:

  1. What does Playnite consider that source's name (as found in the Library Manager of Playnite)?
  2. Are (any of) these games on emulators? If so, what are their platforms according to Playnite?
  3. Do any of these games lack a Platform or Source in Playnite?

Figuring out any other missing releases

Additionally, let's try to narrow down which games are missing and what platform/source they belong to. Playnite Web does not ignore hidden games, so my assumption is that there should be 342 items (db.release.count()) in the release collection. Please see if you can narrow down any other missing games beyond those from the above two sources. I saw that Xbox games may have an issue.

  1. Are there any Xbox games that persisted or are all Xbox games missing?
  2. Please provide the Platforms and sources for some of the missing Xbox games. My guess is that game pass games may have an unsupported source, much like Riot Games did, so I want to verify this and find out what it should be.

Sorry for the long post. Thank you for raising the issue and helping find a solution. 💯

Shayviri commented 2 weeks ago

Thanks a lot for your reply.

I have partial remote access to my server. So I can reply several of your questions.

For the solution for Riot Games, I will do it when I am back to have a full control on things and give you proper feedback.

For the MultiMC Library, the games added using this plugin doesn't have source or platform, which might explain why they are not considered by the playnite web app. The only metadata available are the name, the installation path and a quick description with the minecraft version. Those are not emulated games afaik.

For the other games that are not considered by playnite web, actually, they are all from the Xbox game app. None of my games coming from the Xbox games app are in the mongo database. When I look on Playnite, they do have a platform like PC (Windows) or Mac or Linux and a source which is Xbox.

Hope this help you! I will come back to you when I come back to give you feedback on the solution of Riot Games. Thank you again!

Shayviri commented 4 days ago

Hi again,

I came back and installed the playnite web plugin you gave. I synced my games and checked if any games of Riot games were in db.release.

EDIT: I tested it once and it was not working because I didn't set it up properly. I tried again and it worked. All the Riot Games have been added to the database.

Let me know if you need any more information or data on this!

andrew-codes commented 4 days ago

Hi, thanks for the reply. A feature to default unknown library sources to PC, #633, has been released. This will cover Riot and also other unrecognized sources and assign them as PC platform games. It is unclear if the core problem is due to a game release from an unknown source or something else. If the former, then the most recent release of Playnite Web may address the issue entirely.

Please try the newest version and report back if the starting of games is resolved. In the meantime, I intend to add additional logging to the Playnite Plugin to help troubleshoot this issue further. Thanks!