Add flag to mark save path as regex

save-path-regex
Pat Hartl 2023-11-08 20:43:18 -06:00
parent 81f8d55694
commit 5d5e137e18
8 changed files with 1733 additions and 0 deletions

View File

@ -46,5 +46,6 @@ namespace LANCommander.SDK
public Guid Id { get; set; } public Guid Id { get; set; }
public string Type { get; set; } public string Type { get; set; }
public string Path { get; set; } public string Path { get; set; }
public bool IsRegex { get; set; }
} }
} }

View File

@ -9,6 +9,7 @@ namespace LANCommander.SDK.Models
{ {
public SavePathType Type { get; set; } public SavePathType Type { get; set; }
public string Path { get; set; } public string Path { get; set; }
public bool IsRegex { get; set; }
public virtual Game Game { get; set; } public virtual Game Game { get; set; }
} }
} }

View File

@ -10,6 +10,7 @@ namespace LANCommander.Data.Models
{ {
public SavePathType Type { get; set; } public SavePathType Type { get; set; }
public string Path { get; set; } public string Path { get; set; }
public bool IsRegex { get; set; }
public Guid? GameId { get; set; } public Guid? GameId { get; set; }
[JsonIgnore] [JsonIgnore]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
/// <inheritdoc />
public partial class AddRegexFlagToSavePath : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsRegex",
table: "SavePaths",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsRegex",
table: "SavePaths");
}
}
}

View File

@ -649,6 +649,9 @@ namespace LANCommander.Migrations
b.Property<Guid?>("GameId") b.Property<Guid?>("GameId")
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("IsRegex")
.HasColumnType("INTEGER");
b.Property<string>("Path") b.Property<string>("Path")
.IsRequired() .IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");

View File

@ -17,6 +17,9 @@
<FilePicker @bind-Value="context.Path" ArchiveId="@ArchiveId" AllowDirectories="true" /> <FilePicker @bind-Value="context.Path" ArchiveId="@ArchiveId" AllowDirectories="true" />
} }
</PropertyColumn> </PropertyColumn>
<PropertyColumn Property="p => p.IsRegex" Title="Regex">
<Checkbox @bind-Checked="context.IsRegex" />
</PropertyColumn>
<ActionColumn> <ActionColumn>
<Space Style="display: flex; justify-content: end"> <Space Style="display: flex; justify-content: end">
<SpaceItem> <SpaceItem>

View File

@ -113,6 +113,7 @@ namespace LANCommander.Services
{ {
Id = p.Id, Id = p.Id,
Path = p.Path, Path = p.Path,
IsRegex = p.IsRegex,
Type = p.Type.ToString() Type = p.Type.ToString()
}); });
} }