Finding channel by destination directory if any.

This commit is contained in:
Roland 2022-11-09 08:54:56 -07:00
parent f1bc29d76f
commit ddb35448aa
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 17 additions and 18 deletions

View file

@ -13,12 +13,7 @@ class Downloader extends React.Component {
constructor(props) {
super(props);
this.state = {
advancedOpen: false,
destination: '',
downloader: props.downloader,
pending: false,
urls: '',
valid: true,
advancedOpen: false, destination: '', downloader: props.downloader, pending: false, urls: '', valid: true,
};
}
@ -27,13 +22,7 @@ class Downloader extends React.Component {
if (urls) {
this.setState({pending: true});
try {
let response = await postDownload(
urls,
downloader,
null,
null,
null,
destination);
let response = await postDownload(urls, downloader, null, null, null, destination);
if (response.status === 204) {
this.setState({urls: '', pending: false});
}
@ -44,9 +33,14 @@ class Downloader extends React.Component {
}
handleInputChange = async (event, {name, value}) => {
console.log(name, value);
this.setState({[name]: value}, this.validateUrls);
}
handleDestinationChange = (value) => {
this.setState({destination: value});
}
validateUrls = async () => {
// Validate that all URLs in state are valid.
if (this.state.urls) {
@ -78,7 +72,7 @@ class Downloader extends React.Component {
<DirectoryInput
isDirectory={true}
value={destination}
setInput={value => this.handleInputChange('directory', value)}
setInput={this.handleDestinationChange}
placeholder='download/into/custom/directory'
/>
</FormField>

View file

@ -39,7 +39,8 @@ function VideoPage({videoFile, prevFile, nextFile, setFavorite, ...props}) {
const handleDeleteVideo = async (video_id) => {
try {
await deleteVideos(video_id)
await deleteVideos([video_id])
setDeleteOpen(false);
} catch (e) {
setDeleteOpen(false);
throw e;