* move subtitles provider into scanner * move more stuff into scanner * move nfo into scanner * add scan subcommand * fix a bunch of nfo build warnings * more subcommands * fix warnings * cleanup logging * remove unused code * cleanup old ffmpeg stuff * rename complex filter * refactor wrapped segmenter
35 lines
725 B
C#
35 lines
725 B
C#
namespace ErsatzTV.Core.Metadata;
|
|
|
|
public static class SortTitle
|
|
{
|
|
public static string GetSortTitle(string title)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(title))
|
|
{
|
|
return title;
|
|
}
|
|
|
|
if (title.StartsWith("the ", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return title[4..];
|
|
}
|
|
|
|
if (title.StartsWith("a ", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return title[2..];
|
|
}
|
|
|
|
if (title.StartsWith("an ", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return title[3..];
|
|
}
|
|
|
|
if (title.StartsWith("Æ"))
|
|
{
|
|
return title.Replace("Æ", "E");
|
|
}
|
|
|
|
return title;
|
|
}
|
|
}
|