1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-24 11:43:07 +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:
Mark McDowall 2022-03-28 17:50:11 -07:00
parent ebb48a19cc
commit be1acfc2f9

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() {