mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-13 02:07:12 -07:00
New: Release Profiles, Frontend updates (#580)
* New: Release Profiles - UI Updates * New: Release Profiles - API Changes * New: Release Profiles - Test Updates * New: Release Profiles - Backend Updates * New: Interactive Artist Search * New: Change Montiored on Album Details Page * New: Show Duration on Album Details Page * Fixed: Manual Import not working if no albums are Missing * Fixed: Sort search input by sortTitle * Fixed: Queue columnLabel throwing JS error
This commit is contained in:
parent
f126eafd26
commit
3f064c94b9
409 changed files with 6882 additions and 3176 deletions
|
@ -121,6 +121,34 @@ function scheduleRemoveCommand(command, dispatch) {
|
|||
}, 60000 * 5);
|
||||
}
|
||||
|
||||
export function executeCommandHelper( payload, dispatch) {
|
||||
// TODO: show a message for the user
|
||||
if (lastCommand && isSameCommand(lastCommand, payload)) {
|
||||
console.warn('Please wait at least 5 seconds before running this command again');
|
||||
}
|
||||
|
||||
lastCommand = payload;
|
||||
|
||||
// clear last command after 5 seconds.
|
||||
if (lastCommandTimeout) {
|
||||
clearTimeout(lastCommandTimeout);
|
||||
}
|
||||
|
||||
lastCommandTimeout = setTimeout(() => {
|
||||
lastCommand = null;
|
||||
}, 5000);
|
||||
|
||||
const promise = $.ajax({
|
||||
url: '/command',
|
||||
method: 'POST',
|
||||
data: JSON.stringify(payload)
|
||||
});
|
||||
|
||||
return promise.then((data) => {
|
||||
dispatch(addCommand(data));
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
|
@ -128,31 +156,7 @@ export const actionHandlers = handleThunks({
|
|||
[FETCH_COMMANDS]: createFetchHandler('commands', '/command'),
|
||||
|
||||
[EXECUTE_COMMAND]: function(getState, payload, dispatch) {
|
||||
// TODO: show a message for the user
|
||||
if (lastCommand && isSameCommand(lastCommand, payload)) {
|
||||
console.warn('Please wait at least 5 seconds before running this command again');
|
||||
}
|
||||
|
||||
lastCommand = payload;
|
||||
|
||||
// clear last command after 5 seconds.
|
||||
if (lastCommandTimeout) {
|
||||
clearTimeout(lastCommandTimeout);
|
||||
}
|
||||
|
||||
lastCommandTimeout = setTimeout(() => {
|
||||
lastCommand = null;
|
||||
}, 5000);
|
||||
|
||||
const promise = $.ajax({
|
||||
url: '/command',
|
||||
method: 'POST',
|
||||
data: JSON.stringify(payload)
|
||||
});
|
||||
|
||||
promise.done((data) => {
|
||||
dispatch(addCommand(data));
|
||||
});
|
||||
executeCommandHelper(payload, dispatch);
|
||||
},
|
||||
|
||||
[CANCEL_COMMAND]: createRemoveItemHandler(section, '/command'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue