Update NotificationSounds.plugin.js

This commit is contained in:
Mirco Wittrien 2024-10-04 15:16:07 +02:00
parent 45ceb7bfd1
commit 3e7ea9eb7c
1 changed files with 2 additions and 6 deletions

View File

@ -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
})