-
-
-
-
-
-
-
-
- {
- onDownload.value &&
-
-
-
- }
-
-
-
-
-
-
-
-
-
value;
-
- case filterTypes.GREATER_THAN_OR_EQUAL:
- return rejectionCount >= value;
-
- case filterTypes.LESS_THAN:
- return rejectionCount < value;
-
- case filterTypes.LESS_THAN_OR_EQUAL:
- return rejectionCount <= value;
-
- case filterTypes.NOT_EQUAL:
- return rejectionCount !== value;
-
- default:
- return false;
- }
- }
- },
-
filterBuilderProps: [
{
name: 'title',
@@ -204,17 +149,6 @@ export const defaultState = {
name: 'peers',
label: translate('Peers'),
type: filterBuilderTypes.NUMBER
- },
- {
- name: 'quality',
- label: translate('Quality'),
- type: filterBuilderTypes.EXACT,
- valueType: filterBuilderValueTypes.QUALITY
- },
- {
- name: 'rejectionCount',
- label: translate('RejectionCount'),
- type: filterBuilderTypes.NUMBER
}
],
selectedFilterKey: 'all'
@@ -235,7 +169,7 @@ export const SET_RELEASES_SORT = 'releases/setReleasesSort';
export const CLEAR_RELEASES = 'releases/clearReleases';
export const GRAB_RELEASE = 'releases/grabRelease';
export const UPDATE_RELEASE = 'releases/updateRelease';
-export const SET_RELEASES_FILTER = 'releases/setMovieReleasesFilter';
+export const SET_RELEASES_FILTER = 'releases/setReleasesFilter';
export const SET_RELEASES_TABLE_OPTION = 'releases/setReleasesTableOption';
//
diff --git a/src/NzbDrone.Core/Applications/AppIndexerMapService.cs b/src/NzbDrone.Core/Applications/AppIndexerMapService.cs
index f79132b52..dc361931d 100644
--- a/src/NzbDrone.Core/Applications/AppIndexerMapService.cs
+++ b/src/NzbDrone.Core/Applications/AppIndexerMapService.cs
@@ -1,5 +1,9 @@
using System.Collections.Generic;
+using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
+using NzbDrone.Core.Indexers;
+using NzbDrone.Core.Messaging.Events;
+using NzbDrone.Core.ThingiProvider.Events;
namespace NzbDrone.Core.Applications
{
@@ -10,7 +14,7 @@ namespace NzbDrone.Core.Applications
void DeleteAllForApp(int appId);
}
- public class AppIndexerMapService : IAppIndexerMapService
+ public class AppIndexerMapService : IAppIndexerMapService, IHandle>
{
private readonly IAppIndexerMapRepository _appIndexerMapRepository;
@@ -33,5 +37,10 @@ namespace NzbDrone.Core.Applications
{
return _appIndexerMapRepository.Insert(appIndexerMap);
}
+
+ public void Handle(ProviderDeletedEvent message)
+ {
+ _appIndexerMapRepository.DeleteAllForApp(message.ProviderId);
+ }
}
}
diff --git a/src/NzbDrone.Core/Datastore/Migration/001_initial_setup.cs b/src/NzbDrone.Core/Datastore/Migration/001_initial_setup.cs
index 757c4b40d..3164dad6c 100644
--- a/src/NzbDrone.Core/Datastore/Migration/001_initial_setup.cs
+++ b/src/NzbDrone.Core/Datastore/Migration/001_initial_setup.cs
@@ -14,7 +14,6 @@ namespace NzbDrone.Core.Datastore.Migration
Create.TableForModel("History")
.WithColumn("IndexerId").AsInt32()
- .WithColumn("SourceTitle").AsString()
.WithColumn("Date").AsDateTime()
.WithColumn("Data").AsString()
.WithColumn("EventType").AsInt32().Nullable()
diff --git a/src/NzbDrone.Core/History/History.cs b/src/NzbDrone.Core/History/History.cs
index 7126a09c4..0071fe252 100644
--- a/src/NzbDrone.Core/History/History.cs
+++ b/src/NzbDrone.Core/History/History.cs
@@ -12,7 +12,6 @@ namespace NzbDrone.Core.History
}
public int IndexerId { get; set; }
- public string SourceTitle { get; set; }
public DateTime Date { get; set; }
public HistoryEventType EventType { get; set; }
public Dictionary Data { get; set; }
diff --git a/src/NzbDrone.Core/History/HistoryService.cs b/src/NzbDrone.Core/History/HistoryService.cs
index 2283457c9..e2e25a503 100644
--- a/src/NzbDrone.Core/History/HistoryService.cs
+++ b/src/NzbDrone.Core/History/HistoryService.cs
@@ -86,10 +86,14 @@ namespace NzbDrone.Core.History
{
Date = DateTime.UtcNow,
IndexerId = message.IndexerId,
- EventType = HistoryEventType.IndexerQuery,
- SourceTitle = message.Query
+ EventType = HistoryEventType.IndexerQuery
};
+ history.Data.Add("ElapsedTime", message.Time.ToString());
+ history.Data.Add("Query", message.Query.SceneTitles.FirstOrDefault() ?? string.Empty);
+ history.Data.Add("Successful", message.Successful.ToString());
+ history.Data.Add("QueryResults", message.Results.HasValue ? message.Results.ToString() : null);
+
_historyRepository.Insert(history);
}
diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs
index d54280311..2fcbae2b7 100644
--- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs
+++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using NLog;
@@ -53,10 +54,15 @@ namespace NzbDrone.Core.IndexerSearch
{
var spec = new TSpec()
{
- InteractiveSearch = interactiveSearch
+ InteractiveSearch = interactiveSearch,
+ SceneTitles = new List()
};
- spec.SceneTitles = new List { query };
+ if (query.IsNotNullOrWhiteSpace())
+ {
+ spec.SceneTitles.Add(query);
+ }
+
spec.IndexerIds = indexerIds;
return spec;
@@ -86,21 +92,25 @@ namespace NzbDrone.Core.IndexerSearch
taskList.Add(taskFactory.StartNew(() =>
{
+ var sw = Stopwatch.StartNew();
try
{
var indexerReports = searchAction(indexerLocal);
- _eventAggregator.PublishEvent(new IndexerQueryEvent(indexer.Definition.Id, criteriaBase.QueryTitles.Join(", ")));
-
lock (reports)
{
reports.AddRange(indexerReports);
}
+
+ _eventAggregator.PublishEvent(new IndexerQueryEvent(indexer.Definition.Id, criteriaBase, sw.ElapsedMilliseconds, true, indexerReports.Count()));
}
catch (Exception e)
{
+ _eventAggregator.PublishEvent(new IndexerQueryEvent(indexer.Definition.Id, criteriaBase, sw.ElapsedMilliseconds, false));
_logger.Error(e, "Error while searching for {0}", criteriaBase);
}
+
+ sw.Stop();
}).LogExceptions());
}
diff --git a/src/NzbDrone.Core/Indexers/IndexerQueryEvent.cs b/src/NzbDrone.Core/Indexers/IndexerQueryEvent.cs
index dada6bb30..e83500c7c 100644
--- a/src/NzbDrone.Core/Indexers/IndexerQueryEvent.cs
+++ b/src/NzbDrone.Core/Indexers/IndexerQueryEvent.cs
@@ -1,16 +1,23 @@
using NzbDrone.Common.Messaging;
+using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers
{
public class IndexerQueryEvent : IEvent
{
public int IndexerId { get; set; }
- public string Query { get; set; }
+ public SearchCriteriaBase Query { get; set; }
+ public long Time { get; set; }
+ public bool Successful { get; set; }
+ public int? Results { get; set; }
- public IndexerQueryEvent(int indexerId, string query)
+ public IndexerQueryEvent(int indexerId, SearchCriteriaBase query, long time, bool successful, int? results = null)
{
IndexerId = indexerId;
Query = query;
+ Time = time;
+ Successful = successful;
+ Results = results;
}
}
}
diff --git a/src/Prowlarr.Api.V1/History/HistoryResource.cs b/src/Prowlarr.Api.V1/History/HistoryResource.cs
index 46e8951c0..4075489ee 100644
--- a/src/Prowlarr.Api.V1/History/HistoryResource.cs
+++ b/src/Prowlarr.Api.V1/History/HistoryResource.cs
@@ -1,16 +1,13 @@
using System;
using System.Collections.Generic;
using NzbDrone.Core.History;
-using NzbDrone.Core.Languages;
using Prowlarr.Http.REST;
namespace Prowlarr.Api.V1.History
{
public class HistoryResource : RestResource
{
- public int MovieId { get; set; }
- public string SourceTitle { get; set; }
- public bool QualityCutoffNotMet { get; set; }
+ public int IndexerId { get; set; }
public DateTime Date { get; set; }
public string DownloadId { get; set; }
@@ -32,8 +29,7 @@ namespace Prowlarr.Api.V1.History
{
Id = model.Id,
- MovieId = model.IndexerId,
- SourceTitle = model.SourceTitle,
+ IndexerId = model.IndexerId,
//QualityCutoffNotMet
Date = model.Date,