Renamed AiredAfter to CustomStartDate

This commit is contained in:
Mark McDowall 2012-09-20 08:37:40 -07:00
parent 15e4a286d1
commit a7a0a25029
21 changed files with 93 additions and 71 deletions

View File

@ -146,7 +146,7 @@
<Compile Include="ProviderTests\ConfigProviderTests\ConfigCachingFixture.cs" />
<Compile Include="ProviderTests\BannerProviderTest.cs" />
<Compile Include="ProviderTests\DecisionEngineTests\AllowedReleaseGroupSpecificationFixture.cs" />
<Compile Include="ProviderTests\DecisionEngineTests\EpisodeAiredAfterCutoffSpecificationFixture.cs" />
<Compile Include="ProviderTests\DecisionEngineTests\CustomStartDateSpecificationFixture.cs" />
<Compile Include="ProviderTests\DiskScanProviderTests\CleanUpFixture.cs" />
<Compile Include="ProviderTests\DiskScanProviderTests\CleanUpDropFolderFixture.cs" />
<Compile Include="ProviderTests\DiskScanProviderTests\GetVideoFilesFixture.cs" />

View File

@ -53,7 +53,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(true);
Mocker.GetMock<EpisodeAiredAfterCutoffSpecification>()
Mocker.GetMock<CustomStartDateSpecification>()
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(true);
}
@ -93,9 +93,9 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
.Returns(false);
}
private void WithAiredBeforeCutoff()
private void WithAiredBeforeCustomStartDateCutoff()
{
Mocker.GetMock<EpisodeAiredAfterCutoffSpecification>()
Mocker.GetMock<CustomStartDateSpecification>()
.Setup(c => c.IsSatisfiedBy(It.IsAny<EpisodeParseResult>()))
.Returns(false);
}
@ -144,8 +144,8 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
[Test]
public void should_not_be_allowed_if_episode_aired_before_cutoff()
{
WithAiredBeforeCutoff();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.EpisodeAiredBeforeCutoff);
WithAiredBeforeCustomStartDateCutoff();
spec.IsSatisfiedBy(parseResult).Should().Be(ReportRejectionType.AiredAfterCustomStartDate);
}
[Test]

View File

@ -17,9 +17,9 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
[TestFixture]
// ReSharper disable InconsistentNaming
public class EpisodeAiredAfterCutoffSpecificationFixture : CoreTest
public class CustomStartDateSpecificationFixture : CoreTest
{
private EpisodeAiredAfterCutoffSpecification episodeAiredAfterCutoffSpecification;
private CustomStartDateSpecification _customStartDateSpecification;
private EpisodeParseResult parseResultMulti;
private EpisodeParseResult parseResultSingle;
@ -30,11 +30,11 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
[SetUp]
public void Setup()
{
episodeAiredAfterCutoffSpecification = Mocker.Resolve<EpisodeAiredAfterCutoffSpecification>();
_customStartDateSpecification = Mocker.Resolve<CustomStartDateSpecification>();
fakeSeries = Builder<Series>.CreateNew()
.With(c => c.Monitored = true)
.With(c => c.DownloadEpisodesAiredAfter = null)
.With(c => c.CustomStartDate = null)
.Build();
parseResultMulti = new EpisodeParseResult
@ -75,38 +75,38 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
private void WithAiredAfterYesterday()
{
fakeSeries.DownloadEpisodesAiredAfter = DateTime.Today.AddDays(-1);
fakeSeries.CustomStartDate = DateTime.Today.AddDays(-1);
}
private void WithAiredAfterLastWeek()
{
fakeSeries.DownloadEpisodesAiredAfter = DateTime.Today.AddDays(-7);
fakeSeries.CustomStartDate = DateTime.Today.AddDays(-7);
}
[Test]
public void should_return_true_when_downloadEpisodesAiredAfter_is_null_for_single_episode()
{
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultSingle).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultSingle).Should().BeTrue();
}
[Test]
public void should_return_true_when_downloadEpisodesAiredAfter_is_null_for_multiple_episodes()
{
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
}
[Test]
public void should_return_true_if_both_episodes_air_after_cutoff()
{
WithAiredAfterLastWeek();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
}
[Test]
public void should_return_true_if_episode_airs_after_cutoff()
{
WithAiredAfterLastWeek();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultSingle).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultSingle).Should().BeTrue();
}
[Test]
@ -114,7 +114,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
WithAiredAfterLastWeek();
WithSecondEpisodeYear();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
}
[Test]
@ -122,7 +122,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
WithAiredAfterLastWeek();
WithFirstEpisodeLastYear();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
_customStartDateSpecification.IsSatisfiedBy(parseResultMulti).Should().BeTrue();
}
[Test]
@ -131,7 +131,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
WithAiredAfterLastWeek();
WithFirstEpisodeLastYear();
WithSecondEpisodeYear();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultMulti).Should().BeFalse();
_customStartDateSpecification.IsSatisfiedBy(parseResultMulti).Should().BeFalse();
}
[Test]
@ -139,7 +139,7 @@ namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
{
WithAiredAfterLastWeek();
WithFirstEpisodeLastYear();
episodeAiredAfterCutoffSpecification.IsSatisfiedBy(parseResultSingle).Should().BeFalse();
_customStartDateSpecification.IsSatisfiedBy(parseResultSingle).Should().BeFalse();
}
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Data;
using Migrator.Framework;
using NzbDrone.Common;
namespace NzbDrone.Core.Datastore.Migrations
{
[Migration(20120919)]
public class Migration20120919 : NzbDroneMigration
{
protected override void MainDbUpgrade()
{
Database.AddColumn("Series", new Column("CustomStartDate", DbType.DateTime, ColumnProperty.Null));
Database.ExecuteNonQuery("UPDATE Series SET CustomStartDate = DownloadEpisodesAiredAfter");
Database.RemoveColumn("Series", "DownloadEpisodesAiredAfter");
}
}
}

