mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 11:48:26 -07:00
[UI Work] Misc UI Fixes and Tweaks
This commit is contained in:
parent
2a6decdc4c
commit
44cc642ad4
80 changed files with 267 additions and 349 deletions
|
@ -18,10 +18,10 @@ const albumStudioActionHandlers = {
|
|||
|
||||
let monitoringOptions = null;
|
||||
const series = [];
|
||||
const allSeries = getState().series.items;
|
||||
const allArtists = getState().series.items;
|
||||
|
||||
artistIds.forEach((id) => {
|
||||
const s = _.find(allSeries, { id });
|
||||
const s = _.find(allArtists, { id });
|
||||
const seriesToUpdate = { id };
|
||||
|
||||
if (payload.hasOwnProperty('monitored')) {
|
||||
|
|
|
@ -8,7 +8,7 @@ export const deleteArtist = artistActionHandlers[types.DELETE_ARTIST];
|
|||
export const toggleSeriesMonitored = artistActionHandlers[types.TOGGLE_ARTIST_MONITORED];
|
||||
export const toggleSeasonMonitored = artistActionHandlers[types.TOGGLE_ALBUM_MONITORED];
|
||||
|
||||
export const setSeriesValue = createAction(types.SET_ARTIST_VALUE, (payload) => {
|
||||
export const setArtistValue = createAction(types.SET_ARTIST_VALUE, (payload) => {
|
||||
return {
|
||||
section: 'series',
|
||||
...payload
|
||||
|
|
|
@ -80,7 +80,7 @@ const importArtistActionHandlers = {
|
|||
error: null,
|
||||
items: data,
|
||||
queued: false,
|
||||
selectedSeries: queued.selectedSeries || data[0]
|
||||
selectedArtist: queued.selectedArtist || data[0]
|
||||
}));
|
||||
});
|
||||
|
||||
|
@ -112,12 +112,12 @@ const importArtistActionHandlers = {
|
|||
|
||||
const allNewSeries = ids.reduce((acc, id) => {
|
||||
const item = _.find(items, { id });
|
||||
const selectedSeries = item.selectedSeries;
|
||||
const selectedArtist = item.selectedArtist;
|
||||
|
||||
// Make sure we have a selected series and
|
||||
// the same series hasn't been added yet.
|
||||
if (selectedSeries && !_.some(acc, { foreignArtistId: selectedSeries.foreignArtistId })) {
|
||||
const newSeries = getNewSeries(_.cloneDeep(selectedSeries), item);
|
||||
if (selectedArtist && !_.some(acc, { foreignArtistId: selectedArtist.foreignArtistId })) {
|
||||
const newSeries = getNewSeries(_.cloneDeep(selectedArtist), item);
|
||||
newSeries.path = item.path;
|
||||
|
||||
addedIds.push(id);
|
||||
|
|
|
@ -2,7 +2,7 @@ import { createAction } from 'redux-actions';
|
|||
import * as types from './actionTypes';
|
||||
import importArtistActionHandlers from './importArtistActionHandlers';
|
||||
|
||||
export const queueLookupSeries = importArtistActionHandlers[types.QUEUE_LOOKUP_ARTIST];
|
||||
export const queueLookupArtist = importArtistActionHandlers[types.QUEUE_LOOKUP_ARTIST];
|
||||
export const startLookupSeries = importArtistActionHandlers[types.START_LOOKUP_ARTIST];
|
||||
export const importArtist = importArtistActionHandlers[types.IMPORT_ARTIST];
|
||||
export const clearImportArtist = createAction(types.CLEAR_IMPORT_ARTIST);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { applyMiddleware, compose } from 'redux';
|
||||
import Raven from 'raven-js';
|
||||
import createRavenMiddleware from 'raven-for-redux';
|
||||
// import ravenMiddleware from 'redux-raven-middleware';
|
||||
import thunk from 'redux-thunk';
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import persistState from './persistState';
|
||||
|
|
|
@ -8,9 +8,9 @@ import createSetClientSideCollectionFilterReducer from './Creators/createSetClie
|
|||
export const defaultState = {
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
sortKey: 'sortTitle',
|
||||
sortKey: 'sortName',
|
||||
sortDirection: sortDirections.ASCENDING,
|
||||
secondarySortKey: 'sortTitle',
|
||||
secondarySortKey: 'sortName',
|
||||
secondarySortDirection: sortDirections.ASCENDING,
|
||||
filterKey: null,
|
||||
filterValue: null,
|
||||
|
|
|
@ -10,9 +10,9 @@ export const defaultState = {
|
|||
saveError: null,
|
||||
isDeleting: false,
|
||||
deleteError: null,
|
||||
sortKey: 'sortTitle',
|
||||
sortKey: 'sortName',
|
||||
sortDirection: sortDirections.ASCENDING,
|
||||
secondarySortKey: 'sortTitle',
|
||||
secondarySortKey: 'sortName',
|
||||
secondarySortDirection: sortDirections.ASCENDING,
|
||||
filterKey: null,
|
||||
filterValue: null,
|
||||
|
|
|
@ -8,9 +8,9 @@ import createSetClientSideCollectionSortReducer from './Creators/createSetClient
|
|||
import createSetClientSideCollectionFilterReducer from './Creators/createSetClientSideCollectionFilterReducer';
|
||||
|
||||
export const defaultState = {
|
||||
sortKey: 'sortTitle',
|
||||
sortKey: 'sortName',
|
||||
sortDirection: sortDirections.ASCENDING,
|
||||
secondarySortKey: 'sortTitle',
|
||||
secondarySortKey: 'sortName',
|
||||
secondarySortDirection: sortDirections.ASCENDING,
|
||||
filterKey: null,
|
||||
filterValue: null,
|
||||
|
@ -38,12 +38,6 @@ export const defaultState = {
|
|||
isVisible: true,
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'network',
|
||||
label: 'Network',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'qualityProfileId',
|
||||
label: 'Quality Profile',
|
||||
|
@ -93,8 +87,8 @@ export const defaultState = {
|
|||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'latestSeason',
|
||||
label: 'Latest Season',
|
||||
name: 'latestAlbum',
|
||||
label: 'Latest Album',
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
|
@ -116,12 +110,6 @@ export const defaultState = {
|
|||
isSortable: false,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'useSceneNumbering',
|
||||
label: 'Scene Numbering',
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'actions',
|
||||
columnLabel: 'Actions',
|
||||
|
@ -131,12 +119,6 @@ export const defaultState = {
|
|||
],
|
||||
|
||||
sortPredicates: {
|
||||
network: function(item) {
|
||||
const network = item.network;
|
||||
|
||||
return network ? network.toLowerCase() : '';
|
||||
},
|
||||
|
||||
nextAiring: function(item, direction) {
|
||||
const nextAiring = item.nextAiring;
|
||||
|
||||
|
@ -151,37 +133,37 @@ export const defaultState = {
|
|||
return Number.MAX_VALUE;
|
||||
},
|
||||
|
||||
episodeProgress: function(item) {
|
||||
trackProgress: function(item) {
|
||||
const {
|
||||
episodeCount = 0,
|
||||
episodeFileCount
|
||||
trackCount = 0,
|
||||
trackFileCount
|
||||
} = item;
|
||||
|
||||
const progress = episodeCount ? episodeFileCount / episodeCount * 100 : 100;
|
||||
const progress = trackCount ? trackFileCount / trackCount * 100 : 100;
|
||||
|
||||
return progress + episodeCount / 1000000;
|
||||
return progress + trackCount / 1000000;
|
||||
}
|
||||
},
|
||||
|
||||
filterPredicates: {
|
||||
missing: function(item) {
|
||||
return item.episodeCount - item.episodeFileCount > 0;
|
||||
return item.trackCount - item.trackFileCount > 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const persistState = [
|
||||
'seriesIndex.sortKey',
|
||||
'seriesIndex.sortDirection',
|
||||
'seriesIndex.filterKey',
|
||||
'seriesIndex.filterValue',
|
||||
'seriesIndex.filterType',
|
||||
'seriesIndex.view',
|
||||
'seriesIndex.columns',
|
||||
'seriesIndex.posterOptions'
|
||||
'artistIndex.sortKey',
|
||||
'artistIndex.sortDirection',
|
||||
'artistIndex.filterKey',
|
||||
'artistIndex.filterValue',
|
||||
'artistIndex.filterType',
|
||||
'artistIndex.view',
|
||||
'artistIndex.columns',
|
||||
'artistIndex.posterOptions'
|
||||
];
|
||||
|
||||
const reducerSection = 'seriesIndex';
|
||||
const reducerSection = 'artistIndex';
|
||||
|
||||
const artistIndexReducers = handleActions({
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export const defaultState = {
|
|||
isSaving: false,
|
||||
saveError: null,
|
||||
items: [],
|
||||
sortKey: 'sortTitle',
|
||||
sortKey: 'sortName',
|
||||
sortDirection: sortDirections.ASCENDING,
|
||||
pendingChanges: {}
|
||||
};
|
||||
|
|
|
@ -19,8 +19,8 @@ export const defaultState = {
|
|||
|
||||
columns: [
|
||||
{
|
||||
name: 'series.sortTitle',
|
||||
label: 'Series Title',
|
||||
name: 'series.sortName',
|
||||
label: 'Artist Name',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
|
|
|
@ -4,8 +4,8 @@ import { routerReducer } from 'react-router-redux';
|
|||
import app, { defaultState as defaultappState } from './appReducers';
|
||||
import addArtist, { defaultState as defaultAddSeriesState } from './addArtistReducers';
|
||||
import importArtist, { defaultState as defaultImportArtistState } from './importArtistReducers';
|
||||
import series, { defaultState as defaultSeriesState } from './artistReducers';
|
||||
import seriesIndex, { defaultState as defaultSeriesIndexState } from './artistIndexReducers';
|
||||
import series, { defaultState as defaultArtistState } from './artistReducers';
|
||||
import artistIndex, { defaultState as defaultArtistIndexState } from './artistIndexReducers';
|
||||
import artistEditor, { defaultState as defaultArtistEditorState } from './artistEditorReducers';
|
||||
import albumStudio, { defaultState as defaultAlbumStudioState } from './albumStudioReducers';
|
||||
import calendar, { defaultState as defaultCalendarState } from './calendarReducers';
|
||||
|
@ -32,8 +32,8 @@ export const defaultState = {
|
|||
app: defaultappState,
|
||||
addArtist: defaultAddSeriesState,
|
||||
importArtist: defaultImportArtistState,
|
||||
series: defaultSeriesState,
|
||||
seriesIndex: defaultSeriesIndexState,
|
||||
series: defaultArtistState,
|
||||
artistIndex: defaultArtistIndexState,
|
||||
artistEditor: defaultArtistEditorState,
|
||||
albumStudio: defaultAlbumStudioState,
|
||||
calendar: defaultCalendarState,
|
||||
|
@ -62,7 +62,7 @@ export default enableBatching(combineReducers({
|
|||
addArtist,
|
||||
importArtist,
|
||||
series,
|
||||
seriesIndex,
|
||||
artistIndex,
|
||||
artistEditor,
|
||||
albumStudio,
|
||||
calendar,
|
||||
|
|
|
@ -20,7 +20,7 @@ export const defaultState = {
|
|||
series: function(item, direction) {
|
||||
const series = item.series;
|
||||
|
||||
return series ? series.sortTitle : '';
|
||||
return series ? series.sortName : '';
|
||||
},
|
||||
|
||||
quality: function(item, direction) {
|
||||
|
|
|
@ -71,8 +71,8 @@ export const defaultState = {
|
|||
|
||||
columns: [
|
||||
{
|
||||
name: 'series.sortTitle',
|
||||
label: 'Series Title',
|
||||
name: 'series.sortName',
|
||||
label: 'Artist Name',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
|
|
|
@ -10,8 +10,8 @@ function createImportArtistItemSelector() {
|
|||
createAllArtistSelector(),
|
||||
(id, addArtist, importArtist, series) => {
|
||||
const item = _.find(importArtist.items, { id }) || {};
|
||||
const selectedSeries = item && item.selectedSeries;
|
||||
const isExistingArtist = !!selectedSeries && _.some(series, { foreignArtistId: selectedSeries.foreignArtistId });
|
||||
const selectedArtist = item && item.selectedArtist;
|
||||
const isExistingArtist = !!selectedArtist && _.some(series, { foreignArtistId: selectedArtist.foreignArtistId });
|
||||
|
||||
return {
|
||||
defaultMonitor: addArtist.defaults.monitor,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const scrollPositions = {
|
||||
seriesIndex: 0
|
||||
artistIndex: 0
|
||||
};
|
||||
|
||||
export default scrollPositions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue