mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Renamed AiredAfter to CustomStartDate
This commit is contained in:
parent
15e4a286d1
commit
a7a0a25029
21 changed files with 93 additions and 71 deletions
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue