mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: (History) Save limit and offset in history data
This commit is contained in:
@@ -18,6 +18,8 @@ function HistoryDetails(props) {
|
|||||||
query,
|
query,
|
||||||
queryResults,
|
queryResults,
|
||||||
categories,
|
categories,
|
||||||
|
limit,
|
||||||
|
offset,
|
||||||
source,
|
source,
|
||||||
url
|
url
|
||||||
} = data;
|
} = data;
|
||||||
@@ -31,43 +33,66 @@ function HistoryDetails(props) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{
|
{
|
||||||
!!indexer &&
|
indexer ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Indexer')}
|
title={translate('Indexer')}
|
||||||
data={indexer.name}
|
data={indexer.name}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('QueryResults')}
|
title={translate('QueryResults')}
|
||||||
data={queryResults ? queryResults : '-'}
|
data={queryResults ? queryResults : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Categories')}
|
title={translate('Categories')}
|
||||||
data={categories ? categories : '-'}
|
data={categories ? categories : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
limit ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Limit')}
|
||||||
|
data={limit}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
offset ?
|
||||||
|
<DescriptionListItem
|
||||||
|
title={translate('Offset')}
|
||||||
|
data={offset}
|
||||||
|
/> :
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Source')}
|
title={translate('Source')}
|
||||||
data={source}
|
data={source}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Url')}
|
title={translate('Url')}
|
||||||
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
|
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
@@ -83,35 +108,39 @@ function HistoryDetails(props) {
|
|||||||
return (
|
return (
|
||||||
<DescriptionList>
|
<DescriptionList>
|
||||||
{
|
{
|
||||||
!!indexer &&
|
indexer ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Indexer')}
|
title={translate('Indexer')}
|
||||||
data={indexer.name}
|
data={indexer.name}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Source')}
|
title={translate('Source')}
|
||||||
data={source ? source : '-'}
|
data={source ? source : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('GrabTitle')}
|
title={translate('GrabTitle')}
|
||||||
data={grabTitle ? grabTitle : '-'}
|
data={grabTitle ? grabTitle : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
!!data &&
|
data ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Url')}
|
title={translate('Url')}
|
||||||
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
|
data={url ? <Link to={url}>{translate('Link')}</Link> : '-'}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
@@ -124,11 +153,12 @@ function HistoryDetails(props) {
|
|||||||
title={translate('Auth')}
|
title={translate('Auth')}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
!!indexer &&
|
indexer ?
|
||||||
<DescriptionListItem
|
<DescriptionListItem
|
||||||
title={translate('Indexer')}
|
title={translate('Indexer')}
|
||||||
data={indexer.name}
|
data={indexer.name}
|
||||||
/>
|
/> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
</DescriptionList>
|
</DescriptionList>
|
||||||
);
|
);
|
||||||
|
@@ -66,7 +66,7 @@ class HistoryRow extends Component {
|
|||||||
data
|
data
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const { query, queryType } = data;
|
const { query, queryType, limit, offset } = data;
|
||||||
|
|
||||||
let searchQuery = query;
|
let searchQuery = query;
|
||||||
let categories = [];
|
let categories = [];
|
||||||
@@ -111,7 +111,7 @@ class HistoryRow extends Component {
|
|||||||
searchQuery += `${searchParams}`;
|
searchQuery += `${searchParams}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.onSearchPress(searchQuery, indexer.id, categories, queryType);
|
this.props.onSearchPress(searchQuery, indexer.id, categories, queryType, parseInt(limit), parseInt(offset));
|
||||||
};
|
};
|
||||||
|
|
||||||
onDetailsPress = () => {
|
onDetailsPress = () => {
|
||||||
@@ -312,6 +312,12 @@ class HistoryRow extends Component {
|
|||||||
key={name}
|
key={name}
|
||||||
className={styles.details}
|
className={styles.details}
|
||||||
>
|
>
|
||||||
|
<IconButton
|
||||||
|
name={icons.INFO}
|
||||||
|
onPress={this.onDetailsPress}
|
||||||
|
title={translate('HistoryDetails')}
|
||||||
|
/>
|
||||||
|
|
||||||
{
|
{
|
||||||
eventType === 'indexerQuery' ?
|
eventType === 'indexerQuery' ?
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -321,11 +327,6 @@ class HistoryRow extends Component {
|
|||||||
/> :
|
/> :
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
<IconButton
|
|
||||||
name={icons.INFO}
|
|
||||||
onPress={this.onDetailsPress}
|
|
||||||
title={translate('HistoryDetails')}
|
|
||||||
/>
|
|
||||||
</TableRowCell>
|
</TableRowCell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -48,8 +48,15 @@ class HistoryRowConnector extends Component {
|
|||||||
//
|
//
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
onSearchPress = (term, indexerId, categories, type) => {
|
onSearchPress = (query, indexerId, categories, type, limit, offset) => {
|
||||||
this.props.setSearchDefault({ searchQuery: term, searchIndexerIds: [indexerId], searchCategories: categories, searchType: type });
|
this.props.setSearchDefault({
|
||||||
|
searchQuery: query,
|
||||||
|
searchIndexerIds: [indexerId],
|
||||||
|
searchCategories: categories,
|
||||||
|
searchType: type,
|
||||||
|
searchLimit: limit,
|
||||||
|
searchOffset: offset
|
||||||
|
});
|
||||||
this.props.push(`${window.Prowlarr.urlBase}/search`);
|
this.props.push(`${window.Prowlarr.urlBase}/search`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -27,7 +27,9 @@ class SearchFooter extends Component {
|
|||||||
defaultIndexerIds,
|
defaultIndexerIds,
|
||||||
defaultCategories,
|
defaultCategories,
|
||||||
defaultSearchQuery,
|
defaultSearchQuery,
|
||||||
defaultSearchType
|
defaultSearchType,
|
||||||
|
defaultSearchLimit,
|
||||||
|
defaultSearchOffset
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
@@ -38,8 +40,8 @@ class SearchFooter extends Component {
|
|||||||
searchQuery: defaultSearchQuery || '',
|
searchQuery: defaultSearchQuery || '',
|
||||||
searchIndexerIds: defaultIndexerIds,
|
searchIndexerIds: defaultIndexerIds,
|
||||||
searchCategories: defaultCategories,
|
searchCategories: defaultCategories,
|
||||||
searchLimit: 100,
|
searchLimit: defaultSearchLimit,
|
||||||
searchOffset: 0,
|
searchOffset: defaultSearchOffset,
|
||||||
newSearch: true
|
newSearch: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -303,6 +305,8 @@ SearchFooter.propTypes = {
|
|||||||
defaultCategories: PropTypes.arrayOf(PropTypes.number).isRequired,
|
defaultCategories: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||||
defaultSearchQuery: PropTypes.string.isRequired,
|
defaultSearchQuery: PropTypes.string.isRequired,
|
||||||
defaultSearchType: PropTypes.string.isRequired,
|
defaultSearchType: PropTypes.string.isRequired,
|
||||||
|
defaultSearchLimit: PropTypes.number.isRequired,
|
||||||
|
defaultSearchOffset: PropTypes.number.isRequired,
|
||||||
selectedCount: PropTypes.number.isRequired,
|
selectedCount: PropTypes.number.isRequired,
|
||||||
itemCount: PropTypes.number.isRequired,
|
itemCount: PropTypes.number.isRequired,
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
|
@@ -13,14 +13,18 @@ function createMapStateToProps() {
|
|||||||
searchQuery: defaultSearchQuery,
|
searchQuery: defaultSearchQuery,
|
||||||
searchIndexerIds: defaultIndexerIds,
|
searchIndexerIds: defaultIndexerIds,
|
||||||
searchCategories: defaultCategories,
|
searchCategories: defaultCategories,
|
||||||
searchType: defaultSearchType
|
searchType: defaultSearchType,
|
||||||
|
searchLimit: defaultSearchLimit,
|
||||||
|
searchOffset: defaultSearchOffset
|
||||||
} = releases.defaults;
|
} = releases.defaults;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
defaultSearchQuery,
|
defaultSearchQuery,
|
||||||
defaultIndexerIds,
|
defaultIndexerIds,
|
||||||
defaultCategories,
|
defaultCategories,
|
||||||
defaultSearchType
|
defaultSearchType,
|
||||||
|
defaultSearchLimit,
|
||||||
|
defaultSearchOffset
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -40,7 +40,9 @@ export const defaultState = {
|
|||||||
searchType: 'search',
|
searchType: 'search',
|
||||||
searchQuery: '',
|
searchQuery: '',
|
||||||
searchIndexerIds: [],
|
searchIndexerIds: [],
|
||||||
searchCategories: []
|
searchCategories: [],
|
||||||
|
searchLimit: 100,
|
||||||
|
searchOffset: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
columns: [
|
columns: [
|
||||||
|
@@ -170,6 +170,9 @@ namespace NzbDrone.Core.History
|
|||||||
history.Data.Add("Genre", bookSearchCriteria.Genre);
|
history.Data.Add("Genre", bookSearchCriteria.Genre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
history.Data.Add("Limit", message.Query.Limit?.ToString());
|
||||||
|
history.Data.Add("Offset", message.Query.Offset?.ToString());
|
||||||
|
|
||||||
// Clean empty data
|
// Clean empty data
|
||||||
history.Data = history.Data.Where(d => d.Value != null).ToDictionary(x => x.Key, x => x.Value);
|
history.Data = history.Data.Where(d => d.Value != null).ToDictionary(x => x.Key, x => x.Value);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user