mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
added commands.
they can be triggered using the api api/command/
This commit is contained in:
parent
68ee71ea81
commit
182192e0ba
31 changed files with 265 additions and 74 deletions
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.Download;
|
||||
|
||||
|
@ -11,7 +12,7 @@ namespace NzbDrone.Core.Indexers
|
|||
void Sync();
|
||||
}
|
||||
|
||||
public class RssSyncService : IRssSyncService
|
||||
public class RssSyncService : IRssSyncService, IExecute<RssSyncCommand>
|
||||
{
|
||||
private readonly IFetchAndParseRss _rssFetcherAndParser;
|
||||
private readonly IMakeDownloadDecision _downloadDecisionMaker;
|
||||
|
@ -36,7 +37,7 @@ namespace NzbDrone.Core.Indexers
|
|||
|
||||
//TODO: this will download multiple of same episode if they show up in RSS. need to
|
||||
//proposal: maybe get download decision one by one, that way
|
||||
|
||||
|
||||
var qualifiedReports = decisions
|
||||
.Where(c => c.Approved)
|
||||
.Select(c => c.Episode)
|
||||
|
@ -60,5 +61,10 @@ namespace NzbDrone.Core.Indexers
|
|||
|
||||
_logger.Info("RSS Sync Completed. Reports found: {0}, Fetches attempted: {1}", reports.Count, qualifiedReports.Count());
|
||||
}
|
||||
|
||||
public void Execute(RssSyncCommand message)
|
||||
{
|
||||
Sync();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue