mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Added the lidarr sync !wip
This commit is contained in:
parent
d47e7a7c57
commit
207c60b7f8
23 changed files with 1551 additions and 10 deletions
|
@ -40,6 +40,8 @@ namespace Ombi.Store.Context
|
|||
EntityEntry<TEntity> Update<TEntity>(TEntity entity) where TEntity : class;
|
||||
DbSet<CouchPotatoCache> CouchPotatoCache { get; set; }
|
||||
DbSet<SickRageCache> SickRageCache { get; set; }
|
||||
DbSet<LidarrArtistCache> LidarrArtistCache { get; set; }
|
||||
DbSet<LidarrAlbumCache> LidarrAlbumCache { get; set; }
|
||||
DbSet<SickRageEpisodeCache> SickRageEpisodeCache { get; set; }
|
||||
DbSet<RequestLog> RequestLogs { get; set; }
|
||||
DbSet<RecentlyAddedLog> RecentlyAddedLogs { get; set; }
|
||||
|
|
|
@ -45,6 +45,8 @@ namespace Ombi.Store.Context
|
|||
public DbSet<Audit> Audit { get; set; }
|
||||
public DbSet<Tokens> Tokens { get; set; }
|
||||
public DbSet<SonarrCache> SonarrCache { get; set; }
|
||||
public DbSet<LidarrArtistCache> LidarrArtistCache { get; set; }
|
||||
public DbSet<LidarrAlbumCache> LidarrAlbumCache { get; set; }
|
||||
public DbSet<SonarrEpisodeCache> SonarrEpisodeCache { get; set; }
|
||||
public DbSet<SickRageCache> SickRageCache { get; set; }
|
||||
public DbSet<SickRageEpisodeCache> SickRageEpisodeCache { get; set; }
|
||||
|
|
19
src/Ombi.Store/Entities/LidarrAlbumCache.cs
Normal file
19
src/Ombi.Store/Entities/LidarrAlbumCache.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ombi.Store.Entities
|
||||
{
|
||||
[Table("LidarrAlbumCache")]
|
||||
public class LidarrAlbumCache : Entity
|
||||
{
|
||||
public int ArtistId { get; set; }
|
||||
public string ForeignAlbumId { get; set; }
|
||||
public int TrackCount { get; set; }
|
||||
public DateTime ReleaseDate { get; set; }
|
||||
public bool Monitored { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ArtistId))]
|
||||
public LidarrArtistCache Artist { get; set; }
|
||||
}
|
||||
}
|
17
src/Ombi.Store/Entities/LidarrArtistCache.cs
Normal file
17
src/Ombi.Store/Entities/LidarrArtistCache.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ombi.Store.Entities
|
||||
{
|
||||
[Table("LidarrArtistCache")]
|
||||
public class LidarrArtistCache : Entity
|
||||
{
|
||||
[ForeignKey(nameof(ArtistId))]
|
||||
public int ArtistId { get; set; }
|
||||
public string ArtistName { get; set; }
|
||||
public string ForeignArtistId { get; set; }
|
||||
public bool Monitored { get; set; }
|
||||
|
||||
public List<LidarrAlbumCache> Albums { get; set; }
|
||||
}
|
||||
}
|
1095
src/Ombi.Store/Migrations/20180824202308_LidarrSyncJobs.Designer.cs
generated
Normal file
1095
src/Ombi.Store/Migrations/20180824202308_LidarrSyncJobs.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
65
src/Ombi.Store/Migrations/20180824202308_LidarrSyncJobs.cs
Normal file
65
src/Ombi.Store/Migrations/20180824202308_LidarrSyncJobs.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Ombi.Store.Migrations
|
||||
{
|
||||
public partial class LidarrSyncJobs : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LidarrArtistCache",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ArtistId = table.Column<int>(nullable: false),
|
||||
ArtistName = table.Column<string>(nullable: true),
|
||||
ForeignArtistId = table.Column<string>(nullable: true),
|
||||
Monitored = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LidarrArtistCache", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "LidarrAlbumCache",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ArtistId = table.Column<int>(nullable: false),
|
||||
ForeignAlbumId = table.Column<string>(nullable: true),
|
||||
TrackCount = table.Column<int>(nullable: false),
|
||||
ReleaseDate = table.Column<DateTime>(nullable: false),
|
||||
Monitored = table.Column<bool>(nullable: false),
|
||||
Title = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_LidarrAlbumCache", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_LidarrAlbumCache_LidarrArtistCache_ArtistId",
|
||||
column: x => x.ArtistId,
|
||||
principalTable: "LidarrArtistCache",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LidarrAlbumCache_ArtistId",
|
||||
table: "LidarrAlbumCache",
|
||||
column: "ArtistId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "LidarrAlbumCache");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "LidarrArtistCache");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -244,6 +244,48 @@ namespace Ombi.Store.Migrations
|
|||
b.ToTable("GlobalSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.LidarrAlbumCache", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("ArtistId");
|
||||
|
||||
b.Property<string>("ForeignAlbumId");
|
||||
|
||||
b.Property<bool>("Monitored");
|
||||
|
||||
b.Property<DateTime>("ReleaseDate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<int>("TrackCount");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ArtistId");
|
||||
|
||||
b.ToTable("LidarrAlbumCache");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.LidarrArtistCache", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("ArtistId");
|
||||
|
||||
b.Property<string>("ArtistName");
|
||||
|
||||
b.Property<string>("ForeignArtistId");
|
||||
|
||||
b.Property<bool>("Monitored");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("LidarrArtistCache");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.NotificationTemplates", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
@ -921,6 +963,14 @@ namespace Ombi.Store.Migrations
|
|||
.HasPrincipalKey("EmbyId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.LidarrAlbumCache", b =>
|
||||
{
|
||||
b.HasOne("Ombi.Store.Entities.LidarrArtistCache", "Artist")
|
||||
.WithMany("Albums")
|
||||
.HasForeignKey("ArtistId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b =>
|
||||
{
|
||||
b.HasOne("Ombi.Store.Entities.OmbiUser", "User")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue