Empty directors and writers won't blowup
This commit is contained in:
parent
c0b81a8971
commit
2982e79065
|
@ -121,6 +121,16 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|||
.Returns(episodes.ToList());
|
||||
}
|
||||
|
||||
private void WithNoDirectors()
|
||||
{
|
||||
tvdbSeries.Episodes.ForEach(e => e.Directors = new List<string>());
|
||||
}
|
||||
|
||||
private void WithNoWriters()
|
||||
{
|
||||
tvdbSeries.Episodes.ForEach(e => e.Writer = new List<string>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_blowup()
|
||||
{
|
||||
|
@ -151,5 +161,21 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
|||
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
||||
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(tvdbSeries.Episodes.First().BannerPath, episodeFile.Path.Replace("avi", "tbn")), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_blowup_when_director_is_not_found()
|
||||
{
|
||||
WithSingleEpisodeFile();
|
||||
WithNoDirectors();
|
||||
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_blowup_when_writer_is_not_found()
|
||||
{
|
||||
WithSingleEpisodeFile();
|
||||
WithNoWriters();
|
||||
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -155,8 +155,8 @@ namespace NzbDrone.Core.Providers.Metadata
|
|||
details.Add(new XElement("displayepisode"));
|
||||
details.Add(new XElement("thumb", "http://www.thetvdb.com/banners/" + tvdbEpisode.BannerPath));
|
||||
details.Add(new XElement("watched", "false"));
|
||||
details.Add(new XElement("credits", tvdbEpisode.Writer.First()));
|
||||
details.Add(new XElement("director", tvdbEpisode.Directors.First()));
|
||||
details.Add(new XElement("credits", tvdbEpisode.Writer.FirstOrDefault()));
|
||||
details.Add(new XElement("director", tvdbEpisode.Directors.FirstOrDefault()));
|
||||
details.Add(new XElement("rating", tvDbSeries.Rating));
|
||||
|
||||
foreach(var actor in tvdbEpisode.GuestStars)
|
||||
|
|
Loading…
Reference in New Issue