intro-skipper/IntroSkipper/Data/QueuedEpisode.cs

96 lines
2.7 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.Collections.Generic;
2022-05-01 00:33:22 -05:00
namespace IntroSkipper.Data;
2022-05-01 00:33:22 -05:00
/// <summary>
/// Episode queued for analysis.
/// </summary>
public class QueuedEpisode
{
private readonly Dictionary<AnalysisMode, bool> _isAnalyzed = [];
2022-05-01 00:33:22 -05:00
/// <summary>
/// Gets or sets the series name.
2022-05-01 00:33:22 -05:00
/// </summary>
public string SeriesName { get; set; } = string.Empty;
2022-05-01 00:33:22 -05:00
/// <summary>
/// Gets or sets the season number.
2022-05-01 00:33:22 -05:00
/// </summary>
public int SeasonNumber { get; set; }
/// <summary>
/// Gets or sets the episode id.
2022-05-01 00:33:22 -05:00
/// </summary>
public Guid EpisodeId { get; set; }
/// <summary>
/// Gets or sets the series id.
/// </summary>
public Guid SeriesId { get; set; }
/// <summary>
/// Gets a value indicating whether this media has been already analyzed.
/// </summary>
public IReadOnlyDictionary<AnalysisMode, bool> IsAnalyzed => _isAnalyzed;
2022-05-01 00:33:22 -05:00
/// <summary>
/// Gets or sets the full path to episode.
2022-05-01 00:33:22 -05:00
/// </summary>
public string Path { get; set; } = string.Empty;
2022-05-01 00:33:22 -05:00
2022-05-30 02:23:36 -05:00
/// <summary>
/// Gets or sets the name of the episode.
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether an episode is Anime.
/// </summary>
public bool IsAnime { get; set; }
/// <summary>
/// Gets or sets a value indicating whether an item is a movie.
/// </summary>
public bool IsMovie { get; set; }
2022-05-01 00:33:22 -05:00
/// <summary>
/// Gets or sets the timestamp (in seconds) to stop searching for an introduction at.
2022-05-01 00:33:22 -05:00
/// </summary>
2022-10-31 01:00:39 -05:00
public int IntroFingerprintEnd { get; set; }
/// <summary>
/// Gets or sets the timestamp (in seconds) to start looking for end credits at.
2022-10-31 01:00:39 -05:00
/// </summary>
public int CreditsFingerprintStart { get; set; }
/// <summary>
/// Gets or sets the total duration of this media file (in seconds).
/// </summary>
public int Duration { get; set; }
/// <summary>
/// Sets a value indicating whether this media has been already analyzed.
/// </summary>
/// <param name="mode">Analysis mode.</param>
/// <param name="value">Value to set.</param>
public void SetAnalyzed(AnalysisMode mode, bool value)
{
_isAnalyzed[mode] = value;
}
/// <summary>
/// Sets a value indicating whether this media has been already analyzed.
/// </summary>
/// <param name="mode">Analysis mode.</param>
/// <returns>Value of the analyzed mode.</returns>
public bool GetAnalyzed(AnalysisMode mode)
{
return _isAnalyzed.TryGetValue(mode, out var value) && value;
}
2022-05-01 00:33:22 -05:00
}