mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
More UI Cleanup
This commit is contained in:
parent
9c88c2006d
commit
1700c471b7
96 changed files with 267 additions and 333 deletions
|
@ -68,7 +68,7 @@ const addArtistActionHandlers = {
|
|||
|
||||
promise.done((data) => {
|
||||
dispatch(batchActions([
|
||||
updateItem({ section: 'series', ...data }),
|
||||
updateItem({ section: 'artist', ...data }),
|
||||
|
||||
set({
|
||||
section,
|
||||
|
|
|
@ -17,31 +17,31 @@ const albumStudioActionHandlers = {
|
|||
} = payload;
|
||||
|
||||
let monitoringOptions = null;
|
||||
const series = [];
|
||||
const allArtists = getState().series.items;
|
||||
const artist = [];
|
||||
const allArtists = getState().artist.items;
|
||||
|
||||
artistIds.forEach((id) => {
|
||||
const s = _.find(allArtists, { id });
|
||||
const seriesToUpdate = { id };
|
||||
const artistToUpdate = { id };
|
||||
|
||||
if (payload.hasOwnProperty('monitored')) {
|
||||
seriesToUpdate.monitored = monitored;
|
||||
artistToUpdate.monitored = monitored;
|
||||
}
|
||||
|
||||
if (monitor) {
|
||||
const {
|
||||
seasons,
|
||||
options: seriesMonitoringOptions
|
||||
options: artistMonitoringOptions
|
||||
} = getMonitoringOptions(_.cloneDeep(s.seasons), monitor);
|
||||
|
||||
if (!monitoringOptions) {
|
||||
monitoringOptions = seriesMonitoringOptions;
|
||||
monitoringOptions = artistMonitoringOptions;
|
||||
}
|
||||
|
||||
seriesToUpdate.seasons = seasons;
|
||||
artistToUpdate.seasons = seasons;
|
||||
}
|
||||
|
||||
series.push(seriesToUpdate);
|
||||
artist.push(artistToUpdate);
|
||||
});
|
||||
|
||||
dispatch(set({
|
||||
|
@ -53,7 +53,7 @@ const albumStudioActionHandlers = {
|
|||
url: '/albumStudio',
|
||||
method: 'POST',
|
||||
data: JSON.stringify({
|
||||
series,
|
||||
artist,
|
||||
monitoringOptions
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
|
|
@ -7,7 +7,7 @@ import createSaveProviderHandler from './Creators/createSaveProviderHandler';
|
|||
import createRemoveItemHandler from './Creators/createRemoveItemHandler';
|
||||
import { updateItem } from './baseActions';
|
||||
|
||||
const section = 'series';
|
||||
const section = 'artist';
|
||||
|
||||
const artistActionHandlers = {
|
||||
[types.FETCH_ARTIST]: createFetchHandler(section, '/artist'),
|
||||
|
@ -15,12 +15,12 @@ const artistActionHandlers = {
|
|||
[types.SAVE_ARTIST]: createSaveProviderHandler(
|
||||
section,
|
||||
'/artist',
|
||||
(state) => state.series),
|
||||
(state) => state.artist),
|
||||
|
||||
[types.DELETE_ARTIST]: createRemoveItemHandler(
|
||||
section,
|
||||
'/artist',
|
||||
(state) => state.series),
|
||||
(state) => state.artist),
|
||||
|
||||
[types.TOGGLE_ARTIST_MONITORED]: function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
|
@ -29,7 +29,7 @@ const artistActionHandlers = {
|
|||
monitored
|
||||
} = payload;
|
||||
|
||||
const series = _.find(getState().series.items, { id });
|
||||
const artist = _.find(getState().artist.items, { id });
|
||||
|
||||
dispatch(updateItem({
|
||||
id,
|
||||
|
@ -41,7 +41,7 @@ const artistActionHandlers = {
|
|||
url: `/artist/${id}`,
|
||||
method: 'PUT',
|
||||
data: JSON.stringify({
|
||||
...series,
|
||||
...artist,
|
||||
monitored
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
@ -74,8 +74,8 @@ const artistActionHandlers = {
|
|||
monitored
|
||||
} = payload;
|
||||
|
||||
const series = _.find(getState().series.items, { id });
|
||||
const seasons = _.cloneDeep(series.seasons);
|
||||
const artist = _.find(getState().artist.items, { id });
|
||||
const seasons = _.cloneDeep(artist.seasons);
|
||||
const season = _.find(seasons, { seasonNumber });
|
||||
|
||||
season.isSaving = true;
|
||||
|
@ -92,7 +92,7 @@ const artistActionHandlers = {
|
|||
url: `/artist/${id}`,
|
||||
method: 'PUT',
|
||||
data: JSON.stringify({
|
||||
...series,
|
||||
...artist,
|
||||
seasons
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
@ -122,7 +122,7 @@ const artistActionHandlers = {
|
|||
dispatch(updateItem({
|
||||
id,
|
||||
section,
|
||||
seasons: series.seasons
|
||||
seasons: artist.seasons
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
|
|
@ -5,12 +5,12 @@ import artistActionHandlers from './artistActionHandlers';
|
|||
export const fetchArtist = artistActionHandlers[types.FETCH_ARTIST];
|
||||
export const saveArtist = artistActionHandlers[types.SAVE_ARTIST];
|
||||
export const deleteArtist = artistActionHandlers[types.DELETE_ARTIST];
|
||||
export const toggleSeriesMonitored = artistActionHandlers[types.TOGGLE_ARTIST_MONITORED];
|
||||
export const toggleArtistMonitored = artistActionHandlers[types.TOGGLE_ARTIST_MONITORED];
|
||||
export const toggleSeasonMonitored = artistActionHandlers[types.TOGGLE_ALBUM_MONITORED];
|
||||
|
||||
export const setArtistValue = createAction(types.SET_ARTIST_VALUE, (payload) => {
|
||||
return {
|
||||
section: 'series',
|
||||
section: 'artist',
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
|
|
@ -22,11 +22,11 @@ const artistEditorActionHandlers = {
|
|||
|
||||
promise.done((data) => {
|
||||
dispatch(batchActions([
|
||||
...data.map((series) => {
|
||||
...data.map((artist) => {
|
||||
return updateItem({
|
||||
id: series.id,
|
||||
section: 'series',
|
||||
...series
|
||||
id: artist.id,
|
||||
section: 'artist',
|
||||
...artist
|
||||
});
|
||||
}),
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { batchActions } from 'redux-batched-actions';
|
|||
import getNewSeries from 'Utilities/Series/getNewSeries';
|
||||
import * as types from './actionTypes';
|
||||
import { set, updateItem, removeItem } from './baseActions';
|
||||
import { startLookupSeries } from './importArtistActions';
|
||||
import { startLookupArtist } from './importArtistActions';
|
||||
import { fetchRootFolders } from './rootFolderActions';
|
||||
|
||||
const section = 'importArtist';
|
||||
|
@ -38,7 +38,7 @@ const importArtistActionHandlers = {
|
|||
}));
|
||||
|
||||
if (term && term.length > 2) {
|
||||
dispatch(startLookupSeries());
|
||||
dispatch(startLookupArtist());
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -97,7 +97,7 @@ const importArtistActionHandlers = {
|
|||
|
||||
promise.always(() => {
|
||||
concurrentLookups--;
|
||||
dispatch(startLookupSeries());
|
||||
dispatch(startLookupArtist());
|
||||
});
|
||||
};
|
||||
},
|
||||
|
@ -114,8 +114,8 @@ const importArtistActionHandlers = {
|
|||
const item = _.find(items, { id });
|
||||
const selectedArtist = item.selectedArtist;
|
||||
|
||||
// Make sure we have a selected series and
|
||||
// the same series hasn't been added yet.
|
||||
// Make sure we have a selected artist and
|
||||
// the same artist hasn't been added yet.
|
||||
if (selectedArtist && !_.some(acc, { foreignArtistId: selectedArtist.foreignArtistId })) {
|
||||
const newSeries = getNewSeries(_.cloneDeep(selectedArtist), item);
|
||||
newSeries.path = item.path;
|
||||
|
@ -142,7 +142,7 @@ const importArtistActionHandlers = {
|
|||
isImported: true
|
||||
}),
|
||||
|
||||
...data.map((series) => updateItem({ section: 'series', ...series })),
|
||||
...data.map((artist) => updateItem({ section: 'artist', ...artist })),
|
||||
|
||||
...addedIds.map((id) => removeItem({ section, id }))
|
||||
]));
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as types from './actionTypes';
|
|||
import importArtistActionHandlers from './importArtistActionHandlers';
|
||||
|
||||
export const queueLookupArtist = importArtistActionHandlers[types.QUEUE_LOOKUP_ARTIST];
|
||||
export const startLookupSeries = importArtistActionHandlers[types.START_LOOKUP_ARTIST];
|
||||
export const startLookupArtist = importArtistActionHandlers[types.START_LOOKUP_ARTIST];
|
||||
export const importArtist = importArtistActionHandlers[types.IMPORT_ARTIST];
|
||||
export const clearImportArtist = createAction(types.CLEAR_IMPORT_ARTIST);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue