1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -04:00
Files
Sonarr/src/NzbDrone.Core/Parser/ValidateParsedEpisodeInfo.cs
T
2018-04-21 15:25:21 -07:00

34 lines
943 B
C#

using NLog;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Parser
{
public static class ValidateParsedEpisodeInfo
{
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(ValidateParsedEpisodeInfo));
public static bool ValidateForSeriesType(ParsedEpisodeInfo parsedEpisodeInfo, Series series, bool warnIfInvalid = true)
{
if (parsedEpisodeInfo.IsDaily && series.SeriesType == SeriesTypes.Standard)
{
var message = $"Found daily-style episode for non-daily series: {series}";
if (warnIfInvalid)
{
Logger.Warn(message);
}
else
{
Logger.Debug(message);
}
return false;
}
return true;
}
}
}