1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 20:42:37 +01:00

Merge branch 'markus' into kay.one

This commit is contained in:
kay.one 2011-10-22 15:23:21 -07:00
commit 1b2af8ea1b
7 changed files with 47 additions and 25 deletions

View File

@ -14,7 +14,6 @@ namespace NzbDrone.Core.Test.ProviderTests
// ReSharper disable InconsistentNaming
public class DiskScanProviderTest : TestBase
{
[Test]
public void scan_series_should_update_last_scan_date()
{
@ -38,7 +37,6 @@ public void scan_series_should_update_last_scan_date()
}
[Test]
public void cleanup_should_skip_existing_files()
{
@ -89,7 +87,6 @@ public void cleanup_should_delete_none_existing_files()
}
[Test]
public void cleanup_should_delete_none_existing_files_remove_links_to_episodes()
{
@ -131,7 +128,34 @@ public void cleanup_should_delete_none_existing_files_remove_links_to_episodes()
}
[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);
}
}
}

View File

@ -58,6 +58,12 @@ public virtual List<EpisodeFile> Scan(Series series, string path)
_mediaFileProvider.DeleteOrphaned();
_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)
{
Logger.Debug("Series {0} has no episodes. skipping", series.Title);

View File

@ -83,7 +83,7 @@ public virtual void ProcessDropFolder(string dropFolder)
continue;
}
if (folderStatus != PostDownloadStatusType.Unknown)
if (folderStatus != PostDownloadStatusType.NoError)
{
//Retry processing on the download
ReProcessDownload(new PostDownloadInfoModel{ Name = subfolderInfo.FullName, Status = folderStatus });

View File

@ -26,6 +26,12 @@ public JsonResult RssSync()
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)
{
//Syncs the episodes on disk for the specified series

View File

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

View File

@ -7,6 +7,13 @@ Missing
<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{
@{Html.Telerik().Grid<MissingEpisodeModel>().Name("missing")
.TableHtmlAttributes(new { @class = "Grid" })

View File

@ -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>
}