From a460058c2c43e7b9ac673ed4f1b3f07adba969aa Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Mon, 8 Jun 2026 15:23:15 +0100 Subject: [PATCH] Rename Phase 1C: Backup/import format rename. --- PlotLine/Models/ProjectBackupModels.cs | 2 +- PlotLine/Services/ImportServices.cs | 6 +++--- PlotLine/Services/ProjectExportService.cs | 4 ++-- PlotLine/Services/ProjectRestorePointService.cs | 4 ++-- PlotLine/Services/ProjectRestoreService.cs | 2 +- PlotLine/Sql/036_ProjectRestoreApply.sql | 2 +- PlotLine/Views/Imports/Index.cshtml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/PlotLine/Models/ProjectBackupModels.cs b/PlotLine/Models/ProjectBackupModels.cs index 27c0594..2e92392 100644 --- a/PlotLine/Models/ProjectBackupModels.cs +++ b/PlotLine/Models/ProjectBackupModels.cs @@ -2,7 +2,7 @@ namespace PlotLine.Models; public sealed class ProjectBackupExport { - public string Format { get; init; } = "PlotWeaver.ProjectBackup"; + public string Format { get; init; } = "PlotDirector.ProjectBackup"; public string FormatVersion { get; init; } = "1.0"; public DateTime ExportedAtUtc { get; init; } public string SourceApplication { get; init; } = "PlotDirector"; diff --git a/PlotLine/Services/ImportServices.cs b/PlotLine/Services/ImportServices.cs index ff4e6db..a4fcc9d 100644 --- a/PlotLine/Services/ImportServices.cs +++ b/PlotLine/Services/ImportServices.cs @@ -500,7 +500,7 @@ public sealed class ImportService(IImportRepository imports, ICurrentUserService return false; } - if (!string.Equals(format, "PlotWeaver.ProjectBackup", StringComparison.Ordinal)) + if (!string.Equals(format, "PlotDirector.ProjectBackup", StringComparison.Ordinal)) { validation.Errors.Add("The project backup format is not recognised."); return true; @@ -528,7 +528,7 @@ public sealed class ImportService(IImportRepository imports, ICurrentUserService return true; } - if (!string.Equals(backup.Format, "PlotWeaver.ProjectBackup", StringComparison.Ordinal)) + if (!string.Equals(backup.Format, "PlotDirector.ProjectBackup", StringComparison.Ordinal)) { validation.Errors.Add("The project backup format is not recognised."); } @@ -560,7 +560,7 @@ public sealed class ImportService(IImportRepository imports, ICurrentUserService if (TryGetString(root, "format", out var format) || TryGetString(root, "Format", out format)) { - if (string.Equals(format, "PlotWeaver.ProjectBackup", StringComparison.Ordinal)) + if (string.Equals(format, "PlotDirector.ProjectBackup", StringComparison.Ordinal)) { return ProjectImportFormat.ProjectBackup; } diff --git a/PlotLine/Services/ProjectExportService.cs b/PlotLine/Services/ProjectExportService.cs index c36ca4c..d66ba62 100644 --- a/PlotLine/Services/ProjectExportService.cs +++ b/PlotLine/Services/ProjectExportService.cs @@ -60,9 +60,9 @@ public sealed class ProjectExportService( if (string.IsNullOrWhiteSpace(safeTitle)) { - safeTitle = "PlotWeaver_Project"; + safeTitle = "PlotDirector_Project"; } - return $"{safeTitle}_{exportedAtUtc:yyyy-MM-dd_HHmm}.plotweaver"; + return $"{safeTitle}_{exportedAtUtc:yyyy-MM-dd_HHmm}.plotdirector"; } } diff --git a/PlotLine/Services/ProjectRestorePointService.cs b/PlotLine/Services/ProjectRestorePointService.cs index 449e06f..424e9cf 100644 --- a/PlotLine/Services/ProjectRestorePointService.cs +++ b/PlotLine/Services/ProjectRestorePointService.cs @@ -130,9 +130,9 @@ public sealed class ProjectRestorePointService( if (string.IsNullOrWhiteSpace(safeTitle)) { - safeTitle = "PlotWeaver_Project"; + safeTitle = "PlotDirector_Project"; } - return $"{safeTitle}_RestorePoint_{createdDateUtc:yyyy-MM-dd_HHmm}.plotweaver"; + return $"{safeTitle}_RestorePoint_{createdDateUtc:yyyy-MM-dd_HHmm}.plotdirector"; } } diff --git a/PlotLine/Services/ProjectRestoreService.cs b/PlotLine/Services/ProjectRestoreService.cs index 16a569a..501c557 100644 --- a/PlotLine/Services/ProjectRestoreService.cs +++ b/PlotLine/Services/ProjectRestoreService.cs @@ -97,7 +97,7 @@ public sealed class ProjectRestoreService( return "Restore point JSON is invalid. No project data was changed."; } - if (!string.Equals(backup.Format, "PlotWeaver.ProjectBackup", StringComparison.Ordinal)) + if (!string.Equals(backup.Format, "PlotDirector.ProjectBackup", StringComparison.Ordinal)) { return "Restore point format is not recognised. No project data was changed."; } diff --git a/PlotLine/Sql/036_ProjectRestoreApply.sql b/PlotLine/Sql/036_ProjectRestoreApply.sql index a11d260..8159ad0 100644 --- a/PlotLine/Sql/036_ProjectRestoreApply.sql +++ b/PlotLine/Sql/036_ProjectRestoreApply.sql @@ -150,7 +150,7 @@ BEGIN IF ISJSON(@JsonData) <> 1 THROW 51001, 'Restore JSON is invalid.', 1; - IF JSON_VALUE(@JsonData, '$.Format') <> N'PlotWeaver.ProjectBackup' + IF JSON_VALUE(@JsonData, '$.Format') <> N'PlotDirector.ProjectBackup' THROW 51002, 'Restore JSON format is not recognised.', 1; IF JSON_VALUE(@JsonData, '$.FormatVersion') <> N'1.0' diff --git a/PlotLine/Views/Imports/Index.cshtml b/PlotLine/Views/Imports/Index.cshtml index e713ed4..1fd9c5f 100644 --- a/PlotLine/Views/Imports/Index.cshtml +++ b/PlotLine/Views/Imports/Index.cshtml @@ -40,7 +40,7 @@
- +
Uploading a file replaces the pasted text for this preview.