1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-18 21:35:27 -04:00
Files
Sonarr/src/NzbDrone.Core/Parser/SceneChecker.cs
T
Mark McDowall 20782bbbc1 Episode import improvements
Fixed: Use folder name when file name is not parsable on import
2015-02-08 00:07:08 -08:00

28 lines
824 B
C#

using System;
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.ParseTitle(title);
if (parsedTitle == null ||
parsedTitle.ReleaseGroup == null ||
parsedTitle.Quality.Quality == Qualities.Quality.Unknown ||
String.IsNullOrWhiteSpace(parsedTitle.SeriesTitle))
{
return false;
}
return true;
}
}
}