Skip to content

Commit

Permalink
cf
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Jun 15, 2020
1 parent dc9573f commit e66bf5a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
22 changes: 0 additions & 22 deletions TVRename/ScanActivity/Finders/DownloadingFinder.cs
Expand Up @@ -71,26 +71,4 @@ protected DownloadingFinder(TVDoc doc) : base(doc)
{
}
}

abstract class DownloadingProviderFinder : DownloadingFinder
{
private readonly IDownloadProvider source;
protected DownloadingProviderFinder(TVDoc doc, IDownloadProvider source) : base(doc)
{
this.source = source;
}
protected override string CheckName() => $"Looked in {source.Name()} for the missing files to see if they are being downloaded";

protected override void DoCheck(SetProgressDelegate prog, ICollection<ShowItem> showList, TVDoc.ScanSettings settings)
{
List<TorrentEntry>? downloading = source.GetTorrentDownloads();
if (downloading is null)
{
LOGGER.Warn($"Failed to get current downloads from {source.Name()}");
return;
}
SearchForAppropriateDownloads(downloading, DownloadApp.qBitTorrent, settings);
}

}
}
25 changes: 25 additions & 0 deletions TVRename/ScanActivity/Finders/DownloadingProviderFinder.cs
@@ -0,0 +1,25 @@
using System.Collections.Generic;

namespace TVRename
{
abstract class DownloadingProviderFinder : DownloadingFinder
{
private readonly IDownloadProvider source;
protected DownloadingProviderFinder(TVDoc doc, IDownloadProvider source) : base(doc)
{
this.source = source;
}
protected override string CheckName() => $"Looked in {source.Name()} for the missing files to see if they are being downloaded";

protected override void DoCheck(SetProgressDelegate prog, ICollection<ShowItem> showList, TVDoc.ScanSettings settings)
{
List<TorrentEntry>? downloading = source.GetTorrentDownloads();
if (downloading is null)
{
LOGGER.Warn($"Failed to get current downloads from {source.Name()}");
return;
}
SearchForAppropriateDownloads(downloading, DownloadApp.qBitTorrent, settings);
}
}
}
1 change: 1 addition & 0 deletions TVRename/TVRename.csproj
Expand Up @@ -292,6 +292,7 @@
<Compile Include="Exporter\UpcomingExporter.cs" />
<Compile Include="Exporter\UpcomingiCAL.cs" />
<Compile Include="ScanActivity\Finders\DownloadFinder.cs" />
<Compile Include="ScanActivity\Finders\DownloadingProviderFinder.cs" />
<Compile Include="ScanActivity\Finders\FinderHelper.cs" />
<Compile Include="ScanActivity\Finders\LibraryFolderFileFinder.cs" />
<Compile Include="DownloadProvider\qBitTorrent.cs" />
Expand Down

0 comments on commit e66bf5a

Please sign in to comment.