Refactored sonarr controller to be able to return anime or tv series based on the media found in the server. Also updated models
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public record ConnectionTestRequest(string Address, string ApiKey);
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public record EpisodeDeletionDetails(
|
||||
[property: JsonPropertyName("id")] int? EpisodeId,
|
||||
[property: JsonPropertyName("episodeFileId")] int? EpisodeFileId,
|
||||
[property: JsonPropertyName("seasonNumber")] int? SeasonNumber
|
||||
);
|
||||
5
Jellyfin.Plugin.MediaCleaner/Models/EpisodeIdLists.cs
Normal file
5
Jellyfin.Plugin.MediaCleaner/Models/EpisodeIdLists.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public record EpisodeIdLists(IReadOnlyList<int> EpisodeIds, IReadOnlyList<int> EpisodeFileIds);
|
||||
@@ -4,6 +4,6 @@ namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public abstract class MediaInfo
|
||||
{
|
||||
public required string? TmdbId { get; set; }
|
||||
public required string TmdbId { get; set; }
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
|
||||
8
Jellyfin.Plugin.MediaCleaner/Models/RadarrMovie.cs
Normal file
8
Jellyfin.Plugin.MediaCleaner/Models/RadarrMovie.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public record RadarrMovie(
|
||||
[property: JsonPropertyName("id")] int? Id,
|
||||
[property: JsonPropertyName("title")] string? Title
|
||||
);
|
||||
@@ -12,5 +12,5 @@ public class SeriesInfo : MediaInfo
|
||||
{
|
||||
public Guid SeriesId { get; set; }
|
||||
public IEnumerable<string> Seasons { get; set; } = [];
|
||||
public required string? TvdbId { get; set; }
|
||||
public required string TvdbId { get; set; }
|
||||
}
|
||||
|
||||
18
Jellyfin.Plugin.MediaCleaner/Models/SonarrSeries.cs
Normal file
18
Jellyfin.Plugin.MediaCleaner/Models/SonarrSeries.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Models;
|
||||
|
||||
public record SonarrSeries(
|
||||
[property: JsonPropertyName("id")] int Id,
|
||||
[property: JsonPropertyName("title")] string? Title,
|
||||
[property: JsonPropertyName("seasons")] IReadOnlyList<Season> Seasons,
|
||||
[property: JsonPropertyName("ended")] bool Ended,
|
||||
[property: JsonPropertyName("tvdbId")] int TvdbId
|
||||
// [property: JsonPropertyName("tmdbId")] int TmdbId,
|
||||
// [property: JsonPropertyName("imdbId")] int ImdbId
|
||||
);
|
||||
|
||||
public record Season(
|
||||
[property: JsonPropertyName("seasonNumber")] int? SeasonNumber
|
||||
);
|
||||
Reference in New Issue
Block a user