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> <PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> <AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> <IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout> <DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration> <UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform> <UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath> <ProxyProcessPath></ProxyProcessPath>

View File

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

View File

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

View File

@ -4,6 +4,7 @@ using System.Linq;
using NLog; using NLog;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Configuration.Events; using NzbDrone.Core.Configuration.Events;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Instrumentation.Commands; using NzbDrone.Core.Instrumentation.Commands;
using NzbDrone.Core.Lifecycle; using NzbDrone.Core.Lifecycle;
@ -50,6 +51,7 @@ namespace NzbDrone.Core.Jobs
new ScheduledTask{ Interval = 1, TypeName = typeof(DownloadedEpisodesScanCommand).FullName}, new ScheduledTask{ Interval = 1, TypeName = typeof(DownloadedEpisodesScanCommand).FullName},
new ScheduledTask{ Interval = 60, TypeName = typeof(ApplicationUpdateCommand).FullName}, new ScheduledTask{ Interval = 60, TypeName = typeof(ApplicationUpdateCommand).FullName},
new ScheduledTask{ Interval = 1*60, TypeName = typeof(TrimLogCommand).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} new ScheduledTask{ Interval = 1, TypeName = typeof(TrackedCommandCleanupCommand).FullName}
}; };
@ -89,7 +91,7 @@ namespace NzbDrone.Core.Jobs
public void HandleAsync(ConfigSavedEvent message) public void HandleAsync(ConfigSavedEvent message)
{ {
var rss = _scheduledTaskRepository.GetDefinition(typeof (RssSyncCommand)); var rss = _scheduledTaskRepository.GetDefinition(typeof(RssSyncCommand));
rss.Interval = _configService.RssSyncInterval; rss.Interval = _configService.RssSyncInterval;
_scheduledTaskRepository.Update(rss); _scheduledTaskRepository.Update(rss);
} }

View File

@ -112,7 +112,7 @@ namespace NzbDrone.Core.MediaFiles
var videoFiles = _diskScanService.GetVideoFiles(subfolderInfo.FullName); var videoFiles = _diskScanService.GetVideoFiles(subfolderInfo.FullName);
return ProcessFiles(videoFiles, series); return ProcessFiles(series, videoFiles);
} }
private void ProcessVideoFile(string videoFile) private void ProcessVideoFile(string videoFile)
@ -131,10 +131,10 @@ namespace NzbDrone.Core.MediaFiles
return; 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); var decisions = _importDecisionMaker.GetImportDecisions(videoFiles, series, true);
return _importApprovedEpisodes.Import(decisions, true); return _importApprovedEpisodes.Import(decisions, true);

View File

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

View File

@ -14,10 +14,8 @@ namespace NzbDrone.Core.Tv
{ {
public interface ISeriesService public interface ISeriesService
{ {
bool IsMonitored(int id);
Series GetSeries(int seriesId); Series GetSeries(int seriesId);
Series AddSeries(Series newSeries); Series AddSeries(Series newSeries);
void UpdateFromSeriesEditor(IList<Series> editedSeries);
Series FindByTvdbId(int tvdbId); Series FindByTvdbId(int tvdbId);
Series FindByTvRageId(int tvRageId); Series FindByTvRageId(int tvRageId);
Series FindByTitle(string title); Series FindByTitle(string title);
@ -26,9 +24,6 @@ namespace NzbDrone.Core.Tv
List<Series> GetAllSeries(); List<Series> GetAllSeries();
Series UpdateSeries(Series series); Series UpdateSeries(Series series);
bool SeriesPathExists(string folder); bool SeriesPathExists(string folder);
List<Series> GetSeriesInList(IEnumerable<int> seriesIds);
Series FindBySlug(string slug);
List<String> GetSeriesPaths();
} }
public class SeriesService : ISeriesService public class SeriesService : ISeriesService
@ -55,11 +50,6 @@ namespace NzbDrone.Core.Tv
_logger = logger; _logger = logger;
} }
public bool IsMonitored(int id)
{
return _seriesRepository.Get(id).Monitored;
}
public Series GetSeries(int seriesId) public Series GetSeries(int seriesId)
{ {
return _seriesRepository.Get(seriesId); return _seriesRepository.Get(seriesId);
@ -88,24 +78,6 @@ namespace NzbDrone.Core.Tv
return 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) public Series FindByTvdbId(int tvdbId)
{ {
return _seriesRepository.FindByTvdbId(tvdbId); return _seriesRepository.FindByTvdbId(tvdbId);
@ -116,17 +88,6 @@ namespace NzbDrone.Core.Tv
return _seriesRepository.FindByTvRageId(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) public Series FindByTitle(string title)
{ {
var tvdbId = _sceneMappingService.GetTvDbId(title); var tvdbId = _sceneMappingService.GetTvDbId(title);
@ -170,10 +131,5 @@ namespace NzbDrone.Core.Tv
{ {
return _seriesRepository.SeriesPathExists(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> <PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> <AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> <IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>500</DefaultTestTimeout> <DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration> <UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform> <UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath> <ProxyProcessPath></ProxyProcessPath>

View File

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

View File

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

View File

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

View File

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

View File

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