mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Medium Support (Multi-disc Albums), Quality Grouping (#121)
* Multi Disc Stage 1 - Backend Work * Quality Group Functionality * Fixed: Only show wanted album types on ArtistDetail page * Add Media Count Column to ArtistDetail Page * Parser updates for multidisc cases, other usenet release title formats * Search for Tracks by Medium Number in Addition to Title and TrackNumber * Medium Renaming Token for Track Naming * fixup Codacy and Comment Cleanup * fixup remove comments
This commit is contained in:
parent
e1e7cad951
commit
21428cba6f
154 changed files with 2946 additions and 701 deletions
|
@ -1,5 +1,5 @@
|
|||
import $ from 'jquery';
|
||||
import { batchActions } from 'redux-batched-actions';
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
import { set, update, updateItem } from '../baseActions';
|
||||
|
||||
function createFetchHandler(section, url) {
|
||||
|
@ -12,13 +12,13 @@ function createFetchHandler(section, url) {
|
|||
...otherPayload
|
||||
} = payload;
|
||||
|
||||
const promise = $.ajax({
|
||||
const { request, abortRequest } = createAjaxRequest({
|
||||
url: id == null ? url : `${url}/${id}`,
|
||||
data: otherPayload,
|
||||
traditional: true
|
||||
});
|
||||
|
||||
promise.done((data) => {
|
||||
request.done((data) => {
|
||||
dispatch(batchActions([
|
||||
id == null ? update({ section, data }) : updateItem({ section, ...data }),
|
||||
|
||||
|
@ -31,14 +31,16 @@ function createFetchHandler(section, url) {
|
|||
]));
|
||||
});
|
||||
|
||||
promise.fail((xhr) => {
|
||||
request.fail((xhr) => {
|
||||
dispatch(set({
|
||||
section,
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: xhr
|
||||
error: xhr.aborted ? null : xhr
|
||||
}));
|
||||
});
|
||||
|
||||
return abortRequest;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ function createSaveProviderHandler(section, url, getFromState) {
|
|||
ajaxOptions.method = 'PUT';
|
||||
}
|
||||
|
||||
const { request, abortRequest } = createAjaxRequest()(ajaxOptions);
|
||||
|
||||
const { request, abortRequest } = createAjaxRequest(ajaxOptions);
|
||||
|
||||
abortCurrentRequests[section] = abortRequest;
|
||||
|
||||
request.done((data) => {
|
||||
|
|
|
@ -30,8 +30,8 @@ function createTestProviderHandler(section, url, getFromState) {
|
|||
data: JSON.stringify(testData)
|
||||
};
|
||||
|
||||
const { request, abortRequest } = createAjaxRequest()(ajaxOptions);
|
||||
|
||||
const { request, abortRequest } = createAjaxRequest(ajaxOptions);
|
||||
|
||||
abortCurrentRequests[section] = abortRequest;
|
||||
|
||||
request.done((data) => {
|
||||
|
|
|
@ -113,6 +113,7 @@ export const ALBUM_HISTORY_MARK_AS_FAILED = 'ALBUM_HISTORY_MARK_AS_FAILED';
|
|||
// Releases
|
||||
|
||||
export const FETCH_RELEASES = 'FETCH_RELEASES';
|
||||
export const CANCEL_FETCH_RELEASES = 'CANCEL_FETCH_RELEASES';
|
||||
export const SET_RELEASES_SORT = 'SET_RELEASES_SORT';
|
||||
export const CLEAR_RELEASES = 'CLEAR_RELEASES';
|
||||
export const GRAB_RELEASE = 'GRAB_RELEASE';
|
||||
|
|
|
@ -18,7 +18,7 @@ const addArtistActionHandlers = {
|
|||
abortCurrentRequest();
|
||||
}
|
||||
|
||||
const { request, abortRequest } = createAjaxRequest()({
|
||||
const { request, abortRequest } = createAjaxRequest({
|
||||
url: '/artist/lookup',
|
||||
data: {
|
||||
term: payload.term
|
||||
|
|
|
@ -3,10 +3,27 @@ import createFetchHandler from './Creators/createFetchHandler';
|
|||
import * as types from './actionTypes';
|
||||
import { updateRelease } from './releaseActions';
|
||||
|
||||
let abortCurrentRequest = null;
|
||||
const section = 'releases';
|
||||
|
||||
const fetchReleases = createFetchHandler(section, '/release');
|
||||
|
||||
const releaseActionHandlers = {
|
||||
[types.FETCH_RELEASES]: createFetchHandler(section, '/release'),
|
||||
[types.FETCH_RELEASES]: function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
const abortRequest = fetchReleases(payload)(dispatch, getState);
|
||||
|
||||
abortCurrentRequest = abortRequest;
|
||||
};
|
||||
},
|
||||
|
||||
[types.CANCEL_FETCH_RELEASES]: function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
if (abortCurrentRequest) {
|
||||
abortCurrentRequest = abortCurrentRequest();
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
[types.GRAB_RELEASE]: function(payload) {
|
||||
return function(dispatch, getState) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import * as types from './actionTypes';
|
|||
import releaseActionHandlers from './releaseActionHandlers';
|
||||
|
||||
export const fetchReleases = releaseActionHandlers[types.FETCH_RELEASES];
|
||||
export const cancelFetchReleases = releaseActionHandlers[types.CANCEL_FETCH_RELEASES];
|
||||
export const setReleasesSort = createAction(types.SET_RELEASES_SORT);
|
||||
export const clearReleases = createAction(types.CLEAR_RELEASES);
|
||||
export const grabRelease = releaseActionHandlers[types.GRAB_RELEASE];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue