mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Add Search Capabilities to Indexer API & InfoBox
This commit is contained in:
@@ -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) {
|
||||
</ModalHeader>
|
||||
|
||||
<ModalBody>
|
||||
<DescriptionList>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Id')}
|
||||
data={id}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Description')}
|
||||
data={description ? description : '-'}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Encoding')}
|
||||
data={encoding ? encoding : '-'}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Language')}
|
||||
data={language ?? '-'}
|
||||
/>
|
||||
|
||||
<DescriptionListItemTitle>Indexer Site</DescriptionListItemTitle>
|
||||
<DescriptionListItemDescription>
|
||||
<Link to={indexerUrls[0]}>{indexerUrls[0]}</Link>
|
||||
</DescriptionListItemDescription>
|
||||
|
||||
<DescriptionListItemTitle>{`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`}</DescriptionListItemTitle>
|
||||
<DescriptionListItemDescription>
|
||||
{`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`}
|
||||
</DescriptionListItemDescription>
|
||||
|
||||
</DescriptionList>
|
||||
<FieldSet legend={translate('IndexerDetails')}>
|
||||
<div className={styles.groups}>
|
||||
<DescriptionList>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Id')}
|
||||
data={id}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Description')}
|
||||
data={description ? description : '-'}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Encoding')}
|
||||
data={encoding ? encoding : '-'}
|
||||
/>
|
||||
<DescriptionListItem
|
||||
descriptionClassName={styles.description}
|
||||
title={translate('Language')}
|
||||
data={language ?? '-'}
|
||||
/>
|
||||
<DescriptionListItemTitle>{translate('IndexerSite')}</DescriptionListItemTitle>
|
||||
<DescriptionListItemDescription>
|
||||
<Link to={indexerUrls[0]}>{indexerUrls[0]}</Link>
|
||||
</DescriptionListItemDescription>
|
||||
<DescriptionListItemTitle>{`${protocol === 'usenet' ? 'Newznab' : 'Torznab'} Url`}</DescriptionListItemTitle>
|
||||
<DescriptionListItemDescription>
|
||||
{`${window.location.origin}${window.Prowlarr.urlBase}/${id}/api`}
|
||||
</DescriptionListItemDescription>
|
||||
</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>
|
||||
</ModalContent>
|
||||
</ModalContent >
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
@@ -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",
|
||||
|
@@ -10,6 +10,12 @@ namespace Prowlarr.Api.V1.Indexers
|
||||
public int? LimitsMax { get; set; }
|
||||
public int? LimitsDefault { 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
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user