parent
b2c43fb2a6
commit
48a82ad711
|
@ -58,7 +58,7 @@ function episodesSelector() {
|
|||
}
|
||||
|
||||
export interface SelectedEpisode {
|
||||
fileId: number;
|
||||
id: number;
|
||||
episodes: Episode[];
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ function SelectEpisodeModalContent(props: SelectEpisodeModalContentProps) {
|
|||
return a.seasonNumber - b.seasonNumber;
|
||||
});
|
||||
|
||||
const mappedEpisodes = selectedIds.map((fileId, index): SelectedEpisode => {
|
||||
const mappedEpisodes = selectedIds.map((id, index): SelectedEpisode => {
|
||||
const startingIndex = index * episodesPerFile;
|
||||
const episodes = sortedEpisodes.slice(
|
||||
startingIndex,
|
||||
|
@ -171,7 +171,7 @@ function SelectEpisodeModalContent(props: SelectEpisodeModalContentProps) {
|
|||
);
|
||||
|
||||
return {
|
||||
fileId: fileId as number,
|
||||
id: id as number,
|
||||
episodes,
|
||||
};
|
||||
});
|
||||
|
|
|
@ -51,6 +51,7 @@ import {
|
|||
reprocessInteractiveImportItems,
|
||||
setInteractiveImportMode,
|
||||
setInteractiveImportSort,
|
||||
updateInteractiveImportItem,
|
||||
updateInteractiveImportItems,
|
||||
} from 'Store/Actions/interactiveImportActions';
|
||||
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
|
||||
|
@ -616,13 +617,17 @@ function InteractiveImportModalContent(
|
|||
);
|
||||
|
||||
const onEpisodesSelect = useCallback(
|
||||
(episodes: SelectedEpisode[]) => {
|
||||
(selectedEpisodes: SelectedEpisode[]) => {
|
||||
selectedEpisodes.forEach((selectedEpisode) => {
|
||||
const { id, episodes } = selectedEpisode;
|
||||
|
||||
dispatch(
|
||||
updateInteractiveImportItems({
|
||||
ids: selectedIds,
|
||||
updateInteractiveImportItem({
|
||||
id,
|
||||
episodes,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
dispatch(reprocessInteractiveImportItems({ ids: selectedIds }));
|
||||
|
||||
|
|
Loading…
Reference in New Issue