mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Rename Episode Instances to Album to fix AlbumModal
This commit is contained in:
@@ -5,32 +5,32 @@ function createBatchToggleEpisodeMonitoredHandler(section, getFromState) {
|
||||
return function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
const {
|
||||
episodeIds,
|
||||
albumIds,
|
||||
monitored
|
||||
} = payload;
|
||||
|
||||
const state = getFromState(getState());
|
||||
|
||||
updateEpisodes(dispatch, section, state.items, episodeIds, {
|
||||
updateEpisodes(dispatch, section, state.items, albumIds, {
|
||||
isSaving: true
|
||||
});
|
||||
|
||||
const promise = $.ajax({
|
||||
url: '/episode/monitor',
|
||||
method: 'PUT',
|
||||
data: JSON.stringify({ episodeIds, monitored }),
|
||||
data: JSON.stringify({ albumIds, monitored }),
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
promise.done(() => {
|
||||
updateEpisodes(dispatch, section, state.items, episodeIds, {
|
||||
updateEpisodes(dispatch, section, state.items, albumIds, {
|
||||
isSaving: false,
|
||||
monitored
|
||||
});
|
||||
});
|
||||
|
||||
promise.fail(() => {
|
||||
updateEpisodes(dispatch, section, state.items, episodeIds, {
|
||||
updateEpisodes(dispatch, section, state.items, albumIds, {
|
||||
isSaving: false
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,32 +5,32 @@ function createToggleEpisodeMonitoredHandler(section, getFromState) {
|
||||
return function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
const {
|
||||
episodeId,
|
||||
albumId,
|
||||
monitored
|
||||
} = payload;
|
||||
|
||||
const state = getFromState(getState());
|
||||
|
||||
updateEpisodes(dispatch, section, state.items, [episodeId], {
|
||||
updateEpisodes(dispatch, section, state.items, [albumId], {
|
||||
isSaving: true
|
||||
});
|
||||
|
||||
const promise = $.ajax({
|
||||
url: `/episode/${episodeId}`,
|
||||
url: `/episode/${albumId}`,
|
||||
method: 'PUT',
|
||||
data: JSON.stringify({ monitored }),
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
promise.done(() => {
|
||||
updateEpisodes(dispatch, section, state.items, [episodeId], {
|
||||
updateEpisodes(dispatch, section, state.items, [albumId], {
|
||||
isSaving: false,
|
||||
monitored
|
||||
});
|
||||
});
|
||||
|
||||
promise.fail(() => {
|
||||
updateEpisodes(dispatch, section, state.items, [episodeId], {
|
||||
updateEpisodes(dispatch, section, state.items, [albumId], {
|
||||
isSaving: false
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ const episodeActionHandlers = {
|
||||
[types.TOGGLE_EPISODE_MONITORED]: function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
const {
|
||||
episodeId: id,
|
||||
albumId: id,
|
||||
episodeEntity = episodeEntities.EPISODES,
|
||||
monitored
|
||||
} = payload;
|
||||
@@ -64,9 +64,9 @@ const episodeActionHandlers = {
|
||||
const episodeSection = _.last(episodeEntity.split('.'));
|
||||
|
||||
dispatch(batchActions(
|
||||
albumIds.map((episodeId) => {
|
||||
albumIds.map((albumId) => {
|
||||
return updateItem({
|
||||
id: episodeId,
|
||||
id: albumId,
|
||||
section: episodeSection,
|
||||
isSaving: true
|
||||
});
|
||||
@@ -82,9 +82,9 @@ const episodeActionHandlers = {
|
||||
|
||||
promise.done((data) => {
|
||||
dispatch(batchActions(
|
||||
albumIds.map((episodeId) => {
|
||||
albumIds.map((albumId) => {
|
||||
return updateItem({
|
||||
id: episodeId,
|
||||
id: albumId,
|
||||
section: episodeSection,
|
||||
isSaving: false,
|
||||
monitored
|
||||
@@ -95,9 +95,9 @@ const episodeActionHandlers = {
|
||||
|
||||
promise.fail((xhr) => {
|
||||
dispatch(batchActions(
|
||||
albumIds.map((episodeId) => {
|
||||
albumIds.map((albumId) => {
|
||||
return updateItem({
|
||||
id: episodeId,
|
||||
id: albumId,
|
||||
section: episodeSection,
|
||||
isSaving: false
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user