View File

@ -18,6 +18,6 @@ namespace NzbDrone.Core.Model
Skipped = 11,
Failure = 12,
ReleaseGroupNotWanted = 13,
EpisodeAiredBeforeCutoff = 14
AiredAfterCustomStartDate = 14
}
}

View File

@ -227,6 +227,7 @@
<Compile Include="Datastore\MigrationLogger.cs" />
<Compile Include="Datastore\MigrationsHelper.cs" />
<Compile Include="Datastore\CustomeMapper.cs" />
<Compile Include="Datastore\Migrations\Migration20120919.cs" />
<Compile Include="Datastore\Migrations\Migration20120918.cs" />
<Compile Include="Datastore\Migrations\Migration20120802.cs" />
<Compile Include="Datastore\Migrations\Migration20120727.cs" />
@ -292,7 +293,7 @@
<Compile Include="Model\Xbmc\IconType.cs" />
<Compile Include="Providers\BannerProvider.cs" />
<Compile Include="Providers\DecisionEngine\AllowedReleaseGroupSpecification.cs" />
<Compile Include="Providers\DecisionEngine\EpisodeAiredAfterCutoffSpecification.cs" />
<Compile Include="Providers\DecisionEngine\CustomStartDateSpecification.cs" />
<Compile Include="Providers\DownloadClients\PneumaticProvider.cs" />
<Compile Include="Providers\Indexer\NzbClub.cs" />
<Compile Include="Providers\Indexer\NzbIndex.cs" />

View File

@ -14,14 +14,14 @@ namespace NzbDrone.Core.Providers.DecisionEngine
private readonly AlreadyInQueueSpecification _alreadyInQueueSpecification;
private readonly RetentionSpecification _retentionSpecification;
private readonly AllowedReleaseGroupSpecification _allowedReleaseGroupSpecification;
private readonly EpisodeAiredAfterCutoffSpecification _episodeAiredAfterCutoffSpecification;
private readonly CustomStartDateSpecification _customStartDateSpecification;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public AllowedDownloadSpecification(QualityAllowedByProfileSpecification qualityAllowedByProfileSpecification,
UpgradeDiskSpecification upgradeDiskSpecification, AcceptableSizeSpecification acceptableSizeSpecification,
AlreadyInQueueSpecification alreadyInQueueSpecification, RetentionSpecification retentionSpecification,
AllowedReleaseGroupSpecification allowedReleaseGroupSpecification, EpisodeAiredAfterCutoffSpecification episodeAiredAfterCutoffSpecification)
AllowedReleaseGroupSpecification allowedReleaseGroupSpecification, CustomStartDateSpecification customStartDateSpecification)
{
_qualityAllowedByProfileSpecification = qualityAllowedByProfileSpecification;
_upgradeDiskSpecification = upgradeDiskSpecification;
@ -29,7 +29,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
_alreadyInQueueSpecification = alreadyInQueueSpecification;
_retentionSpecification = retentionSpecification;
_allowedReleaseGroupSpecification = allowedReleaseGroupSpecification;
_episodeAiredAfterCutoffSpecification = episodeAiredAfterCutoffSpecification;
_customStartDateSpecification = customStartDateSpecification;
}
public AllowedDownloadSpecification()
@ -39,7 +39,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
public virtual ReportRejectionType IsSatisfiedBy(EpisodeParseResult subject)
{
if (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.QualityNotWanted;
if (!_episodeAiredAfterCutoffSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.EpisodeAiredBeforeCutoff;
if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AiredAfterCustomStartDate;
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter;
if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Retention;
if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Size;

View File

@ -5,25 +5,25 @@ using NzbDrone.Core.Model;
namespace NzbDrone.Core.Providers.DecisionEngine
{
public class EpisodeAiredAfterCutoffSpecification
public class CustomStartDateSpecification
{
private readonly EpisodeProvider _episodeProvider;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
[Inject]
public EpisodeAiredAfterCutoffSpecification(EpisodeProvider episodeProvider)
public CustomStartDateSpecification(EpisodeProvider episodeProvider)
{
_episodeProvider = episodeProvider;
}
public EpisodeAiredAfterCutoffSpecification()
public CustomStartDateSpecification()
{
}
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
if (!subject.Series.DownloadEpisodesAiredAfter.HasValue)
if (!subject.Series.CustomStartDate.HasValue)
{
logger.Debug("{0} does not restrict downloads before date.", subject.Series.Title);
return true;
@ -31,13 +31,13 @@ namespace NzbDrone.Core.Providers.DecisionEngine
var episodes = _episodeProvider.GetEpisodesByParseResult(subject);
if (episodes.Any(episode => episode.AirDate > subject.Series.DownloadEpisodesAiredAfter.Value))
if (episodes.Any(episode => episode.AirDate > subject.Series.CustomStartDate.Value))
{
logger.Debug("One or more episodes aired after cutoff, downloading.");
return true;
}
logger.Debug("Episodes aired before cutoff date: {0}", subject.Series.DownloadEpisodesAiredAfter);
logger.Debug("Episodes aired before cutoff date: {0}", subject.Series.CustomStartDate);
return false;
}
}

View File

@ -132,7 +132,7 @@ namespace NzbDrone.Core.Providers
repoSeries.BacklogSetting = BacklogSettingType.Inherit;
if (airedAfter.HasValue)
repoSeries.DownloadEpisodesAiredAfter = airedAfter;
repoSeries.CustomStartDate = airedAfter;
_database.Insert(repoSeries);
}
@ -232,7 +232,7 @@ namespace NzbDrone.Core.Providers
series.SeasonFolder = edited.SeasonFolder;
series.BacklogSetting = edited.BacklogSetting;
series.Path = edited.Path;
series.DownloadEpisodesAiredAfter = edited.DownloadEpisodesAiredAfter;
series.CustomStartDate = edited.CustomStartDate;
}
_database.UpdateMany(allSeries);

View File

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Repository
public string Network { get; set; }
public DateTime? DownloadEpisodesAiredAfter { get; set; }
public DateTime? CustomStartDate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Series"/> is hidden.

View File

@ -37,7 +37,7 @@ th .footer-control-quality {
width: 120px;
}
td .aired-after {
td .start-date {
width: 80px;
}
@ -45,7 +45,7 @@ th .footer-control-boolean {
width: 90px;
}
th .footer-control-aired-after {
th .footer-control-start-date {
width: 80px;
}

View File

@ -110,7 +110,7 @@ namespace NzbDrone.Web.Controllers
}
[HttpPost]
public JsonResult AddNewSeries(string path, string seriesName, int seriesId, int qualityProfileId, string airedAfter)
public JsonResult AddNewSeries(string path, string seriesName, int seriesId, int qualityProfileId, string startDate)
{
if (string.IsNullOrWhiteSpace(path) || String.Equals(path,"null",StringComparison.InvariantCultureIgnoreCase))
return JsonNotificationResult.Error("Couldn't add " + seriesName, "You need a valid root folder");
@ -121,20 +121,20 @@ namespace NzbDrone.Web.Controllers
//Use the created folder name when adding the series
path = _diskProvider.CreateDirectory(path);
return AddExistingSeries(path, seriesName, seriesId, qualityProfileId, airedAfter);
return AddExistingSeries(path, seriesName, seriesId, qualityProfileId, startDate);
}
[HttpPost]
[JsonErrorFilter]
public JsonResult AddExistingSeries(string path, string seriesName, int seriesId, int qualityProfileId, string airedAfter)
public JsonResult AddExistingSeries(string path, string seriesName, int seriesId, int qualityProfileId, string startDate)
{
if (seriesId == 0 || String.IsNullOrWhiteSpace(seriesName))
return JsonNotificationResult.Error("Add Existing series failed.", "Invalid Series information");
DateTime? date = null;
if (!String.IsNullOrWhiteSpace(airedAfter))
date = DateTime.Parse(airedAfter, null, DateTimeStyles.RoundtripKind);
if (!String.IsNullOrWhiteSpace(startDate))
date = DateTime.Parse(startDate, null, DateTimeStyles.RoundtripKind);
_seriesProvider.AddSeries(seriesName,path, seriesId, qualityProfileId, date);
_jobProvider.QueueJob(typeof(ImportNewSeriesJob));

View File

@ -73,8 +73,8 @@ namespace NzbDrone.Web.Controllers
series.Path = seriesModel.Path;
series.BacklogSetting = (BacklogSettingType)seriesModel.BacklogSetting;
if (!String.IsNullOrWhiteSpace(seriesModel.DownloadEpisodesAiredAfter))
series.DownloadEpisodesAiredAfter = DateTime.Parse(seriesModel.DownloadEpisodesAiredAfter, null, DateTimeStyles.RoundtripKind);
if (!String.IsNullOrWhiteSpace(seriesModel.CustomStartDate))
series.CustomStartDate = DateTime.Parse(seriesModel.CustomStartDate, null, DateTimeStyles.RoundtripKind);
_seriesProvider.UpdateSeries(series);
@ -190,8 +190,8 @@ namespace NzbDrone.Web.Controllers
SeasonFolder = s.SeasonFolder,
BacklogSetting = (BacklogSettingType)s.BacklogSetting,
Path = s.Path,
DownloadEpisodesAiredAfter = String.IsNullOrWhiteSpace(s.DownloadEpisodesAiredAfter) ? (DateTime?)null
: DateTime.Parse(s.DownloadEpisodesAiredAfter, null, DateTimeStyles.RoundtripKind)
CustomStartDate = String.IsNullOrWhiteSpace(s.CustomStartDate) ? (DateTime?)null
: DateTime.Parse(s.CustomStartDate, null, DateTimeStyles.RoundtripKind)
}
).ToList());
return JsonNotificationResult.Info("Series Mass Edit Saved");
@ -220,7 +220,7 @@ namespace NzbDrone.Web.Controllers
NextAiring = s.NextAiring == null ? String.Empty : s.NextAiring.Value.ToBestDateString(),
NextAiringSorter = s.NextAiring == null ? "12/31/9999" : s.NextAiring.Value.ToString("MM/dd/yyyy"),
AirTime = s.AirTimes,
DownloadEpisodesAiredAfter = s.DownloadEpisodesAiredAfter.HasValue ? s.DownloadEpisodesAiredAfter.Value.ToString("yyyy-MM-dd") : String.Empty
CustomStartDate = s.CustomStartDate.HasValue ? s.CustomStartDate.Value.ToString("yyyy-MM-dd") : String.Empty
}).ToList();
return series;

