GNOME Bugzilla – Bug 783319
refactor: Expose game IDs and media IDs
Last modified: 2021-04-03 09:57:47 UTC
Games currently create Game objects from Uri objects generated separately and it's already a great improvement over what we did before. We should keep standardizing and exposing the internals of how Game objects are created. All games are composed of medias, represented by a URI; each media has an ID and is related to a game, and each game has an ID and is related to a platform. The IDs may be part of an external database (for example each PlayStation disc has its own ID) or something generated by Games (the hash of a file or parts of a file for example). I propose to do the following: - looking for URIs - getting the platform, game ID and media ID corresponding to each URI - create Media objects gathering these media-specific information and the corresponding URIs - creating games from these medias This has the advantage of allowing for more sophisticated caching as all information relative to the URIs and the corresponding medias are exposed.
Created attachment 353010 [details] [review] core: Add MediaInfo This will be used to extract information on a game media from an URI.
Created attachment 353011 [details] [review] core: Add Media.get_info() and Media.with_info() Allow to attach information to and retrieve it from a Media.
Created attachment 353012 [details] [review] core: Make MediaSet.icon settable This will help simplifying and making more flexible the construction of a MediaSet.
Created attachment 353013 [details] [review] core: Add MediaSet.add_media() This will help simplifying and making more flexible the construction of a MediaSet.
Created attachment 353014 [details] [review] core: Allow the MediaSet constructor to take no parameter This will help simplifying and making more flexible the construction of a MediaSet.
Created attachment 353015 [details] [review] retro: Simplify construction of MediaSet in RetroRunner
Created attachment 353016 [details] [review] playstation: Simplify construction of MediaSet Simplify the construction of MediaSet in PlayStationGameFactory.
Created attachment 353017 [details] [review] core: Remove the MediaSet constructor As all its parameters are optionnal and none is used, it should be removed.
Attachment 353010 [details] pushed as 2b8e749 - core: Add MediaInfo Attachment 353011 [details] pushed as 4e21da7 - core: Add Media.get_info() and Media.with_info() Attachment 353012 [details] pushed as 6963c35 - core: Make MediaSet.icon settable Attachment 353013 [details] pushed as bc79462 - core: Add MediaSet.add_media() Attachment 353014 [details] pushed as 3187d47 - core: Allow the MediaSet constructor to take no parameter Attachment 353015 [details] pushed as 12121bc - retro: Simplify construction of MediaSet in RetroRunner Attachment 353016 [details] pushed as 7bd5111 - playstation: Simplify construction of MediaSet Attachment 353017 [details] pushed as b3a9a0e - core: Remove the MediaSet constructor
Closed by accident, reopen it.
Closing, we're not gonna go with it at this point.