1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fix file browser when files should be included

This commit is contained in:
Mark McDowall 2019-03-23 13:03:39 -07:00
parent b63cbbdaaa
commit c3a6e01040
3 changed files with 12 additions and 4 deletions

View File

@ -38,7 +38,10 @@ class PathInputConnector extends Component {
// Listeners // Listeners
onFetchPaths = (path) => { onFetchPaths = (path) => {
this.props.fetchPaths({ path }); this.props.fetchPaths({
path,
includeFiles: this.props.includeFiles
});
} }
onClearPaths = () => { onClearPaths = () => {
@ -60,6 +63,7 @@ class PathInputConnector extends Component {
} }
PathInputConnector.propTypes = { PathInputConnector.propTypes = {
includeFiles: PropTypes.bool.isRequired,
fetchPaths: PropTypes.func.isRequired, fetchPaths: PropTypes.func.isRequired,
clearPaths: PropTypes.func.isRequired clearPaths: PropTypes.func.isRequired
}; };

View File

@ -20,6 +20,8 @@ function getType(type) {
return inputTypes.NUMBER; return inputTypes.NUMBER;
case 'path': case 'path':
return inputTypes.PATH; return inputTypes.PATH;
case 'filepath':
return inputTypes.PATH;
case 'select': case 'select':
return inputTypes.SELECT; return inputTypes.SELECT;
case 'tag': case 'tag':
@ -84,7 +86,7 @@ function ProviderFieldFormGroup(props) {
errors={errors} errors={errors}
warnings={warnings} warnings={warnings}
pending={pending} pending={pending}
hasFileBrowser={false} includeFiles={type === 'filepath' ? true : undefined}
onChange={onChange} onChange={onChange}
{...otherProps} {...otherProps}
/> />

View File

@ -46,14 +46,16 @@ export const actionHandlers = handleThunks({
const { const {
path, path,
allowFoldersWithoutTrailingSlashes = false allowFoldersWithoutTrailingSlashes = false,
includeFiles = false
} = payload; } = payload;
const promise = createAjaxRequest({ const promise = createAjaxRequest({
url: '/filesystem', url: '/filesystem',
data: { data: {
path, path,
allowFoldersWithoutTrailingSlashes allowFoldersWithoutTrailingSlashes,
includeFiles
} }
}).request; }).request;