mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-28 23:27:08 -04:00
33 lines
963 B
C#
33 lines
963 B
C#
namespace NzbDrone.Core.Parser
|
|
{
|
|
public static class SceneChecker
|
|
{
|
|
//This method should prefer false negatives over false positives.
|
|
//It's better not to use a title that might be scene than to use one that isn't scene
|
|
public static bool IsSceneTitle(string title)
|
|
{
|
|
if (!title.Contains("."))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (title.Contains(" "))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var parsedTitle = Parser.ParseMovieTitle(title, false); //We are not lenient when it comes to scene checking!
|
|
|
|
if (parsedTitle == null ||
|
|
parsedTitle.ReleaseGroup == null ||
|
|
parsedTitle.Quality.Quality == Qualities.Quality.Unknown ||
|
|
string.IsNullOrWhiteSpace(parsedTitle.MovieTitle))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|