Merge branch 'markus' into kay.one

pull/3113/head
kay.one 13 years ago
commit 1b2af8ea1b

@ -14,7 +14,6 @@ namespace NzbDrone.Core.Test.ProviderTests
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
public class DiskScanProviderTest : TestBase public class DiskScanProviderTest : TestBase
{ {
[Test] [Test]
public void scan_series_should_update_last_scan_date() public void scan_series_should_update_last_scan_date()
{ {
@ -38,7 +37,6 @@ namespace NzbDrone.Core.Test.ProviderTests
} }
[Test] [Test]
public void cleanup_should_skip_existing_files() public void cleanup_should_skip_existing_files()
{ {
@ -89,7 +87,6 @@ namespace NzbDrone.Core.Test.ProviderTests
} }
[Test] [Test]
public void cleanup_should_delete_none_existing_files_remove_links_to_episodes() public void cleanup_should_delete_none_existing_files_remove_links_to_episodes()
{ {
@ -131,7 +128,34 @@ namespace NzbDrone.Core.Test.ProviderTests
} }
[Test]
public void scan_series_should_log_warning_if_path_doesnt_exist_on_disk()
{
//Setup
var mocker = new AutoMoqer(MockBehavior.Strict);
var series = Builder<Series>.CreateNew()
.With(s => s.Path = @"C:\Test\TV\SeriesName\")
.Build();
mocker.GetMock<MediaFileProvider>()
.Setup(c => c.DeleteOrphaned())
.Returns(0);
mocker.GetMock<MediaFileProvider>()
.Setup(c => c.RepairLinks())
.Returns(0);
mocker.GetMock<DiskProvider>()
.Setup(c => c.FolderExists(series.Path))
.Returns(false);
//Act
mocker.Resolve<DiskScanProvider>().Scan(series, series.Path);
//Assert
mocker.VerifyAllMocks();
ExceptionVerification.ExcpectedWarns(1);
}
} }
} }

@ -58,6 +58,12 @@ namespace NzbDrone.Core.Providers
_mediaFileProvider.DeleteOrphaned(); _mediaFileProvider.DeleteOrphaned();
_mediaFileProvider.RepairLinks(); _mediaFileProvider.RepairLinks();
if (!_diskProvider.FolderExists(path))
{
Logger. Warn("Series folder doesn't exist: {0}", path);
return new List<EpisodeFile>();
}
if (_episodeProvider.GetEpisodeBySeries(series.SeriesId).Count == 0) if (_episodeProvider.GetEpisodeBySeries(series.SeriesId).Count == 0)
{ {
Logger.Debug("Series {0} has no episodes. skipping", series.Title); Logger.Debug("Series {0} has no episodes. skipping", series.Title);

@ -83,7 +83,7 @@ namespace NzbDrone.Core.Providers
continue; continue;
} }
if (folderStatus != PostDownloadStatusType.Unknown) if (folderStatus != PostDownloadStatusType.NoError)
{ {
//Retry processing on the download //Retry processing on the download
ReProcessDownload(new PostDownloadInfoModel{ Name = subfolderInfo.FullName, Status = folderStatus }); ReProcessDownload(new PostDownloadInfoModel{ Name = subfolderInfo.FullName, Status = folderStatus });

@ -26,6 +26,12 @@ namespace NzbDrone.Web.Controllers
return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet }; return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet };
} }
public JsonResult BacklogSearch()
{
_jobProvider.QueueJob(typeof(BacklogSearchJob));
return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
public JsonResult SyncEpisodesOnDisk(int seriesId) public JsonResult SyncEpisodesOnDisk(int seriesId)
{ {
//Syncs the episodes on disk for the specified series //Syncs the episodes on disk for the specified series

@ -752,9 +752,6 @@
<ItemGroup> <ItemGroup>
<Content Include="Views\Series\EditorTemplates\SeriesModel.cshtml" /> <Content Include="Views\Series\EditorTemplates\SeriesModel.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Views\Series\SingleSeason.cshtml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\AddSeries\ExistingSeries.cshtml" /> <Content Include="Views\AddSeries\ExistingSeries.cshtml" />
</ItemGroup> </ItemGroup>

@ -7,6 +7,13 @@ Missing
<link href="../../Content/Grid.css" rel="stylesheet" type="text/css" /> <link href="../../Content/Grid.css" rel="stylesheet" type="text/css" />
@section ActionMenu{
<ul class="sub-menu">
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null)</li>
<li>@Ajax.ActionLink("Start Backlog Search", "BacklogSearch", "Command", null, null)</li>
</ul>
}
@section MainContent{ @section MainContent{
@{Html.Telerik().Grid<MissingEpisodeModel>().Name("missing") @{Html.Telerik().Grid<MissingEpisodeModel>().Name("missing")
.TableHtmlAttributes(new { @class = "Grid" }) .TableHtmlAttributes(new { @class = "Grid" })

@ -1,18 +0,0 @@
@using NzbDrone.Web.Helpers;
@using NzbDrone.Web.Models;
@model SeasonEditModel
@using (Html.BeginCollectionItem("SeasonEditor"))
{
var idClean = ViewData.TemplateInfo.HtmlFieldPrefix.Replace('[', '_').Replace(']', '_');
<fieldset style="display: inline; border-color: lightgrey; width: 22.8%; margin-bottom: 2px; margin-right: 0px; margin-left: 0px; padding-bottom: 1px; padding-top: 1px; padding-left: 2px; padding-right: 2px;">
@Html.DisplayFor(m => m.SeasonString)
<span style="float: right;">@Html.CheckBoxFor(m => m.Monitored, new { @class = "chkbox" })</span>
@Html.HiddenFor(m => m.SeriesId)
@Html.HiddenFor(m => m.SeasonNumber)
@Html.Hidden(idClean, new { @class = "cleanId", })
</fieldset>
}
Loading…
Cancel
Save