mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
fix downloading
This commit is contained in:
@@ -25,13 +25,11 @@ const isDownloading = ref(props.info?.state === "downloading" ? true : false);
|
|||||||
|
|
||||||
// 下载状态控制
|
// 下载状态控制
|
||||||
const toggleDownload = async () => {
|
const toggleDownload = async () => {
|
||||||
let operation = isDownloading.value ? "pause" : "start";
|
let operation = isDownloading.value ? "stop" : "start";
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.put(`download/${props.info?.hash}`, {
|
const result: { [key: string]: any } = await api.put(
|
||||||
params: {
|
`download/${props.info?.hash}/${operation}`
|
||||||
open: operation,
|
);
|
||||||
},
|
|
||||||
});
|
|
||||||
isDownloading.value = !isDownloading.value;
|
isDownloading.value = !isDownloading.value;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user