mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
more test/fixes
This commit is contained in:
parent
43e1c16cca
commit
8fca3c3419
10 changed files with 178 additions and 30 deletions
40
NzbDrone.Core/Providers/DownloadProvider.cs
Normal file
40
NzbDrone.Core/Providers/DownloadProvider.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Providers.Indexer;
|
||||
using NzbDrone.Core.Repository;
|
||||
using SubSonic.Repository;
|
||||
|
||||
namespace NzbDrone.Core.Providers
|
||||
{
|
||||
public class DownloadProvider
|
||||
{
|
||||
private readonly SabProvider _sabProvider;
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public DownloadProvider(SabProvider sabProvider)
|
||||
{
|
||||
_sabProvider = sabProvider;
|
||||
}
|
||||
|
||||
public DownloadProvider()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool DownloadReport(EpisodeParseResult parseResult)
|
||||
{
|
||||
var sabTitle = _sabProvider.GetSabTitle(parseResult);
|
||||
|
||||
if (_sabProvider.IsInQueue(sabTitle))
|
||||
{
|
||||
Logger.Warn("Episode {0} is already in sab's queue. skipping.", parseResult);
|
||||
return false;
|
||||
}
|
||||
|
||||
return _sabProvider.AddByUrl(parseResult.NzbUrl, sabTitle);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue