[gnome-games] mame: Get developer from supported games database



commit eae7b91b3a34e209f33f7b0b89fdc25fec1d3ca1
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Aug 5 16:03:05 2018 +0500

    mame: Get developer from supported games database

 plugins/mame/src/mame-game-info.vala        | 2 ++
 plugins/mame/src/mame-game-uri-adapter.vala | 2 ++
 2 files changed, 4 insertions(+)
---
diff --git a/plugins/mame/src/mame-game-info.vala b/plugins/mame/src/mame-game-info.vala
index d8744bdd..be08436b 100644
--- a/plugins/mame/src/mame-game-info.vala
+++ b/plugins/mame/src/mame-game-info.vala
@@ -5,6 +5,7 @@ private struct Games.MameGameInfo {
        private static Regex game_regex;
 
        public string id;
+       public string company;
        public string name;
 
        public static async HashTable<string, MameGameInfo?> get_supported_games () throws Error {
@@ -34,6 +35,7 @@ private struct Games.MameGameInfo {
 
                        var game_info = MameGameInfo() {
                                id = cleanup_string (match_info.fetch (2)), // NAME
+                               company = cleanup_string (match_info.fetch (9)), // COMPANY
                                name = cleanup_string (match_info.fetch (10)) // FULLNAME
                        };
                        supported_games[game_info.id] = game_info;
diff --git a/plugins/mame/src/mame-game-uri-adapter.vala b/plugins/mame/src/mame-game-uri-adapter.vala
index 5e98250f..eaffc350 100644
--- a/plugins/mame/src/mame-game-uri-adapter.vala
+++ b/plugins/mame/src/mame-game-uri-adapter.vala
@@ -26,6 +26,7 @@ private class Games.MameGameUriAdapter : GameUriAdapter, Object {
                var title = new GenericTitle (title_string);
 
                var cover = new LocalCover (uri);
+               var developer = new GenericDeveloper (info.company);
                var platform = new GenericPlatform (PLATFORM_NAME);
                var core_source = new RetroCoreSource (PLATFORM, { SEARCHED_MIME_TYPE, SPECIFIC_MIME_TYPE });
                var runner = new RetroRunner (core_source, uri, uid, title);
@@ -35,6 +36,7 @@ private class Games.MameGameUriAdapter : GameUriAdapter, Object {
 
                var game = new GenericGame (uid, title, platform, runner);
                game.set_cover (cover);
+               game.set_developer (developer);
 
                return game;
        }


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