Initial commit with UI fixes for dark mode

This repository contains Transmission RSS Manager with the following changes:
- Fixed dark mode navigation tab visibility issue
- Improved text contrast in dark mode throughout the app
- Created dedicated dark-mode.css for better organization
- Enhanced JavaScript for dynamic styling in dark mode
- Added complete installation scripts

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2025-03-13 17:16:41 +00:00
commit 9e544456db
66 changed files with 20187 additions and 0 deletions
+332
View File
@@ -0,0 +1,332 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TransmissionRssManager.Data;
#nullable disable
namespace TransmissionRssManager.Migrations
{
[DbContext(typeof(TorrentManagerContext))]
[Migration("20250312193828_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.17")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<DateTime>("LastCheckedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("RefreshInterval")
.HasColumnType("integer");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("RssFeeds");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("text");
b.Property<DateTime>("DiscoveredAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadError")
.HasColumnType("text");
b.Property<DateTime?>("DownloadedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsDownloaded")
.HasColumnType("boolean");
b.Property<string>("Link")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("MatchedRuleId")
.HasColumnType("integer");
b.Property<DateTime>("PublishDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("TorrentId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("MatchedRuleId");
b.HasIndex("RssFeedId", "Link")
.IsUnique();
b.ToTable("RssFeedItems");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CustomSavePath")
.HasColumnType("text");
b.Property<bool>("EnablePostProcessing")
.HasColumnType("boolean");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<string>("ExcludePattern")
.HasColumnType("text");
b.Property<string>("IncludePattern")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Priority")
.HasColumnType("integer");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<bool>("SaveToCustomPath")
.HasColumnType("boolean");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("UseRegex")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("RssFeedId");
b.ToTable("RssFeedRules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedOn")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("CompletedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadDirectory")
.HasColumnType("text");
b.Property<string>("ErrorMessage")
.HasColumnType("text");
b.Property<string>("Hash")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<double>("PercentDone")
.HasColumnType("double precision");
b.Property<bool>("PostProcessed")
.HasColumnType("boolean");
b.Property<DateTime?>("PostProcessedOn")
.HasColumnType("timestamp with time zone");
b.Property<int?>("RssFeedItemId")
.HasColumnType("integer");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<long>("TotalSize")
.HasColumnType("bigint");
b.Property<int?>("TransmissionId")
.HasColumnType("integer");
b.Property<double>("UploadRatio")
.HasColumnType("double precision");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("RssFeedItemId")
.IsUnique();
b.ToTable("Torrents");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.UserPreference", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Category")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DataType")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("UserPreferences");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedRule", "MatchedRule")
.WithMany("MatchedItems")
.HasForeignKey("MatchedRuleId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Items")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MatchedRule");
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Rules")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedItem", "RssFeedItem")
.WithOne("Torrent")
.HasForeignKey("TransmissionRssManager.Data.Models.Torrent", "RssFeedItemId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("RssFeedItem");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Navigation("Items");
b.Navigation("Rules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Navigation("Torrent");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Navigation("MatchedItems");
});
#pragma warning restore 612, 618
}
}
}
+205
View File
@@ -0,0 +1,205 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace TransmissionRssManager.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RssFeeds",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Url = table.Column<string>(type: "text", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
LastCheckedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastError = table.Column<string>(type: "text", nullable: true),
RefreshInterval = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RssFeeds", x => x.Id);
});
migrationBuilder.CreateTable(
name: "UserPreferences",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Key = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: true),
Description = table.Column<string>(type: "text", nullable: true),
Category = table.Column<string>(type: "text", nullable: true),
DataType = table.Column<string>(type: "text", nullable: true),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserPreferences", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RssFeedRules",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
RssFeedId = table.Column<int>(type: "integer", nullable: false),
IncludePattern = table.Column<string>(type: "text", nullable: true),
ExcludePattern = table.Column<string>(type: "text", nullable: true),
UseRegex = table.Column<bool>(type: "boolean", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
SaveToCustomPath = table.Column<bool>(type: "boolean", nullable: false),
CustomSavePath = table.Column<string>(type: "text", nullable: true),
EnablePostProcessing = table.Column<bool>(type: "boolean", nullable: false),
Priority = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RssFeedRules", x => x.Id);
table.ForeignKey(
name: "FK_RssFeedRules_RssFeeds_RssFeedId",
column: x => x.RssFeedId,
principalTable: "RssFeeds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RssFeedItems",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Title = table.Column<string>(type: "text", nullable: false),
Link = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
PublishDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
RssFeedId = table.Column<int>(type: "integer", nullable: false),
IsDownloaded = table.Column<bool>(type: "boolean", nullable: false),
DiscoveredAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DownloadedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TorrentId = table.Column<int>(type: "integer", nullable: true),
MatchedRuleId = table.Column<int>(type: "integer", nullable: true),
DownloadError = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RssFeedItems", x => x.Id);
table.ForeignKey(
name: "FK_RssFeedItems_RssFeedRules_MatchedRuleId",
column: x => x.MatchedRuleId,
principalTable: "RssFeedRules",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_RssFeedItems_RssFeeds_RssFeedId",
column: x => x.RssFeedId,
principalTable: "RssFeeds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Torrents",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Hash = table.Column<string>(type: "text", nullable: false),
TransmissionId = table.Column<int>(type: "integer", nullable: true),
Status = table.Column<string>(type: "text", nullable: false),
TotalSize = table.Column<long>(type: "bigint", nullable: false),
PercentDone = table.Column<double>(type: "double precision", nullable: false),
UploadRatio = table.Column<double>(type: "double precision", nullable: false),
RssFeedItemId = table.Column<int>(type: "integer", nullable: true),
AddedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CompletedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
PostProcessed = table.Column<bool>(type: "boolean", nullable: false),
PostProcessedOn = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
DownloadDirectory = table.Column<string>(type: "text", nullable: true),
ErrorMessage = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Torrents", x => x.Id);
table.ForeignKey(
name: "FK_Torrents_RssFeedItems_RssFeedItemId",
column: x => x.RssFeedItemId,
principalTable: "RssFeedItems",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateIndex(
name: "IX_RssFeedItems_MatchedRuleId",
table: "RssFeedItems",
column: "MatchedRuleId");
migrationBuilder.CreateIndex(
name: "IX_RssFeedItems_RssFeedId_Link",
table: "RssFeedItems",
columns: new[] { "RssFeedId", "Link" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_RssFeedRules_RssFeedId",
table: "RssFeedRules",
column: "RssFeedId");
migrationBuilder.CreateIndex(
name: "IX_Torrents_Hash",
table: "Torrents",
column: "Hash",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Torrents_RssFeedItemId",
table: "Torrents",
column: "RssFeedItemId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_UserPreferences_Key",
table: "UserPreferences",
column: "Key",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Torrents");
migrationBuilder.DropTable(
name: "UserPreferences");
migrationBuilder.DropTable(
name: "RssFeedItems");
migrationBuilder.DropTable(
name: "RssFeedRules");
migrationBuilder.DropTable(
name: "RssFeeds");
}
}
}
+402
View File
@@ -0,0 +1,402 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TransmissionRssManager.Data;
#nullable disable
namespace TransmissionRssManager.Migrations
{
[DbContext(typeof(TorrentManagerContext))]
[Migration("20250312203308_AddUIFeatures")]
partial class AddUIFeatures
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.17")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DefaultCategory")
.HasColumnType("text");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<int>("ErrorCount")
.HasColumnType("integer");
b.Property<DateTime>("LastCheckedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<int>("MaxHistoryItems")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("RefreshInterval")
.HasColumnType("integer");
b.Property<string>("Schedule")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TransmissionInstanceId")
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("RssFeeds");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("text");
b.Property<DateTime>("DiscoveredAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadError")
.HasColumnType("text");
b.Property<DateTime?>("DownloadedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsDownloaded")
.HasColumnType("boolean");
b.Property<string>("Link")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("MatchedRuleId")
.HasColumnType("integer");
b.Property<DateTime>("PublishDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("TorrentId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("MatchedRuleId");
b.HasIndex("RssFeedId", "Link")
.IsUnique();
b.ToTable("RssFeedItems");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CustomSavePath")
.HasColumnType("text");
b.Property<bool>("EnablePostProcessing")
.HasColumnType("boolean");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<string>("ExcludePattern")
.HasColumnType("text");
b.Property<string>("IncludePattern")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Priority")
.HasColumnType("integer");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<bool>("SaveToCustomPath")
.HasColumnType("boolean");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("UseRegex")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("RssFeedId");
b.ToTable("RssFeedRules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.SystemLogEntry", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Context")
.HasColumnType("text");
b.Property<string>("Level")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Properties")
.HasColumnType("text");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("SystemLogs");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Category")
.HasColumnType("text");
b.Property<DateTime?>("CompletedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadDirectory")
.HasColumnType("text");
b.Property<double>("DownloadSpeed")
.HasColumnType("double precision");
b.Property<long>("DownloadedEver")
.HasColumnType("bigint");
b.Property<string>("ErrorMessage")
.HasColumnType("text");
b.Property<bool>("HasMetadata")
.HasColumnType("boolean");
b.Property<string>("Hash")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PeersConnected")
.HasColumnType("integer");
b.Property<double>("PercentDone")
.HasColumnType("double precision");
b.Property<bool>("PostProcessed")
.HasColumnType("boolean");
b.Property<DateTime?>("PostProcessedOn")
.HasColumnType("timestamp with time zone");
b.Property<int?>("RssFeedItemId")
.HasColumnType("integer");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<long>("TotalSize")
.HasColumnType("bigint");
b.Property<int?>("TransmissionId")
.HasColumnType("integer");
b.Property<string>("TransmissionInstance")
.HasColumnType("text");
b.Property<double>("UploadRatio")
.HasColumnType("double precision");
b.Property<double>("UploadSpeed")
.HasColumnType("double precision");
b.Property<long>("UploadedEver")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("RssFeedItemId")
.IsUnique();
b.ToTable("Torrents");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.UserPreference", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Category")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DataType")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("UserPreferences");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedRule", "MatchedRule")
.WithMany("MatchedItems")
.HasForeignKey("MatchedRuleId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Items")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MatchedRule");
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Rules")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedItem", "RssFeedItem")
.WithOne("Torrent")
.HasForeignKey("TransmissionRssManager.Data.Models.Torrent", "RssFeedItemId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("RssFeedItem");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Navigation("Items");
b.Navigation("Rules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Navigation("Torrent");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Navigation("MatchedItems");
});
#pragma warning restore 612, 618
}
}
}
+179
View File
@@ -0,0 +1,179 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace TransmissionRssManager.Migrations
{
/// <inheritdoc />
public partial class AddUIFeatures : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Category",
table: "Torrents",
type: "text",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "DownloadSpeed",
table: "Torrents",
type: "double precision",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<long>(
name: "DownloadedEver",
table: "Torrents",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<bool>(
name: "HasMetadata",
table: "Torrents",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "PeersConnected",
table: "Torrents",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "TransmissionInstance",
table: "Torrents",
type: "text",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "UploadSpeed",
table: "Torrents",
type: "double precision",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<long>(
name: "UploadedEver",
table: "Torrents",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "DefaultCategory",
table: "RssFeeds",
type: "text",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "ErrorCount",
table: "RssFeeds",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "MaxHistoryItems",
table: "RssFeeds",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "Schedule",
table: "RssFeeds",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TransmissionInstanceId",
table: "RssFeeds",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "SystemLogs",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Timestamp = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Level = table.Column<string>(type: "text", nullable: false),
Message = table.Column<string>(type: "text", nullable: false),
Context = table.Column<string>(type: "text", nullable: true),
Properties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SystemLogs", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SystemLogs");
migrationBuilder.DropColumn(
name: "Category",
table: "Torrents");
migrationBuilder.DropColumn(
name: "DownloadSpeed",
table: "Torrents");
migrationBuilder.DropColumn(
name: "DownloadedEver",
table: "Torrents");
migrationBuilder.DropColumn(
name: "HasMetadata",
table: "Torrents");
migrationBuilder.DropColumn(
name: "PeersConnected",
table: "Torrents");
migrationBuilder.DropColumn(
name: "TransmissionInstance",
table: "Torrents");
migrationBuilder.DropColumn(
name: "UploadSpeed",
table: "Torrents");
migrationBuilder.DropColumn(
name: "UploadedEver",
table: "Torrents");
migrationBuilder.DropColumn(
name: "DefaultCategory",
table: "RssFeeds");
migrationBuilder.DropColumn(
name: "ErrorCount",
table: "RssFeeds");
migrationBuilder.DropColumn(
name: "MaxHistoryItems",
table: "RssFeeds");
migrationBuilder.DropColumn(
name: "Schedule",
table: "RssFeeds");
migrationBuilder.DropColumn(
name: "TransmissionInstanceId",
table: "RssFeeds");
}
}
}
@@ -0,0 +1,399 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TransmissionRssManager.Data;
#nullable disable
namespace TransmissionRssManager.Migrations
{
[DbContext(typeof(TorrentManagerContext))]
partial class TorrentManagerContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.17")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DefaultCategory")
.HasColumnType("text");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<int>("ErrorCount")
.HasColumnType("integer");
b.Property<DateTime>("LastCheckedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastError")
.HasColumnType("text");
b.Property<int>("MaxHistoryItems")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("RefreshInterval")
.HasColumnType("integer");
b.Property<string>("Schedule")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TransmissionInstanceId")
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("RssFeeds");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasColumnType("text");
b.Property<DateTime>("DiscoveredAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadError")
.HasColumnType("text");
b.Property<DateTime?>("DownloadedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsDownloaded")
.HasColumnType("boolean");
b.Property<string>("Link")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("MatchedRuleId")
.HasColumnType("integer");
b.Property<DateTime>("PublishDate")
.HasColumnType("timestamp with time zone");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("TorrentId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("MatchedRuleId");
b.HasIndex("RssFeedId", "Link")
.IsUnique();
b.ToTable("RssFeedItems");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CustomSavePath")
.HasColumnType("text");
b.Property<bool>("EnablePostProcessing")
.HasColumnType("boolean");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<string>("ExcludePattern")
.HasColumnType("text");
b.Property<string>("IncludePattern")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Priority")
.HasColumnType("integer");
b.Property<int>("RssFeedId")
.HasColumnType("integer");
b.Property<bool>("SaveToCustomPath")
.HasColumnType("boolean");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("UseRegex")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("RssFeedId");
b.ToTable("RssFeedRules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.SystemLogEntry", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Context")
.HasColumnType("text");
b.Property<string>("Level")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Properties")
.HasColumnType("text");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("SystemLogs");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Category")
.HasColumnType("text");
b.Property<DateTime?>("CompletedOn")
.HasColumnType("timestamp with time zone");
b.Property<string>("DownloadDirectory")
.HasColumnType("text");
b.Property<double>("DownloadSpeed")
.HasColumnType("double precision");
b.Property<long>("DownloadedEver")
.HasColumnType("bigint");
b.Property<string>("ErrorMessage")
.HasColumnType("text");
b.Property<bool>("HasMetadata")
.HasColumnType("boolean");
b.Property<string>("Hash")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PeersConnected")
.HasColumnType("integer");
b.Property<double>("PercentDone")
.HasColumnType("double precision");
b.Property<bool>("PostProcessed")
.HasColumnType("boolean");
b.Property<DateTime?>("PostProcessedOn")
.HasColumnType("timestamp with time zone");
b.Property<int?>("RssFeedItemId")
.HasColumnType("integer");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.Property<long>("TotalSize")
.HasColumnType("bigint");
b.Property<int?>("TransmissionId")
.HasColumnType("integer");
b.Property<string>("TransmissionInstance")
.HasColumnType("text");
b.Property<double>("UploadRatio")
.HasColumnType("double precision");
b.Property<double>("UploadSpeed")
.HasColumnType("double precision");
b.Property<long>("UploadedEver")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("RssFeedItemId")
.IsUnique();
b.ToTable("Torrents");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.UserPreference", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Category")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DataType")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Key")
.IsUnique();
b.ToTable("UserPreferences");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedRule", "MatchedRule")
.WithMany("MatchedItems")
.HasForeignKey("MatchedRuleId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Items")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MatchedRule");
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeed", "RssFeed")
.WithMany("Rules")
.HasForeignKey("RssFeedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RssFeed");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.Torrent", b =>
{
b.HasOne("TransmissionRssManager.Data.Models.RssFeedItem", "RssFeedItem")
.WithOne("Torrent")
.HasForeignKey("TransmissionRssManager.Data.Models.Torrent", "RssFeedItemId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("RssFeedItem");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeed", b =>
{
b.Navigation("Items");
b.Navigation("Rules");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedItem", b =>
{
b.Navigation("Torrent");
});
modelBuilder.Entity("TransmissionRssManager.Data.Models.RssFeedRule", b =>
{
b.Navigation("MatchedItems");
});
#pragma warning restore 612, 618
}
}
}