mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04: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:
@@ -1,37 +0,0 @@
|
||||
function getMonitoringOptions(monitor) {
|
||||
const monitoringOptions = {
|
||||
selectedOption: 0,
|
||||
monitored: true
|
||||
};
|
||||
|
||||
switch (monitor) {
|
||||
case 'future':
|
||||
monitoringOptions.selectedOption = 1;
|
||||
break;
|
||||
case 'missing':
|
||||
monitoringOptions.selectedOption = 2;
|
||||
break;
|
||||
case 'existing':
|
||||
monitoringOptions.selectedOption = 3;
|
||||
break;
|
||||
case 'first':
|
||||
monitoringOptions.selectedOption = 5;
|
||||
break;
|
||||
case 'latest':
|
||||
monitoringOptions.selectedOption = 4;
|
||||
break;
|
||||
case 'none':
|
||||
monitoringOptions.monitored = false;
|
||||
monitoringOptions.selectedOption = 6;
|
||||
break;
|
||||
default:
|
||||
monitoringOptions.selectedOption = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return {
|
||||
options: monitoringOptions
|
||||
};
|
||||
}
|
||||
|
||||
export default getMonitoringOptions;
|
||||
@@ -1,4 +1,3 @@
|
||||
import getMonitoringOptions from 'Utilities/Artist/getMonitoringOptions';
|
||||
|
||||
function getNewArtist(artist, payload) {
|
||||
const {
|
||||
@@ -13,11 +12,11 @@ function getNewArtist(artist, payload) {
|
||||
searchForMissingAlbums = false
|
||||
} = payload;
|
||||
|
||||
const {
|
||||
options: addOptions
|
||||
} = getMonitoringOptions(monitor);
|
||||
const addOptions = {
|
||||
monitor,
|
||||
searchForMissingAlbums
|
||||
};
|
||||
|
||||
addOptions.searchForMissingAlbums = searchForMissingAlbums;
|
||||
artist.addOptions = addOptions;
|
||||
artist.monitored = true;
|
||||
artist.qualityProfileId = qualityProfileId;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
const monitorOptions = [
|
||||
{ key: 'all', value: 'All Albums' },
|
||||
{ key: 'future', value: 'Future Albums' },
|
||||
{ key: 'missing', value: 'Missing Albums' },
|
||||
{ key: 'existing', value: 'Existing Albums' },
|
||||
{ key: 'first', value: 'Only First Album' },
|
||||
{ key: 'latest', value: 'Only Latest Album' },
|
||||
{ key: 'none', value: 'None' }
|
||||
];
|
||||
|
||||
export default monitorOptions;
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function roundNumber(input, decimalPlaces = 1) {
|
||||
const multiplier = Math.pow(10, decimalPlaces);
|
||||
|
||||
return Math.round(input * multiplier) / multiplier;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ function getProviderState(payload, getState, section) {
|
||||
id,
|
||||
...otherPayload
|
||||
} = payload;
|
||||
|
||||
const state = getSectionState(getState(), section, true);
|
||||
const pendingChanges = Object.assign({}, state.pendingChanges, otherPayload);
|
||||
const pendingFields = state.pendingChanges.fields || {};
|
||||
@@ -15,12 +16,15 @@ function getProviderState(payload, getState, section) {
|
||||
|
||||
if (item.fields) {
|
||||
pendingChanges.fields = _.reduce(item.fields, (result, field) => {
|
||||
const value = pendingFields.hasOwnProperty(field.name) ?
|
||||
pendingFields[field.name] :
|
||||
const name = field.name;
|
||||
|
||||
const value = pendingFields.hasOwnProperty(name) ?
|
||||
pendingFields[name] :
|
||||
field.value;
|
||||
|
||||
// Only send the name and value to the server
|
||||
result.push({
|
||||
...field,
|
||||
name,
|
||||
value
|
||||
});
|
||||
|
||||
@@ -28,7 +32,11 @@ function getProviderState(payload, getState, section) {
|
||||
}, []);
|
||||
}
|
||||
|
||||
return Object.assign({}, item, pendingChanges);
|
||||
const result = Object.assign({}, item, pendingChanges);
|
||||
|
||||
delete result.presets;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export default getProviderState;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint max-params: 0 */
|
||||
import areAllSelected from './areAllSelected';
|
||||
import getToggledRange from './getToggledRange';
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ export function repopulatePage(reason) {
|
||||
if (!currentPopulator) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!reason) {
|
||||
currentPopulator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user