1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

New: Download History

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick
2020-03-29 16:05:48 -04:00
parent 72caab1b2b
commit 824d315a3b
86 changed files with 1086 additions and 426 deletions
@@ -187,12 +187,12 @@ export const actionHandlers = handleThunks({
const addedIds = [];
const allNewMovies = ids.reduce((acc, id) => {
const item = _.find(items, { id });
const item = items.find((i) => i.id === id);
const selectedMovie = item.selectedMovie;
// Make sure we have a selected movie and
// the same movie hasn't been added yet.
if (selectedMovie && !_.some(acc, { tmdbId: selectedMovie.tmdbId })) {
if (selectedMovie && !acc.some((a) => a.tmdbId === selectedMovie.tmdbId)) {
const newMovie = getNewMovie(_.cloneDeep(selectedMovie), item);
newMovie.path = item.path;
@@ -268,7 +268,7 @@ export const reducers = createHandleActions({
[SET_IMPORT_MOVIE_VALUE]: function(state, { payload }) {
const newState = getSectionState(state, section);
const items = newState.items;
const index = _.findIndex(items, { id: payload.id });
const index = items.findIndex((item) => item.id === payload.id);
newState.items = [...items];