Better parser logging.
This commit is contained in:
parent
1e580856ca
commit
78268f3c58
|
@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test
|
||||||
|
|
||||||
parseResults.Should().NotBeEmpty();
|
parseResults.Should().NotBeEmpty();
|
||||||
parseResults.Should().OnlyContain(s => s.Indexer == mockIndexer.Name);
|
parseResults.Should().OnlyContain(s => s.Indexer == mockIndexer.Name);
|
||||||
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.NzbTitle));
|
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
|
||||||
|
|
||||||
ExceptionVerification.ExpectedWarns(warns);
|
ExceptionVerification.ExpectedWarns(warns);
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ namespace NzbDrone.Core.Test
|
||||||
|
|
||||||
parseResults.Should().NotBeEmpty();
|
parseResults.Should().NotBeEmpty();
|
||||||
parseResults.Should().OnlyContain(s => s.Indexer == newzbinProvider.Name);
|
parseResults.Should().OnlyContain(s => s.Indexer == newzbinProvider.Name);
|
||||||
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.NzbTitle));
|
parseResults.Should().OnlyContain(s => !String.IsNullOrEmpty(s.OriginalString));
|
||||||
|
|
||||||
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
||||||
ExceptionVerification.IgnoreWarns();
|
ExceptionVerification.IgnoreWarns();
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace NzbDrone.Core.Test
|
||||||
result.SeasonNumber.Should().Be(seasonNumber);
|
result.SeasonNumber.Should().Be(seasonNumber);
|
||||||
result.EpisodeNumbers.First().Should().Be(episodeNumber);
|
result.EpisodeNumbers.First().Should().Be(episodeNumber);
|
||||||
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
||||||
|
result.OriginalString.Should().Be(postTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -84,6 +85,7 @@ namespace NzbDrone.Core.Test
|
||||||
result.EpisodeNumbers.Should().HaveCount(1);
|
result.EpisodeNumbers.Should().HaveCount(1);
|
||||||
result.SeasonNumber.Should().Be(season);
|
result.SeasonNumber.Should().Be(season);
|
||||||
result.EpisodeNumbers[0].Should().Be(episode);
|
result.EpisodeNumbers[0].Should().Be(episode);
|
||||||
|
result.OriginalString.Should().Be(path);
|
||||||
|
|
||||||
ExceptionVerification.IgnoreWarns();
|
ExceptionVerification.IgnoreWarns();
|
||||||
}
|
}
|
||||||
|
@ -162,6 +164,7 @@ namespace NzbDrone.Core.Test
|
||||||
result.EpisodeNumbers.Should().BeEquivalentTo(result.EpisodeNumbers);
|
result.EpisodeNumbers.Should().BeEquivalentTo(result.EpisodeNumbers);
|
||||||
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
||||||
result.EpisodeNumbers.Count.Should().Be(count);
|
result.EpisodeNumbers.Count.Should().Be(count);
|
||||||
|
result.OriginalString.Should().Be(postTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,7 +181,8 @@ namespace NzbDrone.Core.Test
|
||||||
var airDate = new DateTime(year, month, day);
|
var airDate = new DateTime(year, month, day);
|
||||||
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
||||||
result.AirDate.Should().Be(airDate);
|
result.AirDate.Should().Be(airDate);
|
||||||
Assert.IsNull(result.EpisodeNumbers);
|
result.EpisodeNumbers.Should().BeNull();
|
||||||
|
result.OriginalString.Should().Be(postTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -203,6 +207,7 @@ namespace NzbDrone.Core.Test
|
||||||
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
result.CleanTitle.Should().Be(Parser.NormalizeTitle(title));
|
||||||
result.EpisodeNumbers.Count.Should().Be(0);
|
result.EpisodeNumbers.Count.Should().Be(0);
|
||||||
result.FullSeason.Should().BeTrue();
|
result.FullSeason.Should().BeTrue();
|
||||||
|
result.OriginalString.Should().Be(postTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("Conan", "conan")]
|
[TestCase("Conan", "conan")]
|
||||||
|
@ -342,6 +347,7 @@ namespace NzbDrone.Core.Test
|
||||||
result.CleanTitle.Should().Be(Parser.NormalizeTitle(seriesName));
|
result.CleanTitle.Should().Be(Parser.NormalizeTitle(seriesName));
|
||||||
result.SeasonNumber.Should().Be(seasonNumber);
|
result.SeasonNumber.Should().Be(seasonNumber);
|
||||||
result.FullSeason.Should().BeTrue();
|
result.FullSeason.Should().BeTrue();
|
||||||
|
result.OriginalString.Should().Be(postTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase("5.64 GB", 6055903887)]
|
[TestCase("5.64 GB", 6055903887)]
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace NzbDrone.Core.Model
|
||||||
|
|
||||||
public string NzbUrl { get; set; }
|
public string NzbUrl { get; set; }
|
||||||
|
|
||||||
public string NzbTitle { get; set; }
|
public string OriginalString { get; set; }
|
||||||
|
|
||||||
public Series Series { get; set; }
|
public Series Series { get; set; }
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Model
|
||||||
return string.Format("{0} - S{1:00}E{2} {3}", SeriesTitle, SeasonNumber,
|
return string.Format("{0} - S{1:00}E{2} {3}", SeriesTitle, SeasonNumber,
|
||||||
String.Join("-", EpisodeNumbers), Quality);
|
String.Join("-", EpisodeNumbers), Quality);
|
||||||
|
|
||||||
return NzbTitle;
|
return OriginalString;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ namespace NzbDrone.Core
|
||||||
result = ParseTitle(fileInfo.FullName);
|
result = ParseTitle(fileInfo.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result.OriginalString = path;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,6 +104,7 @@ namespace NzbDrone.Core
|
||||||
|
|
||||||
result.Language = ParseLanguage(title);
|
result.Language = ParseLanguage(title);
|
||||||
result.Quality = ParseQuality(title);
|
result.Quality = ParseQuality(title);
|
||||||
|
result.OriginalString = title;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace NzbDrone.Core.Providers
|
||||||
history.Indexer = parseResult.Indexer;
|
history.Indexer = parseResult.Indexer;
|
||||||
history.IsProper = parseResult.Quality.Proper;
|
history.IsProper = parseResult.Quality.Proper;
|
||||||
history.Quality = parseResult.Quality.QualityType;
|
history.Quality = parseResult.Quality.QualityType;
|
||||||
history.NzbTitle = parseResult.NzbTitle;
|
history.NzbTitle = parseResult.OriginalString;
|
||||||
history.EpisodeId = episode.EpisodeId;
|
history.EpisodeId = episode.EpisodeId;
|
||||||
history.SeriesId = episode.SeriesId;
|
history.SeriesId = episode.SeriesId;
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace NzbDrone.Core.Providers
|
||||||
if (!parseResult.Series.IsDaily)
|
if (!parseResult.Series.IsDaily)
|
||||||
{
|
{
|
||||||
//Todo: Collect this as a Series we want to treat as a daily series, or possible parsing error
|
//Todo: Collect this as a Series we want to treat as a daily series, or possible parsing error
|
||||||
Logger.Warn("Found daily-style episode for non-daily series: {0}. {1}", parseResult.Series.Title, parseResult.NzbTitle);
|
Logger.Warn("Found daily-style episode for non-daily series: {0}. {1}", parseResult.Series.Title, parseResult.OriginalString);
|
||||||
return new List<Episode>();
|
return new List<Episode>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ namespace NzbDrone.Core.Providers
|
||||||
|
|
||||||
if (episodeInfo == null && autoAddNew)
|
if (episodeInfo == null && autoAddNew)
|
||||||
{
|
{
|
||||||
Logger.Info("Episode {0} doesn't exist in db. adding it now. {1}", parseResult, parseResult.NzbTitle);
|
Logger.Info("Episode {0} doesn't exist in db. adding it now. {1}", parseResult, parseResult.OriginalString);
|
||||||
episodeInfo = new Episode
|
episodeInfo = new Episode
|
||||||
{
|
{
|
||||||
SeriesId = parseResult.Series.SeriesId,
|
SeriesId = parseResult.Series.SeriesId,
|
||||||
|
@ -193,7 +193,7 @@ namespace NzbDrone.Core.Providers
|
||||||
//if still null we should add the temp episode
|
//if still null we should add the temp episode
|
||||||
if (episodeInfo == null && autoAddNew)
|
if (episodeInfo == null && autoAddNew)
|
||||||
{
|
{
|
||||||
Logger.Info("Episode {0} doesn't exist in db. adding it now. {1}", parseResult, parseResult.NzbTitle);
|
Logger.Info("Episode {0} doesn't exist in db. adding it now. {1}", parseResult, parseResult.OriginalString);
|
||||||
episodeInfo = new Episode
|
episodeInfo = new Episode
|
||||||
{
|
{
|
||||||
SeriesId = parseResult.Series.SeriesId,
|
SeriesId = parseResult.Series.SeriesId,
|
||||||
|
|
|
@ -177,7 +177,7 @@ namespace NzbDrone.Core.Providers.Indexer
|
||||||
{
|
{
|
||||||
parsedEpisode.NzbUrl = NzbDownloadUrl(item);
|
parsedEpisode.NzbUrl = NzbDownloadUrl(item);
|
||||||
parsedEpisode.Indexer = Name;
|
parsedEpisode.Indexer = Name;
|
||||||
parsedEpisode.NzbTitle = item.Title.Text;
|
parsedEpisode.OriginalString = item.Title.Text;
|
||||||
result.Add(parsedEpisode);
|
result.Add(parsedEpisode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue