aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ui.Common/App/ApplicationData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Ui.Common/App/ApplicationData.cs')
-rw-r--r--src/Ryujinx.Ui.Common/App/ApplicationData.cs26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/Ryujinx.Ui.Common/App/ApplicationData.cs b/src/Ryujinx.Ui.Common/App/ApplicationData.cs
index 1be883ee..65ab01ee 100644
--- a/src/Ryujinx.Ui.Common/App/ApplicationData.cs
+++ b/src/Ryujinx.Ui.Common/App/ApplicationData.cs
@@ -9,10 +9,9 @@ using LibHac.Tools.FsSystem;
using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.FileSystem;
+using Ryujinx.Ui.Common.Helper;
using System;
-using System.Globalization;
using System.IO;
-using System.Text.Json.Serialization;
namespace Ryujinx.Ui.App.Common
{
@@ -24,29 +23,18 @@ namespace Ryujinx.Ui.App.Common
public string TitleId { get; set; }
public string Developer { get; set; }
public string Version { get; set; }
- public string TimePlayed { get; set; }
- public double TimePlayedNum { get; set; }
+ public TimeSpan TimePlayed { get; set; }
public DateTime? LastPlayed { get; set; }
public string FileExtension { get; set; }
- public string FileSize { get; set; }
- public double FileSizeBytes { get; set; }
+ public long FileSize { get; set; }
public string Path { get; set; }
public BlitStruct<ApplicationControlProperty> ControlHolder { get; set; }
- [JsonIgnore]
- public string LastPlayedString
- {
- get
- {
- if (!LastPlayed.HasValue)
- {
- // TODO: maybe put localized string here instead of just "Never"
- return "Never";
- }
+ public string TimePlayedString => ValueFormatUtils.FormatTimeSpan(TimePlayed);
- return LastPlayed.Value.ToLocalTime().ToString(CultureInfo.CurrentCulture);
- }
- }
+ public string LastPlayedString => ValueFormatUtils.FormatDateTime(LastPlayed);
+
+ public string FileSizeString => ValueFormatUtils.FormatFileSize(FileSize);
public static string GetApplicationBuildId(VirtualFileSystem virtualFileSystem, string titleFilePath)
{