aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2022-03-03 13:55:09 +0100
committerGitHub <noreply@github.com>2022-03-03 13:55:09 +0100
commit6e91657f01bfe90689580fd76b0e76814c9bb5ec (patch)
treeea572938ab99049869d3cf2df223497d222bed7c
parentd16bdfbc05ca3425669953998ad72795ac8f9f57 (diff)
parent89c29a7ed893971f562636b4d22b627884424535 (diff)
Merge pull request #7381 from crobibero/migrate-datetime
-rw-r--r--Jellyfin.Server/Migrations/Routines/MigrateAuthenticationDb.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateAuthenticationDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateAuthenticationDb.cs
index 21f153623..afd7aee5d 100644
--- a/Jellyfin.Server/Migrations/Routines/MigrateAuthenticationDb.cs
+++ b/Jellyfin.Server/Migrations/Routines/MigrateAuthenticationDb.cs
@@ -58,13 +58,18 @@ namespace Jellyfin.Server.Migrations.Routines
foreach (var row in authenticatedDevices)
{
+ var dateCreatedStr = row[9].ToString();
+ _ = DateTime.TryParse(dateCreatedStr, out var dateCreated);
+ var dateLastActivityStr = row[10].ToString();
+ _ = DateTime.TryParse(dateLastActivityStr, out var dateLastActivity);
+
if (row[6].IsDbNull())
{
dbContext.ApiKeys.Add(new ApiKey(row[3].ToString())
{
AccessToken = row[1].ToString(),
- DateCreated = row[9].ToDateTime(),
- DateLastActivity = row[10].ToDateTime()
+ DateCreated = dateCreated,
+ DateLastActivity = dateLastActivity
});
}
else
@@ -78,8 +83,8 @@ namespace Jellyfin.Server.Migrations.Routines
{
AccessToken = row[1].ToString(),
IsActive = row[8].ToBool(),
- DateCreated = row[9].ToDateTime(),
- DateLastActivity = row[10].ToDateTime()
+ DateCreated = dateCreated,
+ DateLastActivity = dateLastActivity
});
}
}