jellyfin-plugin-metashark/Jellyfin.Plugin.MetaShark/Model/ParseNameResult.cs

78 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using MediaBrowser.Controller.Providers;
namespace Jellyfin.Plugin.MetaShark.Model
{
public class ParseNameResult : ItemLookupInfo
{
public string? ChineseName { get; set; } = null;
/// <summary>
/// 可能会解析不对最好只在动画SP中才使用
/// </summary>
public string? EpisodeName { get; set; } = null;
private string _animeType = string.Empty;
public string AnimeType
{
get
{
return _animeType.ToUpper();
}
set
{
_animeType = value;
}
}
public bool IsSpecial
{
get
{
return !string.IsNullOrEmpty(AnimeType) && AnimeType.ToUpper() == "SP";
}
}
public bool IsExtra
{
get
{
return !string.IsNullOrEmpty(AnimeType) && AnimeType.ToUpper() != "SP";
}
}
public string? PaddingZeroIndexNumber
{
get
{
if (!IndexNumber.HasValue)
{
return null;
}
return $"{IndexNumber:00}";
}
}
public string ExtraName
{
get
{
if (IndexNumber.HasValue)
{
return $"{Name} {AnimeType} {PaddingZeroIndexNumber}";
}
else
{
return $"{Name} {AnimeType}";
}
}
}
}
}