Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# GameVault App Changelog

## 1.17.3
Recommended Gamevault Server Version: `v16.1.1`
### Changes
- Bug fix: Installed games were sometimes not displayed if they were deleted from the server.
- Bug fix: Completed downloads were sometimes displayed as paused after a restart.
- Bug fix: YouTube videos are loading again

## 1.17.2
Recommended Gamevault Server Version: `v15.0.2`
### Changes
- Added authorization to the admin panel’s registration action, allowing administrators to register users even when server-side registration is disabled.
- Added authorization to the admin panels registration action, allowing administrators to register users even when server-side registration is disabled.
- Extended the existing installation overwrite warning to allow users to continue the installation at their own risk.
- Performance optimization in the community tab
- Bug fix: OAuth access token expiration was not calculated correctly under certain circumstances.
Expand Down
2 changes: 1 addition & 1 deletion gamevault/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
[assembly: AssemblyVersion("1.17.2.0")]
[assembly: AssemblyVersion("1.17.3.0")]
[assembly: AssemblyCopyright("© Phalcode™. All Rights Reserved.")]
#if DEBUG
[assembly: XmlnsDefinition("debug-mode", "Namespace")]
Expand Down
2 changes: 1 addition & 1 deletion gamevault/Helper/Web/HttpClientDownloadWithProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void TriggerProgressChanged(long totalDownloadSize, long currentBytesRea
return;

totalDownloadSize = PreResumeSize == -1 ? totalDownloadSize : PreResumeSize;
double progressPercentage = Math.Round((double)totalBytesRead / totalDownloadSize * 100, 0);
double progressPercentage = (double)totalBytesRead / totalDownloadSize * 100;
ProgressChanged(totalDownloadSize, currentBytesRead, totalBytesRead, progressPercentage, ResumePosition);
}
public void Cancel()
Expand Down
66 changes: 43 additions & 23 deletions gamevault/UserControls/InstallUserControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,33 @@ private async void UserControl_Loaded(object sender, RoutedEventArgs e)
InstallViewModel.Instance.InstalledGamesFilter = CollectionViewSource.GetDefaultView(InstallViewModel.Instance.InstalledGames);
}
}
private List<Game> GetGamesFromOfflineCache(Dictionary<int, string> games)
{
List<Game> offlineCacheGames = new List<Game>();
foreach (KeyValuePair<int, string> entry in games)
{
string objectFromFile = Preferences.Get(entry.Key.ToString(), LoginManager.Instance.GetUserProfile().OfflineCache);
if (objectFromFile != string.Empty)
{
try
{
string decompressedObject = StringCompressor.DecompressString(objectFromFile);
Game? deserializedObject = JsonSerializer.Deserialize<Game>(decompressedObject);
if (deserializedObject != null)
{
offlineCacheGames.Add(deserializedObject);
}
}
catch (FormatException exFormat) { }
}
else
{
string gameTitle = Path.GetFileName(entry.Value);
offlineCacheGames.Add(new Game() { ID = entry.Key, Title = gameTitle.Substring(gameTitle.IndexOf(')') + 1) });
}
}
return offlineCacheGames;
}
public async Task RestoreInstalledGames(bool fromCLI = false)
{
if (gamesRestored)
Expand Down Expand Up @@ -98,33 +125,26 @@ public async Task RestoreInstalledGames(bool fromCLI = false)
if (LoginManager.Instance.IsLoggedIn())
{
string gameList = await WebHelper.GetAsync(@$"{SettingsViewModel.Instance.ServerUrl}/api/games?filter.id=$in:{gameIds}&limit=-1");
return JsonSerializer.Deserialize<PaginatedData<Game>>(gameList).Data;
}
else
{
List<Game> offlineCacheGames = new List<Game>();
foreach (KeyValuePair<int, string> entry in foundGames)
Game[] serverGames = JsonSerializer.Deserialize<PaginatedData<Game>>(gameList)!.Data;

var serverGameIds = new HashSet<int>(serverGames.Select(g => g.ID));
var missingGames = foundGames.Where(kvp => !serverGameIds.Contains(kvp.Key))
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);

//Make sure to display installed games that are already deleted on the server
if (missingGames.Count > 0)
{
string objectFromFile = Preferences.Get(entry.Key.ToString(), LoginManager.Instance.GetUserProfile().OfflineCache);
if (objectFromFile != string.Empty)
{
try
{
string decompressedObject = StringCompressor.DecompressString(objectFromFile);
Game? deserializedObject = JsonSerializer.Deserialize<Game>(decompressedObject);
if (deserializedObject != null)
{
offlineCacheGames.Add(deserializedObject);
}
}
catch (FormatException exFormat) { }
}
else
List<Game> offlineCacheGames = GetGamesFromOfflineCache(foundGames);
if (offlineCacheGames.Count > 0)
{
string gameTitle = Path.GetFileName(entry.Value);
offlineCacheGames.Add(new Game() { ID = entry.Key, Title = gameTitle.Substring(gameTitle.IndexOf(')') + 1) });
serverGames = serverGames.Concat(offlineCacheGames).ToArray();
}
}
return serverGames;
}
else
{
List<Game> offlineCacheGames = GetGamesFromOfflineCache(foundGames);
return offlineCacheGames.ToArray();
}
}
Expand Down
4 changes: 2 additions & 2 deletions gamevault/gamevault.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc2" />
<PackageReference Include="Magick.NET-Q8-x64" Version="14.7.0" />
<PackageReference Include="Magick.NET-Q8-x64" Version="14.9.1" />
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.11.0" />
<PackageReference Include="Markdig.Wpf" Version="0.5.0.1" />
Expand All @@ -67,7 +67,7 @@
<PackageReference Include="System.Management" Version="9.0.1" />
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.0" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="YoutubeExplode" Version="6.5.4" />
<PackageReference Include="YoutubeExplode" Version="6.5.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading