add extension filter when open save dialog (#654)
This commit is contained in:
@@ -159,6 +159,12 @@ export const MediaCaption = () => {
|
||||
defaultPath: `${media.name}(${segment.startTime.toFixed(
|
||||
2
|
||||
)}s-${segment.endTime.toFixed(2)}s).mp3`,
|
||||
filters: [
|
||||
{
|
||||
name: "Audio",
|
||||
extensions: ["mp3"],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
@@ -208,6 +214,12 @@ export const MediaCaption = () => {
|
||||
defaultPath: `${media.name}(${activeRegion.start.toFixed(
|
||||
2
|
||||
)}s-${activeRegion.end.toFixed(2)}s).mp3`,
|
||||
filters: [
|
||||
{
|
||||
name: "Audio",
|
||||
extensions: ["mp3"],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
|
||||
@@ -229,6 +229,12 @@ export const MediaCurrentRecording = () => {
|
||||
.showSaveDialog({
|
||||
title: t("download"),
|
||||
defaultPath: currentRecording.filename,
|
||||
filters: [
|
||||
{
|
||||
name: "Audio",
|
||||
extensions: [currentRecording.filename.split(".").pop()],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
|
||||
@@ -100,6 +100,12 @@ export const MediaPlayer = () => {
|
||||
.showSaveDialog({
|
||||
title: t("download"),
|
||||
defaultPath: media.filename,
|
||||
filters: [
|
||||
{
|
||||
name: media.mediaType,
|
||||
extensions: [media.filename.split(".").pop()],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
|
||||
@@ -71,6 +71,12 @@ export const MediaTranscriptionReadButton = () => {
|
||||
.showSaveDialog({
|
||||
title: t("download"),
|
||||
defaultPath: recording.filename,
|
||||
filters: [
|
||||
{
|
||||
name: "Audio",
|
||||
extensions: [recording.filename.split(".").pop()],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
|
||||
@@ -129,6 +129,12 @@ export const AssistantMessageComponent = (props: {
|
||||
.showSaveDialog({
|
||||
title: t("download"),
|
||||
defaultPath: speech.filename,
|
||||
filters: [
|
||||
{
|
||||
name: "Audio",
|
||||
extensions: [speech.filename.split(".").pop()],
|
||||
},
|
||||
],
|
||||
})
|
||||
.then((savePath) => {
|
||||
if (!savePath) return;
|
||||
|
||||
Reference in New Issue
Block a user