mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-11-24 19:52:39 +01:00
Fixed: Re-assigning file that was mapped to multiple episodes to only one of those episodes
Closes #4946
This commit is contained in:
parent
ebb48a19cc
commit
be1acfc2f9
@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
||||||
import { sortDirections } from 'Helpers/Props';
|
import { sortDirections } from 'Helpers/Props';
|
||||||
import { fetchInteractiveImportItems, setInteractiveImportSort, clearInteractiveImport, setInteractiveImportMode } from 'Store/Actions/interactiveImportActions';
|
import { fetchInteractiveImportItems, setInteractiveImportSort, clearInteractiveImport, setInteractiveImportMode } from 'Store/Actions/interactiveImportActions';
|
||||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||||
@ -29,12 +30,7 @@ function isSameEpisodeFile(file, originalFile) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const episodeIds = episodes.map((e) => e.id);
|
return !hasDifferentItems(originalFile.episodes, episodes);
|
||||||
const originalEpisodeIds = originalFile.episodes ? originalFile.episodes.map((e) => e.id) : [];
|
|
||||||
|
|
||||||
return episodeIds.every((episodeId) => {
|
|
||||||
return originalEpisodeIds.indexOf(episodeId) >= 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMapStateToProps() {
|
function createMapStateToProps() {
|
||||||
|
Loading…
Reference in New Issue
Block a user