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

Fix to Issue #4 and more #6

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

cwarren-qc
Copy link

@cwarren-qc cwarren-qc commented May 27, 2018

The main problem is that the 'switch cases' are not always coherent in the library.

There is a first conversion from "Emby Platform" to "Emby GameSystem". Then, for each provider, there is another switch case to convert an "Emby GameSystem" to a "game provider specific platform" but the switch case use "Emby Platform" string instead of "Emby GameSystem".

So the end result is:

  1. Emby Platform: "Nintendo 64" => Emby GameSystem: "Nintendo64" (in method ResolverHelper.GetGameSystemFromPlatform)
  2. Emby GameSystem: "Nintendo64" => Tgbd Platform: null, because the switch case is looking for "Nintendo 64" with a space (in method GameBrowser.Providers.GamesDb.GetTgdbPlatformFromGameSystem)
  3. The search with the provider API is done without a Platform and often return an ID from another platform
    Info HttpClient: GET http://thegamesdb.net/api/GetGamesList.php?name=5200+Menu+&platform=
  4. The metadata, images, etc are all taken from the wrong game system.

Before Fix:
screenshot 1526787966

After Fix:
screenshot 1527078404

After fixing the issue, I updated a few others things:

  • Added a few GameSystem (Atari Lynx, Atari ST, Neo Geo Pocket, Neo Geo Pocket Color).
  • Added some missing TgbdId for some system (VirtualBoy).
  • Added image types for EmuMovies provider (Banner, BoxRear, Screenshot, etc).
  • And I ended up refactoring the code to remove the multiple switch case. Instead, I created a single "GameSystemDefinition" instance for each game system, which should reduce the risk of error and simplify the addition of more GameSystem in the future.
  • Changed so that the plugin never search for a TgbdId if tgbdGameSystem is null.

I'm not sure of the best way to fix 'corrupted' games in an existing library because the ID is invalid and is never modified on a rescan.
What I ended up doing is:

  1. Rename "games" to "games-old" folder.
  2. Scan Library. I saw a bunch of metadata deletion in library.
    2018-05-22 20:58:21.329 Debug App: Deleting path C:\Users\cwarr\AppData\Roaming\Emby-Server\metadata\library\21\21bd78c11f26a1542ebb5219d8820b49
    2018-05-22 20:58:21.337 Debug App: Deleting path C:\Users\cwarr\AppData\Roaming\Emby-Server\metadata\library\a0\a04f6756481c010d5ec00bd8e6dda3d6
    2018-05-22 20:58:21.346 Debug App: Deleting path C:\Users\cwarr\AppData\Roaming\Emby-Server\metadata\library\8d\8d2e47f8655d091baa196e9fb99609df
  3. Delete .xml file and images in game folders.
  4. Rename "games-old" to "games.
  5. Scan Library. I saw the plugin call "GetGamesList" with the right platform and the correct images were downloaded as well.
    2018-05-22 21:03:28.761 Debug App: Running GamesDbGameProvider for C:\Partage\Medias\Emulation\Games\Atari - 5200\5200 Menu (USA) (Proto)\5200 Menu (USA) (Proto).a52
    2018-05-22 21:03:28.761 Info HttpClient: GET http://thegamesdb.net/api/GetGamesList.php?name=5200+Menu+&platform=Atari 5200

@cwarren-qc cwarren-qc changed the title Fix to Issues #4 and more Fix to Issue #4 and more May 27, 2018
@cwarren-qc
Copy link
Author

More info:

  • IMO, it could be simplified even more if 'consoleType', 'platform' and 'gamesystem' were merged into a single value. Unless I missed something, they all look like 'alias' of the same notion.

@LukePulverenti
Copy link
Member

Yes the entire plugin just needs an overhaul at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants