BacklogSetting refactoring.

This commit is contained in:
Mark McDowall 2012-01-25 17:02:21 -08:00
parent 3a5d99921e
commit 02cb12bdb8
15 changed files with 75 additions and 76 deletions

View File

@ -57,7 +57,7 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(1) var episodes = Builder<Episode>.CreateListOfSize(1)
@ -93,7 +93,7 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
@ -129,7 +129,7 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
@ -169,7 +169,7 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(5) var episodes = Builder<Episode>.CreateListOfSize(5)
@ -210,12 +210,12 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var series2 = Builder<Series>.CreateNew() var series2 = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(10) var episodes = Builder<Episode>.CreateListOfSize(10)
@ -260,10 +260,10 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = false) .With(s => s.Monitored = false)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(11) var episodes = Builder<Episode>.CreateListOfSize(11)
@ -295,13 +295,13 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(3) var series = Builder<Series>.CreateListOfSize(3)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Disable) .With(s => s.BacklogSetting = BacklogSettingType.Disable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Inherit) .With(s => s.BacklogSetting = BacklogSettingType.Inherit)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(12) var episodes = Builder<Episode>.CreateListOfSize(12)
@ -323,9 +323,9 @@ namespace NzbDrone.Core.Test.JobTests
//Assert //Assert
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Enable); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Enable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Disable); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Disable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Inherit); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Inherit);
} }
[Test] [Test]
@ -335,13 +335,13 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(3) var series = Builder<Series>.CreateListOfSize(3)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Disable) .With(s => s.BacklogSetting = BacklogSettingType.Disable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Inherit) .With(s => s.BacklogSetting = BacklogSettingType.Inherit)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(12) var episodes = Builder<Episode>.CreateListOfSize(12)
@ -363,9 +363,9 @@ namespace NzbDrone.Core.Test.JobTests
//Assert //Assert
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Enable); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Enable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Disable); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Disable);
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Inherit); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Inherit);
} }
} }
} }

View File

@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateNew() var series = Builder<Series>.CreateNew()
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
//Setup //Setup
@ -104,10 +104,10 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(2) var series = Builder<Series>.CreateListOfSize(2)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = false) .With(s => s.Monitored = false)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(11) var episodes = Builder<Episode>.CreateListOfSize(11)
@ -139,13 +139,13 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(3) var series = Builder<Series>.CreateListOfSize(3)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Disable) .With(s => s.BacklogSetting = BacklogSettingType.Disable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Inherit) .With(s => s.BacklogSetting = BacklogSettingType.Inherit)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(12) var episodes = Builder<Episode>.CreateListOfSize(12)
@ -167,9 +167,9 @@ namespace NzbDrone.Core.Test.JobTests
//Assert //Assert
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Enable); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Enable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Disable); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Disable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Inherit); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Inherit);
} }
[Test] [Test]
@ -179,13 +179,13 @@ namespace NzbDrone.Core.Test.JobTests
var series = Builder<Series>.CreateListOfSize(3) var series = Builder<Series>.CreateListOfSize(3)
.TheFirst(1) .TheFirst(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Disable) .With(s => s.BacklogSetting = BacklogSettingType.Disable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Enable) .With(s => s.BacklogSetting = BacklogSettingType.Enable)
.TheNext(1) .TheNext(1)
.With(s => s.Monitored = true) .With(s => s.Monitored = true)
.With(s => s.BacklogStatus = BacklogStatusType.Inherit) .With(s => s.BacklogSetting = BacklogSettingType.Inherit)
.Build(); .Build();
var episodes = Builder<Episode>.CreateListOfSize(12) var episodes = Builder<Episode>.CreateListOfSize(12)
@ -207,9 +207,9 @@ namespace NzbDrone.Core.Test.JobTests
//Assert //Assert
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Enable); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Enable);
result.Should().NotContain(s => s.Series.BacklogStatus == BacklogStatusType.Disable); result.Should().NotContain(s => s.Series.BacklogSetting == BacklogSettingType.Disable);
result.Should().Contain(s => s.Series.BacklogStatus == BacklogStatusType.Inherit); result.Should().Contain(s => s.Series.BacklogSetting == BacklogSettingType.Inherit);
} }
} }

View File

@ -8,8 +8,7 @@ namespace NzbDrone.Core.Datastore.Migrations
{ {
protected override void MainDbUpgrade() protected override void MainDbUpgrade()
{ {
Database.AddColumn("Series", "BacklogStatus", DbType.Int32, ColumnProperty.Null); Database.AddColumn("Series", "BacklogSetting", DbType.Int32, ColumnProperty.Null);
Database.ExecuteNonQuery("UPDATE Series SET BacklogStatus = 2");
} }
} }
} }

View File

@ -92,7 +92,7 @@ namespace NzbDrone.Core.Jobs
{ {
Logger.Trace("Backlog searching is not enabled, only running for explicitly enabled series."); Logger.Trace("Backlog searching is not enabled, only running for explicitly enabled series.");
return _episodeProvider.EpisodesWithoutFiles(true).Where(e => return _episodeProvider.EpisodesWithoutFiles(true).Where(e =>
e.Series.BacklogStatus == BacklogStatusType.Enable && e.Series.BacklogSetting == BacklogSettingType.Enable &&
e.Series.Monitored e.Series.Monitored
).ToList(); ).ToList();
} }
@ -101,7 +101,7 @@ namespace NzbDrone.Core.Jobs
{ {
Logger.Trace("Backlog searching is enabled, skipping explicity disabled series."); Logger.Trace("Backlog searching is enabled, skipping explicity disabled series.");
return _episodeProvider.EpisodesWithoutFiles(true).Where(e => return _episodeProvider.EpisodesWithoutFiles(true).Where(e =>
e.Series.BacklogStatus != BacklogStatusType.Disable && e.Series.BacklogSetting != BacklogSettingType.Disable &&
e.Series.Monitored e.Series.Monitored
).ToList(); ).ToList();
} }

View File

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Jobs
Logger.Trace("Backlog searching is not enabled, only running for explicitly enabled series."); Logger.Trace("Backlog searching is not enabled, only running for explicitly enabled series.");
return _episodeProvider.EpisodesWithoutFiles(true).Where(e => return _episodeProvider.EpisodesWithoutFiles(true).Where(e =>
e.AirDate >= DateTime.Today.AddDays(-30) && e.AirDate >= DateTime.Today.AddDays(-30) &&
e.Series.BacklogStatus == BacklogStatusType.Enable && e.Series.BacklogSetting == BacklogSettingType.Enable &&
e.Series.Monitored e.Series.Monitored
).ToList(); ).ToList();
} }
@ -64,7 +64,7 @@ namespace NzbDrone.Core.Jobs
Logger.Trace("Backlog searching is enabled, skipping explicity disabled series."); Logger.Trace("Backlog searching is enabled, skipping explicity disabled series.");
return _episodeProvider.EpisodesWithoutFiles(true).Where(e => return _episodeProvider.EpisodesWithoutFiles(true).Where(e =>
e.AirDate >= DateTime.Today.AddDays(-30) && e.AirDate >= DateTime.Today.AddDays(-30) &&
e.Series.BacklogStatus != BacklogStatusType.Disable && e.Series.BacklogSetting != BacklogSettingType.Disable &&
e.Series.Monitored e.Series.Monitored
).ToList(); ).ToList();
} }

View File

@ -0,0 +1,9 @@
namespace NzbDrone.Core.Model
{
public enum BacklogSettingType
{
Inherit = 0,
Enable = 1,
Disable = 2
}
}

View File

@ -1,9 +0,0 @@
namespace NzbDrone.Core.Model
{
public enum BacklogStatusType
{
Disable = 0,
Enable = 1,
Inherit = 2
}
}

View File

@ -229,7 +229,7 @@
<Compile Include="Datastore\PetaPoco\PetaPoco.cs" /> <Compile Include="Datastore\PetaPoco\PetaPoco.cs" />
<Compile Include="Model\AtomicParsleyTitleType.cs" /> <Compile Include="Model\AtomicParsleyTitleType.cs" />
<Compile Include="Model\ConnectionInfoModel.cs" /> <Compile Include="Model\ConnectionInfoModel.cs" />
<Compile Include="Model\BacklogStatusType.cs" /> <Compile Include="Model\BacklogSettingType.cs" />
<Compile Include="Model\PostDownloadStatusType.cs" /> <Compile Include="Model\PostDownloadStatusType.cs" />
<Compile Include="Model\JobQueueItem.cs" /> <Compile Include="Model\JobQueueItem.cs" />
<Compile Include="Model\LanguageType.cs" /> <Compile Include="Model\LanguageType.cs" />

View File

