using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Jellyfin.Plugin.Request.Tmdb;
///
/// Normalized search hit returned to clients.
///
public sealed class TmdbSearchItem
{
///
/// Gets or sets the TMDB identifier.
///
public int TmdbId { get; set; }
///
/// Gets or sets the media type.
///
public string MediaType { get; set; } = string.Empty;
///
/// Gets or sets the title.
///
public string Title { get; set; } = string.Empty;
///
/// Gets or sets the overview.
///
public string? Overview { get; set; }
///
/// Gets or sets the year.
///
public int? Year { get; set; }
///
/// Gets or sets the poster path.
///
public string? PosterPath { get; set; }
///
/// Gets the full poster URL when a path is present.
///
public string? PosterUrl => string.IsNullOrEmpty(PosterPath)
? null
: $"https://image.tmdb.org/t/p/w342{PosterPath}";
}
///
/// Normalized media detail returned to clients.
///
public sealed class TmdbMediaDetail
{
///
/// Gets or sets the TMDB identifier.
///
public int TmdbId { get; set; }
///
/// Gets or sets the media type.
///
public string MediaType { get; set; } = string.Empty;
///
/// Gets or sets the title.
///
public string Title { get; set; } = string.Empty;
///
/// Gets or sets the overview.
///
public string? Overview { get; set; }
///
/// Gets or sets the year.
///
public int? Year { get; set; }
///
/// Gets or sets the poster path.
///
public string? PosterPath { get; set; }
///
/// Gets the full poster URL when a path is present.
///
public string? PosterUrl => string.IsNullOrEmpty(PosterPath)
? null
: $"https://image.tmdb.org/t/p/w500{PosterPath}";
///
/// Gets or sets TV seasons when applicable.
///
public List Seasons { get; set; } = [];
}
///
/// Season summary for TV detail views.
///
public sealed class TmdbSeasonInfo
{
///
/// Gets or sets the season number.
///
public int SeasonNumber { get; set; }
///
/// Gets or sets the season name.
///
public string Name { get; set; } = string.Empty;
///
/// Gets or sets the episode count.
///
public int EpisodeCount { get; set; }
}
internal sealed class TmdbSearchResponse
{
[JsonPropertyName("results")]
public List Results { get; set; } = [];
}
internal sealed class TmdbRawResult
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("media_type")]
public string? MediaType { get; set; }
[JsonPropertyName("title")]
public string? Title { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("overview")]
public string? Overview { get; set; }
[JsonPropertyName("poster_path")]
public string? PosterPath { get; set; }
[JsonPropertyName("release_date")]
public string? ReleaseDate { get; set; }
[JsonPropertyName("first_air_date")]
public string? FirstAirDate { get; set; }
}
internal sealed class TmdbMovieDetailResponse
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("title")]
public string? Title { get; set; }
[JsonPropertyName("overview")]
public string? Overview { get; set; }
[JsonPropertyName("poster_path")]
public string? PosterPath { get; set; }
[JsonPropertyName("release_date")]
public string? ReleaseDate { get; set; }
}
internal sealed class TmdbTvDetailResponse
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("overview")]
public string? Overview { get; set; }
[JsonPropertyName("poster_path")]
public string? PosterPath { get; set; }
[JsonPropertyName("first_air_date")]
public string? FirstAirDate { get; set; }
[JsonPropertyName("seasons")]
public List Seasons { get; set; } = [];
}
internal sealed class TmdbSeasonRaw
{
[JsonPropertyName("season_number")]
public int SeasonNumber { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("episode_count")]
public int EpisodeCount { get; set; }
}