[gnome-games] Fetch metadata for Steam games



commit 7ae98d1b374e5a9d83541208c2322408c1251350
Author: Tony Crisci <tony dubstepdish com>
Date:   Sat Sep 29 10:55:47 2018 -0400

    Fetch metadata for Steam games
    
    Use the "PC" mime type from the thegamesdb.net grilo plugin to fetch
    metadata for Steam games.
    
    fixes #113

 plugins/steam/src/steam-plugin.vala | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/plugins/steam/src/steam-plugin.vala b/plugins/steam/src/steam-plugin.vala
index 6f858e8d..fded88da 100644
--- a/plugins/steam/src/steam-plugin.vala
+++ b/plugins/steam/src/steam-plugin.vala
@@ -1,6 +1,8 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 private class Games.SteamPlugin : Object, Plugin {
+       private const string STEAM_MIME_TYPE = "PC";
+
        private const string STEAM_APPID = "com.valvesoftware.Steam";
        private const string STEAM_FLATPAK_DIR = "/.var/app/" + STEAM_APPID;
 
@@ -94,6 +96,26 @@ private class Games.SteamPlugin : Object, Plugin {
                game.set_icon (icon);
                game.set_cover (cover);
 
+               var media = new GriloMedia (title, STEAM_MIME_TYPE);
+
+               var release_date = new GriloReleaseDate (media);
+               var cooperative = new GriloCooperative (media);
+               var genre = new GriloGenre (media);
+               var players = new GriloPlayers (media);
+               var developer = new GriloDeveloper (media);
+               var publisher = new GriloPublisher (media);
+               var description = new GriloDescription (media);
+               var rating = new GriloRating (media);
+
+               game.set_release_date (release_date);
+               game.set_cooperative (cooperative);
+               game.set_genre (genre);
+               game.set_players (players);
+               game.set_developer (developer);
+               game.set_publisher (publisher);
+               game.set_description (description);
+               game.set_rating (rating);
+
                return game;
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]