diff --git a/frontend/src/Components/Form/IndexersSelectInputConnector.js b/frontend/src/Components/Form/IndexersSelectInputConnector.js index 032b303de..3dbc429d2 100644 --- a/frontend/src/Components/Form/IndexersSelectInputConnector.js +++ b/frontend/src/Components/Form/IndexersSelectInputConnector.js @@ -46,7 +46,7 @@ class IndexersSelectInputConnector extends Component { IndexersSelectInputConnector.propTypes = { name: PropTypes.string.isRequired, - indexerIds: PropTypes.number.isRequired, + indexerIds: PropTypes.number, value: PropTypes.arrayOf(PropTypes.number).isRequired, values: PropTypes.arrayOf(PropTypes.object).isRequired, onChange: PropTypes.func.isRequired diff --git a/frontend/src/Components/Page/Header/PageHeader.css b/frontend/src/Components/Page/Header/PageHeader.css index 8cd5728a6..ab45b66df 100644 --- a/frontend/src/Components/Page/Header/PageHeader.css +++ b/frontend/src/Components/Page/Header/PageHeader.css @@ -51,6 +51,12 @@ flex-grow: 1; } +.actionMenu { + &:hover { + color: #515253; + } +} + .translate { composes: link from '~Components/Link/Link.css'; @@ -63,7 +69,7 @@ line-height: 60px; &:hover { - color: $toobarButtonHoverColor; + color: #515253; } } diff --git a/frontend/src/Indexer/Editor/MovieEditorFooter.js b/frontend/src/Indexer/Editor/MovieEditorFooter.js index 65707706f..690242be6 100644 --- a/frontend/src/Indexer/Editor/MovieEditorFooter.js +++ b/frontend/src/Indexer/Editor/MovieEditorFooter.js @@ -158,8 +158,7 @@ MovieEditorFooter.propTypes = { saveError: PropTypes.object, isDeleting: PropTypes.bool.isRequired, deleteError: PropTypes.object, - onSaveSelected: PropTypes.func.isRequired, - onOrganizeMoviePress: PropTypes.func.isRequired + onSaveSelected: PropTypes.func.isRequired }; export default MovieEditorFooter; diff --git a/frontend/src/Indexer/History/MovieHistoryRow.css b/frontend/src/Indexer/History/MovieHistoryRow.css deleted file mode 100644 index 101e23783..000000000 --- a/frontend/src/Indexer/History/MovieHistoryRow.css +++ /dev/null @@ -1,11 +0,0 @@ -.actions { - composes: cell from '~Components/Table/Cells/TableRowCell.css'; - - min-width: 70px; -} - -.sourceTitle { - composes: cell from '~Components/Table/Cells/TableRowCell.css'; - - word-break: break-word; -} diff --git a/frontend/src/Indexer/History/MovieHistoryRow.js b/frontend/src/Indexer/History/MovieHistoryRow.js deleted file mode 100644 index 453c27f13..000000000 --- a/frontend/src/Indexer/History/MovieHistoryRow.js +++ /dev/null @@ -1,162 +0,0 @@ -import HistoryDetailsModal from 'Activity/History/Details/HistoryDetailsModal'; -import HistoryEventTypeCell from 'Activity/History/HistoryEventTypeCell'; -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import IconButton from 'Components/Link/IconButton'; -import ConfirmModal from 'Components/Modal/ConfirmModal'; -import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector'; -import TableRowCell from 'Components/Table/Cells/TableRowCell'; -import TableRow from 'Components/Table/TableRow'; -import { icons, kinds } from 'Helpers/Props'; -import MovieLanguage from 'Indexer/MovieLanguage'; -import MovieQuality from 'Indexer/MovieQuality'; -import translate from 'Utilities/String/translate'; -import styles from './MovieHistoryRow.css'; - -class MovieHistoryRow extends Component { - - // - // Lifecycle - - constructor(props, context) { - super(props, context); - - this.state = { - isMarkAsFailedModalOpen: false, - isDetailsModalOpen: false - }; - } - - // - // Listeners - - onMarkAsFailedPress = () => { - this.setState({ isMarkAsFailedModalOpen: true }); - } - - onConfirmMarkAsFailed = () => { - this.props.onMarkAsFailedPress(this.props.id); - this.setState({ isMarkAsFailedModalOpen: false }); - } - - onMarkAsFailedModalClose = () => { - this.setState({ isMarkAsFailedModalOpen: false }); - } - - onDetailsPress = () => { - this.setState({ isDetailsModalOpen: true }); - } - - onDetailsModalClose = () => { - this.setState({ isDetailsModalOpen: false }); - } - - // - // Render - - render() { - const { - eventType, - sourceTitle, - quality, - languages, - qualityCutoffNotMet, - date, - data, - isMarkingAsFailed, - shortDateFormat, - timeFormat, - onMarkAsFailedPress - } = this.props; - - const { - isMarkAsFailedModalOpen - } = this.state; - - return ( - - - - - {sourceTitle} - - - - - - - - - - - - - - - - { - eventType === 'grabbed' && - - } - - - - - - - ); - } -} - -MovieHistoryRow.propTypes = { - id: PropTypes.number.isRequired, - eventType: PropTypes.string.isRequired, - sourceTitle: PropTypes.string.isRequired, - languages: PropTypes.arrayOf(PropTypes.object).isRequired, - quality: PropTypes.object.isRequired, - qualityCutoffNotMet: PropTypes.bool.isRequired, - date: PropTypes.string.isRequired, - data: PropTypes.object.isRequired, - isMarkingAsFailed: PropTypes.bool, - movie: PropTypes.object.isRequired, - shortDateFormat: PropTypes.string.isRequired, - timeFormat: PropTypes.string.isRequired, - onMarkAsFailedPress: PropTypes.func.isRequired -}; - -export default MovieHistoryRow; diff --git a/frontend/src/Indexer/History/MovieHistoryRowConnector.js b/frontend/src/Indexer/History/MovieHistoryRowConnector.js deleted file mode 100644 index 6d34226e8..000000000 --- a/frontend/src/Indexer/History/MovieHistoryRowConnector.js +++ /dev/null @@ -1,27 +0,0 @@ -import { connect } from 'react-redux'; -import { createSelector } from 'reselect'; -import { fetchHistory, markAsFailed } from 'Store/Actions/historyActions'; -import createIndexerSelector from 'Store/Selectors/createIndexerSelector'; -import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; -import MovieHistoryRow from './MovieHistoryRow'; - -function createMapStateToProps() { - return createSelector( - createIndexerSelector(), - createUISettingsSelector(), - (movie, uiSettings) => { - return { - movie, - shortDateFormat: uiSettings.shortDateFormat, - timeFormat: uiSettings.timeFormat - }; - } - ); -} - -const mapDispatchToProps = { - fetchHistory, - markAsFailed -}; - -export default connect(createMapStateToProps, mapDispatchToProps)(MovieHistoryRow); diff --git a/frontend/src/Indexer/History/MovieHistoryTable.js b/frontend/src/Indexer/History/MovieHistoryTable.js deleted file mode 100644 index f5cfd2404..000000000 --- a/frontend/src/Indexer/History/MovieHistoryTable.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import MovieHistoryTableContentConnector from './MovieHistoryTableContentConnector'; - -function MovieHistoryTable(props) { - const { - ...otherProps - } = props; - - return ( - - ); -} - -MovieHistoryTable.propTypes = { -}; - -export default MovieHistoryTable; diff --git a/frontend/src/Indexer/History/MovieHistoryTableContent.css b/frontend/src/Indexer/History/MovieHistoryTableContent.css deleted file mode 100644 index 34be6dff1..000000000 --- a/frontend/src/Indexer/History/MovieHistoryTableContent.css +++ /dev/null @@ -1,5 +0,0 @@ -.blankpad { - padding-top: 10px; - padding-bottom: 10px; - padding-left: 2em; -} diff --git a/frontend/src/Indexer/History/MovieHistoryTableContent.js b/frontend/src/Indexer/History/MovieHistoryTableContent.js deleted file mode 100644 index b43ae68a9..000000000 --- a/frontend/src/Indexer/History/MovieHistoryTableContent.js +++ /dev/null @@ -1,114 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import IconButton from 'Components/Link/IconButton'; -import LoadingIndicator from 'Components/Loading/LoadingIndicator'; -import Table from 'Components/Table/Table'; -import TableBody from 'Components/Table/TableBody'; -import { icons } from 'Helpers/Props'; -import translate from 'Utilities/String/translate'; -import MovieHistoryRowConnector from './MovieHistoryRowConnector'; -import styles from './MovieHistoryTableContent.css'; - -const columns = [ - { - name: 'eventType', - isVisible: true - }, - { - name: 'sourceTitle', - label: translate('SourceTitle'), - isVisible: true - }, - { - name: 'languages', - label: translate('Languages'), - isVisible: true - }, - { - name: 'quality', - label: translate('Quality'), - isVisible: true - }, - { - name: 'customFormats', - label: translate('CustomFormats'), - isSortable: false, - isVisible: true - }, - { - name: 'date', - label: translate('Date'), - isVisible: true - }, - { - name: 'actions', - label: React.createElement(IconButton, { name: icons.ADVANCED_SETTINGS }), - isVisible: true - } -]; - -class MovieHistoryTableContent extends Component { - - // - // Render - - render() { - const { - isFetching, - isPopulated, - error, - items, - onMarkAsFailedPress - } = this.props; - - const hasItems = !!items.length; - - return ( -
- { - isFetching && - - } - - { - !isFetching && !!error && -
Unable to load history
- } - - { - isPopulated && !hasItems && !error && -
No history
- } - - { - isPopulated && hasItems && !error && - - - { - items.map((item) => { - return ( - - ); - }) - } - -
- } -
- ); - } -} - -MovieHistoryTableContent.propTypes = { - isFetching: PropTypes.bool.isRequired, - isPopulated: PropTypes.bool.isRequired, - error: PropTypes.object, - items: PropTypes.arrayOf(PropTypes.object).isRequired, - onMarkAsFailedPress: PropTypes.func.isRequired -}; - -export default MovieHistoryTableContent; diff --git a/frontend/src/Indexer/History/MovieHistoryTableContentConnector.js b/frontend/src/Indexer/History/MovieHistoryTableContentConnector.js deleted file mode 100644 index a59626693..000000000 --- a/frontend/src/Indexer/History/MovieHistoryTableContentConnector.js +++ /dev/null @@ -1,55 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { connect } from 'react-redux'; -import { createSelector } from 'reselect'; -import { movieHistoryMarkAsFailed } from 'Store/Actions/movieHistoryActions'; -import MovieHistoryTableContent from './MovieHistoryTableContent'; - -function createMapStateToProps() { - return createSelector( - (state) => state.movieHistory, - (movieHistory) => { - return movieHistory; - } - ); -} - -const mapDispatchToProps = { - movieHistoryMarkAsFailed -}; - -class MovieHistoryTableContentConnector extends Component { - - // - // Listeners - - onMarkAsFailedPress = (historyId) => { - const { - movieId - } = this.props; - - this.props.movieHistoryMarkAsFailed({ - historyId, - movieId - }); - } - - // - // Render - - render() { - return ( - - ); - } -} - -MovieHistoryTableContentConnector.propTypes = { - movieId: PropTypes.number.isRequired, - movieHistoryMarkAsFailed: PropTypes.func.isRequired -}; - -export default connect(createMapStateToProps, mapDispatchToProps)(MovieHistoryTableContentConnector); diff --git a/frontend/src/Indexer/Index/IndexerIndexConnector.js b/frontend/src/Indexer/Index/IndexerIndexConnector.js index 217643fb9..fd876a8e5 100644 --- a/frontend/src/Indexer/Index/IndexerIndexConnector.js +++ b/frontend/src/Indexer/Index/IndexerIndexConnector.js @@ -15,11 +15,11 @@ function createMapStateToProps() { createIndexerClientSideCollectionItemsSelector('indexerIndex'), createDimensionsSelector(), ( - movies, + indexers, dimensionsState ) => { return { - ...movies, + ...indexers, isSmallScreen: dimensionsState.isSmallScreen }; } diff --git a/frontend/src/Search/Menus/SearchIndexSortMenu.js b/frontend/src/Search/Menus/SearchIndexSortMenu.js index 3e4ae0574..6b3623f68 100644 --- a/frontend/src/Search/Menus/SearchIndexSortMenu.js +++ b/frontend/src/Search/Menus/SearchIndexSortMenu.js @@ -30,7 +30,7 @@ function SearchIndexSortMenu(props) {
+ +
+ + + {label} + + { + isSaving && + + } +
+ ); +} + +SearchFooterLabel.propTypes = { + className: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + isSaving: PropTypes.bool.isRequired +}; + +SearchFooterLabel.defaultProps = { + className: styles.label +}; + +export default SearchFooterLabel; diff --git a/frontend/src/Search/SearchIndex.js b/frontend/src/Search/SearchIndex.js index a4a4c5ef4..27723906f 100644 --- a/frontend/src/Search/SearchIndex.js +++ b/frontend/src/Search/SearchIndex.js @@ -11,6 +11,7 @@ import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection'; import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator'; import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper'; import { align, icons, sortDirections } from 'Helpers/Props'; +import NoIndexer from 'Indexer/NoIndexer'; import * as keyCodes from 'Utilities/Constants/keyCodes'; import getErrorMessage from 'Utilities/Object/getErrorMessage'; import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder'; @@ -83,7 +84,7 @@ class SearchIndex extends Component { } = this.props; // Reset if not sorting by sortTitle - if (sortKey !== 'sortTitle') { + if (sortKey !== 'title') { this.setState({ jumpBarItems: { order: [] } }); return; } @@ -161,6 +162,7 @@ class SearchIndex extends Component { onScroll, onSortSelect, onFilterSelect, + hasIndexers, ...otherProps } = this.props; @@ -174,8 +176,6 @@ class SearchIndex extends Component { const isLoaded = !!(!error && isPopulated && items.length && scroller); const hasNoIndexer = !totalItems; - console.log(hasNoIndexer); - return ( @@ -247,7 +247,12 @@ class SearchIndex extends Component { } { - !error && !isFetching && !items.length && + !error && !isFetching && !hasIndexers && + + } + + { + !error && !isFetching && hasIndexers && !items.length && } @@ -286,7 +291,8 @@ SearchIndex.propTypes = { onSortSelect: PropTypes.func.isRequired, onFilterSelect: PropTypes.func.isRequired, onSearchPress: PropTypes.func.isRequired, - onScroll: PropTypes.func.isRequired + onScroll: PropTypes.func.isRequired, + hasIndexers: PropTypes.func.isRequired }; export default SearchIndex; diff --git a/frontend/src/Search/SearchIndexConnector.js b/frontend/src/Search/SearchIndexConnector.js index da8e98559..26f59a022 100644 --- a/frontend/src/Search/SearchIndexConnector.js +++ b/frontend/src/Search/SearchIndexConnector.js @@ -6,19 +6,23 @@ import withScrollPosition from 'Components/withScrollPosition'; import { fetchReleases, setReleasesFilter, setReleasesSort, setReleasesTableOption } from 'Store/Actions/releaseActions'; import scrollPositions from 'Store/scrollPositions'; import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector'; +import createIndexerClientSideCollectionItemsSelector from 'Store/Selectors/createIndexerClientSideCollectionItemsSelector'; import createReleaseClientSideCollectionItemsSelector from 'Store/Selectors/createReleaseClientSideCollectionItemsSelector'; import SearchIndex from './SearchIndex'; function createMapStateToProps() { return createSelector( + createIndexerClientSideCollectionItemsSelector('indexerIndex'), createReleaseClientSideCollectionItemsSelector('releases'), createDimensionsSelector(), ( - movies, + indexers, + releases, dimensionsState ) => { return { - ...movies, + ...releases, + hasIndexers: indexers.items.length > 0, isSmallScreen: dimensionsState.isSmallScreen }; } diff --git a/frontend/src/Search/Table/SearchIndexHeader.css b/frontend/src/Search/Table/SearchIndexHeader.css index 7322d6ebe..c7be5e061 100644 --- a/frontend/src/Search/Table/SearchIndexHeader.css +++ b/frontend/src/Search/Table/SearchIndexHeader.css @@ -1,4 +1,4 @@ -.status { +.protocol { composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css'; flex: 0 0 60px; diff --git a/frontend/src/Search/Table/SearchIndexRow.css b/frontend/src/Search/Table/SearchIndexRow.css index 68c921b1d..2ca871cd5 100644 --- a/frontend/src/Search/Table/SearchIndexRow.css +++ b/frontend/src/Search/Table/SearchIndexRow.css @@ -5,7 +5,7 @@ align-items: center; } -.status { +.protocol { composes: cell; flex: 0 0 60px; diff --git a/frontend/src/Search/Table/SearchIndexTableConnector.js b/frontend/src/Search/Table/SearchIndexTableConnector.js index 355523904..d79ea3630 100644 --- a/frontend/src/Search/Table/SearchIndexTableConnector.js +++ b/frontend/src/Search/Table/SearchIndexTableConnector.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { setMovieSort } from 'Store/Actions/indexerIndexActions'; +import { setReleasesSort } from 'Store/Actions/releaseActions'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import SearchIndexTable from './SearchIndexTable'; @@ -23,7 +23,7 @@ function createMapStateToProps() { function createMapDispatchToProps(dispatch, props) { return { onSortPress(sortKey) { - dispatch(setMovieSort({ sortKey })); + dispatch(setReleasesSort({ sortKey })); } }; } diff --git a/frontend/src/Settings/Indexers/Indexers/AddIndexerItem.js b/frontend/src/Settings/Indexers/Indexers/AddIndexerItem.js index 6d8e9fadc..d0b02e45b 100644 --- a/frontend/src/Settings/Indexers/Indexers/AddIndexerItem.js +++ b/frontend/src/Settings/Indexers/Indexers/AddIndexerItem.js @@ -27,6 +27,7 @@ class AddIndexerItem extends Component { render() { const { + name, implementation, implementationName, infoLink, @@ -47,7 +48,7 @@ class AddIndexerItem extends Component {
- {implementationName} + {name}
@@ -101,6 +102,7 @@ class AddIndexerItem extends Component { } AddIndexerItem.propTypes = { + name: PropTypes.string.isRequired, implementation: PropTypes.string.isRequired, implementationName: PropTypes.string.isRequired, infoLink: PropTypes.string.isRequired, diff --git a/frontend/src/Settings/UI/UISettings.js b/frontend/src/Settings/UI/UISettings.js index 5f0e2c570..1b9be3964 100644 --- a/frontend/src/Settings/UI/UISettings.js +++ b/frontend/src/Settings/UI/UISettings.js @@ -88,33 +88,6 @@ class UISettings extends Component { id="uiSettings" {...otherProps} > -
- - {translate('SettingsFirstDayOfWeek')} - - - - - - {translate('SettingsWeekColumnHeader')} - - - -
-
{translate('SettingsShortDateFormat')} diff --git a/frontend/src/Store/Actions/indexerIndexActions.js b/frontend/src/Store/Actions/indexerIndexActions.js index 0f3a7bd2e..5317d70d5 100644 --- a/frontend/src/Store/Actions/indexerIndexActions.js +++ b/frontend/src/Store/Actions/indexerIndexActions.js @@ -60,25 +60,25 @@ export const defaultState = { name: 'protocol', label: translate('Protocol'), isSortable: true, - isVisible: false + isVisible: true }, { name: 'privacy', label: translate('Privacy'), isSortable: true, - isVisible: false + isVisible: true }, { name: 'added', label: translate('Added'), isSortable: true, - isVisible: false + isVisible: true }, { name: 'capabilities', - label: 'Capabilities', + label: 'Categories', isSortable: false, - isVisible: false + isVisible: true }, { name: 'tags', diff --git a/frontend/src/Store/Actions/releaseActions.js b/frontend/src/Store/Actions/releaseActions.js index 2339c74f3..56160cbf1 100644 --- a/frontend/src/Store/Actions/releaseActions.js +++ b/frontend/src/Store/Actions/releaseActions.js @@ -26,7 +26,7 @@ export const defaultState = { isPopulated: false, error: null, items: [], - sortKey: 'releaseWeight', + sortKey: 'title', sortDirection: sortDirections.ASCENDING, columns: [ diff --git a/frontend/src/Styles/Variables/colors.js b/frontend/src/Styles/Variables/colors.js index eb39f2b8b..fa87b81e9 100644 --- a/frontend/src/Styles/Variables/colors.js +++ b/frontend/src/Styles/Variables/colors.js @@ -113,8 +113,8 @@ module.exports = { // // Toolbar - toobarButtonHoverColor: '#ffc230', - toobarButtonSelectedColor: '#ffc230', + toobarButtonHoverColor: '#e66000', + toobarButtonSelectedColor: '#e66000', // // Scroller diff --git a/frontend/src/System/Status/MoreInfo/MoreInfo.js b/frontend/src/System/Status/MoreInfo/MoreInfo.js index cae7d8b22..1546a89bd 100644 --- a/frontend/src/System/Status/MoreInfo/MoreInfo.js +++ b/frontend/src/System/Status/MoreInfo/MoreInfo.js @@ -17,7 +17,7 @@ class MoreInfo extends Component { Home page - prowlarr.video + prowlarr.com Discord diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 0836089b7..3413fe911 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -13,11 +13,10 @@ namespace NzbDrone.Core.IndexerSearch.Definitions private static readonly Regex BeginningThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); public List SceneTitles { get; set; } - public virtual bool UserInvokedSearch { get; set; } public virtual bool InteractiveSearch { get; set; } + public List IndexerIds { get; set; } public string ImdbId { get; set; } public int TmdbId { get; set; } - public List IndexerIds { get; set; } public List QueryTitles => SceneTitles.Select(GetQueryTitle).ToList(); diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index d9cca36d7..d54280311 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -15,8 +15,8 @@ namespace NzbDrone.Core.IndexerSearch { public interface ISearchForNzb { - List Search(string query, List indexerIds, bool userInvokedSearch, bool interactiveSearch); - NewznabResults Search(NewznabRequest request, List indexerIds, bool userInvokedSearch, bool interactiveSearch); + List Search(string query, List indexerIds, bool interactiveSearch); + NewznabResults Search(NewznabRequest request, List indexerIds, bool interactiveSearch); } public class NzbSearchService : ISearchForNzb @@ -34,26 +34,25 @@ namespace NzbDrone.Core.IndexerSearch _logger = logger; } - public List Search(string query, List indexerIds, bool userInvokedSearch, bool interactiveSearch) + public List Search(string query, List indexerIds, bool interactiveSearch) { - var searchSpec = Get(query, indexerIds, userInvokedSearch, interactiveSearch); + var searchSpec = Get(query, indexerIds, interactiveSearch); return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec); } - public NewznabResults Search(NewznabRequest request, List indexerIds, bool userInvokedSearch, bool interactiveSearch) + public NewznabResults Search(NewznabRequest request, List indexerIds, bool interactiveSearch) { - var searchSpec = Get(request.q, indexerIds, userInvokedSearch, interactiveSearch); + var searchSpec = Get(request.q, indexerIds, interactiveSearch); return new NewznabResults { Releases = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec) }; } - private TSpec Get(string query, List indexerIds, bool userInvokedSearch, bool interactiveSearch) + private TSpec Get(string query, List indexerIds, bool interactiveSearch) where TSpec : SearchCriteriaBase, new() { var spec = new TSpec() { - UserInvokedSearch = userInvokedSearch, InteractiveSearch = interactiveSearch }; diff --git a/src/NzbDrone.Core/Indexers/Definitions/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Definitions/Newznab/Newznab.cs index 055f6d2fc..426fd891e 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Newznab/Newznab.cs @@ -53,10 +53,10 @@ namespace NzbDrone.Core.Indexers.Newznab yield return GetDefinition("Nzb-Tortuga", GetSettings("https://www.nzb-tortuga.com")); yield return GetDefinition("Nzb.su", GetSettings("https://api.nzb.su")); yield return GetDefinition("NZBCat", GetSettings("https://nzb.cat")); - yield return GetDefinition("NZBFinder.ws", GetSettings("https://nzbfinder.ws", categories: new[] { 2030, 2040, 2045, 2050, 2060, 2070, 2080, 2090 })); + yield return GetDefinition("NZBFinder.ws", GetSettings("https://nzbfinder.ws")); yield return GetDefinition("NZBgeek", GetSettings("https://api.nzbgeek.info")); yield return GetDefinition("nzbplanet.net", GetSettings("https://api.nzbplanet.net")); - yield return GetDefinition("omgwtfnzbs", GetSettings("https://api.omgwtfnzbs.me", categories: new[] { 2000, 2020, 2030, 2040, 2045, 2050, 2070 })); + yield return GetDefinition("omgwtfnzbs", GetSettings("https://api.omgwtfnzbs.me")); yield return GetDefinition("OZnzb.com", GetSettings("https://api.oznzb.com")); yield return GetDefinition("SimplyNZBs", GetSettings("https://simplynzbs.com")); yield return GetDefinition("Tabula Rasa", GetSettings("https://www.tabula-rasa.pw", apiPath: @"/api/v1/api")); diff --git a/src/NzbDrone.Core/Indexers/Definitions/Rarbg/Rarbg.cs b/src/NzbDrone.Core/Indexers/Definitions/Rarbg/Rarbg.cs index 19c674ccc..78533536a 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Rarbg/Rarbg.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Rarbg/Rarbg.cs @@ -19,6 +19,27 @@ namespace NzbDrone.Core.Indexers.Rarbg public override DownloadProtocol Protocol => DownloadProtocol.Torrent; public override IndexerPrivacy Privacy => IndexerPrivacy.Public; + + public override IndexerCapabilities Capabilities => new IndexerCapabilities + { + TvSearchParams = new List + { + TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep + }, + MovieSearchParams = new List + { + MovieSearchParam.Q, MovieSearchParam.ImdbId + }, + MusicSearchParams = new List + { + MusicSearchParam.Q + }, + BookSearchParams = new List + { + BookSearchParam.Q + } + }; + public override TimeSpan RateLimit => TimeSpan.FromSeconds(2); public Rarbg(IRarbgTokenProvider tokenProvider, IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, Logger logger) diff --git a/src/NzbDrone.Core/Prowlarr.Core.csproj b/src/NzbDrone.Core/Prowlarr.Core.csproj index fb0138f20..f2be69e9d 100644 --- a/src/NzbDrone.Core/Prowlarr.Core.csproj +++ b/src/NzbDrone.Core/Prowlarr.Core.csproj @@ -17,6 +17,7 @@ + diff --git a/src/Prowlarr.Api.V1/History/HistoryModule.cs b/src/Prowlarr.Api.V1/History/HistoryModule.cs index 86f31ef8a..5a87bda70 100644 --- a/src/Prowlarr.Api.V1/History/HistoryModule.cs +++ b/src/Prowlarr.Api.V1/History/HistoryModule.cs @@ -20,7 +20,7 @@ namespace Prowlarr.Api.V1.History GetResourcePaged = GetHistory; Get("/since", x => GetHistorySince()); - Get("/movie", x => GetMovieHistory()); + Get("/indexer", x => GetIndexerHistory()); } protected HistoryResource MapToResource(NzbDrone.Core.History.History model, bool includeMovie) @@ -75,26 +75,26 @@ namespace Prowlarr.Api.V1.History return _historyService.Since(date, eventType).Select(h => MapToResource(h, includeMovie)).ToList(); } - private List GetMovieHistory() + private List GetIndexerHistory() { - var queryMovieId = Request.Query.MovieId; + var queryIndexerId = Request.Query.IndexerId; var queryEventType = Request.Query.EventType; - if (!queryMovieId.HasValue) + if (!queryIndexerId.HasValue) { - throw new BadRequestException("movieId is missing"); + throw new BadRequestException("indexerId is missing"); } - int movieId = Convert.ToInt32(queryMovieId.Value); + int indexerId = Convert.ToInt32(queryIndexerId.Value); HistoryEventType? eventType = null; - var includeMovie = Request.GetBooleanQueryParameter("includeMovie"); + var includeIndexer = Request.GetBooleanQueryParameter("includeIndexer"); if (queryEventType.HasValue) { eventType = (HistoryEventType)Convert.ToInt32(queryEventType.Value); } - return _historyService.GetByIndexerId(movieId, eventType).Select(h => MapToResource(h, includeMovie)).ToList(); + return _historyService.GetByIndexerId(indexerId, eventType).Select(h => MapToResource(h, includeIndexer)).ToList(); } } } diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs b/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs index c9d9b59ec..c9859bdc7 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerModule.cs @@ -62,8 +62,10 @@ namespace Prowlarr.Api.V1.Indexers Response response = indexerInstance.GetCapabilities().ToXml(); response.ContentType = "application/rss+xml"; return response; + case "tvsearch": + case "music": case "movie": - Response movieResponse = _nzbSearchService.Search(request, new List { indexer.Id }, true, false).ToXml(); + Response movieResponse = _nzbSearchService.Search(request, new List { indexer.Id }, false).ToXml(); movieResponse.ContentType = "application/rss+xml"; return movieResponse; default: diff --git a/src/Prowlarr.Api.V1/Search/SearchModule.cs b/src/Prowlarr.Api.V1/Search/SearchModule.cs index 5288bd104..81621448c 100644 --- a/src/Prowlarr.Api.V1/Search/SearchModule.cs +++ b/src/Prowlarr.Api.V1/Search/SearchModule.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Net; using Nancy.ModelBinding; using NLog; @@ -50,7 +49,7 @@ namespace Prowlarr.Api.V1.Search { try { - var decisions = _nzbSearhService.Search(query, indexerIds, true, true); + var decisions = _nzbSearhService.Search(query, indexerIds, true); return MapDecisions(decisions); }