rlauuzo 6ccf002e51
Recaps and Previews Support (#357)
* Recaps and Previews Support

* Add draft UI of preview / recap edit

* remove intro/credit tasks

* Update configPage.html

* rename task

* Reorganize settings by relation

* More standardized formatting

* Some additional formatting

* fix a typo

* Update configPage.html

* Allow missing recap / prview data

* More risk to corrupt than benefit

* Update TimeStamps.cs

* Update PluginConfiguration.cs

* Update configPage.html

* Update PluginConfiguration.cs

* Add chapter regex to settings

* Move all UI into UI section

* Move ending seconds with similar

* Add default

* fixes

* Update SkipIntroController.cs

* Autoskip all segments

* Check if adjacent segment

* Update AutoSkip.cs

* Update AutoSkip.cs

* Settings apply to all segment types

* Update SegmentProvider

* Update configPage.html

Whoops

* Update Plugin.cs

* Update AutoSkip.cs

* Let’s call it missing instead

* Update BaseItemAnalyzerTask.cs

* Update BaseItemAnalyzerTask.cs

* Update BaseItemAnalyzerTask.cs

* Move "select" all below list

* Clarify button wording

* Update configPage.html

* Nope, long client list will hide it

* Simplify wording

* Update QueuedEpisode.cs

* fix unit test for ffmpeg7

* Add migration

* Restore DataContract

* update

* Update configPage.html

* remove analyzed status

* Update AutoSkip.cs

* Update configPage.html typo

* Store analyzed items in seasoninfo

* Update VisualizationController.cs

* update

* Update IntroSkipperDbContext.cs

* Add preview / recap delete

* This keeps changing itself

* Update SkipIntroController.cs

* Rather add it to be removed

---------

Co-authored-by: rlauu <46294892+rlauu@users.noreply.github.com>
Co-authored-by: TwistedUmbrellaX <1173913+AbandonedCart@users.noreply.github.com>
Co-authored-by: Kilian von Pflugk <github@jumoog.io>
2024-11-21 09:42:55 -05:00

66 lines
1.8 KiB
C#

// Copyright (C) 2024 Intro-Skipper contributors <intro-skipper.org>
// SPDX-License-Identifier: GPL-3.0-only.
using System;
using IntroSkipper.Data;
namespace IntroSkipper.Db;
/// <summary>
/// All times are measured in seconds relative to the beginning of the media file.
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="DbSegment"/> class.
/// </remarks>
public class DbSegment
{
/// <summary>
/// Initializes a new instance of the <see cref="DbSegment"/> class.
/// </summary>
/// <param name="segment">The segment to initialize the instance with.</param>
/// <param name="type">The type of analysis that was used to determine this segment.</param>
public DbSegment(Segment segment, AnalysisMode type)
{
ItemId = segment.EpisodeId;
Start = segment.Start;
End = segment.End;
Type = type;
}
/// <summary>
/// Initializes a new instance of the <see cref="DbSegment"/> class.
/// </summary>
public DbSegment()
{
}
/// <summary>
/// Gets or sets the episode id.
/// </summary>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the start time.
/// </summary>
public double Start { get; set; }
/// <summary>
/// Gets or sets the end time.
/// </summary>
public double End { get; set; }
/// <summary>
/// Gets the type of analysis that was used to determine this segment.
/// </summary>
public AnalysisMode Type { get; private set; }
/// <summary>
/// Converts the instance to a <see cref="Segment"/> object.
/// </summary>
/// <returns>A <see cref="Segment"/> object.</returns>
internal Segment ToSegment()
{
return new Segment(ItemId, new TimeRange(Start, End));
}
}