mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Replace for loop with find for QueueStatus
This commit is contained in:
parent
9472af8f83
commit
d6d740a0d2
@ -63,17 +63,8 @@ function createMapStateToProps() {
|
|||||||
command.body.movieIds.includes(movie.id)
|
command.body.movieIds.includes(movie.id)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
let queueStatus = null;
|
const firstQueueItem = queueItems.find((q) => q.movieId === movie.id);
|
||||||
let queueState = null;
|
|
||||||
|
|
||||||
for (const q in queueItems) {
|
|
||||||
if (queueItems[q].movieId === movie.id) {
|
|
||||||
queueStatus = queueItems[q].status;
|
|
||||||
queueState = queueItems[q].trackedDownloadState;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...movie,
|
...movie,
|
||||||
@ -81,8 +72,8 @@ function createMapStateToProps() {
|
|||||||
showSearchAction,
|
showSearchAction,
|
||||||
isRefreshingMovie,
|
isRefreshingMovie,
|
||||||
isSearchingMovie,
|
isSearchingMovie,
|
||||||
queueStatus,
|
queueStatus: firstQueueItem.status,
|
||||||
queueState
|
queueState: firstQueueItem.trackedDownloadState
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user