From a14b7cdeacebd7a886bbfccdfff81036655df3b4 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Tue, 7 May 2024 20:08:07 -0500 Subject: [PATCH] Slim down responses from game imports Reduced the amount of data being sent to the client from the API which results in smaller, somewhat faster requests. In a library of ~250 games the requests went from 5.6MB to 3.3MB. --- LANCommander.SDK/Models/Collection.cs | 7 +++++-- LANCommander.SDK/Models/Company.cs | 6 ++++-- LANCommander.SDK/Models/Genre.cs | 6 ++++-- LANCommander.SDK/Models/Media.cs | 1 + LANCommander.SDK/Models/MultiplayerMode.cs | 1 + LANCommander.SDK/Models/SavePath.cs | 3 ++- LANCommander.SDK/Models/Tag.cs | 6 ++++-- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/LANCommander.SDK/Models/Collection.cs b/LANCommander.SDK/Models/Collection.cs index 4a652da0..279fe044 100644 --- a/LANCommander.SDK/Models/Collection.cs +++ b/LANCommander.SDK/Models/Collection.cs @@ -1,7 +1,10 @@ -namespace LANCommander.SDK.Models +using System; + +namespace LANCommander.SDK.Models { - public class Collection : BaseModel + public class Collection { + public Guid Id { get; set; } public string Name { get; set; } } } diff --git a/LANCommander.SDK/Models/Company.cs b/LANCommander.SDK/Models/Company.cs index adce32c3..cd7f40fe 100644 --- a/LANCommander.SDK/Models/Company.cs +++ b/LANCommander.SDK/Models/Company.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace LANCommander.SDK.Models { - public class Company : BaseModel + public class Company { + public Guid Id { get; set; } public string Name { get; set; } } } diff --git a/LANCommander.SDK/Models/Genre.cs b/LANCommander.SDK/Models/Genre.cs index 1ad281d7..e8ffc9d7 100644 --- a/LANCommander.SDK/Models/Genre.cs +++ b/LANCommander.SDK/Models/Genre.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace LANCommander.SDK.Models { - public class Genre : BaseModel + public class Genre { + public Guid Id { get; set; } public string Name { get; set; } } } diff --git a/LANCommander.SDK/Models/Media.cs b/LANCommander.SDK/Models/Media.cs index fdfea632..1c857612 100644 --- a/LANCommander.SDK/Models/Media.cs +++ b/LANCommander.SDK/Models/Media.cs @@ -7,6 +7,7 @@ namespace LANCommander.SDK.Models { public class Media : BaseModel { + public Guid Id { get; set; } public Guid FileId { get; set; } public MediaType Type { get; set; } public string SourceUrl { get; set; } diff --git a/LANCommander.SDK/Models/MultiplayerMode.cs b/LANCommander.SDK/Models/MultiplayerMode.cs index 5f29eee5..b96163b0 100644 --- a/LANCommander.SDK/Models/MultiplayerMode.cs +++ b/LANCommander.SDK/Models/MultiplayerMode.cs @@ -7,6 +7,7 @@ namespace LANCommander.SDK.Models { public class MultiplayerMode { + public Guid Id { get; set; } public MultiplayerType Type { get; set; } public NetworkProtocol NetworkProtocol { get; set; } public string Description { get; set; } diff --git a/LANCommander.SDK/Models/SavePath.cs b/LANCommander.SDK/Models/SavePath.cs index 91ddef4b..6fb53298 100644 --- a/LANCommander.SDK/Models/SavePath.cs +++ b/LANCommander.SDK/Models/SavePath.cs @@ -5,8 +5,9 @@ using System.Text; namespace LANCommander.SDK.Models { - public class SavePath : BaseModel + public class SavePath { + public Guid Id { get; set; } public SavePathType Type { get; set; } public string Path { get; set; } public string WorkingDirectory { get; set; } diff --git a/LANCommander.SDK/Models/Tag.cs b/LANCommander.SDK/Models/Tag.cs index 41e6206f..ad71cc5e 100644 --- a/LANCommander.SDK/Models/Tag.cs +++ b/LANCommander.SDK/Models/Tag.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace LANCommander.SDK.Models { - public class Tag : BaseModel + public class Tag { + public Guid Id { get; set; } public string Name { get; set; } } }