mirror of https://github.com/lidarr/Lidarr
Fixed: Don't prompt to move artist to the same folder (case sensitive)
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
510439570e
commit
342122cbb4
|
@ -8,13 +8,30 @@ import createArtistSelector from 'Store/Selectors/createArtistSelector';
|
|||
import { setArtistValue, saveArtist } from 'Store/Actions/artistActions';
|
||||
import EditArtistModalContent from './EditArtistModalContent';
|
||||
|
||||
function createIsPathChangingSelector() {
|
||||
return createSelector(
|
||||
(state) => state.artist.pendingChanges,
|
||||
createArtistSelector(),
|
||||
(pendingChanges, artist) => {
|
||||
const path = pendingChanges.path;
|
||||
|
||||
if (path == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return artist.path !== path;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.artist,
|
||||
(state) => state.settings.languageProfiles,
|
||||
(state) => state.settings.metadataProfiles,
|
||||
createArtistSelector(),
|
||||
(artistState, languageProfiles, metadataProfiles, artist) => {
|
||||
createIsPathChangingSelector(),
|
||||
(artistState, languageProfiles, metadataProfiles, artist, isPathChanging) => {
|
||||
const {
|
||||
isSaving,
|
||||
saveError,
|
||||
|
@ -37,7 +54,7 @@ function createMapStateToProps() {
|
|||
artistName: artist.artistName,
|
||||
isSaving,
|
||||
saveError,
|
||||
isPathChanging: pendingChanges.hasOwnProperty('path'),
|
||||
isPathChanging,
|
||||
originalPath: artist.path,
|
||||
item: settings.settings,
|
||||
showLanguageProfile: languageProfiles.items.length > 1,
|
||||
|
|
Loading…
Reference in New Issue