93 lines
2.3 KiB
C#
93 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using Learn.Utils;
|
|
|
|
namespace Learn.Config;
|
|
|
|
public class MatchGroupsRules
|
|
{
|
|
public List<string> Full { get; set; } = new();
|
|
public List<string> Partial { get; set; } = new();
|
|
}
|
|
|
|
|
|
public class MatchTypeExtra
|
|
{
|
|
public List<string> IfDirNameIs { get; set; } = new();
|
|
public List<string> IfFileExtensionIs { get; set; } = new();
|
|
}
|
|
|
|
public class MatchTypeSubtitle
|
|
{
|
|
public List<string> IfFileExtensionIs { get; set; } = new();
|
|
}
|
|
|
|
public class MatchTypeEpisode
|
|
{
|
|
public List<string> IfFileExtensionIs { get; set; } = new();
|
|
}
|
|
|
|
public class MatchTypeRules
|
|
{
|
|
public MatchTypeExtra Extra { get; set; }
|
|
public MatchTypeSubtitle Subtitle { get; set; }
|
|
public MatchTypeEpisode Episode { get; set; }
|
|
}
|
|
|
|
public class MatchSeasonRules
|
|
{
|
|
public List<string> Regexes { get; set; } = new();
|
|
}
|
|
|
|
public class MatchEpisodeRules
|
|
{
|
|
public List<string> Regexes { get; set; } = new();
|
|
}
|
|
|
|
public class FilterTokenRules
|
|
{
|
|
public List<string> Regexes { get; set; } = new();
|
|
}
|
|
|
|
[ConfigItem("RawParser")]
|
|
public class RawParserConfig : IConfigItem
|
|
{
|
|
public string SplitRegex { get; set; } = @"[^\[\]_【】《》]+";
|
|
|
|
public MatchTypeRules TypeMatchRules { get; set; } = new()
|
|
{
|
|
Extra = new ()
|
|
{
|
|
IfDirNameIs = {"NCOP&NCED", "PV", "menu", "Fonts", "Scans", "特典映像", "CDs", "迷你动画", "SPs"},
|
|
IfFileExtensionIs = {".rar", ".zip", "png", "jpg", "jpeg"}
|
|
},
|
|
Subtitle = new ()
|
|
{
|
|
IfFileExtensionIs = {".srt", ".ass"}
|
|
},
|
|
Episode = new ()
|
|
{
|
|
IfFileExtensionIs = {".mp4", ".mkv"}
|
|
}
|
|
};
|
|
|
|
public MatchGroupsRules GroupsMatchRules { get; set; } = new()
|
|
{
|
|
Full = { "Rev", "Mukai", "WYQSub" },
|
|
Partial = { "-Studio", "-Raws", "LoliHouse", "字幕组", "VCB-Studio", "Nekomoe kissaten", "Kamigami", "ANi"}
|
|
};
|
|
|
|
public MatchSeasonRules SeasonMatchRules { get; set; } = new()
|
|
{
|
|
Regexes = {@"第(.+)季", @"[Ss]eason *(\d+)", @"S(\d{2})E\d{2}"}
|
|
};
|
|
|
|
public MatchEpisodeRules EpisodeRules { get; set; } = new()
|
|
{
|
|
Regexes = {@"(^\d{1,2}$)", @"S\d{2}E(\d{2})"}
|
|
};
|
|
|
|
public FilterTokenRules TokenFilterRules { get; set; } = new()
|
|
{
|
|
Regexes = { @"\d+[Pp]$", @"\d{1,2}-\d{1,2}" }
|
|
};
|
|
} |