@ -46,7 +46,7 @@ namespace NzbDrone.Core.Providers
{ {
var series = _database var series = _database
.Fetch<Series, QualityProfile>(@"SELECT Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek,Series.AirTimes, .Fetch<Series, QualityProfile>(@"SELECT Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek,Series.AirTimes,
Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogStatus, Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogSetting,
SUM(CASE WHEN Ignored = 0 AND Airdate <= @0 THEN 1 ELSE 0 END) AS EpisodeCount, SUM(CASE WHEN Ignored = 0 AND Airdate <= @0 THEN 1 ELSE 0 END) AS EpisodeCount,
SUM(CASE WHEN Episodes.Ignored = 0 AND Episodes.EpisodeFileId > 0 AND Episodes.AirDate <= @0 THEN 1 ELSE 0 END) as EpisodeFileCount, SUM(CASE WHEN Episodes.Ignored = 0 AND Episodes.EpisodeFileId > 0 AND Episodes.AirDate <= @0 THEN 1 ELSE 0 END) as EpisodeFileCount,
MAX(Episodes.SeasonNumber) as SeasonCount, MIN(CASE WHEN AirDate < @0 OR Ignored = 1 THEN NULL ELSE AirDate END) as NextAiring, MAX(Episodes.SeasonNumber) as SeasonCount, MIN(CASE WHEN AirDate < @0 OR Ignored = 1 THEN NULL ELSE AirDate END) as NextAiring,
@ -56,7 +56,7 @@ namespace NzbDrone.Core.Providers
LEFT JOIN Episodes ON Series.SeriesId = Episodes.SeriesId LEFT JOIN Episodes ON Series.SeriesId = Episodes.SeriesId
WHERE Series.LastInfoSync IS NOT NULL WHERE Series.LastInfoSync IS NOT NULL
GROUP BY Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek,Series.AirTimes, GROUP BY Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek,Series.AirTimes,
Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogStatus, Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogSetting,
QualityProfiles.QualityProfileId, QualityProfiles.Name, QualityProfiles.Cutoff, QualityProfiles.SonicAllowed", DateTime.Today); QualityProfiles.QualityProfileId, QualityProfiles.Name, QualityProfiles.Cutoff, QualityProfiles.SonicAllowed", DateTime.Today);
return series; return series;
@ -120,7 +120,7 @@ namespace NzbDrone.Core.Providers
repoSeries.QualityProfileId = _configProvider.DefaultQualityProfile; repoSeries.QualityProfileId = _configProvider.DefaultQualityProfile;
repoSeries.SeasonFolder = _configProvider.UseSeasonFolder; repoSeries.SeasonFolder = _configProvider.UseSeasonFolder;
repoSeries.BacklogStatus = BacklogStatusType.Inherit; repoSeries.BacklogSetting = BacklogSettingType.Inherit;
_database.Insert(repoSeries); _database.Insert(repoSeries);
} }
@ -212,7 +212,7 @@ namespace NzbDrone.Core.Providers
series.QualityProfileId = edited.QualityProfileId; series.QualityProfileId = edited.QualityProfileId;
series.Monitored = edited.Monitored; series.Monitored = edited.Monitored;
series.SeasonFolder = edited.SeasonFolder; series.SeasonFolder = edited.SeasonFolder;
series.BacklogStatus = edited.BacklogStatus; series.BacklogSetting = edited.BacklogSetting;
series.Path = edited.Path; series.Path = edited.Path;
} }

View File

