From 80fe9caa90cc18c010d0659cf4c57fad2f150677 Mon Sep 17 00:00:00 2001 From: an-lee Date: Sat, 13 Jan 2024 16:13:51 +0800 Subject: [PATCH] cannot share local video --- enjoy/src/i18n/en.json | 1 + enjoy/src/i18n/zh-CN.json | 1 + enjoy/src/renderer/components/videos/video-detail.tsx | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/enjoy/src/i18n/en.json b/enjoy/src/i18n/en.json index e76a106f..ffc69b7f 100644 --- a/enjoy/src/i18n/en.json +++ b/enjoy/src/i18n/en.json @@ -338,6 +338,7 @@ "areYouSureToShareThisAudioToCommunity": "Are you sure to share this audio to community?", "shareVideo": "Share video", "sharedVideo": "Shared a video resource", + "cannotShareLocalVideo": "Cannot share local video", "areYouSureToShareThisVideoToCommunity": "Are you sure to share this video to community?", "sharePrompt": "Share prompt", "sharedPrompt": "Shared a prompt", diff --git a/enjoy/src/i18n/zh-CN.json b/enjoy/src/i18n/zh-CN.json index 86cbee2d..9521b805 100644 --- a/enjoy/src/i18n/zh-CN.json +++ b/enjoy/src/i18n/zh-CN.json @@ -338,6 +338,7 @@ "areYouSureToShareThisAudioToCommunity": "您确定要分享此音频到社区吗?", "shareVideo": "分享视频", "sharedVideo": "分享了一个视频材料", + "cannotShareLocalVideo": "无法分享本地视频", "areYouSureToShareThisVideoToCommunity": "您确定要分享此视频到社区吗?", "sharePrompt": "分享提示语", "sharedPrompt": "分享了一条提示语", diff --git a/enjoy/src/renderer/components/videos/video-detail.tsx b/enjoy/src/renderer/components/videos/video-detail.tsx index c9b28ada..58d7ecce 100644 --- a/enjoy/src/renderer/components/videos/video-detail.tsx +++ b/enjoy/src/renderer/components/videos/video-detail.tsx @@ -60,6 +60,14 @@ export const VideoDetail = (props: { id?: string; md5?: string }) => { }; const handleShare = async () => { + if (!video.source.startsWith("http")) { + toast({ + title: t("shareFailed"), + description: t("cannotShareLocalVideo"), + }); + return; + } + if (!video.source && !video.isUploaded) { try { await EnjoyApp.videos.upload(video.id);