Rename Phase 1C: Backup/import format rename.
This commit is contained in:
parent
3f912d63e2
commit
a460058c2c
@ -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";
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.";
|
||||
}
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="row g-3">
|
||||
<div class="col-12">
|
||||
<label asp-for="JsonFile" class="form-label">Upload JSON or PlotDirector backup file</label>
|
||||
<input asp-for="JsonFile" class="form-control" type="file" accept=".json,.plotweaver,application/json" />
|
||||
<input asp-for="JsonFile" class="form-control" type="file" accept=".json,.plotdirector,application/json" />
|
||||
<div class="form-text">Uploading a file replaces the pasted text for this preview.</div>
|
||||
<div class="form-text" data-upload-status></div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user