mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Movie Details Tab (#3564)
* History Added * History Cleanup * History Mark Failed Fix * History Lint Fix * Search Tab Initial * Interactive Search Cleanup * Files Tab + Small Backend change to MovieFile api * Reverse Movie History Items * Grabbed files are not grabbable again. * Partial movie title outline + Search not updating fix * Lint Fix + InteractiveSearch refactor * Rename movieLanguage.js to MovieLanguage.js * Fixes for qstick's comments * Rename language selector to allow for const languages * Qstick comment changes. * Activity Tabs - Language Column fixed * Movie Details - MoveStatusLabel fixed * Spaces + Lower Case added * fixed DownloadAllowed * Added padding to history and file tables * Fix class => className * Updated search to not refresh unless switching movie * lint fix * File Tab Converted to Inline Editting * FIles tab fix + Alt Titles tab implemented * lint fix * Cleanup via qstick request
This commit is contained in:
@@ -38,9 +38,16 @@ export const defaultState = {
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
|
@@ -42,11 +42,13 @@ export const defaultState = {
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isVisible: false
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
|
@@ -137,9 +137,10 @@ export const actionHandlers = handleThunks({
|
||||
},
|
||||
|
||||
[UPDATE_MOVIE_FILES]: function(getState, payload, dispatch) {
|
||||
|
||||
const {
|
||||
movieFileIds,
|
||||
language,
|
||||
languages,
|
||||
quality
|
||||
} = payload;
|
||||
|
||||
@@ -149,8 +150,8 @@ export const actionHandlers = handleThunks({
|
||||
movieFileIds
|
||||
};
|
||||
|
||||
if (language) {
|
||||
data.language = language;
|
||||
if (languages) {
|
||||
data.languages = languages;
|
||||
}
|
||||
|
||||
if (quality) {
|
||||
@@ -169,8 +170,8 @@ export const actionHandlers = handleThunks({
|
||||
...movieFileIds.map((id) => {
|
||||
const props = {};
|
||||
|
||||
if (language) {
|
||||
props.language = language;
|
||||
if (languages) {
|
||||
props.languages = languages;
|
||||
}
|
||||
|
||||
if (quality) {
|
||||
|
@@ -23,27 +23,27 @@ export const defaultState = {
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_SERIES_HISTORY = 'seriesHistory/fetchMovieHistory';
|
||||
export const CLEAR_SERIES_HISTORY = 'seriesHistory/clearMovieHistory';
|
||||
export const SERIES_HISTORY_MARK_AS_FAILED = 'seriesHistory/seriesHistoryMarkAsFailed';
|
||||
export const FETCH_MOVIE_HISTORY = 'movieHistory/fetchMovieHistory';
|
||||
export const CLEAR_MOVIE_HISTORY = 'movieHistory/clearMovieHistory';
|
||||
export const MOVIE_HISTORY_MARK_AS_FAILED = 'movieHistory/movieHistoryMarkAsFailed';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchMovieHistory = createThunk(FETCH_SERIES_HISTORY);
|
||||
export const clearMovieHistory = createAction(CLEAR_SERIES_HISTORY);
|
||||
export const seriesHistoryMarkAsFailed = createThunk(SERIES_HISTORY_MARK_AS_FAILED);
|
||||
export const fetchMovieHistory = createThunk(FETCH_MOVIE_HISTORY);
|
||||
export const clearMovieHistory = createAction(CLEAR_MOVIE_HISTORY);
|
||||
export const movieHistoryMarkAsFailed = createThunk(MOVIE_HISTORY_MARK_AS_FAILED);
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
export const actionHandlers = handleThunks({
|
||||
|
||||
[FETCH_SERIES_HISTORY]: function(getState, payload, dispatch) {
|
||||
[FETCH_MOVIE_HISTORY]: function(getState, payload, dispatch) {
|
||||
dispatch(set({ section, isFetching: true }));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/history/series',
|
||||
url: '/history/movie',
|
||||
data: payload
|
||||
}).request;
|
||||
|
||||
@@ -70,11 +70,10 @@ export const actionHandlers = handleThunks({
|
||||
});
|
||||
},
|
||||
|
||||
[SERIES_HISTORY_MARK_AS_FAILED]: function(getState, payload, dispatch) {
|
||||
[MOVIE_HISTORY_MARK_AS_FAILED]: function(getState, payload, dispatch) {
|
||||
const {
|
||||
historyId,
|
||||
seriesId,
|
||||
seasonNumber
|
||||
movieId
|
||||
} = payload;
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
@@ -86,7 +85,7 @@ export const actionHandlers = handleThunks({
|
||||
}).request;
|
||||
|
||||
promise.done(() => {
|
||||
dispatch(fetchMovieHistory({ seriesId, seasonNumber }));
|
||||
dispatch(fetchMovieHistory({ movieId }));
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -96,7 +95,7 @@ export const actionHandlers = handleThunks({
|
||||
|
||||
export const reducers = createHandleActions({
|
||||
|
||||
[CLEAR_SERIES_HISTORY]: (state) => {
|
||||
[CLEAR_MOVIE_HISTORY]: (state) => {
|
||||
return Object.assign({}, state, defaultState);
|
||||
}
|
||||
|
||||
|
74
frontend/src/Store/Actions/movieTitlesActions.js
Normal file
74
frontend/src/Store/Actions/movieTitlesActions.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import { batchActions } from 'redux-batched-actions';
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
import { createThunk, handleThunks } from 'Store/thunks';
|
||||
import createHandleActions from './Creators/createHandleActions';
|
||||
import { set, update } from './baseActions';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
export const section = 'movieTitles';
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
export const defaultState = {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
items: []
|
||||
};
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_MOVIE_TITLES = 'movieTitles/fetchMovieTitles';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchMovieTitles = createThunk(FETCH_MOVIE_TITLES);
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
export const actionHandlers = handleThunks({
|
||||
|
||||
[FETCH_MOVIE_TITLES]: function(getState, payload, dispatch) {
|
||||
dispatch(set({ section, isFetching: true }));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/alttitle',
|
||||
data: payload
|
||||
}).request;
|
||||
|
||||
promise.done((data) => {
|
||||
dispatch(batchActions([
|
||||
update({ section, data }),
|
||||
|
||||
set({
|
||||
section,
|
||||
isFetching: false,
|
||||
isPopulated: true,
|
||||
error: null
|
||||
})
|
||||
]));
|
||||
});
|
||||
|
||||
promise.fail((xhr) => {
|
||||
dispatch(set({
|
||||
section,
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: xhr
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
export const reducers = createHandleActions({
|
||||
|
||||
}, defaultState, section);
|
@@ -68,6 +68,12 @@ export const defaultState = {
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'languages',
|
||||
label: 'Languages',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
|
@@ -11,8 +11,6 @@ import createHandleActions from './Creators/createHandleActions';
|
||||
// Variables
|
||||
|
||||
export const section = 'releases';
|
||||
export const episodeSection = 'releases.episode';
|
||||
export const seasonSection = 'releases.season';
|
||||
|
||||
let abortCurrentRequest = null;
|
||||
|
||||
@@ -54,28 +52,6 @@ export const defaultState = {
|
||||
key: 'all',
|
||||
label: 'All',
|
||||
filters: []
|
||||
},
|
||||
{
|
||||
key: 'season-pack',
|
||||
label: 'Season Pack',
|
||||
filters: [
|
||||
{
|
||||
key: 'fullSeason',
|
||||
value: true,
|
||||
type: filterTypes.EQUAL
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'not-season-pack',
|
||||
label: 'Not Season Pack',
|
||||
filters: [
|
||||
{
|
||||
key: 'fullSeason',
|
||||
value: false,
|
||||
type: filterTypes.EQUAL
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -146,20 +122,13 @@ export const defaultState = {
|
||||
type: filterBuilderTypes.NUMBER
|
||||
}
|
||||
],
|
||||
selectedFilterKey: 'all'
|
||||
|
||||
episode: {
|
||||
selectedFilterKey: 'all'
|
||||
},
|
||||
|
||||
season: {
|
||||
selectedFilterKey: 'season-pack'
|
||||
}
|
||||
};
|
||||
|
||||
export const persistState = [
|
||||
'releases.selectedFilterKey',
|
||||
'releases.episode.customFilters',
|
||||
'releases.season.customFilters'
|
||||
'releases.customFilters',
|
||||
'releases.selectedFilterKey'
|
||||
];
|
||||
|
||||
//
|
||||
@@ -171,8 +140,7 @@ export const SET_RELEASES_SORT = 'releases/setReleasesSort';
|
||||
export const CLEAR_RELEASES = 'releases/clearReleases';
|
||||
export const GRAB_RELEASE = 'releases/grabRelease';
|
||||
export const UPDATE_RELEASE = 'releases/updateRelease';
|
||||
export const SET_EPISODE_RELEASES_FILTER = 'releases/setEpisodeReleasesFilter';
|
||||
export const SET_SEASON_RELEASES_FILTER = 'releases/setSeasonReleasesFilter';
|
||||
export const SET_RELEASES_FILTER = 'releases/setMovieReleasesFilter';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
@@ -183,8 +151,7 @@ export const setReleasesSort = createAction(SET_RELEASES_SORT);
|
||||
export const clearReleases = createAction(CLEAR_RELEASES);
|
||||
export const grabRelease = createThunk(GRAB_RELEASE);
|
||||
export const updateRelease = createAction(UPDATE_RELEASE);
|
||||
export const setEpisodeReleasesFilter = createAction(SET_EPISODE_RELEASES_FILTER);
|
||||
export const setSeasonReleasesFilter = createAction(SET_SEASON_RELEASES_FILTER);
|
||||
export const setReleasesFilter = createAction(SET_RELEASES_FILTER);
|
||||
|
||||
//
|
||||
// Helpers
|
||||
@@ -248,13 +215,7 @@ export const actionHandlers = handleThunks({
|
||||
export const reducers = createHandleActions({
|
||||
|
||||
[CLEAR_RELEASES]: (state) => {
|
||||
const {
|
||||
episode,
|
||||
season,
|
||||
...otherDefaultState
|
||||
} = defaultState;
|
||||
|
||||
return Object.assign({}, state, otherDefaultState);
|
||||
return Object.assign({}, state, defaultState);
|
||||
},
|
||||
|
||||
[UPDATE_RELEASE]: (state, { payload }) => {
|
||||
@@ -276,8 +237,7 @@ export const reducers = createHandleActions({
|
||||
return newState;
|
||||
},
|
||||
|
||||
[SET_RELEASES_SORT]: createSetClientSideCollectionSortReducer(section),
|
||||
[SET_EPISODE_RELEASES_FILTER]: createSetClientSideCollectionFilterReducer(episodeSection),
|
||||
[SET_SEASON_RELEASES_FILTER]: createSetClientSideCollectionFilterReducer(seasonSection)
|
||||
[SET_RELEASES_FILTER]: createSetClientSideCollectionFilterReducer(section),
|
||||
[SET_RELEASES_SORT]: createSetClientSideCollectionSortReducer(section)
|
||||
|
||||
}, defaultState, section);
|
||||
|
Reference in New Issue
Block a user