Upgrade Prettier to 2.0.4. Reformatted all JS files

This commit is contained in:
Deluan 2020-04-20 09:09:29 -04:00
parent de115ff466
commit b3f70538a9
55 changed files with 318 additions and 286 deletions

52
ui/package-lock.json generated
View File

@ -1643,6 +1643,7 @@
"version": "25.4.0",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-25.4.0.tgz",
"integrity": "sha512-XBeaWNzw2PPnGW5aXvZt3+VO60M+34RY3XDsCK5tW7kyj3RK0XClRutCfjqcBuaR2aBQTbluEDME9b5MB9UAPw==",
"dev": true,
"requires": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^1.1.1",
@ -1936,6 +1937,7 @@
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-7.2.1.tgz",
"integrity": "sha512-xIGoHlQ2ZiEL1dJIFKNmLDypzYF+4OJTTASRctl/aoIDaS5y/pRVHRigoqvPUV11mdJoR71IIgi/6UviMgyz4g==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"@types/testing-library__dom": "^7.0.0",
@ -1948,6 +1950,7 @@
"version": "7.9.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz",
"integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
@ -1956,6 +1959,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.0.2.tgz",
"integrity": "sha512-S1G1V790fTaigUSM/Gd0NngzEfiMy9uTUfMyHhKhVyy4cH5O/eTuR01ydhGL0z4Za1PXFTRGH3qL8VhUQuEO5w==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.4",
"@babel/runtime-corejs3": "^7.7.4"
@ -1964,7 +1968,8 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
}
}
},
@ -1972,6 +1977,7 @@
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.5.0.tgz",
"integrity": "sha512-7sWHrpxG4Yd8TmryI7Rtbx8Ff4mbs3ASye3oshQIuHvsCR+QHgr7rTR/PfeXvOmwUwR36wSTTAvrLKsPmr6VEQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"@types/testing-library__jest-dom": "^5.0.2",
@ -1988,6 +1994,7 @@
"version": "7.9.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz",
"integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
@ -1995,7 +2002,8 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
}
}
},
@ -2003,6 +2011,7 @@
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/@testing-library/react/-/react-10.0.2.tgz",
"integrity": "sha512-YT6Mw0oJz7R6vlEkmo1FlUD+K15FeXApOB5Ffm9zooFVnrwkt00w18dUJFMOh1yRp9wTdVRonbor7o4PIpFCmA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"@testing-library/dom": "^7.1.0",
@ -2013,6 +2022,7 @@
"version": "7.9.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz",
"integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
@ -2020,14 +2030,16 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
}
}
},
"@testing-library/user-event": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-10.0.2.tgz",
"integrity": "sha512-fVeP4U37BIYdp9nBRKEITFSLPqgCSS7Og6LHvxoQ2JSOTJ1NJI4Dfesv4uNXxvNNcJgBS88V+Tc6h8vbDsa2iA=="
"integrity": "sha512-fVeP4U37BIYdp9nBRKEITFSLPqgCSS7Og6LHvxoQ2JSOTJ1NJI4Dfesv4uNXxvNNcJgBS88V+Tc6h8vbDsa2iA==",
"dev": true
},
"@types/babel__core": {
"version": "7.1.6",
@ -2117,6 +2129,7 @@
"version": "25.2.1",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.1.tgz",
"integrity": "sha512-msra1bCaAeEdkSyA0CZ6gW1ukMIvZ5YoJkdXw/qhQdsuuDlFTcEUrUw8CLCPt2rVRUfXlClVvK2gvPs9IokZaA==",
"dev": true,
"requires": {
"jest-diff": "^25.2.1",
"pretty-format": "^25.2.1"
@ -2165,6 +2178,7 @@
"version": "16.9.6",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.6.tgz",
"integrity": "sha512-S6ihtlPMDotrlCJE9ST1fRmYrQNNwfgL61UB4I1W7M6kPulUKx9fXAleW5zpdIjUQ4fTaaog8uERezjsGUj9HQ==",
"dev": true,
"requires": {
"@types/react": "*"
}
@ -2186,6 +2200,7 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/@types/testing-library__dom/-/testing-library__dom-7.0.1.tgz",
"integrity": "sha512-WokGRksRJb3Dla6h02/0/NNHTkjsj4S8aJZiwMj/5/UL8VZ1iCe3H8SHzfpmBeH8Vp4SPRT8iC2o9kYULFhDIw==",
"dev": true,
"requires": {
"pretty-format": "^25.1.0"
}
@ -2194,6 +2209,7 @@
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.0.3.tgz",
"integrity": "sha512-NdbKc6yseg6uq4UJFwimPws0iwsGugVbPoOTP2EH+PJMJKiZsoSg5F2H3XYweOyytftCOuIMuXifBUrF9CSvaQ==",
"dev": true,
"requires": {
"@types/jest": "*"
}
@ -2202,6 +2218,7 @@
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-10.0.1.tgz",
"integrity": "sha512-RbDwmActAckbujLZeVO/daSfdL1pnjVqas25UueOkAY5r7vriavWf0Zqg7ghXMHa8ycD/kLkv8QOj31LmSYwww==",
"dev": true,
"requires": {
"@types/react-dom": "*",
"@types/testing-library__dom": "*",
@ -2212,6 +2229,7 @@
"version": "15.0.4",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz",
"integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==",
"dev": true,
"requires": {
"@types/yargs-parser": "*"
}
@ -4519,7 +4537,8 @@
"css.escape": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
"integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s="
"integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=",
"dev": true
},
"cssdb": {
"version": "4.4.0",
@ -4893,7 +4912,8 @@
"diff-sequences": {
"version": "25.2.6",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz",
"integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg=="
"integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==",
"dev": true
},
"diffie-hellman": {
"version": "5.0.3",
@ -4947,7 +4967,8 @@
"dom-accessibility-api": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.4.3.tgz",
"integrity": "sha512-JZ8iPuEHDQzq6q0k7PKMGbrIdsgBB7TRrtVOUm4nSMCExlg5qQG4KXWTH2k90yggjM4tTumRGwTKJSldMzKyLA=="
"integrity": "sha512-JZ8iPuEHDQzq6q0k7PKMGbrIdsgBB7TRrtVOUm4nSMCExlg5qQG4KXWTH2k90yggjM4tTumRGwTKJSldMzKyLA==",
"dev": true
},
"dom-align": {
"version": "1.11.1",
@ -8060,6 +8081,7 @@
"version": "25.4.0",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.4.0.tgz",
"integrity": "sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"diff-sequences": "^25.2.6",
@ -8334,7 +8356,8 @@
"jest-get-type": {
"version": "25.2.6",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz",
"integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig=="
"integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==",
"dev": true
},
"jest-haste-map": {
"version": "24.9.0",
@ -9069,6 +9092,7 @@
"version": "25.4.0",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.4.0.tgz",
"integrity": "sha512-yPMdtj7YDgXhnGbc66bowk8AkQ0YwClbbwk3Kzhn5GVDrciiCr27U4NJRbrqXbTdtxjImONITg2LiRIw650k5A==",
"dev": true,
"requires": {
"chalk": "^3.0.0",
"jest-diff": "^25.4.0",
@ -10691,7 +10715,8 @@
"min-indent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz",
"integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY="
"integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=",
"dev": true
},
"mini-create-react-context": {
"version": "0.3.2",
@ -12716,9 +12741,9 @@
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
},
"prettier": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.4.tgz",
"integrity": "sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==",
"dev": true
},
"pretty-bytes": {
@ -12739,6 +12764,7 @@
"version": "25.4.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.4.0.tgz",
"integrity": "sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ==",
"dev": true,
"requires": {
"@jest/types": "^25.4.0",
"ansi-regex": "^5.0.0",
@ -13931,6 +13957,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
"integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
"dev": true,
"requires": {
"indent-string": "^4.0.0",
"strip-indent": "^3.0.0"
@ -15407,6 +15434,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
"dev": true,
"requires": {
"min-indent": "^1.0.0"
}

View File

@ -21,10 +21,10 @@
"react-scripts": "^3.4.1"
},
"devDependencies": {
"prettier": "^1.19.1",
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.2",
"@testing-library/user-event": "^10.0.2"
"@testing-library/user-event": "^10.0.2",
"prettier": "^2.0.4"
},
"scripts": {
"start": "react-scripts start",

View File

@ -2,7 +2,7 @@ import {
Button,
sanitizeListRestProps,
TopToolbar,
useTranslate
useTranslate,
} from 'react-admin'
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
import ShuffleIcon from '@material-ui/icons/Shuffle'
@ -65,5 +65,5 @@ export const AlbumActions = ({
AlbumActions.defaultProps = {
selectedIds: [],
onUnselectItems: () => null
onUnselectItems: () => null,
}

View File

@ -9,29 +9,29 @@ import subsonic from '../subsonic'
const useStyles = makeStyles((theme) => ({
root: {
margin: '20px'
margin: '20px',
},
gridListTile: {
minHeight: '180px',
minWidth: '180px'
minWidth: '180px',
},
cover: {
display: 'inline-block',
width: '100%',
height: '100%'
height: '100%',
},
tileBar: {
textAlign: 'center',
background:
'linear-gradient(to top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.4) 70%,rgba(0,0,0,0) 100%)'
'linear-gradient(to top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.4) 70%,rgba(0,0,0,0) 100%)',
},
albumArtistName: {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
textAlign: 'center',
fontSize: '1em'
}
fontSize: '1em',
},
}))
const getColsForWidth = (width) => {

View File

@ -9,7 +9,7 @@ import {
ReferenceInput,
SearchInput,
Pagination,
useTranslate
useTranslate,
} from 'react-admin'
import { Title } from '../common'
import { withWidth } from '@material-ui/core'

View File

@ -35,7 +35,7 @@ const AlbumListActions = ({
showFilter,
displayedFilters,
filterValues,
context: 'button'
context: 'button',
})}
<ButtonGroup
variant="text"
@ -63,7 +63,7 @@ const AlbumListActions = ({
AlbumListActions.defaultProps = {
selectedIds: [],
onUnselectItems: () => null
onUnselectItems: () => null,
}
export default AlbumListActions

View File

@ -7,7 +7,7 @@ import {
FunctionField,
Show,
SimpleShowLayout,
TextField
TextField,
} from 'react-admin'
import { DurationField, RangeField } from '../common'
import { useMediaQuery } from '@material-ui/core'

View File

@ -6,7 +6,7 @@ import {
ListToolbar,
TextField,
useListController,
DatagridLoading
DatagridLoading,
} from 'react-admin'
import classnames from 'classnames'
import { useDispatch } from 'react-redux'
@ -20,7 +20,7 @@ const useStyles = makeStyles(
(theme) => ({
root: {},
main: {
display: 'flex'
display: 'flex',
},
content: {
marginTop: 0,
@ -28,29 +28,29 @@ const useStyles = makeStyles(
position: 'relative',
flex: '1 1 auto',
[theme.breakpoints.down('xs')]: {
boxShadow: 'none'
boxShadow: 'none',
},
overflow: 'inherit'
overflow: 'inherit',
},
bulkActionsDisplayed: {
marginTop: -theme.spacing(8),
transition: theme.transitions.create('margin-top')
transition: theme.transitions.create('margin-top'),
},
actions: {
zIndex: 2,
display: 'flex',
justifyContent: 'flex-end',
flexWrap: 'wrap'
flexWrap: 'wrap',
},
noResults: { padding: 20 }
noResults: { padding: 20 },
}),
{ name: 'RaList' }
)
const useStylesListToolbar = makeStyles({
toolbar: {
justifyContent: 'flex-start'
}
justifyContent: 'flex-start',
},
})
const trackName = (r) => {
@ -88,7 +88,7 @@ const AlbumSongs = (props) => {
<Card
className={classnames(classes.content, {
[classes.bulkActionsDisplayed]:
controllerProps.selectedIds.length > 0
controllerProps.selectedIds.length > 0,
})}
key={version}
>

View File

@ -15,5 +15,5 @@ export const ArtistLinkField = (props) => {
ArtistLinkField.defaultProps = {
source: 'artistId',
addLabel: true
addLabel: true,
}

View File

@ -14,8 +14,8 @@ const albumListParams = {
ALBUM_LIST_NEWEST: { sort: { field: 'created_at', order: 'DESC' } },
ALBUM_LIST_RECENT: {
sort: { field: 'play_date', order: 'DESC' },
filter: { starred: true }
}
filter: { starred: true },
},
}
const selectAlbumList = (mode) => ({ type: mode })
@ -24,7 +24,7 @@ const albumViewReducer = (
previousState = {
mode: ALBUM_MODE_LIST,
list: ALBUM_LIST_ALL,
params: { sort: {}, filter: {} }
params: { sort: {}, filter: {} },
},
payload
) => {
@ -54,5 +54,5 @@ export {
ALBUM_LIST_STARRED,
albumViewReducer,
selectViewMode,
selectAlbumList
selectAlbumList,
}

View File

@ -5,5 +5,5 @@ import AlbumShow from './AlbumShow'
export default {
list: AlbumList,
show: AlbumShow,
icon: AlbumIcon
icon: AlbumIcon,
}

View File

@ -4,44 +4,44 @@ export const useStyles = makeStyles((theme) => ({
container: {
[theme.breakpoints.down('xs')]: {
padding: '0.7em',
minWidth: '24em'
minWidth: '24em',
},
[theme.breakpoints.up('sm')]: {
padding: '1em',
minWidth: '32em'
}
minWidth: '32em',
},
},
albumCover: {
display: 'inline-block',
[theme.breakpoints.down('xs')]: {
height: '8em',
width: '8em'
width: '8em',
},
[theme.breakpoints.up('sm')]: {
height: '10em',
width: '10em'
width: '10em',
},
[theme.breakpoints.up('lg')]: {
height: '15em',
width: '15em'
}
width: '15em',
},
},
albumDetails: {
display: 'inline-block',
verticalAlign: 'top',
[theme.breakpoints.down('xs')]: {
width: '14em'
width: '14em',
},
[theme.breakpoints.up('sm')]: {
width: '26em'
width: '26em',
},
[theme.breakpoints.up('lg')]: {
width: '38em'
}
width: '38em',
},
},
albumTitle: {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis'
}
textOverflow: 'ellipsis',
},
}))

View File

@ -5,7 +5,7 @@ import {
List,
NumberField,
SearchInput,
TextField
TextField,
} from 'react-admin'
import { Pagination, Title } from '../common'
@ -15,7 +15,7 @@ const ArtistFilter = (props) => (
</Filter>
)
const artistRowClick = (id, basePath, record) => {
const artistRowClick = (id) => {
const filter = { artist_id: id }
return `/album?filter=${JSON.stringify(
filter

View File

@ -3,5 +3,5 @@ import ArtistList from './ArtistList'
export default {
list: ArtistList,
icon: MicIcon
icon: MicIcon,
}

View File

@ -29,7 +29,7 @@ const Player = () => {
showMediaSession: true,
defaultPosition: {
top: 300,
left: 120
left: 120,
},
locale: {
playListsText: translate('player.playListsText'),
@ -55,9 +55,9 @@ const Player = () => {
order: translate('player.playModeText.order'),
orderLoop: translate('player.playModeText.orderLoop'),
singleLoop: translate('player.playModeText.singleLoop'),
shufflePlay: translate('player.playModeText.shufflePlay')
}
}
shufflePlay: translate('player.playModeText.shufflePlay'),
},
},
}
const addQueueToOptions = (queue) => {
@ -65,7 +65,7 @@ const Player = () => {
...defaultOptions,
autoPlay: true,
clearPriorAudioLists: queue.clear,
audioLists: queue.queue.map((item) => item)
audioLists: queue.queue.map((item) => item),
}
}

View File

@ -13,33 +13,33 @@ const mapToAudioLists = (item) => ({
name: item.title,
singer: item.artist,
cover: subsonic.url('getCoverArt', item.id, { size: 300 }),
musicSrc: subsonic.url('stream', item.id, { ts: true })
musicSrc: subsonic.url('stream', item.id, { ts: true }),
})
const addTrack = (data) => ({
type: PLAYER_ADD_TRACK,
data
data,
})
const setTrack = (data) => ({
type: PLAYER_SET_TRACK,
data
data,
})
const playAlbum = (id, data) => ({
type: PLAYER_PLAY_ALBUM,
data,
id
id,
})
const syncQueue = (data) => ({
type: PLAYER_SYNC_QUEUE,
data
data,
})
const scrobbled = (id) => ({
type: PLAYER_SCROBBLE,
data: id
data: id,
})
const playQueueReducer = (
@ -61,7 +61,7 @@ const playQueueReducer = (
const newQueue = previousState.queue.map((item) => {
return {
...item,
scrobbled: item.scrobbled || item.trackId === data
scrobbled: item.scrobbled || item.trackId === data,
}
})
return { queue: newQueue, clear: false }

View File

@ -8,11 +8,11 @@ const BitrateField = ({ record = {}, source }) => {
BitrateField.propTypes = {
label: PropTypes.string,
record: PropTypes.object,
source: PropTypes.string.isRequired
source: PropTypes.string.isRequired,
}
BitrateField.defaultProps = {
addLabel: true
addLabel: true,
}
export default BitrateField

View File

@ -15,11 +15,11 @@ const format = (d) => {
DurationField.propTypes = {
label: PropTypes.string,
record: PropTypes.object,
source: PropTypes.string.isRequired
source: PropTypes.string.isRequired,
}
DurationField.defaultProps = {
addLabel: true
addLabel: true,
}
export default DurationField

View File

@ -25,6 +25,6 @@ const PlayButton = ({ icon = defaultIcon, action, ...rest }) => {
PlayButton.propTypes = {
icon: PropTypes.element,
action: PropTypes.object
action: PropTypes.object,
}
export default PlayButton

View File

@ -22,11 +22,11 @@ const RangeField = ({ record = {}, source }) => {
RangeField.propTypes = {
label: PropTypes.string,
record: PropTypes.object,
source: PropTypes.string.isRequired
source: PropTypes.string.isRequired,
}
RangeField.defaultProps = {
addLabel: true
addLabel: true,
}
export { formatRange }

View File

@ -15,9 +15,9 @@ const useStyles = makeStyles(
{
link: {
textDecoration: 'none',
color: 'inherit'
color: 'inherit',
},
tertiary: { float: 'right', opacity: 0.541176 }
tertiary: { float: 'right', opacity: 0.541176 },
},
{ name: 'RaSimpleList' }
)
@ -28,7 +28,7 @@ const LinkOrNot = ({
basePath,
id,
record,
children
children,
}) => {
const classes = useStyles({ classes: classesOverride })
return linkType === 'edit' || linkType === true ? (
@ -129,7 +129,7 @@ SimpleList.propTypes = {
linkType: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.func
PropTypes.func,
]).isRequired,
onToggleItem: PropTypes.func,
primaryText: PropTypes.func,
@ -137,13 +137,13 @@ SimpleList.propTypes = {
rightIcon: PropTypes.func,
secondaryText: PropTypes.func,
selectedIds: PropTypes.arrayOf(PropTypes.any).isRequired,
tertiaryText: PropTypes.func
tertiaryText: PropTypes.func,
}
SimpleList.defaultProps = {
linkType: 'edit',
hasBulkActions: false,
selectedIds: []
selectedIds: [],
}
export default SimpleList

View File

@ -20,11 +20,11 @@ function formatBytes(bytes, decimals = 2) {
SizeField.propTypes = {
label: PropTypes.string,
record: PropTypes.object,
source: PropTypes.string.isRequired
source: PropTypes.string.isRequired,
}
SizeField.defaultProps = {
addLabel: true
addLabel: true,
}
export default SizeField

View File

@ -20,7 +20,7 @@ const SongDetails = (props) => {
bitRate: <BitrateField record={record} source="bitRate" />,
size: <SizeField record={record} source="size" />,
updatedAt: <DateField record={record} source="updatedAt" showTime />,
playCount: <TextField record={record} source="playCount" />
playCount: <TextField record={record} source="playCount" />,
}
if (record.playCount > 0) {
data.playDate = <DateField record={record} source="playDate" showTime />
@ -34,7 +34,7 @@ const SongDetails = (props) => {
<TableRow key={record.id}>
<TableCell component="th" scope="row">
{translate(`resources.song.fields.${key}`, {
_: inflection.humanize(inflection.underscore(key))
_: inflection.humanize(inflection.underscore(key)),
})}
:
</TableCell>

View File

@ -18,5 +18,5 @@ export {
SimpleList,
RangeField,
SongDetails,
formatRange
formatRange,
}

View File

@ -19,11 +19,11 @@ export default deepmerge(chineseMessages, {
playCount: '播放次数',
trackNumber: '音轨 #',
size: '大小',
updatedAt: '上次更新'
updatedAt: '上次更新',
},
bulk: {
addToQueue: '稍后播放'
}
addToQueue: '稍后播放',
},
},
album: {
name: '专辑 |||| 专辑',
@ -35,21 +35,21 @@ export default deepmerge(chineseMessages, {
songCount: '曲目数',
playCount: '播放次数',
compilation: '合辑',
year: '年份'
year: '年份',
},
actions: {
playAll: '播放',
playNext: '播放下一首',
addToQueue: '稍后播放',
shuffle: '刷新'
}
shuffle: '刷新',
},
},
artist: {
name: '歌手 |||| 歌手',
fields: {
name: '名称',
albumCount: '歌手数'
}
albumCount: '歌手数',
},
},
user: {
name: '用户 |||| 用户',
@ -58,8 +58,8 @@ export default deepmerge(chineseMessages, {
isAdmin: '管理员',
lastLoginAt: '最后一次访问',
updatedAt: '上次修改',
name: '名称'
}
name: '名称',
},
},
player: {
name: '用户 |||| 用户',
@ -69,8 +69,8 @@ export default deepmerge(chineseMessages, {
maxBitRate: '最大比特率',
client: '应用程序',
userName: '用户',
lastSeen: '最后一次访问'
}
lastSeen: '最后一次访问',
},
},
transcoding: {
name: '转码 |||| 转码',
@ -78,21 +78,21 @@ export default deepmerge(chineseMessages, {
name: '名称',
targetFormat: '格式',
defaultBitRate: '默认比特率',
command: '命令'
}
}
command: '命令',
},
},
},
ra: {
auth: {
welcome1: '感谢您安装Navidrome!',
welcome2: '为了开始使用,请创建一个管理员账户',
confirmPassword: '确认密码',
buttonCreateAdmin: '创建管理员'
buttonCreateAdmin: '创建管理员',
},
validation: {
invalidChars: '请只使用字母和数字',
passwordDoesNotMatch: '密码不匹配'
}
passwordDoesNotMatch: '密码不匹配',
},
},
menu: {
library: '曲库',
@ -103,9 +103,9 @@ export default deepmerge(chineseMessages, {
name: '个性化',
options: {
theme: '主题',
language: '语言'
}
}
language: '语言',
},
},
},
player: {
playListsText: '播放队列',
@ -130,7 +130,7 @@ export default deepmerge(chineseMessages, {
order: '顺序播放',
orderLoop: '列表循环',
singleLoop: '单曲循环',
shufflePlay: '随机播放'
}
}
shufflePlay: '随机播放',
},
},
})

View File

@ -10,11 +10,11 @@ export default deepmerge(englishMessages, {
albumArtist: 'Album Artist',
duration: 'Time',
trackNumber: 'Track #',
playCount: 'Plays'
playCount: 'Plays',
},
bulk: {
addToQueue: 'Play Later'
}
addToQueue: 'Play Later',
},
},
album: {
fields: {
@ -22,27 +22,27 @@ export default deepmerge(englishMessages, {
artist: 'Artist',
duration: 'Time',
songCount: 'Songs',
playCount: 'Plays'
playCount: 'Plays',
},
actions: {
playAll: 'Play',
playNext: 'Play Next',
addToQueue: 'Play Later',
shuffle: 'Shuffle'
}
}
shuffle: 'Shuffle',
},
},
},
ra: {
auth: {
welcome1: 'Thanks for installing Navidrome!',
welcome2: 'To start, create an admin user',
confirmPassword: 'Confirm Password',
buttonCreateAdmin: 'Create Admin'
buttonCreateAdmin: 'Create Admin',
},
validation: {
invalidChars: 'Please only use letter and numbers',
passwordDoesNotMatch: 'Password does not match'
}
passwordDoesNotMatch: 'Password does not match',
},
},
menu: {
library: 'Library',
@ -53,9 +53,9 @@ export default deepmerge(englishMessages, {
name: 'Personal',
options: {
theme: 'Theme',
language: 'Language'
}
}
language: 'Language',
},
},
},
player: {
playListsText: 'Play Queue',
@ -80,7 +80,7 @@ export default deepmerge(englishMessages, {
order: 'In order',
orderLoop: 'Repeat',
singleLoop: 'Repeat One',
shufflePlay: 'Shuffle'
}
}
shufflePlay: 'Shuffle',
},
},
})

View File

@ -15,14 +15,14 @@ export default deepmerge(frenchMessages, {
compilation: 'Compilation',
duration: 'Durée',
year: 'Année',
playCount: 'Nombre d\'écoutes',
playCount: "Nombre d'écoutes",
trackNumber: '#',
size: 'Taille',
updatedAt: 'Mise à jour'
updatedAt: 'Mise à jour',
},
bulk: {
addToQueue: 'Ajouter à la file'
}
addToQueue: 'Ajouter à la file',
},
},
album: {
name: 'Album |||| Albums',
@ -31,55 +31,55 @@ export default deepmerge(frenchMessages, {
artist: 'Artiste',
songCount: 'Numéro de piste',
genre: 'Genre',
playCount: 'Numbre d\'écoutes',
playCount: "Numbre d'écoutes",
compilation: 'Compilation',
duration: 'Durée',
year: 'Année'
year: 'Année',
},
actions: {
playAll: 'Lire',
playNext: 'Lire ensuite',
addToQueue: 'Ajouter à la file',
shuffle: 'Mélanger'
}
shuffle: 'Mélanger',
},
},
artist: {
name: 'Artiste |||| Artistes',
fields: {
name: 'Nom',
albumCount: 'Nombre d\'albums'
}
albumCount: "Nombre d'albums",
},
},
user: {
name: 'Utilisateur |||| Utilisateurs',
fields: {
name: 'Nom'
}
name: 'Nom',
},
},
transcoding: {
name: 'Conversion |||| Conversions',
fields: {
name: 'Nom'
}
name: 'Nom',
},
},
player: {
name: 'Lecteur |||| Lecteurs',
fields: {
name: 'Nom'
}
}
name: 'Nom',
},
},
},
ra: {
auth: {
welcome1: 'Merci d\'avoir installé Navidrome !',
welcome1: "Merci d'avoir installé Navidrome !",
welcome2: 'Pour commencer, créez un compte administrateur',
confirmPassword: 'Confirmer votre mot de passe',
buttonCreateAdmin: 'Créer un compte administrateur'
buttonCreateAdmin: 'Créer un compte administrateur',
},
validation: {
invalidChars: 'Merci d\'utiliser uniquement des chiffres et des lettres',
passwordDoesNotMatch: 'Les mots de passes ne correspondent pas'
}
invalidChars: "Merci d'utiliser uniquement des chiffres et des lettres",
passwordDoesNotMatch: 'Les mots de passes ne correspondent pas',
},
},
menu: {
library: 'Bibliothèque',
@ -89,9 +89,9 @@ export default deepmerge(frenchMessages, {
name: 'Paramètres personel',
options: {
theme: 'Thème',
language: 'Langue'
}
}
language: 'Langue',
},
},
},
player: {
playListsText: 'File de lecture',
@ -106,7 +106,7 @@ export default deepmerge(frenchMessages, {
order: 'Ordonner',
orderLoop: 'Tout répéter',
singleLoop: 'Repéter',
shufflePlay: 'Aleatoire'
}
}
shufflePlay: 'Aleatoire',
},
},
})

View File

@ -18,11 +18,11 @@ export default deepmerge(italianMessages, {
playCount: 'Riproduzioni',
trackNumber: '#',
size: 'Dimensioni',
updatedAt: 'Ultimo aggiornamento'
updatedAt: 'Ultimo aggiornamento',
},
bulk: {
addToQueue: 'Aggiungi alla coda'
}
addToQueue: 'Aggiungi alla coda',
},
},
album: {
name: 'Album |||| Album',
@ -34,21 +34,21 @@ export default deepmerge(italianMessages, {
playCount: 'Riproduzioni',
compilation: 'Compilation',
duration: 'Durata',
year: 'Anno'
year: 'Anno',
},
actions: {
playAll: 'Riproduci',
playNext: 'Riproduci come successivo',
addToQueue: 'Aggiungi alla coda',
shuffle: 'Riprodici casualmente'
}
shuffle: 'Riprodici casualmente',
},
},
artist: {
name: 'Artista |||| Artisti',
fields: {
name: 'Nome',
albumCount: 'Album'
}
albumCount: 'Album',
},
},
user: {
name: 'Utente |||| Utenti',
@ -57,8 +57,8 @@ export default deepmerge(italianMessages, {
isAdmin: 'Amministratore',
lastLoginAt: 'Ultimo accesso',
updatedAt: 'Ultima modifica',
name: 'Nome'
}
name: 'Nome',
},
},
player: {
name: 'Client |||| Client',
@ -68,8 +68,8 @@ export default deepmerge(italianMessages, {
maxBitRate: 'Bitrate massimo',
client: 'Applicazione',
userName: 'Utente',
lastSeen: 'Ultimo acesso'
}
lastSeen: 'Ultimo acesso',
},
},
transcoding: {
name: 'Transcodifica |||| Transcodifiche',
@ -77,21 +77,21 @@ export default deepmerge(italianMessages, {
name: 'Nome',
targetFormat: 'Formato',
defaultBitRate: 'Bitrate predefinito',
command: 'Comando'
}
}
command: 'Comando',
},
},
},
ra: {
auth: {
welcome1: 'Grazie per aver installato Navidrome!',
welcome2: 'Per iniziare, crea un amministratore',
confirmPassword: 'Conferma la password',
buttonCreateAdmin: 'Crea amministratore'
buttonCreateAdmin: 'Crea amministratore',
},
validation: {
invalidChars: 'Per favore usa solo lettere e numeri',
passwordDoesNotMatch: 'Le password non coincidono'
}
passwordDoesNotMatch: 'Le password non coincidono',
},
},
menu: {
library: 'Libreria',
@ -101,9 +101,9 @@ export default deepmerge(italianMessages, {
name: 'Personale',
options: {
theme: 'Tema',
language: 'Lingua'
}
}
language: 'Lingua',
},
},
},
player: {
playListsText: 'Coda',
@ -121,7 +121,7 @@ export default deepmerge(italianMessages, {
order: 'In ordine',
orderLoop: 'Ripeti',
singleLoop: 'Ripeti una volta',
shufflePlay: 'Casuale'
}
}
shufflePlay: 'Casuale',
},
},
})

View File

@ -18,11 +18,11 @@ export default deepmerge(portugueseMessages, {
playCount: 'Execuções',
trackNumber: '#',
size: 'Tamanho',
updatedAt: 'Últ. Atualização'
updatedAt: 'Últ. Atualização',
},
bulk: {
addToQueue: 'Play Later'
}
addToQueue: 'Play Later',
},
},
album: {
name: 'Álbum |||| Álbuns',
@ -34,21 +34,21 @@ export default deepmerge(portugueseMessages, {
playCount: 'Execuções',
compilation: 'Coletânea',
duration: 'Duração',
year: 'Ano'
year: 'Ano',
},
actions: {
playAll: 'Play',
playNext: 'Play Next',
addToQueue: 'Play Later',
shuffle: 'Shuffle'
}
shuffle: 'Shuffle',
},
},
artist: {
name: 'Artista |||| Artistas',
fields: {
name: 'Nome',
albumCount: 'Total de Álbuns'
}
albumCount: 'Total de Álbuns',
},
},
user: {
name: 'Usuário |||| Usuários',
@ -57,8 +57,8 @@ export default deepmerge(portugueseMessages, {
isAdmin: 'Admin?',
lastLoginAt: 'Últ. Login',
updatedAt: 'Últ. Atualização',
name: 'Nome'
}
name: 'Nome',
},
},
player: {
name: 'Tocador |||| Tocadores',
@ -68,8 +68,8 @@ export default deepmerge(portugueseMessages, {
maxBitRate: 'Bitrate máx',
client: 'Cliente',
userName: 'Usuário',
lastSeen: 'Últ. acesso'
}
lastSeen: 'Últ. acesso',
},
},
transcoding: {
name: 'Conversão |||| Conversões',
@ -77,21 +77,21 @@ export default deepmerge(portugueseMessages, {
name: 'Nome',
targetFormat: 'Formato',
defaultBitRate: 'Bitrate padrão',
command: 'Comando'
}
}
command: 'Comando',
},
},
},
ra: {
auth: {
welcome1: 'Obrigado por instalar Navidrome!',
welcome2: 'Para iniciar, crie um usuário admin',
confirmPassword: 'Confirme a senha',
buttonCreateAdmin: 'Criar Admin'
buttonCreateAdmin: 'Criar Admin',
},
validation: {
invalidChars: 'Somente use letras e numeros',
passwordDoesNotMatch: 'Senha não confere'
}
passwordDoesNotMatch: 'Senha não confere',
},
},
menu: {
library: 'Biblioteca',
@ -101,9 +101,9 @@ export default deepmerge(portugueseMessages, {
name: 'Pessoal',
options: {
theme: 'Tema',
language: 'Língua'
}
}
language: 'Língua',
},
},
},
player: {
playListsText: 'Fila de Execução',
@ -121,7 +121,7 @@ export default deepmerge(portugueseMessages, {
order: 'Em ordem',
orderLoop: 'Repetir tudo',
singleLoop: 'Repetir',
shufflePlay: 'Aleatório'
}
}
shufflePlay: 'Aleatório',
},
},
})

View File

@ -3,7 +3,7 @@ import {
AppBar as RAAppBar,
MenuItemLink,
UserMenu,
useTranslate
useTranslate,
} from 'react-admin'
import { makeStyles } from '@material-ui/core'
import InfoIcon from '@material-ui/icons/Info'
@ -11,8 +11,8 @@ import config from '../config'
const useStyles = makeStyles((theme) => ({
menuItem: {
color: theme.palette.text.secondary
}
color: theme.palette.text.secondary,
},
}))
const VersionMenu = forwardRef((props, ref) => {
@ -23,7 +23,7 @@ const VersionMenu = forwardRef((props, ref) => {
ref={ref}
to="#"
primaryText={translate('menu.version', {
version: config.version
version: config.version,
})}
leftIcon={<InfoIcon />}
className={classes.menuItem}

View File

@ -7,7 +7,7 @@ import AppBar from './AppBar'
import themes from '../themes'
const useStyles = makeStyles({
root: { paddingBottom: (props) => (props.addPadding ? '80px' : 0) }
root: { paddingBottom: (props) => (props.addPadding ? '80px' : 0) },
})
export default (props) => {

View File

@ -27,35 +27,35 @@ const useStyles = makeStyles((theme) => ({
background: `url(${config.loginBackgroundURL})`,
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
backgroundPosition: 'center'
backgroundPosition: 'center',
},
card: {
minWidth: 300,
marginTop: '6em'
marginTop: '6em',
},
avatar: {
margin: '1em',
display: 'flex',
justifyContent: 'center'
justifyContent: 'center',
},
icon: {
backgroundColor: theme.palette.secondary.main
backgroundColor: theme.palette.secondary.main,
},
systemName: {
marginTop: '1em',
display: 'flex',
justifyContent: 'center',
color: 'blue' //theme.palette.grey[500]
color: 'blue', //theme.palette.grey[500]
},
form: {
padding: '0 1em 1em 1em'
padding: '0 1em 1em 1em',
},
input: {
marginTop: '1em'
marginTop: '1em',
},
actions: {
padding: '0 1em 1em 1em'
}
padding: '0 1em 1em 1em',
},
}))
const renderInput = ({
@ -274,7 +274,7 @@ const Login = ({ location }) => {
Login.propTypes = {
authProvider: PropTypes.func,
previousRoute: PropTypes.string
previousRoute: PropTypes.string,
}
// We need to put the ThemeProvider decoration in another component

View File

@ -17,9 +17,9 @@ const translatedResourceName = (resource, translate) =>
resource.options && resource.options.label
? translate(resource.options.label, {
smart_count: 2,
_: resource.options.label
_: resource.options.label,
})
: inflection.humanize(inflection.pluralize(resource.name))
: inflection.humanize(inflection.pluralize(resource.name)),
})
const Menu = ({ onMenuClick, dense, logout }) => {
@ -31,7 +31,7 @@ const Menu = ({ onMenuClick, dense, logout }) => {
// TODO State is not persisted in mobile when you close the sidebar menu. Move to redux?
const [state, setState] = useState({
menuLibrary: true,
menuSettings: false
menuSettings: false,
})
const handleToggle = (menu) => {

View File

@ -5,8 +5,8 @@ import TuneIcon from '@material-ui/icons/Tune'
const useStyles = makeStyles((theme) => ({
menuItem: {
color: theme.palette.text.secondary
}
color: theme.palette.text.secondary,
},
}))
const PersonalMenu = forwardRef(({ onClick, sidebarIsOpen, dense }, ref) => {

View File

@ -14,12 +14,12 @@ const useStyles = makeStyles((theme) => ({
icon: { minWidth: theme.spacing(5) },
sidebarIsOpen: {
paddingLeft: 25,
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms'
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
},
sidebarIsClosed: {
paddingLeft: 0,
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms'
}
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
},
}))
const SubMenu = ({
@ -29,7 +29,7 @@ const SubMenu = ({
name,
icon,
children,
dense
dense,
}) => {
const translate = useTranslate()
const classes = useStyles()

View File

@ -7,7 +7,7 @@ import {
SelectInput,
useTranslate,
useSetLocale,
useLocale
useLocale,
} from 'react-admin'
import { makeStyles } from '@material-ui/core/styles'
import { changeTheme } from './actions'
@ -15,7 +15,7 @@ import themes from '../themes'
import i18n from '../i18n'
const useStyles = makeStyles({
root: { marginTop: '1em' }
root: { marginTop: '1em' },
})
const SelectLanguage = (props) => {

View File

@ -2,5 +2,5 @@ export const CHANGE_THEME = 'CHANGE_THEME'
export const changeTheme = (theme) => ({
type: CHANGE_THEME,
payload: theme
payload: theme,
})

View File

@ -6,7 +6,7 @@ import {
required,
SimpleForm,
SelectInput,
ReferenceInput
ReferenceInput,
} from 'react-admin'
import { Title } from '../common'
@ -39,7 +39,7 @@ const PlayerEdit = (props) => (
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' },
{ id: 0, name: 'Unlimited' }
{ id: 0, name: 'Unlimited' },
]}
/>
<TextField source="client" />

View File

@ -5,7 +5,7 @@ import {
TextField,
DateField,
FunctionField,
ReferenceField
ReferenceField,
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import { SimpleList, Title } from '../common'
@ -21,18 +21,18 @@ const PlayerList = (props) => {
tertiaryText={(r) => (r.maxBitRate ? r.maxBitRate : 'Unlimited')}
/>
) : (
<Datagrid rowClick="edit">
<TextField source="name" />
<ReferenceField source="transcodingId" reference="transcoding">
<Datagrid rowClick="edit">
<TextField source="name" />
</ReferenceField>
<FunctionField
source="maxBitRate"
render={(r) => (r.maxBitRate ? r.maxBitRate : 'Unlimited')}
/>
<DateField source="lastSeen" showTime />
</Datagrid>
)}
<ReferenceField source="transcodingId" reference="transcoding">
<TextField source="name" />
</ReferenceField>
<FunctionField
source="maxBitRate"
render={(r) => (r.maxBitRate ? r.maxBitRate : 'Unlimited')}
/>
<DateField source="lastSeen" showTime />
</Datagrid>
)}
</List>
)
}

View File

@ -5,5 +5,5 @@ import PlayerEdit from './PlayerEdit'
export default {
list: PlayerList,
edit: PlayerEdit,
icon: RadioIcon
icon: RadioIcon,
}

View File

@ -3,7 +3,7 @@ import {
Button,
useDataProvider,
useTranslate,
useUnselectAll
useUnselectAll,
} from 'react-admin'
import { useDispatch } from 'react-redux'
import { addTrack } from '../audioplayer'

View File

@ -11,5 +11,5 @@ export const AlbumLinkField = (props) => (
)
AlbumLinkField.defaultProps = {
addLabel: true
addLabel: true,
}

View File

@ -6,7 +6,7 @@ import {
List,
NumberField,
SearchInput,
TextField
TextField,
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import {
@ -14,7 +14,7 @@ import {
Pagination,
PlayButton,
SimpleList,
Title
Title,
} from '../common'
import { useDispatch } from 'react-redux'
import { addTrack, setTrack } from '../audioplayer'

View File

@ -3,5 +3,5 @@ import SongList from './SongList'
export default {
list: SongList,
icon: MusicNoteIcon
icon: MusicNoteIcon,
}

View File

@ -10,12 +10,12 @@ export default ({
authProvider,
dataProvider,
history,
customReducers = {}
customReducers = {},
}) => {
const reducer = combineReducers({
admin: adminReducer,
router: connectRouter(history),
...customReducers
...customReducers,
})
const resettableAppReducer = (state, action) =>
reducer(action.type !== USER_LOGOUT ? state : undefined, action)
@ -31,7 +31,7 @@ export default ({
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
trace: true,
traceLimit: 25
traceLimit: 25,
})) ||
compose
@ -48,7 +48,7 @@ export default ({
saveState({
theme: state.theme,
queue: state.queue,
albumView: state.albumView
albumView: state.albumView,
})
}),
1000

View File

@ -4,19 +4,19 @@ export default {
themeName: 'Dark (default)',
palette: {
primary: {
main: '#90caf9'
main: '#90caf9',
},
secondary: blue,
type: 'dark'
type: 'dark',
},
overrides: {
MuiFormGroup: {
root: {
color: 'white'
}
}
color: 'white',
},
},
},
player: {
theme: 'dark'
}
theme: 'dark',
},
}

View File

@ -5,20 +5,20 @@ export default {
light: '#5f5fc4',
dark: '#001064',
main: '#283593',
contrastText: '#fff'
}
contrastText: '#fff',
},
},
overrides: {
MuiFilledInput: {
root: {
backgroundColor: 'rgba(0, 0, 0, 0.04)',
'&$disabled': {
backgroundColor: 'rgba(0, 0, 0, 0.04)'
}
}
}
backgroundColor: 'rgba(0, 0, 0, 0.04)',
},
},
},
},
player: {
theme: 'light'
}
theme: 'light',
},
}

View File

@ -4,7 +4,7 @@ import {
SelectInput,
Create,
required,
SimpleForm
SimpleForm,
} from 'react-admin'
import { Title } from '../common'
@ -30,7 +30,7 @@ const TranscodingCreate = (props) => (
{ id: 160, name: '160' },
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' }
{ id: 320, name: '320' },
]}
defaultValue={192}
/>

View File

@ -24,7 +24,7 @@ const TranscodingEdit = (props) => (
{ id: 160, name: '160' },
{ id: 192, name: '192' },
{ id: 256, name: '256' },
{ id: 320, name: '320' }
{ id: 320, name: '320' },
]}
/>
<TextInput source="command" fullWidth validate={[required()]} />

View File

@ -6,7 +6,11 @@ import { SimpleList, Title } from '../common'
const TranscodingList = (props) => {
const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs'))
return (
<List title={<Title subTitle={'Transcodings'} />} exporter={false} {...props}>
<List
title={<Title subTitle={'Transcodings'} />}
exporter={false}
{...props}
>
{isXsmall ? (
<SimpleList
primaryText={(r) => r.name}
@ -14,13 +18,13 @@ const TranscodingList = (props) => {
tertiaryText={(r) => r.defaultBitRate}
/>
) : (
<Datagrid rowClick="edit">
<TextField source="name" />
<TextField source="targetFormat" />
<TextField source="defaultBitRate" />
<TextField source="command" />
</Datagrid>
)}
<Datagrid rowClick="edit">
<TextField source="name" />
<TextField source="targetFormat" />
<TextField source="defaultBitRate" />
<TextField source="command" />
</Datagrid>
)}
</List>
)
}

View File

@ -7,5 +7,5 @@ export default {
list: TranscodingList,
edit: TranscodingEdit,
create: TranscodingCreate,
icon: TransformIcon
icon: TransformIcon,
}

View File

@ -6,7 +6,7 @@ import {
PasswordInput,
required,
email,
SimpleForm
SimpleForm,
} from 'react-admin'
import { Title } from '../common'

View File

@ -7,7 +7,7 @@ import {
Edit,
required,
email,
SimpleForm
SimpleForm,
} from 'react-admin'
import { Title } from '../common'

View File

@ -7,7 +7,7 @@ import {
List,
SearchInput,
SimpleList,
TextField
TextField,
} from 'react-admin'
import { useMediaQuery } from '@material-ui/core'
import { Title } from '../common'

View File

@ -7,5 +7,5 @@ export default {
list: UserList,
edit: UserEdit,
create: UserCreate,
icon: Group
icon: Group,
}