Fixed: Re-assigning file that was mapped to multiple episodes to only one of those episodes

Closes #4946
This commit is contained in:
Mark McDowall 2022-03-28 17:50:11 -07:00
parent ebb48a19cc
commit be1acfc2f9
1 changed files with 2 additions and 6 deletions

View File

@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import { sortDirections } from 'Helpers/Props';
import { fetchInteractiveImportItems, setInteractiveImportSort, clearInteractiveImport, setInteractiveImportMode } from 'Store/Actions/interactiveImportActions';
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
@ -29,12 +30,7 @@ function isSameEpisodeFile(file, originalFile) {
return false;
}
const episodeIds = episodes.map((e) => e.id);
const originalEpisodeIds = originalFile.episodes ? originalFile.episodes.map((e) => e.id) : [];
return episodeIds.every((episodeId) => {
return originalEpisodeIds.indexOf(episodeId) >= 0;
});
return !hasDifferentItems(originalFile.episodes, episodes);
}
function createMapStateToProps() {