mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 13:02:23 -07:00
Fixed: Refresh album files after renaming
This commit is contained in:
parent
e6e50c8784
commit
edad5d0a74
2 changed files with 31 additions and 3 deletions
|
@ -70,6 +70,12 @@ function createMapStateToProps() {
|
||||||
isCommandExecuting(isSearchingCommand) &&
|
isCommandExecuting(isSearchingCommand) &&
|
||||||
isSearchingCommand.body.albumIds.indexOf(album.id) > -1
|
isSearchingCommand.body.albumIds.indexOf(album.id) > -1
|
||||||
);
|
);
|
||||||
|
const isRenamingFiles = isCommandExecuting(findCommand(commands, { name: commandNames.RENAME_FILES, artistId: artist.id }));
|
||||||
|
const isRenamingArtistCommand = findCommand(commands, { name: commandNames.RENAME_ARTIST });
|
||||||
|
const isRenamingArtist = (
|
||||||
|
isCommandExecuting(isRenamingArtistCommand) &&
|
||||||
|
isRenamingArtistCommand.body.artistIds.indexOf(artist.id) > -1
|
||||||
|
);
|
||||||
|
|
||||||
const isFetching = tracks.isFetching || isTrackFilesFetching;
|
const isFetching = tracks.isFetching || isTrackFilesFetching;
|
||||||
const isPopulated = tracks.isPopulated && isTrackFilesPopulated;
|
const isPopulated = tracks.isPopulated && isTrackFilesPopulated;
|
||||||
|
@ -80,6 +86,8 @@ function createMapStateToProps() {
|
||||||
shortDateFormat: uiSettings.shortDateFormat,
|
shortDateFormat: uiSettings.shortDateFormat,
|
||||||
artist,
|
artist,
|
||||||
isSearching,
|
isSearching,
|
||||||
|
isRenamingFiles,
|
||||||
|
isRenamingArtist,
|
||||||
isFetching,
|
isFetching,
|
||||||
isPopulated,
|
isPopulated,
|
||||||
tracksError,
|
tracksError,
|
||||||
|
@ -113,8 +121,27 @@ class AlbumDetailsConnector extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (!_.isEqual(getMonitoredReleases(prevProps), getMonitoredReleases(this.props)) ||
|
const {
|
||||||
(prevProps.anyReleaseOk === false && this.props.anyReleaseOk === true)) {
|
id,
|
||||||
|
anyReleaseOk,
|
||||||
|
isRenamingFiles,
|
||||||
|
isRenamingArtist
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
if (
|
||||||
|
(prevProps.isRenamingFiles && !isRenamingFiles) ||
|
||||||
|
(prevProps.isRenamingArtist && !isRenamingArtist) ||
|
||||||
|
!_.isEqual(getMonitoredReleases(prevProps), getMonitoredReleases(this.props)) ||
|
||||||
|
(prevProps.anyReleaseOk === false && anyReleaseOk === true)
|
||||||
|
) {
|
||||||
|
this.unpopulate();
|
||||||
|
this.populate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the id has changed we need to clear the album
|
||||||
|
// files and fetch from the server.
|
||||||
|
|
||||||
|
if (prevProps.id !== id) {
|
||||||
this.unpopulate();
|
this.unpopulate();
|
||||||
this.populate();
|
this.populate();
|
||||||
}
|
}
|
||||||
|
@ -174,6 +201,8 @@ class AlbumDetailsConnector extends Component {
|
||||||
AlbumDetailsConnector.propTypes = {
|
AlbumDetailsConnector.propTypes = {
|
||||||
id: PropTypes.number,
|
id: PropTypes.number,
|
||||||
anyReleaseOk: PropTypes.bool,
|
anyReleaseOk: PropTypes.bool,
|
||||||
|
isRenamingFiles: PropTypes.bool.isRequired,
|
||||||
|
isRenamingArtist: PropTypes.bool.isRequired,
|
||||||
isAlbumFetching: PropTypes.bool,
|
isAlbumFetching: PropTypes.bool,
|
||||||
isAlbumPopulated: PropTypes.bool,
|
isAlbumPopulated: PropTypes.bool,
|
||||||
foreignAlbumId: PropTypes.string.isRequired,
|
foreignAlbumId: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -107,7 +107,6 @@ function createMapStateToProps() {
|
||||||
const isRefreshing = isArtistRefreshing || allArtistRefreshing;
|
const isRefreshing = isArtistRefreshing || allArtistRefreshing;
|
||||||
const isSearching = isCommandExecuting(findCommand(commands, { name: commandNames.ARTIST_SEARCH, artistId: artist.id }));
|
const isSearching = isCommandExecuting(findCommand(commands, { name: commandNames.ARTIST_SEARCH, artistId: artist.id }));
|
||||||
const isRenamingFiles = isCommandExecuting(findCommand(commands, { name: commandNames.RENAME_FILES, artistId: artist.id }));
|
const isRenamingFiles = isCommandExecuting(findCommand(commands, { name: commandNames.RENAME_FILES, artistId: artist.id }));
|
||||||
|
|
||||||
const isRenamingArtistCommand = findCommand(commands, { name: commandNames.RENAME_ARTIST });
|
const isRenamingArtistCommand = findCommand(commands, { name: commandNames.RENAME_ARTIST });
|
||||||
const isRenamingArtist = (
|
const isRenamingArtist = (
|
||||||
isCommandExecuting(isRenamingArtistCommand) &&
|
isCommandExecuting(isRenamingArtistCommand) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue