Merge remote-tracking branch 'origin/master' into backbone
This commit is contained in:
commit
461d55f15c
|
@ -131,6 +131,11 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
||||||
tvdbSeries.Episodes.ForEach(e => e.Writer = new List<string>());
|
tvdbSeries.Episodes.ForEach(e => e.Writer = new List<string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void WithoutThumbnails()
|
||||||
|
{
|
||||||
|
tvdbSeries.Episodes.ForEach(e => e.BannerPath = String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_not_blowup()
|
public void should_not_blowup()
|
||||||
{
|
{
|
||||||
|
@ -177,5 +182,15 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
||||||
WithNoWriters();
|
WithNoWriters();
|
||||||
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_download_nfo_even_if_thumbnail_is_missing()
|
||||||
|
{
|
||||||
|
WithSingleEpisodeFile();
|
||||||
|
WithoutThumbnails();
|
||||||
|
Mocker.Resolve<Xbmc>().CreateForEpisodeFile(episodeFile, tvdbSeries);
|
||||||
|
|
||||||
|
Mocker.GetMock<DiskProvider>().Verify(v => v.WriteAllText(It.IsAny<String>(), It.IsAny<String>()), Times.Once());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -165,5 +165,34 @@ namespace NzbDrone.Core.Test.ProviderTests.Metadata
|
||||||
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
||||||
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season-specials.tbn")), Times.Exactly(1));
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.Is<string>(s => s.Contains("banners")), It.IsRegex(@"season-specials.tbn")), Times.Exactly(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_not_try_to_download_fanart_if_fanart_path_is_empty()
|
||||||
|
{
|
||||||
|
WithUseBanners();
|
||||||
|
tvdbSeries.FanartPath = String.Empty;
|
||||||
|
|
||||||
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
||||||
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.IsAny<String>(), Path.Combine(series.Path, "fanart.jpg")), Times.Never());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_not_try_to_download_banner_if_banner_path_is_empty()
|
||||||
|
{
|
||||||
|
WithUseBanners();
|
||||||
|
tvdbSeries.BannerPath = String.Empty;
|
||||||
|
|
||||||
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
||||||
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.IsAny<String>(), Path.Combine(series.Path, "folder.jpg")), Times.Never());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_not_try_to_download_poster_if_poster_path_is_empty()
|
||||||
|
{
|
||||||
|
tvdbSeries.PosterPath = String.Empty;
|
||||||
|
|
||||||
|
Mocker.Resolve<Xbmc>().CreateForSeries(series, tvdbSeries);
|
||||||
|
Mocker.GetMock<BannerProvider>().Verify(v => v.Download(It.IsAny<String>(), Path.Combine(series.Path, "folder.jpg")), Times.Never());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -68,27 +68,40 @@ namespace NzbDrone.Core.Providers.Metadata
|
||||||
_diskProvider.WriteAllText(Path.Combine(series.Path, "tvshow.nfo"), doc.ToString());
|
_diskProvider.WriteAllText(Path.Combine(series.Path, "tvshow.nfo"), doc.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(String.IsNullOrWhiteSpace(tvDbSeries.FanartPath))
|
||||||
|
{
|
||||||
|
_logger.Debug("Fanart does not exist for series: {0}, skipping.", series.Title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (!_diskProvider.FileExists(Path.Combine(series.Path, "fanart.jpg")))
|
if (!_diskProvider.FileExists(Path.Combine(series.Path, "fanart.jpg")))
|
||||||
{
|
{
|
||||||
_logger.Debug("Downloading fanart for: {0}", series.Title);
|
_logger.Debug("Downloading fanart for: {0}", series.Title);
|
||||||
_bannerProvider.Download(tvDbSeries.FanartPath, Path.Combine(series.Path, "fanart.jpg"));
|
_bannerProvider.Download(tvDbSeries.FanartPath, Path.Combine(series.Path, "fanart.jpg"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_diskProvider.FileExists(Path.Combine(series.Path, "folder.jpg")))
|
if (!_diskProvider.FileExists(Path.Combine(series.Path, "folder.jpg")))
|
||||||
{
|
{
|
||||||
if(_configProvider.MetadataUseBanners)
|
if(_configProvider.MetadataUseBanners)
|
||||||
|
{
|
||||||
|
if(!String.IsNullOrWhiteSpace(tvDbSeries.BannerPath))
|
||||||
{
|
{
|
||||||
_logger.Debug("Downloading series banner for: {0}", series.Title);
|
_logger.Debug("Downloading series banner for: {0}", series.Title);
|
||||||
_bannerProvider.Download(tvDbSeries.BannerPath, Path.Combine(series.Path, "folder.jpg"));
|
_bannerProvider.Download(tvDbSeries.BannerPath, Path.Combine(series.Path, "folder.jpg"));
|
||||||
|
}
|
||||||
|
|
||||||
_logger.Debug("Downloading Season banners for {0}", series.Title);
|
_logger.Debug("Downloading Season banners for {0}", series.Title);
|
||||||
DownloadSeasonThumbnails(series, tvDbSeries, TvdbSeasonBanner.Type.seasonwide);
|
DownloadSeasonThumbnails(series, tvDbSeries, TvdbSeasonBanner.Type.seasonwide);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(!String.IsNullOrWhiteSpace(tvDbSeries.PosterPath))
|
||||||
{
|
{
|
||||||
_logger.Debug("Downloading series thumbnail for: {0}", series.Title);
|
_logger.Debug("Downloading series thumbnail for: {0}", series.Title);
|
||||||
_bannerProvider.Download(tvDbSeries.PosterPath, Path.Combine(series.Path, "folder.jpg"));
|
_bannerProvider.Download(tvDbSeries.PosterPath, Path.Combine(series.Path, "folder.jpg"));
|
||||||
|
}
|
||||||
|
|
||||||
_logger.Debug("Downloading Season posters for {0}", series.Title);
|
_logger.Debug("Downloading Season posters for {0}", series.Title);
|
||||||
DownloadSeasonThumbnails(series, tvDbSeries, TvdbSeasonBanner.Type.season);
|
DownloadSeasonThumbnails(series, tvDbSeries, TvdbSeasonBanner.Type.season);
|
||||||
|
@ -115,15 +128,19 @@ namespace NzbDrone.Core.Providers.Metadata
|
||||||
if(episodeFileThumbnail == null || String.IsNullOrWhiteSpace(episodeFileThumbnail.BannerPath))
|
if(episodeFileThumbnail == null || String.IsNullOrWhiteSpace(episodeFileThumbnail.BannerPath))
|
||||||
{
|
{
|
||||||
_logger.Debug("No thumbnail is available for this episode");
|
_logger.Debug("No thumbnail is available for this episode");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
if (!_diskProvider.FileExists(episodeFile.Path.Replace(Path.GetExtension(episodeFile.Path), ".tbn")))
|
if (!_diskProvider.FileExists(episodeFile.Path.Replace(Path.GetExtension(episodeFile.Path), ".tbn")))
|
||||||
{
|
{
|
||||||
_logger.Debug("Downloading episode thumbnail for: {0}", episodeFile.EpisodeFileId);
|
_logger.Debug("Downloading episode thumbnail for: {0}", episodeFile.EpisodeFileId);
|
||||||
_bannerProvider.Download(episodeFileThumbnail.BannerPath,
|
_bannerProvider.Download(episodeFileThumbnail.BannerPath,
|
||||||
episodeFile.Path.Replace(Path.GetExtension(episodeFile.Path), ".tbn"));
|
episodeFile.Path.Replace(Path.GetExtension(episodeFile.Path), ".tbn"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_logger.Debug("Generating filename.nfo for: {0}", episodeFile.EpisodeFileId);
|
_logger.Debug("Generating filename.nfo for: {0}", episodeFile.EpisodeFileId);
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@
|
||||||
<WebProjectProperties>
|
<WebProjectProperties>
|
||||||
<UseIIS>False</UseIIS>
|
<UseIIS>False</UseIIS>
|
||||||
<AutoAssignPort>True</AutoAssignPort>
|
<AutoAssignPort>True</AutoAssignPort>
|
||||||
<DevelopmentServerPort>62182</DevelopmentServerPort>
|
<DevelopmentServerPort>32122</DevelopmentServerPort>
|
||||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||||
<IISUrl>http://localhost:62182/</IISUrl>
|
<IISUrl>http://localhost:62182/</IISUrl>
|
||||||
<NTLMAuthentication>False</NTLMAuthentication>
|
<NTLMAuthentication>False</NTLMAuthentication>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Dynamic;
|
using System.Linq.Dynamic;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
@ -45,7 +46,7 @@ namespace NzbDrone.Web.Controllers
|
||||||
Quality = h.Quality.ToString(),
|
Quality = h.Quality.ToString(),
|
||||||
IsProper = h.IsProper,
|
IsProper = h.IsProper,
|
||||||
Date = h.Date.ToString(),
|
Date = h.Date.ToString(),
|
||||||
DateSorter = h.Date.ToString("MM/dd/yyyy h:mm:ss tt"),
|
DateSorter = h.Date.ToString("o", CultureInfo.InvariantCulture),
|
||||||
Indexer = h.Indexer,
|
Indexer = h.Indexer,
|
||||||
EpisodeId = h.EpisodeId,
|
EpisodeId = h.EpisodeId,
|
||||||
NzbInfoUrl = h.NzbInfoUrl,
|
NzbInfoUrl = h.NzbInfoUrl,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
@ -34,8 +35,8 @@ namespace NzbDrone.Web.Controllers
|
||||||
Overview = e.Overview,
|
Overview = e.Overview,
|
||||||
SeriesTitle = e.Series.Title,
|
SeriesTitle = e.Series.Title,
|
||||||
SeriesTitleSorter = SortHelper.SkipArticles(e.Series.Title),
|
SeriesTitleSorter = SortHelper.SkipArticles(e.Series.Title),
|
||||||
AirDate = e.AirDate.Value.ToString("MM/dd/yyyy"),
|
AirDateSorter = e.AirDate.Value.ToString("o", CultureInfo.InvariantCulture),
|
||||||
AirDateString = e.AirDate.Value.ToBestDateString()
|
AirDate = e.AirDate.Value.ToBestDateString()
|
||||||
});
|
});
|
||||||
|
|
||||||
JsConfig.IncludeNullValues = true;
|
JsConfig.IncludeNullValues = true;
|
||||||
|
|
|
@ -225,7 +225,7 @@ namespace NzbDrone.Web.Controllers
|
||||||
EpisodeCount = s.EpisodeCount,
|
EpisodeCount = s.EpisodeCount,
|
||||||
EpisodeFileCount = s.EpisodeFileCount,
|
EpisodeFileCount = s.EpisodeFileCount,
|
||||||
NextAiring = s.NextAiring == null ? String.Empty : s.NextAiring.Value.ToBestDateString(),
|
NextAiring = s.NextAiring == null ? String.Empty : s.NextAiring.Value.ToBestDateString(),
|
||||||
NextAiringSorter = s.NextAiring == null ? "12/31/9999" : s.NextAiring.Value.ToString("MM/dd/yyyy"),
|
NextAiringSorter = s.NextAiring == null ? new DateTime(9999, 12, 31).ToString("o", CultureInfo.InvariantCulture) : s.NextAiring.Value.ToString("o", CultureInfo.InvariantCulture),
|
||||||
AirTime = s.AirTimes,
|
AirTime = s.AirTimes,
|
||||||
CustomStartDate = s.CustomStartDate.HasValue ? s.CustomStartDate.Value.ToString("yyyy-MM-dd") : String.Empty
|
CustomStartDate = s.CustomStartDate.HasValue ? s.CustomStartDate.Value.ToString("yyyy-MM-dd") : String.Empty
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
|
@ -12,8 +12,8 @@ namespace NzbDrone.Web.Models
|
||||||
public string SeriesTitleSorter { get; set; }
|
public string SeriesTitleSorter { get; set; }
|
||||||
public string EpisodeNumbering { get; set; }
|
public string EpisodeNumbering { get; set; }
|
||||||
public string EpisodeTitle { get; set; }
|
public string EpisodeTitle { get; set; }
|
||||||
|
public string AirDateSorter { get; set; }
|
||||||
public string AirDate { get; set; }
|
public string AirDate { get; set; }
|
||||||
public string AirDateString { get; set; }
|
|
||||||
public string Overview { get; set; }
|
public string Overview { get; set; }
|
||||||
public string Details { get; set; }
|
public string Details { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
function airDate (source, type, val) {
|
function airDate (source, type, val) {
|
||||||
// 'display' and 'filter' use our fancy naming
|
// 'display' and 'filter' use our fancy naming
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
return source["AirDateString"];
|
return source["AirDate"];
|
||||||
}
|
}
|
||||||
// 'sort' and 'type' both just use the raw data
|
// 'sort' and 'type' both just use the raw data
|
||||||
return source["AirDate"];
|
return source["AirDateSorter"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function actions(row) {
|
function actions(row) {
|
||||||
|
|
Loading…
Reference in New Issue