Split API Model into separate classes

This commit is contained in:
Pijus Kamandulis 2022-06-02 22:24:17 +03:00
parent ae1cdd4787
commit 992cbc76ff
9 changed files with 52 additions and 41 deletions

View File

@ -15,19 +15,4 @@ namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
Data = initialData;
}
}
public class ResponseMeta
{
public long? Count { get; set; }
}
public class Included
{
public IncludedAttributes Attributes { get; set; }
}
public class IncludedAttributes
{
public string Name { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class Included
{
public IncludedAttributes Attributes { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class IncludedAttributes
{
public string Name { get; set; }
}
}

View File

@ -1,5 +1,3 @@
using System;
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class KitsuEpisode
@ -7,15 +5,4 @@ namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
public long Id { get; set; }
public KitsuEpisodeAttributes Attributes { get; set; }
}
public class KitsuEpisodeAttributes
{
public string Synopsis { get; set; }
public KitsuTitles Titles { get; set; }
public int? Number { get; set; }
public int? SeasonNumber { get; set; }
public DateTime? AirDate { get; set; }
public int? Length { get; set; }
public KitsuImage Thumbnail { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class KitsuEpisodeAttributes
{
public string Synopsis { get; set; }
public KitsuTitles Titles { get; set; }
public int? Number { get; set; }
public int? SeasonNumber { get; set; }
public DateTime? AirDate { get; set; }
public int? Length { get; set; }
public KitsuImage Thumbnail { get; set; }
}
}

View File

@ -1,5 +1,3 @@
using System;
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class KitsuSeries
@ -7,14 +5,4 @@ namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
public long Id { get; set; }
public KitsuSeriesAttributes Attributes { get; set; }
}
public class KitsuSeriesAttributes
{
public string Synopsis { get; set; }
public KitsuTitles Titles { get; set; }
public string AverageRating { get; set; }
public DateTimeOffset? StartDate { get; set; }
public KitsuImage PosterImage { get; set; }
public KitsuImage CoverImage { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class KitsuSeriesAttributes
{
public string Synopsis { get; set; }
public KitsuTitles Titles { get; set; }
public string AverageRating { get; set; }
public DateTimeOffset? StartDate { get; set; }
public KitsuImage PosterImage { get; set; }
public KitsuImage CoverImage { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models
{
public class ResponseMeta
{
public long? Count { get; set; }
}
}

View File

@ -14,6 +14,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using Microsoft.Extensions.Logging;
using MediaBrowser.Controller.Entities.TV;
using Jellyfin.Plugin.Kitsu.Providers.KitsuIO.ApiClient.Models;
namespace Jellyfin.Plugin.Anime.Providers.KitsuIO.Metadata
{
@ -117,7 +118,7 @@ namespace Jellyfin.Plugin.Anime.Providers.KitsuIO.Metadata
File.WriteAllText(path, url);
}
private RemoteSearchResult MapToRemoteSearchResult(Series series)
private RemoteSearchResult MapToRemoteSearchResult(KitsuSeries series)
{
var parsedSeries = new RemoteSearchResult
{