@ -44,7 +44,7 @@ namespace NzbDrone.Core.Repository
public bool IsDaily { get; set; } public bool IsDaily { get; set; }
public BacklogStatusType BacklogStatus { get; set; } public BacklogSettingType BacklogSetting { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this <see cref="Series"/> is hidden. /// Gets or sets a value indicating whether this <see cref="Series"/> is hidden.

View File

@ -51,12 +51,12 @@ namespace NzbDrone.Web.Controllers
var backlogStatusTypes = new List<KeyValuePair<int, string>>(); var backlogStatusTypes = new List<KeyValuePair<int, string>>();
foreach (BacklogStatusType backlogStatusType in Enum.GetValues(typeof(BacklogStatusType))) foreach (BacklogSettingType backlogStatusType in Enum.GetValues(typeof(BacklogSettingType)))
{ {
backlogStatusTypes.Add(new KeyValuePair<int, string>((int)backlogStatusType, backlogStatusType.ToString())); backlogStatusTypes.Add(new KeyValuePair<int, string>((int)backlogStatusType, backlogStatusType.ToString()));
} }
ViewData["BacklogStatusSelectList"] = new SelectList(backlogStatusTypes, "Key", "Value"); ViewData["BacklogSettingSelectList"] = new SelectList(backlogStatusTypes, "Key", "Value");
return View(); return View();
} }
@ -70,14 +70,14 @@ namespace NzbDrone.Web.Controllers
[AcceptVerbs(HttpVerbs.Post)] [AcceptVerbs(HttpVerbs.Post)]
[GridAction] [GridAction]
public ActionResult _SaveAjaxSeriesEditing(int id, string path, bool monitored, bool seasonFolder, int qualityProfileId, int backlogStatus) public ActionResult _SaveAjaxSeriesEditing(int id, string path, bool monitored, bool seasonFolder, int qualityProfileId, int backlogSetting)
{ {
var oldSeries = _seriesProvider.GetSeries(id); var oldSeries = _seriesProvider.GetSeries(id);
oldSeries.Monitored = monitored; oldSeries.Monitored = monitored;
oldSeries.SeasonFolder = seasonFolder; oldSeries.SeasonFolder = seasonFolder;
oldSeries.QualityProfileId = qualityProfileId; oldSeries.QualityProfileId = qualityProfileId;
oldSeries.Path = path; oldSeries.Path = path;
oldSeries.BacklogStatus = (BacklogStatusType)backlogStatus; oldSeries.BacklogSetting = (BacklogSettingType)backlogSetting;
_seriesProvider.UpdateSeries(oldSeries); _seriesProvider.UpdateSeries(oldSeries);
@ -179,18 +179,18 @@ namespace NzbDrone.Web.Controllers
}, "Key", "Value" }, "Key", "Value"
); );
var backlogStatusTypes = new List<KeyValuePair<int, string>>(); var backlogSettingTypes = new List<KeyValuePair<int, string>>();
foreach (BacklogStatusType backlogStatusType in Enum.GetValues(typeof(BacklogStatusType))) foreach (BacklogSettingType backlogSettingType in Enum.GetValues(typeof(BacklogSettingType)))
{ {
backlogStatusTypes.Add(new KeyValuePair<int, string>((int)backlogStatusType, backlogStatusType.ToString())); backlogSettingTypes.Add(new KeyValuePair<int, string>((int)backlogSettingType, backlogSettingType.ToString()));
} }
ViewData["BacklogStatusTypes"] = backlogStatusTypes; ViewData["BacklogSettingTypes"] = backlogSettingTypes;
var masterBacklogList = backlogStatusTypes.ToList(); var masterBacklogList = backlogSettingTypes.ToList();
masterBacklogList.Insert(0, new KeyValuePair<int, string>(-10, "Unchanged")); masterBacklogList.Insert(0, new KeyValuePair<int, string>(-10, "Unchanged"));
ViewData["MasterBacklogStatusSelectList"] = new SelectList(masterBacklogList, "Key", "Value"); ViewData["MasterBacklogSettingSelectList"] = new SelectList(masterBacklogList, "Key", "Value");
var series = _seriesProvider.GetAllSeries().OrderBy(o => SortHelper.SkipArticles(o.Title)); var series = _seriesProvider.GetAllSeries().OrderBy(o => SortHelper.SkipArticles(o.Title));
@ -221,7 +221,7 @@ namespace NzbDrone.Web.Controllers
QualityProfileId = s.QualityProfileId, QualityProfileId = s.QualityProfileId,
QualityProfileName = s.QualityProfile.Name, QualityProfileName = s.QualityProfile.Name,
SeasonFolder = s.SeasonFolder, SeasonFolder = s.SeasonFolder,
BacklogStatus = (int)s.BacklogStatus, BacklogSetting = (int)s.BacklogSetting,
Status = s.Status, Status = s.Status,
SeasonsCount = s.SeasonCount, SeasonsCount = s.SeasonCount,
EpisodeCount = s.EpisodeCount, EpisodeCount = s.EpisodeCount,

View File

@ -44,8 +44,8 @@ namespace NzbDrone.Web.Models
[Description("Should NzbDrone download episodes for this series?")] [Description("Should NzbDrone download episodes for this series?")]
public bool Monitored { get; set; } public bool Monitored { get; set; }
[DisplayName("Backlog Status")] [DisplayName("Backlog Setting")]
[Description("Should NzbDrone download past missing episodes?")] [Description("Should NzbDrone download past missing episodes?")]
public int BacklogStatus { get; set; } public int BacklogSetting { get; set; }
} }
} }

