1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

added scheduled task for UpdateSceneMappingCommand

This commit is contained in:
Keivan Beigi 2013-09-12 15:41:50 -07:00
parent ead1f8a868
commit 21fd12e1a6
14 changed files with 16 additions and 58 deletions

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -4,6 +4,7 @@
using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Instrumentation.Commands;
using NzbDrone.Core.Lifecycle;
@ -50,6 +51,7 @@ public void Handle(ApplicationStartedEvent message)
new ScheduledTask{ Interval = 1, TypeName = typeof(DownloadedEpisodesScanCommand).FullName},
new ScheduledTask{ Interval = 60, TypeName = typeof(ApplicationUpdateCommand).FullName},
new ScheduledTask{ Interval = 1*60, TypeName = typeof(TrimLogCommand).FullName},
new ScheduledTask{ Interval = 3*60, TypeName = typeof(UpdateSceneMappingCommand).FullName},
new ScheduledTask{ Interval = 1, TypeName = typeof(TrackedCommandCleanupCommand).FullName}
};
@ -89,7 +91,7 @@ public void HandleAsync(CommandExecutedEvent message)
public void HandleAsync(ConfigSavedEvent message)
{
var rss = _scheduledTaskRepository.GetDefinition(typeof (RssSyncCommand));
var rss = _scheduledTaskRepository.GetDefinition(typeof(RssSyncCommand));
rss.Interval = _configService.RssSyncInterval;
_scheduledTaskRepository.Update(rss);
}

View File

@ -112,7 +112,7 @@ private List<ImportDecision> ProcessSubFolder(DirectoryInfo subfolderInfo)
var videoFiles = _diskScanService.GetVideoFiles(subfolderInfo.FullName);
return ProcessFiles(videoFiles, series);
return ProcessFiles(series, videoFiles);
}
private void ProcessVideoFile(string videoFile)
@ -131,10 +131,10 @@ private void ProcessVideoFile(string videoFile)
return;
}
ProcessFiles(new[] { videoFile }, series);
ProcessFiles(series, videoFile);
}
private List<ImportDecision> ProcessFiles(IEnumerable<string> videoFiles, Series series)
private List<ImportDecision> ProcessFiles(Series series, params string[] videoFiles)
{
var decisions = _importDecisionMaker.GetImportDecisions(videoFiles, series, true);
return _importApprovedEpisodes.Import(decisions, true);

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -14,10 +14,8 @@ namespace NzbDrone.Core.Tv
{
public interface ISeriesService
{
bool IsMonitored(int id);
Series GetSeries(int seriesId);
Series AddSeries(Series newSeries);
void UpdateFromSeriesEditor(IList<Series> editedSeries);
Series FindByTvdbId(int tvdbId);
Series FindByTvRageId(int tvRageId);
Series FindByTitle(string title);
@ -26,9 +24,6 @@ public interface ISeriesService
List<Series> GetAllSeries();
Series UpdateSeries(Series series);
bool SeriesPathExists(string folder);
List<Series> GetSeriesInList(IEnumerable<int> seriesIds);
Series FindBySlug(string slug);
List<String> GetSeriesPaths();
}
public class SeriesService : ISeriesService
@ -55,11 +50,6 @@ public SeriesService(ISeriesRepository seriesRepository,
_logger = logger;
}
public bool IsMonitored(int id)
{
return _seriesRepository.Get(id).Monitored;
}
public Series GetSeries(int seriesId)
{
return _seriesRepository.Get(seriesId);
@ -88,24 +78,6 @@ public Series AddSeries(Series newSeries)
return newSeries;
}
public void UpdateFromSeriesEditor(IList<Series> editedSeries)
{
var allSeries = _seriesRepository.All();
foreach (var series in allSeries)
{
//Only update parameters that can be changed in MassEdit
var edited = editedSeries.Single(s => s.Id == series.Id);
series.QualityProfileId = edited.QualityProfileId;
series.Monitored = edited.Monitored;
series.SeasonFolder = edited.SeasonFolder;
series.Path = edited.Path;
_seriesRepository.Update(series);
}
}
public Series FindByTvdbId(int tvdbId)
{
return _seriesRepository.FindByTvdbId(tvdbId);
@ -116,17 +88,6 @@ public Series FindByTvRageId(int tvRageId)
return _seriesRepository.FindByTvRageId(tvRageId);
}
public Series FindBySlug(string slug)
{
var series = _seriesRepository.FindBySlug(slug);
return series;
}
public List<string> GetSeriesPaths()
{
return _seriesRepository.GetSeriesPaths();
}
public Series FindByTitle(string title)
{
var tvdbId = _sceneMappingService.GetTvDbId(title);
@ -170,10 +131,5 @@ public bool SeriesPathExists(string folder)
{
return _seriesRepository.SeriesPathExists(folder);
}
public List<Series> GetSeriesInList(IEnumerable<int> seriesIds)
{
return _seriesRepository.Get(seriesIds).ToList();
}
}
}

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>

View File

@ -12,7 +12,7 @@
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>