Fixed a bug with converting default quality profile from config when adding a new series.

Re-enabled the RssSyncTimer so it will run an RSS Sync when fired.
pull/4/head
markus101 14 years ago
parent da79ad147e
commit 735668f7b3

@ -104,7 +104,7 @@ namespace NzbDrone.Core.Providers
return false; return false;
} }
throw new NotImplementedException(); return true;
} }
public void RefreshEpisodeInfo(int seriesId) public void RefreshEpisodeInfo(int seriesId)

@ -108,7 +108,7 @@ namespace NzbDrone.Core.Providers
repoSeries.Path = path; repoSeries.Path = path;
repoSeries.CleanTitle = Parser.NormalizeTitle(series.SeriesName); repoSeries.CleanTitle = Parser.NormalizeTitle(series.SeriesName);
repoSeries.Monitored = true; //New shows should be monitored repoSeries.Monitored = true; //New shows should be monitored
repoSeries.QualityProfile = (QualityProfile) Enum.Parse(typeof (QualityProfile), _config.GetValue("Quality", 1, true)); repoSeries.QualityProfile = _quality.Find(Convert.ToInt32(_config.GetValue("Quality", 1, true)));
_sonioRepo.Add(repoSeries); _sonioRepo.Add(repoSeries);
} }

@ -36,7 +36,7 @@ namespace NzbDrone.Core.Providers
public void ResetRssSyncTimer() public void ResetRssSyncTimer()
{ {
double interval = _rssSyncTimer.Interval; double interval = _rssSyncTimer.Interval;
_rssSyncTimer .Interval= interval; _rssSyncTimer.Interval = interval;
} }
public void StartRssSyncTimer() public void StartRssSyncTimer()
@ -47,7 +47,7 @@ namespace NzbDrone.Core.Providers
throw new InvalidOperationException("RSS Sync Frequency Invalid"); throw new InvalidOperationException("RSS Sync Frequency Invalid");
} }
_rssSyncTimer.Elapsed +=new ElapsedEventHandler(RunRssSync); _rssSyncTimer.Elapsed += new ElapsedEventHandler(RunRssSync);
_rssSyncTimer.Start(); _rssSyncTimer.Start();
_rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval); _rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval);
} }
@ -59,7 +59,7 @@ namespace NzbDrone.Core.Providers
public void SetRssSyncTimer(int minutes) public void SetRssSyncTimer(int minutes)
{ {
long ms = minutes*60*1000; long ms = minutes * 60 * 1000;
_rssSyncTimer.Interval = ms; _rssSyncTimer.Interval = ms;
} }
@ -89,7 +89,7 @@ namespace NzbDrone.Core.Providers
private void RunRssSync(object obj, ElapsedEventArgs args) private void RunRssSync(object obj, ElapsedEventArgs args)
{ {
_rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval); _rssSyncNextInterval = DateTime.Now.AddMilliseconds(_rssSyncTimer.Interval);
//_rssSyncProvider.Begin(); _rssSyncProvider.Begin();
} }
private void MinuteTimer_Elapsed(object obj, ElapsedEventArgs args) private void MinuteTimer_Elapsed(object obj, ElapsedEventArgs args)

@ -145,7 +145,7 @@ namespace NzbDrone.Web.Controllers
var defaultQualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", profiles[0].ProfileId, true)); var defaultQualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", profiles[0].ProfileId, true));
var selectList = new SelectList(profiles, "ProfileId", "Name"); var selectList = new SelectList(profiles, "ProfileId", "Name");
return new QualityModel {DefaultProfileId = defaultQualityProfileId, SelectList = selectList}; return new QualityModel { DefaultProfileId = defaultQualityProfileId, SelectList = selectList };
} }
[HttpPost] [HttpPost]
@ -167,10 +167,7 @@ namespace NzbDrone.Web.Controllers
{ {
//Todo: Only allow indexers to be enabled if user information has been provided //Todo: Only allow indexers to be enabled if user information has been provided
foreach (var indexer in data.Indexers) foreach (var indexer in data.Indexers)
{
indexer.ApiUrl = String.Empty; //TODO: Remove this and use a Real API URL
_indexerProvider.Update(indexer); _indexerProvider.Update(indexer);
}
_configProvider.SetValue("NzbMatrixUsername", data.NzbMatrixUsername); _configProvider.SetValue("NzbMatrixUsername", data.NzbMatrixUsername);
_configProvider.SetValue("NzbMatrixApiKey", data.NzbMatrixApiKey); _configProvider.SetValue("NzbMatrixApiKey", data.NzbMatrixApiKey);
@ -190,18 +187,18 @@ namespace NzbDrone.Web.Controllers
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
_configProvider.SetValue("SyncFrequency", data.SyncFrequency.ToString()); _configProvider.SetValue("SyncFrequency", data.SyncFrequency.ToString());
_configProvider.SetValue("DownloadPropers", data.DownloadPropers.ToString()); _configProvider.SetValue("DownloadPropers", data.DownloadPropers.ToString());
_configProvider.SetValue("Retention", data.Retention.ToString()); _configProvider.SetValue("Retention", data.Retention.ToString());
_configProvider.SetValue("SabHost", data.SabHost); _configProvider.SetValue("SabHost", data.SabHost);
_configProvider.SetValue("SabPort", data.SabPort.ToString()); _configProvider.SetValue("SabPort", data.SabPort.ToString());
_configProvider.SetValue("SabApiKey", data.SabApiKey); _configProvider.SetValue("SabApiKey", data.SabApiKey);
_configProvider.SetValue("SabUsername", data.SabUsername); _configProvider.SetValue("SabUsername", data.SabUsername);
_configProvider.SetValue("SabPassword", data.SabPassword); _configProvider.SetValue("SabPassword", data.SabPassword);
_configProvider.SetValue("SabCategory", data.SabCategory); _configProvider.SetValue("SabCategory", data.SabCategory);
_configProvider.SetValue("SabPriority", data.SabPriority.ToString()); _configProvider.SetValue("SabPriority", data.SabPriority.ToString());
return Content(_settingsSaved); return Content(_settingsSaved);
} }
return Content(_settingsFailed); return Content(_settingsFailed);

Loading…
Cancel
Save