New: Add Search Capabilities to Indexer API & InfoBox

pull/921/head
bakerboy448 3 years ago committed by Qstick
parent 6ce9c779c1
commit 4f056bf228

@ -4,6 +4,7 @@ import DescriptionList from 'Components/DescriptionList/DescriptionList';
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem'; import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
import DescriptionListItemDescription from 'Components/DescriptionList/DescriptionListItemDescription'; import DescriptionListItemDescription from 'Components/DescriptionList/DescriptionListItemDescription';
import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionListItemTitle'; import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionListItemTitle';
import FieldSet from 'Components/FieldSet';
import Link from 'Components/Link/Link'; import Link from 'Components/Link/Link';
import ModalBody from 'Components/Modal/ModalBody'; import ModalBody from 'Components/Modal/ModalBody';
import ModalContent from 'Components/Modal/ModalContent'; import ModalContent from 'Components/Modal/ModalContent';
@ -20,6 +21,7 @@ function IndexerInfoModalContent(props) {
language, language,
indexerUrls, indexerUrls,
protocol, protocol,
capabilities,
onModalClose onModalClose
} = props; } = props;
@ -30,6 +32,8 @@ function IndexerInfoModalContent(props) {
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
<FieldSet legend={translate('IndexerDetails')}>
<div className={styles.groups}>
<DescriptionList> <DescriptionList>
<DescriptionListItem <DescriptionListItem
descriptionClassName={styles.description} descriptionClassName={styles.description}
@ -51,18 +55,53 @@ function IndexerInfoModalContent(props) {
title={translate('Language')} title={translate('Language')}
data={language ?? '-'} data={language ?? '-'}
/> />
<DescriptionListItemTitle>{translate('IndexerSite')}</DescriptionListItemTitle>
<DescriptionListItemTitle>Indexer Site</DescriptionListItemTitle>
<DescriptionListItemDescription> <DescriptionListItemDescription>
<Link to={indexerUrls[0]}>{indexerUrls[0]}</Link> <Link to={indexerUrls[0]}>{indexerUrls[0]}</Link>
</DescriptionListItemDescription> </DescriptionListItemDescription>
<DescriptionListItemTitle>{`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`}</DescriptionListItemTitle> <DescriptionListItemTitle>{`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`}</DescriptionListItemTitle>
<DescriptionListItemDescription> <DescriptionListItemDescription>
{`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`} {`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`}
</DescriptionListItemDescription> </DescriptionListItemDescription>
</DescriptionList> </DescriptionList>
</div>
</FieldSet>
<FieldSet legend={translate('SearchCapabilities')}>
<div className={styles.groups}>
<DescriptionList>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('RawSearchSupported')}
data={capabilities.supportsRawSearch ? translate('Yes') : translate('No')}
/>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('SearchTypes')}
data={capabilities.search.length === 0 ? translate('NotSupported') : capabilities.search[0]}
/>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('TVSearchTypes')}
data={capabilities.tv.length === 0 ? translate('NotSupported') : capabilities.tv.join(', ')}
/>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('MovieSearchTypes')}
data={capabilities.movie.length === 0 ? translate('NotSupported') : capabilities.movie.join(', ')}
/>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('BookSearchTypes')}
data={capabilities.book.length === 0 ? translate('NotSupported') : capabilities.book.join(', ')}
/>
<DescriptionListItem
descriptionClassName={styles.description}
title={translate('MusicSearchTypes')}
data={capabilities.music.length === 0 ? translate('NotSupported') : capabilities.music.join(', ')}
/>
</DescriptionList>
</div>
</FieldSet>
</ModalBody> </ModalBody>
</ModalContent > </ModalContent >
); );
@ -76,6 +115,7 @@ IndexerInfoModalContent.propTypes = {
language: PropTypes.string.isRequired, language: PropTypes.string.isRequired,
indexerUrls: PropTypes.arrayOf(PropTypes.string).isRequired, indexerUrls: PropTypes.arrayOf(PropTypes.string).isRequired,
protocol: PropTypes.string.isRequired, protocol: PropTypes.string.isRequired,
capabilities: PropTypes.object.isRequired,
onModalClose: PropTypes.func.isRequired onModalClose: PropTypes.func.isRequired
}; };

@ -55,6 +55,7 @@
"BindAddress": "Bind Address", "BindAddress": "Bind Address",
"BindAddressHelpText": "Valid IP4 address or '*' for all interfaces", "BindAddressHelpText": "Valid IP4 address or '*' for all interfaces",
"BookSearch": "Book Search", "BookSearch": "Book Search",
"BookSearchTypes": "Book Search Types",
"Branch": "Branch", "Branch": "Branch",
"BranchUpdate": "Branch to use to update Prowlarr", "BranchUpdate": "Branch to use to update Prowlarr",
"BranchUpdateMechanism": "Branch used by external update mechanism", "BranchUpdateMechanism": "Branch used by external update mechanism",
@ -172,13 +173,14 @@
"Indexer": "Indexer", "Indexer": "Indexer",
"IndexerAlreadySetup": "At least one instace of indexer is already setup", "IndexerAlreadySetup": "At least one instace of indexer is already setup",
"IndexerAuth": "Indexer Auth", "IndexerAuth": "Indexer Auth",
"IndexerDetails": "Indexer Details",
"IndexerFlags": "Indexer Flags", "IndexerFlags": "Indexer Flags",
"IndexerHealthCheckNoIndexers": "No indexers enabled, Prowlarr will not return search results", "IndexerHealthCheckNoIndexers": "No indexers enabled, Prowlarr will not return search results",
"IndexerInfo": "Indexer Info", "IndexerInfo": "Indexer Info",
"IndexerLongTermStatusCheckAllClientMessage": "All indexers are unavailable due to failures for more than 6 hours", "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}", "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", "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", "IndexerPriority": "Indexer Priority",
"IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.", "IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.",
"IndexerProxies": "Indexer Proxies", "IndexerProxies": "Indexer Proxies",
@ -189,6 +191,7 @@
"IndexerRss": "Indexer Rss", "IndexerRss": "Indexer Rss",
"Indexers": "Indexers", "Indexers": "Indexers",
"IndexerSettingsSummary": "Configure various global Indexer settings including Proxies.", "IndexerSettingsSummary": "Configure various global Indexer settings including Proxies.",
"IndexerSite": "Indexer Site",
"IndexersSelectedInterp": "{0} Indexer(s) Selected", "IndexersSelectedInterp": "{0} Indexer(s) Selected",
"IndexerStatusCheckAllClientMessage": "All indexers are unavailable due to failures", "IndexerStatusCheckAllClientMessage": "All indexers are unavailable due to failures",
"IndexerStatusCheckSingleClientMessage": "Indexers unavailable due to failures: {0}", "IndexerStatusCheckSingleClientMessage": "Indexers unavailable due to failures: {0}",
@ -219,6 +222,8 @@
"MovieIndexScrollBottom": "Movie Index: Scroll Bottom", "MovieIndexScrollBottom": "Movie Index: Scroll Bottom",
"MovieIndexScrollTop": "Movie Index: Scroll Top", "MovieIndexScrollTop": "Movie Index: Scroll Top",
"MovieSearch": "Movie Search", "MovieSearch": "Movie Search",
"MovieSearchTypes": "Movie Search Types",
"MusicSearchTypes": "Music Search Types",
"Name": "Name", "Name": "Name",
"NetCore": ".NET", "NetCore": ".NET",
"New": "New", "New": "New",
@ -234,6 +239,7 @@
"Notifications": "Notifications", "Notifications": "Notifications",
"NotificationTriggers": "Notification Triggers", "NotificationTriggers": "Notification Triggers",
"NotificationTriggersHelpText": "Select which events should trigger this notification", "NotificationTriggersHelpText": "Select which events should trigger this notification",
"NotSupported": "Not Supported",
"NoUpdatesAreAvailable": "No updates are available", "NoUpdatesAreAvailable": "No updates are available",
"OAuthPopupMessage": "Pop-ups are being blocked by your browser", "OAuthPopupMessage": "Pop-ups are being blocked by your browser",
"Ok": "Ok", "Ok": "Ok",
@ -279,6 +285,7 @@
"QueryOptions": "Query Options", "QueryOptions": "Query Options",
"QueryResults": "Query Results", "QueryResults": "Query Results",
"Queue": "Queue", "Queue": "Queue",
"RawSearchSupported": "Raw Search Supported",
"ReadTheWikiForMoreInformation": "Read the Wiki for more information", "ReadTheWikiForMoreInformation": "Read the Wiki for more information",
"Reddit": "Reddit", "Reddit": "Reddit",
"Redirect": "Redirect", "Redirect": "Redirect",
@ -309,8 +316,10 @@
"Scheduled": "Scheduled", "Scheduled": "Scheduled",
"ScriptPath": "Script Path", "ScriptPath": "Script Path",
"Search": "Search", "Search": "Search",
"SearchCapabilities": "Search Capabilities",
"SearchIndexers": "Search Indexers", "SearchIndexers": "Search Indexers",
"SearchType": "Search Type", "SearchType": "Search Type",
"SearchTypes": "Search Types",
"Security": "Security", "Security": "Security",
"Seeders": "Seeders", "Seeders": "Seeders",
"SelectAll": "Select All", "SelectAll": "Select All",
@ -379,6 +388,7 @@
"Torrent": "Torrent", "Torrent": "Torrent",
"Torrents": "Torrents", "Torrents": "Torrents",
"TvSearch": "TV Search", "TvSearch": "TV Search",
"TVSearchTypes": "TV Search Types",
"Type": "Type", "Type": "Type",
"UI": "UI", "UI": "UI",
"UILanguage": "UI Language", "UILanguage": "UI Language",

@ -10,6 +10,12 @@ namespace Prowlarr.Api.V1.Indexers
public int? LimitsMax { get; set; } public int? LimitsMax { get; set; }
public int? LimitsDefault { get; set; } public int? LimitsDefault { get; set; }
public List<IndexerCategory> Categories { get; set; } public List<IndexerCategory> Categories { get; set; }
public bool SupportsRawSearch { get; set; }
public List<SearchParam> SearchParams { get; set; }
public List<TvSearchParam> TvSearchParams { get; set; }
public List<MovieSearchParam> MovieSearchParams { get; set; }
public List<MusicSearchParam> MusicSearchParams { get; set; }
public List<BookSearchParam> BookSearchParams { get; set; }
} }
public static class IndexerCapabilitiesResourceMapper public static class IndexerCapabilitiesResourceMapper
@ -25,7 +31,13 @@ namespace Prowlarr.Api.V1.Indexers
{ {
LimitsMax = model.LimitsMax, LimitsMax = model.LimitsMax,
LimitsDefault = model.LimitsDefault, 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
}; };
} }

Loading…
Cancel
Save