Skip to content

Commit 92c4458

Browse files
authored
Release 1.17.3
Release 1.17.3
2 parents 3d5f348 + 0ba56c7 commit 92c4458

File tree

5 files changed

+55
-28
lines changed

5 files changed

+55
-28
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# GameVault App Changelog
22

3+
## 1.17.3
4+
Recommended Gamevault Server Version: `v16.1.1`
5+
### Changes
6+
- Bug fix: Installed games were sometimes not displayed if they were deleted from the server.
7+
- Bug fix: Completed downloads were sometimes displayed as paused after a restart.
8+
- Bug fix: YouTube videos are loading again
9+
310
## 1.17.2
411
Recommended Gamevault Server Version: `v15.0.2`
512
### Changes
6-
- Added authorization to the admin panel’s registration action, allowing administrators to register users even when server-side registration is disabled.
13+
- Added authorization to the admin panels registration action, allowing administrators to register users even when server-side registration is disabled.
714
- Extended the existing installation overwrite warning to allow users to continue the installation at their own risk.
815
- Performance optimization in the community tab
916
- Bug fix: OAuth access token expiration was not calculated correctly under certain circumstances.

gamevault/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//(used if a resource is not found in the page,
1212
// app, or any theme specific resource dictionaries)
1313
)]
14-
[assembly: AssemblyVersion("1.17.2.0")]
14+
[assembly: AssemblyVersion("1.17.3.0")]
1515
[assembly: AssemblyCopyright("© Phalcode™. All Rights Reserved.")]
1616
#if DEBUG
1717
[assembly: XmlnsDefinition("debug-mode", "Namespace")]

gamevault/Helper/Web/HttpClientDownloadWithProgress.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private void TriggerProgressChanged(long totalDownloadSize, long currentBytesRea
190190
return;
191191

192192
totalDownloadSize = PreResumeSize == -1 ? totalDownloadSize : PreResumeSize;
193-
double progressPercentage = Math.Round((double)totalBytesRead / totalDownloadSize * 100, 0);
193+
double progressPercentage = (double)totalBytesRead / totalDownloadSize * 100;
194194
ProgressChanged(totalDownloadSize, currentBytesRead, totalBytesRead, progressPercentage, ResumePosition);
195195
}
196196
public void Cancel()

gamevault/UserControls/InstallUserControl.xaml.cs

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,33 @@ private async void UserControl_Loaded(object sender, RoutedEventArgs e)
4040
InstallViewModel.Instance.InstalledGamesFilter = CollectionViewSource.GetDefaultView(InstallViewModel.Instance.InstalledGames);
4141
}
4242
}
43+
private List<Game> GetGamesFromOfflineCache(Dictionary<int, string> games)
44+
{
45+
List<Game> offlineCacheGames = new List<Game>();
46+
foreach (KeyValuePair<int, string> entry in games)
47+
{
48+
string objectFromFile = Preferences.Get(entry.Key.ToString(), LoginManager.Instance.GetUserProfile().OfflineCache);
49+
if (objectFromFile != string.Empty)
50+
{
51+
try
52+
{
53+
string decompressedObject = StringCompressor.DecompressString(objectFromFile);
54+
Game? deserializedObject = JsonSerializer.Deserialize<Game>(decompressedObject);
55+
if (deserializedObject != null)
56+
{
57+
offlineCacheGames.Add(deserializedObject);
58+
}
59+
}
60+
catch (FormatException exFormat) { }
61+
}
62+
else
63+
{
64+
string gameTitle = Path.GetFileName(entry.Value);
65+
offlineCacheGames.Add(new Game() { ID = entry.Key, Title = gameTitle.Substring(gameTitle.IndexOf(')') + 1) });
66+
}
67+
}
68+
return offlineCacheGames;
69+
}
4370
public async Task RestoreInstalledGames(bool fromCLI = false)
4471
{
4572
if (gamesRestored)
@@ -98,33 +125,26 @@ public async Task RestoreInstalledGames(bool fromCLI = false)
98125
if (LoginManager.Instance.IsLoggedIn())
99126
{
100127
string gameList = await WebHelper.GetAsync(@$"{SettingsViewModel.Instance.ServerUrl}/api/games?filter.id=$in:{gameIds}&limit=-1");
101-
return JsonSerializer.Deserialize<PaginatedData<Game>>(gameList).Data;
102-
}
103-
else
104-
{
105-
List<Game> offlineCacheGames = new List<Game>();
106-
foreach (KeyValuePair<int, string> entry in foundGames)
128+
Game[] serverGames = JsonSerializer.Deserialize<PaginatedData<Game>>(gameList)!.Data;
129+
130+
var serverGameIds = new HashSet<int>(serverGames.Select(g => g.ID));
131+
var missingGames = foundGames.Where(kvp => !serverGameIds.Contains(kvp.Key))
132+
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
133+
134+
//Make sure to display installed games that are already deleted on the server
135+
if (missingGames.Count > 0)
107136
{
108-
string objectFromFile = Preferences.Get(entry.Key.ToString(), LoginManager.Instance.GetUserProfile().OfflineCache);
109-
if (objectFromFile != string.Empty)
110-
{
111-
try
112-
{
113-
string decompressedObject = StringCompressor.DecompressString(objectFromFile);
114-
Game? deserializedObject = JsonSerializer.Deserialize<Game>(decompressedObject);
115-
if (deserializedObject != null)
116-
{
117-
offlineCacheGames.Add(deserializedObject);
118-
}
119-
}
120-
catch (FormatException exFormat) { }
121-
}
122-
else
137+
List<Game> offlineCacheGames = GetGamesFromOfflineCache(foundGames);
138+
if (offlineCacheGames.Count > 0)
123139
{
124-
string gameTitle = Path.GetFileName(entry.Value);
125-
offlineCacheGames.Add(new Game() { ID = entry.Key, Title = gameTitle.Substring(gameTitle.IndexOf(')') + 1) });
140+
serverGames = serverGames.Concat(offlineCacheGames).ToArray();
126141
}
127142
}
143+
return serverGames;
144+
}
145+
else
146+
{
147+
List<Game> offlineCacheGames = GetGamesFromOfflineCache(foundGames);
128148
return offlineCacheGames.ToArray();
129149
}
130150
}

gamevault/gamevault.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
5858
<PackageReference Include="CommandLineParser" Version="2.9.1" />
5959
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc2" />
60-
<PackageReference Include="Magick.NET-Q8-x64" Version="14.7.0" />
60+
<PackageReference Include="Magick.NET-Q8-x64" Version="14.9.1" />
6161
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
6262
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.11.0" />
6363
<PackageReference Include="Markdig.Wpf" Version="0.5.0.1" />
@@ -67,7 +67,7 @@
6767
<PackageReference Include="System.Management" Version="9.0.1" />
6868
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.0" />
6969
<PackageReference Include="YamlDotNet" Version="16.3.0" />
70-
<PackageReference Include="YoutubeExplode" Version="6.5.4" />
70+
<PackageReference Include="YoutubeExplode" Version="6.5.6" />
7171
</ItemGroup>
7272

7373
<ItemGroup>

0 commit comments

Comments
 (0)