Fixed: Status on search showing queue status instead of missing (#5854)

Fix status on search to show a downloading status when it is in queue
Fix for monitor not being set to true when adding from search
pull/5789/head
nitsua 4 years ago committed by GitHub
parent a0d2af54e8
commit 6d7fb3de25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,9 +11,9 @@ function createMapStateToProps() {
createExclusionMovieSelector(),
createDimensionsSelector(),
(state) => state.queue.details.items,
(state) => state.tmdbId,
(isExistingMovie, isExclusionMovie, dimensions, queueItems, tmdbId) => {
const firstQueueItem = queueItems.find((q) => q.tmdbId === tmdbId);
(state, { internalId }) => internalId,
(isExistingMovie, isExclusionMovie, dimensions, queueItems, internalId) => {
const firstQueueItem = queueItems.find((q) => q.movieId === internalId && internalId > 0);
return {
isExistingMovie,

@ -88,6 +88,8 @@ export const actionHandlers = handleThunks({
abortCurrentRequest = abortRequest;
request.done((data) => {
data = data.map((movie) => ({ ...movie, internalId: movie.id, id: movie.tmdbId }));
dispatch(batchActions([
update({ section, data }),
@ -116,6 +118,7 @@ export const actionHandlers = handleThunks({
const tmdbId = payload.tmdbId;
const items = getState().addMovie.items;
const newMovie = getNewMovie(_.cloneDeep(_.find(items, { tmdbId })), payload);
newMovie.id = 0;
const promise = createAjaxRequest({
url: '/movie',
@ -125,8 +128,12 @@ export const actionHandlers = handleThunks({
}).request;
promise.done((data) => {
const updatedItem = _.cloneDeep(data);
updatedItem.id = updatedItem.tmdbId;
dispatch(batchActions([
updateItem({ section: 'movies', ...data }),
updateItem({ section: 'addMovie', ...updatedItem }),
set({
section,

Loading…
Cancel
Save