From 6a062d5c40b017b754cf8a0aec3bcc4a198f532f Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 3 Jan 2021 21:22:52 +0000 Subject: [PATCH] Fixed a bunch of jellyfin issues --- .../Engine/V2/MovieSearchEngineV2.cs | 1 + .../Rules/Search/JellyfinAvailabilityRule.cs | 3 +- src/Ombi.Helpers/StartupSingleton.cs | 3 + .../Jobs/Ombi/RefreshMetadata.cs | 4 +- ...cs => 20210103205509_Jellyfin.Designer.cs} | 201 +++++++++--------- ...Jellyfin.cs => 20210103205509_Jellyfin.cs} | 46 ++-- .../ExternalMySqlContextModelSnapshot.cs | 86 ++++---- src/Ombi.sln | 6 +- .../episode-request.component.html | 4 +- .../V1/External/TesterController.cs | 29 ++- src/Ombi/Ombi.csproj | 4 + src/Ombi/wwwroot/translations/en.json | 1 + 12 files changed, 214 insertions(+), 174 deletions(-) rename src/Ombi.Store/Migrations/ExternalMySql/{20201212163118_Jellyfin.Designer.cs => 20210103205509_Jellyfin.Designer.cs} (69%) rename src/Ombi.Store/Migrations/ExternalMySql/{20201212163118_Jellyfin.cs => 20210103205509_Jellyfin.cs} (52%) diff --git a/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs b/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs index b0a78fbb3..1e2110b38 100644 --- a/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs +++ b/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs @@ -287,6 +287,7 @@ namespace Ombi.Core.Engine.V2 mapped.Requested = viewMovie.Requested; mapped.PlexUrl = viewMovie.PlexUrl; mapped.EmbyUrl = viewMovie.EmbyUrl; + mapped.JellyfinUrl = viewMovie.JellyfinUrl; mapped.Subscribed = viewMovie.Subscribed; mapped.ShowSubscribe = viewMovie.ShowSubscribe; diff --git a/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs index 2f6a39f91..0447458d9 100644 --- a/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/JellyfinAvailabilityRule.cs @@ -74,7 +74,8 @@ namespace Ombi.Core.Rule.Rules.Search } else { - obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, server?.ServerId, null); + var firstServer = s.Servers?.FirstOrDefault(); + obj.JellyfinUrl = JellyfinHelper.GetJellyfinMediaUrl(item.JellyfinId, firstServer.ServerId, firstServer.FullUri); } } diff --git a/src/Ombi.Helpers/StartupSingleton.cs b/src/Ombi.Helpers/StartupSingleton.cs index 41fd1a9ab..c9df7665a 100644 --- a/src/Ombi.Helpers/StartupSingleton.cs +++ b/src/Ombi.Helpers/StartupSingleton.cs @@ -11,5 +11,8 @@ public string StoragePath { get; set; } public string SecurityKey { get; set; } +#if DEBUG + = "test"; +#endif } } \ No newline at end of file diff --git a/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs b/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs index 599cea66a..65c85b586 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/RefreshMetadata.cs @@ -224,7 +224,7 @@ namespace Ombi.Schedule.Jobs.Ombi if (!hasImdb) { - var id = await GetImdbId(hasTheMovieDb, hasTvDbId, show.Title, show.TheMovieDbId, show.TvDbId); + var id = await GetImdbId(hasTheMovieDb, hasTvDbId, show.Title, show.TheMovieDbId, show.TvDbId, RequestType.TvShow); show.ImdbId = id; _jellyfinRepo.UpdateWithoutSave(show); } @@ -364,7 +364,7 @@ namespace Ombi.Schedule.Jobs.Ombi if (!movie.HasImdb) { - var imdbId = await GetImdbId(movie.HasTheMovieDb, false, movie.Title, movie.TheMovieDbId, string.Empty); + var imdbId = await GetImdbId(movie.HasTheMovieDb, false, movie.Title, movie.TheMovieDbId, string.Empty, RequestType.Movie); movie.ImdbId = imdbId; _jellyfinRepo.UpdateWithoutSave(movie); } diff --git a/src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.Designer.cs b/src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.Designer.cs similarity index 69% rename from src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.Designer.cs rename to src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.Designer.cs index 93c128c5c..72f8d2376 100644 --- a/src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.Designer.cs +++ b/src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.Designer.cs @@ -9,23 +9,24 @@ using Ombi.Store.Context.MySql; namespace Ombi.Store.Migrations.ExternalMySql { [DbContext(typeof(ExternalMySqlContext))] - [Migration("20201212014227_Jellyfin")] + [Migration("20210103205509_Jellyfin")] partial class Jellyfin { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("ProductVersion", "5.0.1"); modelBuilder.Entity("Ombi.Store.Entities.CouchPotatoCache", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -36,35 +37,35 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("EmbyId") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("varchar(255)"); b.Property("ImdbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("ProviderId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TheMovieDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Type") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Url") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -75,37 +76,37 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("EmbyId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("EpisodeNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ImdbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("ParentId") - .HasColumnType("TEXT"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -118,35 +119,35 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("ImdbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("JellyfinId") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TheMovieDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Type") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Url") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -157,37 +158,37 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("EpisodeNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ImdbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("JellyfinId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("ParentId") - .HasColumnType("TEXT"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -200,31 +201,31 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("ArtistId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ForeignAlbumId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Monitored") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("PercentOfTracks") - .HasColumnType("TEXT"); + .HasColumnType("decimal(65,30)"); b.Property("ReleaseDate") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TrackCount") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -235,19 +236,19 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ArtistId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ArtistName") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("ForeignArtistId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Monitored") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.HasKey("Id"); @@ -258,25 +259,25 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("EpisodeNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("GrandparentKey") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Key") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ParentKey") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -289,22 +290,22 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("ParentKey") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("PlexContentId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("PlexServerContentId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("SeasonKey") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -317,40 +318,40 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("TEXT"); + .HasColumnType("datetime(6)"); b.Property("ImdbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Key") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Quality") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("ReleaseYear") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("RequestId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.Property("Type") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("Url") - .HasColumnType("TEXT"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -361,13 +362,13 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("HasFile") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("TheMovieDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -378,10 +379,10 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TvDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -392,16 +393,16 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("EpisodeNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TvDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -412,10 +413,10 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TvDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); @@ -426,19 +427,19 @@ namespace Ombi.Store.Migrations.ExternalMySql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("EpisodeNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("HasFile") - .HasColumnType("INTEGER"); + .HasColumnType("tinyint(1)"); b.Property("SeasonNumber") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.Property("TvDbId") - .HasColumnType("INTEGER"); + .HasColumnType("int"); b.HasKey("Id"); diff --git a/src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.cs b/src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.cs similarity index 52% rename from src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.cs rename to src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.cs index bb23c95c9..cd7fe85d5 100644 --- a/src/Ombi.Store/Migrations/ExternalMySql/20201212163118_Jellyfin.cs +++ b/src/Ombi.Store/Migrations/ExternalMySql/20210103205509_Jellyfin.cs @@ -12,17 +12,17 @@ namespace Ombi.Store.Migrations.ExternalMySql name: "JellyfinContent", columns: table => new { - Id = table.Column(nullable: false) + Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(nullable: true), - ProviderId = table.Column(nullable: true), - JellyfinId = table.Column(nullable: false), - Type = table.Column(nullable: false), - AddedAt = table.Column(nullable: false), - ImdbId = table.Column(nullable: true), - TheMovieDbId = table.Column(nullable: true), - TvDbId = table.Column(nullable: true), - Url = table.Column(nullable: true) + Title = table.Column(type: "longtext", nullable: true), + ProviderId = table.Column(type: "longtext", nullable: true), + JellyfinId = table.Column(type: "varchar(255)", nullable: false), + Type = table.Column(type: "int", nullable: false), + AddedAt = table.Column(type: "datetime(6)", nullable: false), + ImdbId = table.Column(type: "longtext", nullable: true), + TheMovieDbId = table.Column(type: "longtext", nullable: true), + TvDbId = table.Column(type: "longtext", nullable: true), + Url = table.Column(type: "longtext", nullable: true) }, constraints: table => { @@ -34,18 +34,18 @@ namespace Ombi.Store.Migrations.ExternalMySql name: "JellyfinEpisode", columns: table => new { - Id = table.Column(nullable: false) + Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(nullable: true), - JellyfinId = table.Column(nullable: true), - EpisodeNumber = table.Column(nullable: false), - SeasonNumber = table.Column(nullable: false), - ParentId = table.Column(nullable: true), - ProviderId = table.Column(nullable: true), - AddedAt = table.Column(nullable: false), - TvDbId = table.Column(nullable: true), - ImdbId = table.Column(nullable: true), - TheMovieDbId = table.Column(nullable: true) + Title = table.Column(type: "longtext", nullable: true), + JellyfinId = table.Column(type: "longtext", nullable: true), + EpisodeNumber = table.Column(type: "int", nullable: false), + SeasonNumber = table.Column(type: "int", nullable: false), + ParentId = table.Column(type: "varchar(255)", nullable: true), + ProviderId = table.Column(type: "longtext", nullable: true), + AddedAt = table.Column(type: "datetime(6)", nullable: false), + TvDbId = table.Column(type: "longtext", nullable: true), + ImdbId = table.Column(type: "longtext", nullable: true), + TheMovieDbId = table.Column(type: "longtext", nullable: true) }, constraints: table => { @@ -67,10 +67,10 @@ namespace Ombi.Store.Migrations.ExternalMySql protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "JellyfinContent"); + name: "JellyfinEpisode"); migrationBuilder.DropTable( - name: "JellyfinEpisode"); + name: "JellyfinContent"); } } } diff --git a/src/Ombi.Store/Migrations/ExternalMySql/ExternalMySqlContextModelSnapshot.cs b/src/Ombi.Store/Migrations/ExternalMySql/ExternalMySqlContextModelSnapshot.cs index 70312e542..00b274c52 100644 --- a/src/Ombi.Store/Migrations/ExternalMySql/ExternalMySqlContextModelSnapshot.cs +++ b/src/Ombi.Store/Migrations/ExternalMySql/ExternalMySqlContextModelSnapshot.cs @@ -14,8 +14,8 @@ namespace Ombi.Store.Migrations.ExternalMySql { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.1") - .HasAnnotation("Relational:MaxIdentifierLength", 64); + .HasAnnotation("Relational:MaxIdentifierLength", 64) + .HasAnnotation("ProductVersion", "5.0.1"); modelBuilder.Entity("Ombi.Store.Entities.CouchPotatoCache", b => { @@ -42,28 +42,28 @@ namespace Ombi.Store.Migrations.ExternalMySql b.Property("EmbyId") .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ProviderId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TheMovieDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Type") .HasColumnType("int"); b.Property("Url") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -80,31 +80,31 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("datetime(6)"); b.Property("EmbyId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("EpisodeNumber") .HasColumnType("int"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ParentId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("SeasonNumber") .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -123,29 +123,29 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("datetime(6)"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("JellyfinId") .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TheMovieDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Type") .HasColumnType("int"); b.Property("Url") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -159,34 +159,34 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("int"); b.Property("AddedAt") - .HasColumnType("dateime(6)"); + .HasColumnType("datetime(6)"); b.Property("EpisodeNumber") .HasColumnType("int"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("JellyfinId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ParentId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ProviderId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("SeasonNumber") .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -208,7 +208,7 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("int"); b.Property("ForeignAlbumId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Monitored") .HasColumnType("tinyint(1)"); @@ -220,7 +220,7 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("datetime(6)"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TrackCount") .HasColumnType("int"); @@ -240,10 +240,10 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("int"); b.Property("ArtistName") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ForeignArtistId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Monitored") .HasColumnType("tinyint(1)"); @@ -275,7 +275,7 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("int"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -322,34 +322,34 @@ namespace Ombi.Store.Migrations.ExternalMySql .HasColumnType("datetime(6)"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Key") .HasColumnType("int"); b.Property("Quality") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ReleaseYear") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestId") .HasColumnType("int"); b.Property("TheMovieDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TvDbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Type") .HasColumnType("int"); b.Property("Url") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); diff --git a/src/Ombi.sln b/src/Ombi.sln index 29decbc1c..658d37c3b 100644 --- a/src/Ombi.sln +++ b/src/Ombi.sln @@ -39,7 +39,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Schedule", "Ombi.Sched EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Emby", "Ombi.Api.Emby\Ombi.Api.Emby.csproj", "{08FF107D-31E1-470D-AF86-E09B015CEE06}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Jellyfin", "Ombi.Api.Jellyfin\Ombi.Api.Jellyfin.csproj", "{08FF107D-31E1-470D-AF86-E09B015CEE06}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Jellyfin", "Ombi.Api.Jellyfin\Ombi.Api.Jellyfin.csproj", "{F03757C7-5145-45C9-AFFF-B4E946755779}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Sonarr", "Ombi.Api.Sonarr\Ombi.Api.Sonarr.csproj", "{CFB5E008-D0D0-43C0-AA06-89E49D17F384}" EndProject @@ -171,6 +171,10 @@ Global {08FF107D-31E1-470D-AF86-E09B015CEE06}.Debug|Any CPU.Build.0 = Debug|Any CPU {08FF107D-31E1-470D-AF86-E09B015CEE06}.Release|Any CPU.ActiveCfg = Release|Any CPU {08FF107D-31E1-470D-AF86-E09B015CEE06}.Release|Any CPU.Build.0 = Release|Any CPU + {F03757C7-5145-45C9-AFFF-B4E946755779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F03757C7-5145-45C9-AFFF-B4E946755779}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F03757C7-5145-45C9-AFFF-B4E946755779}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F03757C7-5145-45C9-AFFF-B4E946755779}.Release|Any CPU.Build.0 = Release|Any CPU {CFB5E008-D0D0-43C0-AA06-89E49D17F384}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CFB5E008-D0D0-43C0-AA06-89E49D17F384}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFB5E008-D0D0-43C0-AA06-89E49D17F384}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html index f57f014c9..4802ccaaa 100644 --- a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html +++ b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html @@ -24,9 +24,9 @@ Season {{season.seasonNumber}} Season {{season.seasonNumber}} - +
diff --git a/src/Ombi/Controllers/V1/External/TesterController.cs b/src/Ombi/Controllers/V1/External/TesterController.cs index 0dbaac688..0c80b051c 100644 --- a/src/Ombi/Controllers/V1/External/TesterController.cs +++ b/src/Ombi/Controllers/V1/External/TesterController.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Ombi.Api.CouchPotato; using Ombi.Api.Emby; +using Ombi.Api.Jellyfin; using Ombi.Api.Lidarr; using Ombi.Api.Plex; using Ombi.Api.Radarr; @@ -37,6 +38,7 @@ namespace Ombi.Controllers.V1.External [Produces("application/json")] public class TesterController : Controller { + /// /// Initializes a new instance of the class. /// @@ -44,7 +46,8 @@ namespace Ombi.Controllers.V1.External IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm, IPlexApi plex, IEmbyApiFactory emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger log, IEmailProvider provider, ICouchPotatoApi cpApi, ITelegramNotification telegram, ISickRageApi srApi, INewsletterJob newsletter, ILegacyMobileNotification mobileNotification, - ILidarrApi lidarrApi, IGotifyNotification gotifyNotification, IWhatsAppApi whatsAppApi, OmbiUserManager um, IWebhookNotification webhookNotification) + ILidarrApi lidarrApi, IGotifyNotification gotifyNotification, IWhatsAppApi whatsAppApi, OmbiUserManager um, IWebhookNotification webhookNotification, + IJellyfinApi jellyfinApi) { Service = service; DiscordNotification = notification; @@ -69,6 +72,7 @@ namespace Ombi.Controllers.V1.External WhatsAppApi = whatsAppApi; UserManager = um; WebhookNotification = webhookNotification; + _jellyfinApi = jellyfinApi; } private INotificationService Service { get; } @@ -93,7 +97,8 @@ namespace Ombi.Controllers.V1.External private ILegacyMobileNotification MobileNotification { get; } private ILidarrApi LidarrApi { get; } private IWhatsAppApi WhatsAppApi { get; } - private OmbiUserManager UserManager {get;} + private OmbiUserManager UserManager {get; } + private readonly IJellyfinApi _jellyfinApi; /// /// Sends a test message to discord using the provided settings @@ -333,6 +338,26 @@ namespace Ombi.Controllers.V1.External } } + /// + /// Checks if we can connect to Jellyfin with the provided settings + /// + /// + /// + [HttpPost("jellyfin")] + public async Task Jellyfin([FromBody] JellyfinServers settings) + { + try + { + var result = await _jellyfinApi.GetUsers(settings.FullUri, settings.ApiKey); + return result.Any(); + } + catch (Exception e) + { + Log.LogError(LoggingEvents.Api, e, "Could not test Jellyfin"); + return false; + } + } + /// /// Checks if we can connect to Radarr with the provided settings /// diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 2c615f57c..0b86b06f1 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -53,6 +53,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 665811489..4108bb848 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -92,6 +92,7 @@ "TheatricalRelease": "Theatrical Release: {{date}}", "ViewOnPlex": "View On Plex", "ViewOnEmby": "View On Emby", + "ViewOnJellyfin": "View On Jellyfin", "RequestAdded": "Request for {{title}} has been added successfully", "Similar": "Similar", "Refine": "Refine",