Add sonarr search option (#18)
* added Sonarr search type option * updated test data * fixed duplicated Sonarr search items when using search type Season * added enhanced logging option along with Sonarr and Radarr enhanced logs * switched to ghcr.io
This commit is contained in:
@@ -4,6 +4,7 @@ public record QueueRecord
|
||||
{
|
||||
public int SeriesId { get; init; }
|
||||
public int EpisodeId { get; init; }
|
||||
public int SeasonNumber { get; init; }
|
||||
public int MovieId { get; init; }
|
||||
public required string Title { get; init; }
|
||||
public string Status { get; init; }
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Domain.Models.Arr;
|
||||
|
||||
public class SearchItem
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not SearchItem other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Id == other.Id;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Id.GetHashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Domain.Models.Arr;
|
||||
|
||||
public sealed class SonarrSearchItem : SearchItem
|
||||
{
|
||||
public long SeriesId { get; set; }
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not SonarrSearchItem other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Id == other.Id && SeriesId == other.SeriesId;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(Id, SeriesId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Domain.Models.Radarr;
|
||||
|
||||
public sealed record Movie
|
||||
{
|
||||
public required long Id { get; init; }
|
||||
|
||||
public required string Title { get; init; }
|
||||
}
|
||||
@@ -4,5 +4,5 @@ public sealed record RadarrCommand
|
||||
{
|
||||
public required string Name { get; init; }
|
||||
|
||||
public required HashSet<int> MovieIds { get; init; }
|
||||
public required List<long> MovieIds { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Domain.Models.Sonarr;
|
||||
|
||||
public sealed record Episode
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public int EpisodeNumber { get; set; }
|
||||
|
||||
public int SeasonNumber { get; set; }
|
||||
|
||||
public long SeriesId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Domain.Models.Sonarr;
|
||||
|
||||
public sealed record Series
|
||||
{
|
||||
public required long Id { get; init; }
|
||||
|
||||
public required string Title { get; init; }
|
||||
}
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
public sealed record SonarrCommand
|
||||
{
|
||||
public required string Name { get; init; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public required int SeriesId { get; set; }
|
||||
public long? SeriesId { get; set; }
|
||||
|
||||
public long? SeasonNumber { get; set; }
|
||||
|
||||
public List<long>? EpisodeIds { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user