diff --git a/DataLayer/Migrations/20191007202808_UpgradeToCore3.Designer.cs b/DataLayer/Migrations/20191007202808_UpgradeToCore3.Designer.cs deleted file mode 100644 index 6248b9e8..00000000 --- a/DataLayer/Migrations/20191007202808_UpgradeToCore3.Designer.cs +++ /dev/null @@ -1,341 +0,0 @@ -// -using System; -using DataLayer; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace DataLayer.Migrations -{ - [DbContext(typeof(LibationContext))] - [Migration("20191007202808_UpgradeToCore3")] - partial class UpgradeToCore3 - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("DataLayer.Book", b => - { - b.Property("BookId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudibleProductId") - .HasColumnType("nvarchar(450)"); - - b.Property("CategoryId") - .HasColumnType("int"); - - b.Property("DatePublished") - .HasColumnType("datetime2"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("HasBookDetails") - .HasColumnType("bit"); - - b.Property("IsAbridged") - .HasColumnType("bit"); - - b.Property("LengthInMinutes") - .HasColumnType("int"); - - b.Property("PictureId") - .HasColumnType("nvarchar(max)"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.HasKey("BookId"); - - b.HasIndex("AudibleProductId"); - - b.HasIndex("CategoryId"); - - b.ToTable("Books"); - }); - - modelBuilder.Entity("DataLayer.BookContributor", b => - { - b.Property("BookId") - .HasColumnType("int"); - - b.Property("ContributorId") - .HasColumnType("int"); - - b.Property("Role") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("tinyint"); - - b.HasKey("BookId", "ContributorId", "Role"); - - b.HasIndex("BookId"); - - b.HasIndex("ContributorId"); - - b.ToTable("BookContributor"); - }); - - modelBuilder.Entity("DataLayer.Category", b => - { - b.Property("CategoryId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudibleCategoryId") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("ParentCategoryCategoryId") - .HasColumnType("int"); - - b.HasKey("CategoryId"); - - b.HasIndex("AudibleCategoryId"); - - b.HasIndex("ParentCategoryCategoryId"); - - b.ToTable("Categories"); - - b.HasData( - new - { - CategoryId = -1, - AudibleCategoryId = "", - Name = "" - }); - }); - - modelBuilder.Entity("DataLayer.Contributor", b => - { - b.Property("ContributorId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudibleAuthorId") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.HasKey("ContributorId"); - - b.HasIndex("Name"); - - b.ToTable("Contributors"); - }); - - modelBuilder.Entity("DataLayer.LibraryBook", b => - { - b.Property("BookId") - .HasColumnType("int"); - - b.Property("DateAdded") - .HasColumnType("datetime2"); - - b.Property("DownloadBookLink") - .HasColumnType("nvarchar(max)"); - - b.HasKey("BookId"); - - b.ToTable("Library"); - }); - - modelBuilder.Entity("DataLayer.Series", b => - { - b.Property("SeriesId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudibleSeriesId") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("SeriesId"); - - b.HasIndex("AudibleSeriesId"); - - b.ToTable("Series"); - }); - - modelBuilder.Entity("DataLayer.SeriesBook", b => - { - b.Property("SeriesId") - .HasColumnType("int"); - - b.Property("BookId") - .HasColumnType("int"); - - b.Property("Index") - .HasColumnType("real"); - - b.HasKey("SeriesId", "BookId"); - - b.HasIndex("BookId"); - - b.HasIndex("SeriesId"); - - b.ToTable("SeriesBook"); - }); - - modelBuilder.Entity("DataLayer.Book", b => - { - b.HasOne("DataLayer.Category", "Category") - .WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("DataLayer.Rating", "Rating", b1 => - { - b1.Property("BookId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b1.Property("OverallRating") - .HasColumnType("real"); - - b1.Property("PerformanceRating") - .HasColumnType("real"); - - b1.Property("StoryRating") - .HasColumnType("real"); - - b1.HasKey("BookId"); - - b1.ToTable("Books"); - - b1.WithOwner() - .HasForeignKey("BookId"); - }); - - b.OwnsMany("DataLayer.Supplement", "Supplements", b1 => - { - b1.Property("SupplementId") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b1.Property("BookId") - .HasColumnType("int"); - - b1.Property("Url") - .HasColumnType("nvarchar(max)"); - - b1.HasKey("SupplementId"); - - b1.HasIndex("BookId"); - - b1.ToTable("Supplement"); - - b1.WithOwner("Book") - .HasForeignKey("BookId"); - }); - - b.OwnsOne("DataLayer.UserDefinedItem", "UserDefinedItem", b1 => - { - b1.Property("BookId") - .HasColumnType("int"); - - b1.Property("Tags") - .HasColumnType("nvarchar(max)"); - - b1.HasKey("BookId"); - - b1.ToTable("UserDefinedItem"); - - b1.WithOwner("Book") - .HasForeignKey("BookId"); - - b1.OwnsOne("DataLayer.Rating", "Rating", b2 => - { - b2.Property("UserDefinedItemBookId") - .HasColumnType("int"); - - b2.Property("OverallRating") - .HasColumnType("real"); - - b2.Property("PerformanceRating") - .HasColumnType("real"); - - b2.Property("StoryRating") - .HasColumnType("real"); - - b2.HasKey("UserDefinedItemBookId"); - - b2.ToTable("UserDefinedItem"); - - b2.WithOwner() - .HasForeignKey("UserDefinedItemBookId"); - }); - }); - }); - - modelBuilder.Entity("DataLayer.BookContributor", b => - { - b.HasOne("DataLayer.Book", "Book") - .WithMany("ContributorsLink") - .HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DataLayer.Contributor", "Contributor") - .WithMany("BooksLink") - .HasForeignKey("ContributorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("DataLayer.Category", b => - { - b.HasOne("DataLayer.Category", "ParentCategory") - .WithMany() - .HasForeignKey("ParentCategoryCategoryId"); - }); - - modelBuilder.Entity("DataLayer.LibraryBook", b => - { - b.HasOne("DataLayer.Book", "Book") - .WithOne() - .HasForeignKey("DataLayer.LibraryBook", "BookId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("DataLayer.SeriesBook", b => - { - b.HasOne("DataLayer.Book", "Book") - .WithMany("SeriesLink") - .HasForeignKey("BookId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("DataLayer.Series", "Series") - .WithMany("BooksLink") - .HasForeignKey("SeriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DataLayer/Migrations/20191105183104_NoScraping.cs b/DataLayer/Migrations/20191105183104_NoScraping.cs deleted file mode 100644 index e0d4cde8..00000000 --- a/DataLayer/Migrations/20191105183104_NoScraping.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace DataLayer.Migrations -{ - public partial class NoScraping : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Supplement_Books_BookId", - table: "Supplement"); - - migrationBuilder.DropForeignKey( - name: "FK_UserDefinedItem_Books_BookId", - table: "UserDefinedItem"); - - migrationBuilder.DropColumn( - name: "DownloadBookLink", - table: "Library"); - - migrationBuilder.DropColumn( - name: "HasBookDetails", - table: "Books"); - - migrationBuilder.AddForeignKey( - name: "FK_Supplement_Books_BookId", - table: "Supplement", - column: "BookId", - principalTable: "Books", - principalColumn: "BookId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_UserDefinedItem_Books_BookId", - table: "UserDefinedItem", - column: "BookId", - principalTable: "Books", - principalColumn: "BookId", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Supplement_Books_BookId", - table: "Supplement"); - - migrationBuilder.DropForeignKey( - name: "FK_UserDefinedItem_Books_BookId", - table: "UserDefinedItem"); - - migrationBuilder.AddColumn( - name: "DownloadBookLink", - table: "Library", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "HasBookDetails", - table: "Books", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddForeignKey( - name: "FK_Supplement_Books_BookId", - table: "Supplement", - column: "BookId", - principalTable: "Books", - principalColumn: "BookId", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_UserDefinedItem_Books_BookId", - table: "UserDefinedItem", - column: "BookId", - principalTable: "Books", - principalColumn: "BookId", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/DataLayer/Migrations/20191105183104_NoScraping.Designer.cs b/DataLayer/Migrations/20191115193402_Fresh.Designer.cs similarity index 99% rename from DataLayer/Migrations/20191105183104_NoScraping.Designer.cs rename to DataLayer/Migrations/20191115193402_Fresh.Designer.cs index 37db1775..3eb401de 100644 --- a/DataLayer/Migrations/20191105183104_NoScraping.Designer.cs +++ b/DataLayer/Migrations/20191115193402_Fresh.Designer.cs @@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace DataLayer.Migrations { [DbContext(typeof(LibationContext))] - [Migration("20191105183104_NoScraping")] - partial class NoScraping + [Migration("20191115193402_Fresh")] + partial class Fresh { protected override void BuildTargetModel(ModelBuilder modelBuilder) { diff --git a/DataLayer/Migrations/20191007202808_UpgradeToCore3.cs b/DataLayer/Migrations/20191115193402_Fresh.cs similarity index 98% rename from DataLayer/Migrations/20191007202808_UpgradeToCore3.cs rename to DataLayer/Migrations/20191115193402_Fresh.cs index 470c2ddf..ccc37c52 100644 --- a/DataLayer/Migrations/20191007202808_UpgradeToCore3.cs +++ b/DataLayer/Migrations/20191115193402_Fresh.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace DataLayer.Migrations { - public partial class UpgradeToCore3 : Migration + public partial class Fresh : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -67,7 +67,6 @@ namespace DataLayer.Migrations Description = table.Column(nullable: true), LengthInMinutes = table.Column(nullable: false), PictureId = table.Column(nullable: true), - HasBookDetails = table.Column(nullable: false), IsAbridged = table.Column(nullable: false), DatePublished = table.Column(nullable: true), CategoryId = table.Column(nullable: false), @@ -117,8 +116,7 @@ namespace DataLayer.Migrations columns: table => new { BookId = table.Column(nullable: false), - DateAdded = table.Column(nullable: false), - DownloadBookLink = table.Column(nullable: true) + DateAdded = table.Column(nullable: false) }, constraints: table => { diff --git a/FileLiberator/UNTESTED/IProcessableExt.cs b/FileLiberator/UNTESTED/IProcessableExt.cs index 931358dd..c89991e1 100644 --- a/FileLiberator/UNTESTED/IProcessableExt.cs +++ b/FileLiberator/UNTESTED/IProcessableExt.cs @@ -22,7 +22,8 @@ namespace FileLiberator if (libraryBook == null) return null; - var status = await processable.ProcessAsync(libraryBook); + // this should never happen. check anyway. ProcessFirstValidAsync returning null is the signal that we're done. we can't let another IProcessable accidentally send this commans + var status = await processable.ProcessAsync(libraryBook); if (status == null) throw new Exception("Processable should never return a null status"); diff --git a/__TODO.txt b/__TODO.txt index da696e40..b85ce95e 100644 --- a/__TODO.txt +++ b/__TODO.txt @@ -1,6 +1,4 @@ -- begin BETA --------------------------------------------------------------------------------------------------------------------- -Replace StatusHandler with CSharpFunctionalExtensions - TESTING BUG dbl clk. long pause. exception: System.ComponentModel.Win32Exception (2): The system cannot find the file specified.