From 4f056bf2288468cd4988cd78a94d6f3c584f9ed9 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Sat, 29 Jan 2022 17:37:29 -0600 Subject: [PATCH] New: Add Search Capabilities to Indexer API & InfoBox --- .../Indexer/Info/IndexerInfoModalContent.js | 108 ++++++++++++------ src/NzbDrone.Core/Localization/Core/en.json | 12 +- .../Indexers/IndexerCapabilityResource.cs | 14 ++- 3 files changed, 98 insertions(+), 36 deletions(-) diff --git a/frontend/src/Indexer/Info/IndexerInfoModalContent.js b/frontend/src/Indexer/Info/IndexerInfoModalContent.js index 8a0ec5d5e..47ad33e17 100644 --- a/frontend/src/Indexer/Info/IndexerInfoModalContent.js +++ b/frontend/src/Indexer/Info/IndexerInfoModalContent.js @@ -4,6 +4,7 @@ import DescriptionList from 'Components/DescriptionList/DescriptionList'; import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem'; import DescriptionListItemDescription from 'Components/DescriptionList/DescriptionListItemDescription'; import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionListItemTitle'; +import FieldSet from 'Components/FieldSet'; import Link from 'Components/Link/Link'; import ModalBody from 'Components/Modal/ModalBody'; import ModalContent from 'Components/Modal/ModalContent'; @@ -20,6 +21,7 @@ function IndexerInfoModalContent(props) { language, indexerUrls, protocol, + capabilities, onModalClose } = props; @@ -30,41 +32,78 @@ function IndexerInfoModalContent(props) { - - - - - - - Indexer Site - - {indexerUrls[0]} - - - {`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`} - - {`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`} - - - +
+
+ + + + + + {translate('IndexerSite')} + + {indexerUrls[0]} + + {`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`} + + {`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`} + + +
+
+
+
+ + + + + + + + +
+
- + ); } @@ -76,6 +115,7 @@ IndexerInfoModalContent.propTypes = { language: PropTypes.string.isRequired, indexerUrls: PropTypes.arrayOf(PropTypes.string).isRequired, protocol: PropTypes.string.isRequired, + capabilities: PropTypes.object.isRequired, onModalClose: PropTypes.func.isRequired }; diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 7c851310b..a0a9beeac 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -55,6 +55,7 @@ "BindAddress": "Bind Address", "BindAddressHelpText": "Valid IP4 address or '*' for all interfaces", "BookSearch": "Book Search", + "BookSearchTypes": "Book Search Types", "Branch": "Branch", "BranchUpdate": "Branch to use to update Prowlarr", "BranchUpdateMechanism": "Branch used by external update mechanism", @@ -172,13 +173,14 @@ "Indexer": "Indexer", "IndexerAlreadySetup": "At least one instace of indexer is already setup", "IndexerAuth": "Indexer Auth", + "IndexerDetails": "Indexer Details", "IndexerFlags": "Indexer Flags", "IndexerHealthCheckNoIndexers": "No indexers enabled, Prowlarr will not return search results", "IndexerInfo": "Indexer Info", "IndexerLongTermStatusCheckAllClientMessage": "All indexers are unavailable due to failures for more than 6 hours", "IndexerLongTermStatusCheckSingleClientMessage": "Indexers unavailable due to failures for more than 6 hours: {0}", - "IndexerObsoleteCheckMessage": "Indexers are obsolete or have been updated: {0}. Please remove and (or) re-add to Prowlarr", "IndexerNoDefCheckMessage": "Indexers have no definition and will not work: {0}. Please remove and (or) re-add to Prowlarr", + "IndexerObsoleteCheckMessage": "Indexers are obsolete or have been updated: {0}. Please remove and (or) re-add to Prowlarr", "IndexerPriority": "Indexer Priority", "IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.", "IndexerProxies": "Indexer Proxies", @@ -189,6 +191,7 @@ "IndexerRss": "Indexer Rss", "Indexers": "Indexers", "IndexerSettingsSummary": "Configure various global Indexer settings including Proxies.", + "IndexerSite": "Indexer Site", "IndexersSelectedInterp": "{0} Indexer(s) Selected", "IndexerStatusCheckAllClientMessage": "All indexers are unavailable due to failures", "IndexerStatusCheckSingleClientMessage": "Indexers unavailable due to failures: {0}", @@ -219,6 +222,8 @@ "MovieIndexScrollBottom": "Movie Index: Scroll Bottom", "MovieIndexScrollTop": "Movie Index: Scroll Top", "MovieSearch": "Movie Search", + "MovieSearchTypes": "Movie Search Types", + "MusicSearchTypes": "Music Search Types", "Name": "Name", "NetCore": ".NET", "New": "New", @@ -234,6 +239,7 @@ "Notifications": "Notifications", "NotificationTriggers": "Notification Triggers", "NotificationTriggersHelpText": "Select which events should trigger this notification", + "NotSupported": "Not Supported", "NoUpdatesAreAvailable": "No updates are available", "OAuthPopupMessage": "Pop-ups are being blocked by your browser", "Ok": "Ok", @@ -279,6 +285,7 @@ "QueryOptions": "Query Options", "QueryResults": "Query Results", "Queue": "Queue", + "RawSearchSupported": "Raw Search Supported", "ReadTheWikiForMoreInformation": "Read the Wiki for more information", "Reddit": "Reddit", "Redirect": "Redirect", @@ -309,8 +316,10 @@ "Scheduled": "Scheduled", "ScriptPath": "Script Path", "Search": "Search", + "SearchCapabilities": "Search Capabilities", "SearchIndexers": "Search Indexers", "SearchType": "Search Type", + "SearchTypes": "Search Types", "Security": "Security", "Seeders": "Seeders", "SelectAll": "Select All", @@ -379,6 +388,7 @@ "Torrent": "Torrent", "Torrents": "Torrents", "TvSearch": "TV Search", + "TVSearchTypes": "TV Search Types", "Type": "Type", "UI": "UI", "UILanguage": "UI Language", diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerCapabilityResource.cs b/src/Prowlarr.Api.V1/Indexers/IndexerCapabilityResource.cs index ffeee495a..f97204289 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerCapabilityResource.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerCapabilityResource.cs @@ -10,6 +10,12 @@ namespace Prowlarr.Api.V1.Indexers public int? LimitsMax { get; set; } public int? LimitsDefault { get; set; } public List Categories { get; set; } + public bool SupportsRawSearch { get; set; } + public List SearchParams { get; set; } + public List TvSearchParams { get; set; } + public List MovieSearchParams { get; set; } + public List MusicSearchParams { get; set; } + public List BookSearchParams { get; set; } } public static class IndexerCapabilitiesResourceMapper @@ -25,7 +31,13 @@ namespace Prowlarr.Api.V1.Indexers { LimitsMax = model.LimitsMax, LimitsDefault = model.LimitsDefault, - Categories = model.Categories.GetTorznabCategoryTree() + Categories = model.Categories.GetTorznabCategoryTree(), + SupportsRawSearch = model.SupportsRawSearch, + SearchParams = model.SearchParams, + TvSearchParams = model.TvSearchParams, + MovieSearchParams = model.MovieSearchParams, + MusicSearchParams = model.MusicSearchParams, + BookSearchParams = model.BookSearchParams }; }