54 lines
1.6 KiB
C#
Raw Normal View History

2024-10-25 14:31:50 -04:00
// Copyright (C) 2024 Intro-Skipper contributors <intro-skipper.org>
// SPDX-License-Identifier: GPL-3.0-only.
2024-10-25 14:15:12 -04:00
2022-05-01 00:33:22 -05:00
using System;
using System.Runtime.Serialization;
2022-05-01 00:33:22 -05: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>
/// <remarks>
/// Initializes a new instance of the <see cref="Intro"/> class.
/// </remarks>
/// <param name="intro">intro.</param>
[DataContract(Namespace = "http://schemas.datacontract.org/2004/07/ConfusedPolarBear.Plugin.IntroSkipper")]
public class Intro(Segment intro)
{
2022-05-01 01:24:57 -05:00
/// <summary>
/// Gets or sets the Episode ID.
2022-05-01 01:24:57 -05:00
/// </summary>
[DataMember]
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.
/// 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>
/// Gets or sets the introduction sequence start time.
2022-05-01 00:33:22 -05:00
/// </summary>
[DataMember]
public double IntroStart { get; set; } = intro.Start;
2022-05-01 00:33:22 -05:00
/// <summary>
/// Gets or sets the introduction sequence end time.
2022-05-01 00:33:22 -05:00
/// </summary>
[DataMember]
public double IntroEnd { get; set; } = intro.End;
2022-05-01 00:33:22 -05:00
/// <summary>
/// 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>
/// 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; }
}