mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 21:42:16 -07:00
New: Manual import refreshes decisions when artist/album updated (#540)
This commit is contained in:
parent
d62b4e49f9
commit
32c75cfcbc
15 changed files with 211 additions and 43 deletions
|
@ -224,6 +224,16 @@ class SignalRConnector extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
handleManualimport = (body) => {
|
||||
if (body.action === 'updated') {
|
||||
this.props.dispatchUpdateItem({
|
||||
section: 'interactiveImport',
|
||||
updateOnly: true,
|
||||
...body.resource
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleQueue = () => {
|
||||
if (this.props.isQueuePopulated) {
|
||||
this.props.dispatchFetchQueue();
|
||||
|
|
|
@ -5,6 +5,7 @@ import { connect } from 'react-redux';
|
|||
import { createSelector } from 'reselect';
|
||||
import {
|
||||
updateInteractiveImportItem,
|
||||
saveInteractiveImportItem,
|
||||
fetchInteractiveImportAlbums,
|
||||
setInteractiveImportAlbumsSort,
|
||||
clearInteractiveImportAlbums
|
||||
|
@ -25,7 +26,8 @@ const mapDispatchToProps = {
|
|||
fetchInteractiveImportAlbums,
|
||||
setInteractiveImportAlbumsSort,
|
||||
clearInteractiveImportAlbums,
|
||||
updateInteractiveImportItem
|
||||
updateInteractiveImportItem,
|
||||
saveInteractiveImportItem
|
||||
};
|
||||
|
||||
class SelectAlbumModalContentConnector extends Component {
|
||||
|
@ -61,8 +63,10 @@ class SelectAlbumModalContentConnector extends Component {
|
|||
this.props.updateInteractiveImportItem({
|
||||
id,
|
||||
album,
|
||||
tracks: []
|
||||
tracks: [],
|
||||
rejections: []
|
||||
});
|
||||
this.props.saveInteractiveImportItem({ id });
|
||||
});
|
||||
|
||||
this.props.onModalClose(true);
|
||||
|
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { updateInteractiveImportItem } from 'Store/Actions/interactiveImportActions';
|
||||
import { updateInteractiveImportItem, saveInteractiveImportItem } from 'Store/Actions/interactiveImportActions';
|
||||
import createAllArtistSelector from 'Store/Selectors/createAllArtistSelector';
|
||||
import SelectArtistModalContent from './SelectArtistModalContent';
|
||||
|
||||
|
@ -29,7 +29,8 @@ function createMapStateToProps() {
|
|||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
updateInteractiveImportItem
|
||||
updateInteractiveImportItem,
|
||||
saveInteractiveImportItem
|
||||
};
|
||||
|
||||
class SelectArtistModalContentConnector extends Component {
|
||||
|
@ -45,8 +46,10 @@ class SelectArtistModalContentConnector extends Component {
|
|||
id,
|
||||
artist,
|
||||
album: undefined,
|
||||
tracks: []
|
||||
tracks: [],
|
||||
rejections: []
|
||||
});
|
||||
this.props.saveInteractiveImportItem({ id });
|
||||
});
|
||||
|
||||
this.props.onModalClose(true);
|
||||
|
|
|
@ -324,6 +324,7 @@ class InteractiveImportRow extends Component {
|
|||
id={id}
|
||||
artistId={artist && artist.id}
|
||||
albumId={album && album.id}
|
||||
filename={relativePath}
|
||||
onModalClose={this.onSelectTrackModalClose}
|
||||
/>
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ class SelectTrackModalContent extends Component {
|
|||
sortKey,
|
||||
sortDirection,
|
||||
onSortPress,
|
||||
onModalClose
|
||||
onModalClose,
|
||||
filename
|
||||
} = this.props;
|
||||
|
||||
const {
|
||||
|
@ -96,12 +97,13 @@ class SelectTrackModalContent extends Component {
|
|||
selectedState
|
||||
} = this.state;
|
||||
|
||||
const title = `Manual Import - Select Track(s): ${filename}`;
|
||||
const errorMessage = getErrorMessage(error, 'Unable to load tracks');
|
||||
|
||||
return (
|
||||
<ModalContent onModalClose={onModalClose}>
|
||||
<ModalHeader>
|
||||
Manual Import - Select Track(s)
|
||||
{title}
|
||||
</ModalHeader>
|
||||
|
||||
<ModalBody>
|
||||
|
@ -179,7 +181,8 @@ SelectTrackModalContent.propTypes = {
|
|||
sortDirection: PropTypes.string,
|
||||
onSortPress: PropTypes.func.isRequired,
|
||||
onTracksSelect: PropTypes.func.isRequired,
|
||||
onModalClose: PropTypes.func.isRequired
|
||||
onModalClose: PropTypes.func.isRequired,
|
||||
filename: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
export default SelectTrackModalContent;
|
||||
|
|
|
@ -8,6 +8,7 @@ import { sortDirections } from 'Helpers/Props';
|
|||
import createSetClientSideCollectionSortReducer from './Creators/Reducers/createSetClientSideCollectionSortReducer';
|
||||
import createFetchHandler from './Creators/createFetchHandler';
|
||||
import createHandleActions from './Creators/createHandleActions';
|
||||
import createSaveProviderHandler from './Creators/createSaveProviderHandler';
|
||||
import { set, update } from './baseActions';
|
||||
|
||||
//
|
||||
|
@ -25,6 +26,7 @@ export const defaultState = {
|
|||
isPopulated: false,
|
||||
error: null,
|
||||
items: [],
|
||||
pendingChanges: {},
|
||||
sortKey: 'quality',
|
||||
sortDirection: sortDirections.DESCENDING,
|
||||
recentFolders: [],
|
||||
|
@ -67,6 +69,7 @@ export const persistState = [
|
|||
|
||||
export const FETCH_INTERACTIVE_IMPORT_ITEMS = 'FETCH_INTERACTIVE_IMPORT_ITEMS';
|
||||
export const UPDATE_INTERACTIVE_IMPORT_ITEM = 'UPDATE_INTERACTIVE_IMPORT_ITEM';
|
||||
export const SAVE_INTERACTIVE_IMPORT_ITEM = 'SAVE_INTERACTIVE_IMPORT_ITEM';
|
||||
export const SET_INTERACTIVE_IMPORT_SORT = 'SET_INTERACTIVE_IMPORT_SORT';
|
||||
export const CLEAR_INTERACTIVE_IMPORT = 'CLEAR_INTERACTIVE_IMPORT';
|
||||
export const ADD_RECENT_FOLDER = 'ADD_RECENT_FOLDER';
|
||||
|
@ -83,6 +86,7 @@ export const CLEAR_INTERACTIVE_IMPORT_ALBUMS = 'CLEAR_INTERACTIVE_IMPORT_ALBUMS'
|
|||
export const fetchInteractiveImportItems = createThunk(FETCH_INTERACTIVE_IMPORT_ITEMS);
|
||||
export const setInteractiveImportSort = createAction(SET_INTERACTIVE_IMPORT_SORT);
|
||||
export const updateInteractiveImportItem = createAction(UPDATE_INTERACTIVE_IMPORT_ITEM);
|
||||
export const saveInteractiveImportItem = createThunk(SAVE_INTERACTIVE_IMPORT_ITEM);
|
||||
export const clearInteractiveImport = createAction(CLEAR_INTERACTIVE_IMPORT);
|
||||
export const addRecentFolder = createAction(ADD_RECENT_FOLDER);
|
||||
export const removeRecentFolder = createAction(REMOVE_RECENT_FOLDER);
|
||||
|
@ -131,6 +135,8 @@ export const actionHandlers = handleThunks({
|
|||
});
|
||||
},
|
||||
|
||||
[SAVE_INTERACTIVE_IMPORT_ITEM]: createSaveProviderHandler(section, '/manualimport'),
|
||||
|
||||
[FETCH_INTERACTIVE_IMPORT_ALBUMS]: createFetchHandler('interactiveImport.albums', '/album')
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue