2022-05-01 00:33:22 -05:00
|
|
|
using System;
|
2024-09-01 17:01:24 +02:00
|
|
|
using System.Runtime.Serialization;
|
2022-05-01 00:33:22 -05:00
|
|
|
|
2024-10-19 23:50:41 +02:00
|
|
|
namespace IntroSkipper.Data;
|
2022-05-01 00:33:22 -05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Result of fingerprinting and analyzing two episodes in a season.
|
|
|
|
/// All times are measured in seconds relative to the beginning of the media file.
|
|
|
|
/// </summary>
|
2024-09-12 08:37:47 +00:00
|
|
|
/// <remarks>
|
|
|
|
/// Initializes a new instance of the <see cref="Intro"/> class.
|
|
|
|
/// </remarks>
|
|
|
|
/// <param name="intro">intro.</param>
|
2024-09-01 18:34:25 +02:00
|
|
|
[DataContract(Namespace = "http://schemas.datacontract.org/2004/07/ConfusedPolarBear.Plugin.IntroSkipper")]
|
2024-09-12 08:37:47 +00:00
|
|
|
public class Intro(Segment intro)
|
2022-05-09 22:50:41 -05:00
|
|
|
{
|
2022-05-01 01:24:57 -05:00
|
|
|
/// <summary>
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Gets or sets the Episode ID.
|
2022-05-01 01:24:57 -05:00
|
|
|
/// </summary>
|
2024-09-01 17:01:24 +02:00
|
|
|
[DataMember]
|
2024-09-12 08:37:47 +00:00
|
|
|
public Guid EpisodeId { get; set; } = intro.EpisodeId;
|
2022-05-01 01:24:57 -05:00
|
|
|
|
2022-05-01 00:33:22 -05:00
|
|
|
/// <summary>
|
2022-05-13 01:13:13 -05:00
|
|
|
/// Gets a value indicating whether this introduction is valid or not.
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Invalid results must not be returned through the API.
|
2022-05-01 00:33:22 -05:00
|
|
|
/// </summary>
|
2022-05-13 01:13:13 -05:00
|
|
|
public bool Valid => IntroEnd > 0;
|
2022-05-01 00:33:22 -05:00
|
|
|
|
|
|
|
/// <summary>
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Gets or sets the introduction sequence start time.
|
2022-05-01 00:33:22 -05:00
|
|
|
/// </summary>
|
2024-09-01 17:01:24 +02:00
|
|
|
[DataMember]
|
2024-09-12 08:37:47 +00:00
|
|
|
public double IntroStart { get; set; } = intro.Start;
|
2022-05-01 00:33:22 -05:00
|
|
|
|
|
|
|
/// <summary>
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Gets or sets the introduction sequence end time.
|
2022-05-01 00:33:22 -05:00
|
|
|
/// </summary>
|
2024-09-01 17:01:24 +02:00
|
|
|
[DataMember]
|
2024-09-12 08:37:47 +00:00
|
|
|
public double IntroEnd { get; set; } = intro.End;
|
2022-05-01 00:33:22 -05:00
|
|
|
|
|
|
|
/// <summary>
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Gets or sets the recommended time to display the skip intro prompt.
|
2022-05-01 00:33:22 -05:00
|
|
|
/// </summary>
|
|
|
|
public double ShowSkipPromptAt { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
2022-05-09 22:50:41 -05:00
|
|
|
/// Gets or sets the recommended time to hide the skip intro prompt.
|
2022-05-01 00:33:22 -05:00
|
|
|
/// </summary>
|
|
|
|
public double HideSkipPromptAt { get; set; }
|
|
|
|
}
|