From 3e7ea9eb7c34452bdcb52acd45388cbbb80b5802 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Fri, 4 Oct 2024 15:16:07 +0200 Subject: [PATCH] Update NotificationSounds.plugin.js --- Plugins/NotificationSounds/NotificationSounds.plugin.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index eb4135286e..d7fef1a5d7 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -2,7 +2,7 @@ * @name NotificationSounds * @author DevilBro * @authorId 278543574059057154 - * @version 3.9.6 + * @version 3.9.7 * @description Allows you to replace the native Sounds with custom Sounds * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -426,7 +426,6 @@ module.exports = (_ => { className: "input-newsound input-source", type: "file", filter: ["audio", "video"], - useFilePath: true, value: "", placeholder: "Source" }) @@ -446,10 +445,7 @@ module.exports = (_ => { } BDFDB.NotificationUtils.toast("Use a valid direct link to a video or audio source, they usually end on something like .mp3, .mp4 or .wav", {type: "danger"}); }); - else BDFDB.LibraryRequires.fs.readFile(source, "base64", (error, body) => { - if (error) BDFDB.NotificationUtils.toast("Could not fetch file. Please make sure the file exists.", {type: "danger"}); - else return successSavedAudio({category, sound, source: `data:audio/mpeg;base64,${body}`}); - }); + else if (source.indexOf("data:") == 0) return successSavedAudio({category, sound, source: source}); }, children: BDFDB.LanguageUtils.LanguageStrings.SAVE })