Automatic Collection Creation (#1768)
* Made the unread badges slightly smaller and rounded on top right. * A bit more tweaks on the not read badges. Looking really nice now. * In order to start the work on managing collections from ScanLoop, I needed to refactor collection apis into the service layer and add unit tests. Removed ToUpper Normalization for new tags. * Hooked up ability to auto generate collections from SeriesGroup metadata tag.
This commit is contained in:
parent
91a2a6854f
commit
1da27f085c
26 changed files with 2222 additions and 121 deletions
|
|
@ -104,6 +104,9 @@ public sealed class DataContext : IdentityDbContext<AppUser, AppRole, int,
|
|||
builder.Entity<Library>()
|
||||
.Property(b => b.IncludeInSearch)
|
||||
.HasDefaultValue(true);
|
||||
builder.Entity<Library>()
|
||||
.Property(b => b.ManageCollections)
|
||||
.HasDefaultValue(true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public static class DbFactory
|
|||
return new CollectionTag()
|
||||
{
|
||||
Id = id,
|
||||
NormalizedTitle = Services.Tasks.Scanner.Parser.Parser.Normalize(title?.Trim()).ToUpper(),
|
||||
NormalizedTitle = Services.Tasks.Scanner.Parser.Parser.Normalize(title?.Trim()),
|
||||
Title = title?.Trim(),
|
||||
Summary = summary?.Trim(),
|
||||
Promoted = promoted
|
||||
|
|
@ -106,7 +106,7 @@ public static class DbFactory
|
|||
{
|
||||
return new ReadingList()
|
||||
{
|
||||
NormalizedTitle = Services.Tasks.Scanner.Parser.Parser.Normalize(title?.Trim()).ToUpper(),
|
||||
NormalizedTitle = Services.Tasks.Scanner.Parser.Parser.Normalize(title?.Trim()),
|
||||
Title = title?.Trim(),
|
||||
Summary = summary?.Trim(),
|
||||
Promoted = promoted,
|
||||
|
|
|
|||
1754
API/Data/Migrations/20230130210252_AutoCollections.Designer.cs
generated
Normal file
1754
API/Data/Migrations/20230130210252_AutoCollections.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
36
API/Data/Migrations/20230130210252_AutoCollections.cs
Normal file
36
API/Data/Migrations/20230130210252_AutoCollections.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace API.Data.Migrations
|
||||
{
|
||||
public partial class AutoCollections : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ManageCollections",
|
||||
table: "Library",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "SeriesGroup",
|
||||
table: "Chapter",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ManageCollections",
|
||||
table: "Library");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SeriesGroup",
|
||||
table: "Chapter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -400,6 +400,9 @@ namespace API.Data.Migrations
|
|||
b.Property<DateTime>("ReleaseDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SeriesGroup")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Summary")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
|
@ -580,6 +583,11 @@ namespace API.Data.Migrations
|
|||
b.Property<DateTime>("LastScanned")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("ManageCollections")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue