|
|
@ -1,9 +1,15 @@
|
|
|
|
import _ from 'lodash';
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { createAction } from 'redux-actions';
|
|
|
|
import { createAction } from 'redux-actions';
|
|
|
|
import { batchActions } from 'redux-batched-actions';
|
|
|
|
import { batchActions } from 'redux-batched-actions';
|
|
|
|
|
|
|
|
import Icon from 'Components/Icon';
|
|
|
|
|
|
|
|
import IconButton from 'Components/Link/IconButton';
|
|
|
|
|
|
|
|
import { icons } from 'Helpers/Props';
|
|
|
|
import movieEntities from 'Movie/movieEntities';
|
|
|
|
import movieEntities from 'Movie/movieEntities';
|
|
|
|
|
|
|
|
import createSetTableOptionReducer from 'Store/Actions/Creators/Reducers/createSetTableOptionReducer';
|
|
|
|
import { createThunk, handleThunks } from 'Store/thunks';
|
|
|
|
import { createThunk, handleThunks } from 'Store/thunks';
|
|
|
|
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
|
|
|
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
|
|
|
|
|
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
import { removeItem, set, updateItem } from './baseActions';
|
|
|
|
import { removeItem, set, updateItem } from './baseActions';
|
|
|
|
import createFetchHandler from './Creators/createFetchHandler';
|
|
|
|
import createFetchHandler from './Creators/createFetchHandler';
|
|
|
|
import createHandleActions from './Creators/createHandleActions';
|
|
|
|
import createHandleActions from './Creators/createHandleActions';
|
|
|
@ -25,9 +31,82 @@ export const defaultState = {
|
|
|
|
deleteError: null,
|
|
|
|
deleteError: null,
|
|
|
|
isSaving: false,
|
|
|
|
isSaving: false,
|
|
|
|
saveError: null,
|
|
|
|
saveError: null,
|
|
|
|
items: []
|
|
|
|
items: [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'relativePath',
|
|
|
|
|
|
|
|
label: () => translate('RelativePath'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'videoCodec',
|
|
|
|
|
|
|
|
label: () => translate('VideoCodec'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'audioInfo',
|
|
|
|
|
|
|
|
label: () => translate('AudioInfo'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'audioLanguages',
|
|
|
|
|
|
|
|
label: () => translate('AudioLanguages'),
|
|
|
|
|
|
|
|
isVisible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'subtitleLanguages',
|
|
|
|
|
|
|
|
label: () => translate('SubtitleLanguages'),
|
|
|
|
|
|
|
|
isVisible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'size',
|
|
|
|
|
|
|
|
label: () => translate('Size'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'languages',
|
|
|
|
|
|
|
|
label: () => translate('Languages'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'quality',
|
|
|
|
|
|
|
|
label: () => translate('Quality'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'releaseGroup',
|
|
|
|
|
|
|
|
label: () => translate('ReleaseGroup'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'customFormats',
|
|
|
|
|
|
|
|
label: () => translate('Formats'),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'customFormatScore',
|
|
|
|
|
|
|
|
columnLabel: () => translate('CustomFormatScore'),
|
|
|
|
|
|
|
|
label: React.createElement(Icon, {
|
|
|
|
|
|
|
|
name: icons.SCORE,
|
|
|
|
|
|
|
|
title: () => translate('CustomFormatScore')
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
isVisible: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'actions',
|
|
|
|
|
|
|
|
columnLabel: () => translate('Actions'),
|
|
|
|
|
|
|
|
label: React.createElement(IconButton, { name: icons.ADVANCED_SETTINGS }),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
isModifiable: false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const persistState = [
|
|
|
|
|
|
|
|
'movieFiles.columns'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Actions Types
|
|
|
|
// Actions Types
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +115,7 @@ export const DELETE_MOVIE_FILE = 'movieFiles/deleteMovieFile';
|
|
|
|
export const DELETE_MOVIE_FILES = 'movieFiles/deleteMovieFiles';
|
|
|
|
export const DELETE_MOVIE_FILES = 'movieFiles/deleteMovieFiles';
|
|
|
|
export const UPDATE_MOVIE_FILES = 'movieFiles/updateMovieFiles';
|
|
|
|
export const UPDATE_MOVIE_FILES = 'movieFiles/updateMovieFiles';
|
|
|
|
export const CLEAR_MOVIE_FILES = 'movieFiles/clearMovieFiles';
|
|
|
|
export const CLEAR_MOVIE_FILES = 'movieFiles/clearMovieFiles';
|
|
|
|
|
|
|
|
export const SET_MOVIE_FILES_TABLE_OPTION = 'movieFiles/setMovieFilesTableOption';
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Action Creators
|
|
|
|
// Action Creators
|
|
|
@ -45,6 +125,7 @@ export const deleteMovieFile = createThunk(DELETE_MOVIE_FILE);
|
|
|
|
export const deleteMovieFiles = createThunk(DELETE_MOVIE_FILES);
|
|
|
|
export const deleteMovieFiles = createThunk(DELETE_MOVIE_FILES);
|
|
|
|
export const updateMovieFiles = createThunk(UPDATE_MOVIE_FILES);
|
|
|
|
export const updateMovieFiles = createThunk(UPDATE_MOVIE_FILES);
|
|
|
|
export const clearMovieFiles = createAction(CLEAR_MOVIE_FILES);
|
|
|
|
export const clearMovieFiles = createAction(CLEAR_MOVIE_FILES);
|
|
|
|
|
|
|
|
export const setMovieFilesTableOption = createAction(SET_MOVIE_FILES_TABLE_OPTION);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Helpers
|
|
|
|
// Helpers
|
|
|
@ -234,9 +315,19 @@ export const actionHandlers = handleThunks({
|
|
|
|
// Reducers
|
|
|
|
// Reducers
|
|
|
|
|
|
|
|
|
|
|
|
export const reducers = createHandleActions({
|
|
|
|
export const reducers = createHandleActions({
|
|
|
|
|
|
|
|
[SET_MOVIE_FILES_TABLE_OPTION]: createSetTableOptionReducer(section),
|
|
|
|
|
|
|
|
|
|
|
|
[CLEAR_MOVIE_FILES]: (state) => {
|
|
|
|
[CLEAR_MOVIE_FILES]: (state) => {
|
|
|
|
return Object.assign({}, state, defaultState);
|
|
|
|
return Object.assign({}, state, {
|
|
|
|
|
|
|
|
isFetching: false,
|
|
|
|
|
|
|
|
isPopulated: false,
|
|
|
|
|
|
|
|
error: null,
|
|
|
|
|
|
|
|
isDeleting: false,
|
|
|
|
|
|
|
|
deleteError: null,
|
|
|
|
|
|
|
|
isSaving: false,
|
|
|
|
|
|
|
|
saveError: null,
|
|
|
|
|
|
|
|
items: []
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}, defaultState, section);
|
|
|
|
}, defaultState, section);
|
|
|
|