2017-10-19 01:42:57 +00:00
|
|
|
namespace NzbDrone.Core.Parser
|
2014-09-01 23:37:59 +00:00
|
|
|
{
|
|
|
|
public static class SceneChecker
|
|
|
|
{
|
2022-11-22 01:51:00 +00:00
|
|
|
// 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
|
2014-09-01 23:37:59 +00:00
|
|
|
public static bool IsSceneTitle(string title)
|
|
|
|
{
|
2023-04-12 02:31:27 +00:00
|
|
|
if (!title.Contains('.'))
|
2020-01-03 12:49:24 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-04-12 02:31:27 +00:00
|
|
|
if (title.Contains(' '))
|
2020-01-03 12:49:24 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2014-09-01 23:37:59 +00:00
|
|
|
|
2017-10-19 01:42:57 +00:00
|
|
|
var parsedTitle = Parser.ParseMusicTitle(title);
|
2015-01-27 05:57:07 +00:00
|
|
|
|
|
|
|
if (parsedTitle == null ||
|
|
|
|
parsedTitle.ReleaseGroup == null ||
|
|
|
|
parsedTitle.Quality.Quality == Qualities.Quality.Unknown ||
|
2017-10-19 01:42:57 +00:00
|
|
|
string.IsNullOrWhiteSpace(parsedTitle.ArtistTitle))
|
2015-01-27 05:57:07 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2014-09-01 23:37:59 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|