first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.JRay.Models;
|
||||
|
||||
/// <summary>
|
||||
/// An actor visible on screen at a queried timestamp.
|
||||
/// </summary>
|
||||
public class ActorAtTime
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's display name.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's IMDB person id, or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("imdb_id")]
|
||||
public string ImdbId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's TMDB person id, or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("tmdb_id")]
|
||||
public string TmdbId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's Jellyfin Person item GUID, or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("jellyfin_id")]
|
||||
public string JellyfinId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.JRay.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Extensible "what's happening at time t" context for a media item.
|
||||
/// Returned by the <c>jray?t=</c> endpoint; new fields (e.g. locations,
|
||||
/// trivia) can be added here without changing the route.
|
||||
/// </summary>
|
||||
public class JRayContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the list of actors visible on screen at the queried timestamp.
|
||||
/// </summary>
|
||||
[JsonPropertyName("actors")]
|
||||
public Collection<ActorAtTime> Actors { get; } = new();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.JRay.Models;
|
||||
|
||||
/// <summary>
|
||||
/// One actor entry in a <see cref="TruthFile"/>, with the time windows during
|
||||
/// which they are visible on screen.
|
||||
/// </summary>
|
||||
public class TruthActor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's display name.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's IMDB person id (e.g. "nm0000158"), or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("imdb_id")]
|
||||
public string ImdbId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's TMDB person id, or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("tmdb_id")]
|
||||
public string TmdbId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actor's Jellyfin Person item GUID, or "" if unresolved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("jellyfin_id")]
|
||||
public string JellyfinId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of [start_sec, end_sec] windows during which the actor is on screen.
|
||||
/// </summary>
|
||||
[JsonPropertyName("scenes")]
|
||||
public Collection<double[]> Scenes { get; } = new();
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.JRay.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Root object of a scene-actor-extraction "truth" file
|
||||
/// (schema_version 1, minimal verbosity). See SPEC.md.
|
||||
/// </summary>
|
||||
public class TruthFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the schema version of this file.
|
||||
/// </summary>
|
||||
[JsonPropertyName("schema_version")]
|
||||
public int SchemaVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source media path at extraction time (informational).
|
||||
/// </summary>
|
||||
[JsonPropertyName("movie")]
|
||||
public string Movie { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sampling rate (frames per second) used during extraction.
|
||||
/// </summary>
|
||||
[JsonPropertyName("sample_fps")]
|
||||
public double SampleFps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the gap (seconds) below which consecutive detections were merged into one scene.
|
||||
/// </summary>
|
||||
[JsonPropertyName("anneal_sec")]
|
||||
public double AnnealSec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of actors detected in the film, each with their on-screen scene windows.
|
||||
/// </summary>
|
||||
[JsonPropertyName("actors")]
|
||||
public Collection<TruthActor> Actors { get; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user