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:
Qstick 2017-11-15 21:24:33 -05:00 committed by GitHub
parent e1e7cad951
commit 21428cba6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
154 changed files with 2946 additions and 701 deletions

View file

@ -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;
};
};
}

View file

@ -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) => {

View file

@ -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) => {

View file

@ -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';

View file

@ -18,7 +18,7 @@ const addArtistActionHandlers = {
abortCurrentRequest();
}
const { request, abortRequest } = createAjaxRequest()({
const { request, abortRequest } = createAjaxRequest({
url: '/artist/lookup',
data: {
term: payload.term

View file

@ -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) {

View file

@ -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];