JosefNemec / PlayniteExtensions

Extensions for Playnite game launcher and manager.
MIT License
173 stars 41 forks source link

Importing new games from steam silently fails #198

Closed brabulla closed 2 years ago

brabulla commented 2 years ago

Describe the bug Some recently purchased games are not getting imported to Playnite when the Steam library integration runs the import.

The client shows no indication of error, but the games are not added to the library.

The playnite.log file shows the following error:

TIMESTAMP|ERROR|GameDatabase:Failed to import game into database.
System.InvalidCastException: Unable to cast object of type 'LiteDB.EmptyPage' to type 'LiteDB.HeaderPage'.
   at LiteDB.PageService.GetPage[T](UInt32 pageID)
   at LiteDB.TransactionService.PersistDirtyPages()
   at LiteDB.LiteEngine.Transaction[T](String collection, Boolean addIfNotExists, Func`2 action)
   at LiteDB.LiteEngine.Upsert(String collection, IEnumerable`1 docs, BsonType autoId)
   at LiteDB.LiteCollection`1.Upsert(IEnumerable`1 documents)
   at LiteDB.LiteCollection`1.Upsert(T document)
   at Playnite.Database.ItemCollection`1.Add(TItem itemToAdd) in C:\projects\playnite\source\Playnite\Database\Collections\ItemCollection.cs:line 348
   at Playnite.Database.GamesCollection.Add(Game item) in C:\projects\playnite\source\Playnite\Database\Collections\GamesCollection.cs:line 85
   at Playnite.Database.GameDatabase.ImportGame(GameMetadata game, Guid pluginId) in C:\projects\playnite\source\Playnite\Database\GameDatabase.cs:line 1119
   at Playnite.Database.GameDatabase.ImportGames(LibraryPlugin library, Boolean forcePlayTimeSync, CancellationToken cancelToken) in C:\projects\playnite\source\Playnite\Database\GameDatabase.cs:line 1173

Some further info:

Diagnostics ID 9b379111-e3bd-42b2-bec8-52604e391d1b

JosefNemec commented 2 years ago

Your library database file is corrupted, please attach %AppData%\Playnite\library\games.db file, I'll try to repair it.

brabulla commented 2 years ago

Thank you, created a zip, since Github did not let me upload a .db file.

games.zip

JosefNemec commented 2 years ago

Here's fixed file.

brabulla commented 2 years ago

Thank you, now it works perfectly!