[gnome-games/wip/exalm/rebrand: 109/124] Remove GameInfo titles




commit de0c66ae6495ac35940054cfe79d11f9316e3825
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Mar 31 00:22:39 2021 +0500

    Remove GameInfo titles

 src/gameinfo/gameinfo-disc-id-disc-title.vala     | 29 -----------------------
 src/gameinfo/gameinfo-disc-id-game-title.vala     | 23 ------------------
 src/meson.build                                   |  2 --
 src/platforms/playstation/playstation-parser.vala | 13 ++++++++--
 4 files changed, 11 insertions(+), 56 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 7bb1d0ab..1eeaf548 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -57,8 +57,6 @@ vala_sources = [
 
   'gameinfo/gameinfo-doc.vala',
   'gameinfo/gameinfo-error.vala',
-  'gameinfo/gameinfo-disc-id-disc-title.vala',
-  'gameinfo/gameinfo-disc-id-game-title.vala',
 
   'gamepad/gamepad-dpad.vala',
   'gamepad/gamepad-input.vala',
diff --git a/src/platforms/playstation/playstation-parser.vala 
b/src/platforms/playstation/playstation-parser.vala
index 8be66779..adf6357f 100644
--- a/src/platforms/playstation/playstation-parser.vala
+++ b/src/platforms/playstation/playstation-parser.vala
@@ -69,7 +69,16 @@ public class Games.PlayStationParser : GameParser {
                Media[] new_medias_array = {};
                var new_disc_ids = gameinfo.get_disc_set_ids_for_disc_id (disc_id);
                foreach (var new_disc_id in new_disc_ids) {
-                       var title = new GameinfoDiscIdDiscTitle (gameinfo, new_disc_id);
+                       string title;
+                       try {
+                               title = gameinfo.get_disc_title_for_disc_id (new_disc_id);
+                       }
+                       catch (Error e) {
+                               var index = gameinfo.get_disc_set_index_for_disc_id (new_disc_id);
+
+                               title = _("Disc %d").printf (index + 1);
+                       }
+
                        var media = new Media (new_disc_id, title);
                        new_medias_array += media;
                        new_medias[new_disc_id] = media;
@@ -78,7 +87,7 @@ public class Games.PlayStationParser : GameParser {
                var media = new_medias.lookup (disc_id);
                media.add_uri (uri);
 
-               var media_set = new MediaSet (disc_set_id, new GameinfoDiscIdGameTitle (gameinfo, 
disc_set_id));
+               var media_set = new MediaSet (disc_set_id, gameinfo.get_game_title_for_disc_id (disc_set_id));
                foreach (var game_media in new_medias_array)
                        media_set.add_media (game_media);
                media_set.icon_name = ICON_NAME;


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