View File

@ -53,8 +53,8 @@ namespace NzbDrone.Web.Models
[Description("Should NzbDrone search for missing episodes every 30 days?")]
public int BacklogSetting { get; set; }
[DisplayName("Download Episodes Aired After")]
[Description("Should NzbDrone only download episodes a certain date?")]
public string DownloadEpisodesAiredAfter { get; set; }
[DisplayName("Custom Start Date")]
[Description("Should NzbDrone only download episodes after your preferred start date?")]
public string CustomStartDate { get; set; }
}
}

View File

@ -25,7 +25,7 @@ $(".addExistingButton").live('click', function () {
var title = $(this).siblings(".seriesLookup").val();
var seriesId = $(this).siblings(".seriesId").val();
var qualityId = $(this).siblings(".qualitySelector").val();
var date = $(this).siblings('.aired-after').val();
var date = $(this).siblings('.start-date').val();
var path = root.find(".seriesPathValue Label").text();
@ -43,7 +43,7 @@ $(".addExistingButton").live('click', function () {
$.ajax({
type: "POST",
url: addSeriesUrl,
data: jQuery.param({ path: path, seriesName: title, seriesId: seriesId, qualityProfileId: qualityId, airedAfter: date }),
data: jQuery.param({ path: path, seriesName: title, seriesId: seriesId, qualityProfileId: qualityId, startDate: date }),
error: function (req, status, error) {
$(button).removeAttr('disabled');
alert("Sorry! We could not add " + path + " at this time. " + error);
@ -67,10 +67,10 @@ function reloadExistingSeries() {
});
}
$(".aired-after-master").live('change', function () {
$(".start-date-master").live('change', function () {
var date = $(this).val();
$("#existingSeries").find(".aired-after").each(function () {
$("#existingSeries").find(".start-date").each(function () {
$(this).val(date);
});
});
@ -129,12 +129,12 @@ $('#saveNewSeries').live('click', function () {
var seriesId = $("#newSeriesId").val();
var qualityId = $("#qualityList").val();
var path = $('#newSeriesPath').val();
var date = $('#newAiredAfter').val();
var date = $('#newStartDate').val();
$.ajax({
type: "POST",
url: addNewSeriesUrl,
data: jQuery.param({ path: path, seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId, airedAfter: date }),
data: jQuery.param({ path: path, seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId, startDate: date }),
error: function (req, status, error) {
$('#saveNewSeries').removeAttr('disabled');
alert("Sorry! We could not add " + path + " at this time. " + error);
@ -142,7 +142,7 @@ $('#saveNewSeries').live('click', function () {
success: function () {
$('#saveNewSeries').removeAttr('disabled');
$("#newSeriesLookup").val('');
$('#newAiredAfter').val('');
$('#newStartDate').val('');
}
});
});

View File

@ -7,7 +7,7 @@
</div>
@Html.DropDownList("newSeriesPath", new SelectList((IList)ViewData["RootDirs"]), new { style = "width: 406px; margin-left: 0px;" })
@Html.DropDownList("qualityList", (SelectList)ViewData["QualityProfiles"], new { @class = "qualitySelector" })
@Html.TextBox("newAiredAfter", "", new { type = "date", @class = "jQuery-datepicker aired-after", title = "Only download episodes that aired after the choosen date" })
@Html.TextBox("newStartDate", "", new { type = "date", @class = "jQuery-datepicker start-date", placeholder = "Custom Start Date", title = "Only download episodes that aired after the specified date" })
<button id="saveNewSeries">
Add</button>
</div>

View File

@ -23,7 +23,7 @@ else
{
@Html.DropDownList(Guid.NewGuid().ToString(), Model.Quality, new { @class = "qualitySelector masterQualitySelector" })
@Html.TextBox(Guid.NewGuid().ToString(), "", new { type="date", @class = "jQuery-datepicker aired-after-master", title = "Skip episodes that aired before the choosen date" })
@Html.TextBox(Guid.NewGuid().ToString(), "", new { type="date", @class = "jQuery-datepicker start-date-master", placeholder = "Custom Start Date", title = "Only download episodes that aired after the specified date" })
foreach (var series in Model.ExistingSeries)
{
@ -35,7 +35,7 @@ else
<input class="seriesLookup" type="text" style="width: 400px;" value="@series.Item2" placeholder="Series Title" />
@Html.Hidden("seriesId", series.Item3, new { @class = "seriesId" })
@Html.DropDownList(Guid.NewGuid().ToString(), Model.Quality, new { @class = "qualitySelector" })
@Html.TextBox(Guid.NewGuid().ToString(), "", new { type="date", @class = "jQuery-datepicker aired-after", title = "Only download episodes that aired after the choosen date" })
@Html.TextBox(Guid.NewGuid().ToString(), "", new { type="date", @class = "jQuery-datepicker start-date", placeholder = "Custom Start Date", title = "Only download episodes that aired after the specified date" })
<button class="addExistingButton">
Add</button>
</div>

View File

@ -20,7 +20,7 @@
position: relative;
}
.aired-after-master {
.start-date-master {
left: 430px;
position: relative;
}
@ -51,7 +51,7 @@
text-decoration: underline;
}
input[type=date].aired-after {
input[type=date].start-date {
margin-left: 10px;
}
</style>

View File

@ -37,9 +37,9 @@
</label>
@Html.DropDownListFor(m => m.BacklogSetting, (SelectList)ViewData["BacklogSettingSelectList"], new { @class = "inputClass" })
<label class="labelClass">@Html.LabelFor(m => m.DownloadEpisodesAiredAfter)
<span class="small">@Html.DescriptionFor(m => m.DownloadEpisodesAiredAfter)</span>
<label class="labelClass">@Html.LabelFor(m => m.CustomStartDate)
<span class="small">@Html.DescriptionFor(m => m.CustomStartDate)</span>
</label>
@Html.TextBoxFor(m => m.DownloadEpisodesAiredAfter, new { type = "date", @class = "inputClass jQuery-datepicker" })
@Html.TextBoxFor(m => m.CustomStartDate, new { type = "date", @class = "inputClass jQuery-datepicker" })
}
</div>

View File

@ -27,7 +27,7 @@
<th width="90px">Monitored</th>
<th width="110px">Season Folder</th>
<th width="110px">Backlog Status</th>
<th width="80px">Aired After</th>
<th width="80px" title="Custom Start Date">Start Date</th>
<th width="310px">Path</th>
</tr>
</thead>
@ -56,7 +56,7 @@
@Html.DropDownList("masterBacklogSetting", (SelectList)ViewData["MasterBacklogSettingSelectList"], new { @class = "footer-control masterSelector master-backlog-setting", disabled = true })
</th>
<th>
@Html.TextBox("masterAiredAfter", "" , new { type = "date", @class = "footer-control-aired-after masterSelector master-aired-after jQuery-datepicker", disabled = true })
@Html.TextBox("masterStartDate", "" , new { type = "date", @class = "footer-control-start-date masterSelector master-start-date jQuery-datepicker", disabled = true })
</th>
<th>
<button id="series-editor-save" type="submit" class="save_button" disabled="disabled" title="Commit the settings from your series above to the database">
@ -184,13 +184,13 @@
});
});
$(document).on('change', '#masterAiredAfter', function () {
var airedAfter = $(this).val();
$(document).on('change', '#masterStartDate', function () {
var startDate = $(this).val();
var selected = $('.editToggle:checked');
selected.each(function () {
$(this).parent('td').parent('.seriesEditRow').find('.aired-after').val(airedAfter);
$(this).parent('td').parent('.seriesEditRow').find('.start-date').val(startDate);
});
});

View File

@ -21,7 +21,7 @@
<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>@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.DownloadEpisodesAiredAfter, new { type = "date", @class = "aired-after jQuery-datepicker" })</td>
<td>@Html.TextBoxFor(m => m.CustomStartDate, new { type = "date", @class = "start-date jQuery-datepicker" })</td>
<td>@Html.TextBoxFor(m => m.Path, new { @class = "path" })</td>
}
</tr>