View File

@ -30,9 +30,9 @@
<span class="small">@Html.DescriptionFor(m => m.Path)</span> <span class="small">@Html.DescriptionFor(m => m.Path)</span>
</label> </label>
@Html.TextBoxFor(m => m.Path, new { @class = "inputClass" }) @Html.TextBoxFor(m => m.Path, new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.BacklogStatus) <label class="labelClass">@Html.LabelFor(m => m.BacklogSetting)
<span class="small">@Html.DescriptionFor(m => m.BacklogStatus)</span> <span class="small">@Html.DescriptionFor(m => m.BacklogSetting)</span>
</label> </label>
@Html.DropDownListFor(m => m.BacklogStatus, (SelectList)ViewData["BacklogStatusSelectList"], new { @class = "inputClass" }) @Html.DropDownListFor(m => m.BacklogSetting, (SelectList)ViewData["BacklogSettingSelectList"], new { @class = "inputClass" })
</div> </div>
</div> </div>

View File

@ -99,7 +99,7 @@
<label class="labelClass">Backlog Status <label class="labelClass">Backlog Status
<span class="small">Should NzbDrone perform backlog searches for this series?</span> <span class="small">Should NzbDrone perform backlog searches for this series?</span>
</label> </label>
@Html.DropDownList("masterBacklogStatus", (SelectList)ViewData["MasterBacklogStatusSelectList"], new { @class = "inputClass" }) @Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "inputClass" })
</div> </div>
</div> </div>
</div> </div>
@ -127,7 +127,7 @@
var profileId = $('#masterQualitySelector').val(); var profileId = $('#masterQualitySelector').val();
var monitored = $('#masterMonitored').val(); var monitored = $('#masterMonitored').val();
var seasonFolder = $('#masterSeasonFolder').val(); var seasonFolder = $('#masterSeasonFolder').val();
var backlogStatus = $('#masterBacklogStatus').val(); var backlogStatus = $('#masterBacklogSetting').val();
var selected = $('.editToggle:checked'); var selected = $('.editToggle:checked');
@ -153,7 +153,7 @@
} }
if (backlogStatus != -10) { if (backlogStatus != -10) {
$(this).parent('td').parent('.seriesEditRow').find('.backlogStatus').val(backlogStatus); $(this).parent('td').parent('.seriesEditRow').find('.backlogSetting').val(backlogStatus);
} }
}); });

View File

@ -19,7 +19,7 @@
<td>@Html.DropDownListFor(m => m.QualityProfileId, new SelectList((List<QualityProfile>)ViewData["QualityProfiles"], "QualityProfileId", "Name", Model.QualityProfileId), new { @class = "quality" })</td> <td>@Html.DropDownListFor(m => m.QualityProfileId, new SelectList((List<QualityProfile>)ViewData["QualityProfiles"], "QualityProfileId", "Name", Model.QualityProfileId), new { @class = "quality" })</td>
<td class="checkboxColumn">@Html.CheckBoxFor(m => m.Monitored, new {@class = "seriesCheckbox monitored"})</td> <td class="checkboxColumn">@Html.CheckBoxFor(m => m.Monitored, new {@class = "seriesCheckbox monitored"})</td>
<td class="checkboxColumn">@Html.CheckBoxFor(m => m.SeasonFolder, new {@class = "seriesCheckbox seasonFolder"})</td> <td class="checkboxColumn">@Html.CheckBoxFor(m => m.SeasonFolder, new {@class = "seriesCheckbox seasonFolder"})</td>
<td>@Html.DropDownListFor(m => m.BacklogStatus, new SelectList((List<KeyValuePair<int, string>>)ViewData["BacklogStatusTypes"], "Key", "Value", (int)Model.BacklogStatus), new { @class = "backlogStatus" })</td> <td>@Html.DropDownListFor(m => m.BacklogSetting, new SelectList((List<KeyValuePair<int, string>>)ViewData["BacklogSettingTypes"], "Key", "Value", (int)Model.BacklogSetting), new { @class = "backlogSetting" })</td>
<td>@Html.TextBoxFor(m => m.Path, new { @class = "path" })</td> <td>@Html.TextBoxFor(m => m.Path, new { @class = "path" })</td>
</tr> </tr>
} }