Skip to content

Commit

Permalink
Enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
aandrew-me committed Oct 29, 2023
1 parent 8a41bb4 commit 1514a95
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions src/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ if (!fs.existsSync(ffmpegPath)) {
}
console.log("ffmpeg:", ffmpeg);

if (localStorage.getItem("preferredVideoQuality")) {
preferredVideoQuality = localStorage.getItem("preferredVideoQuality");
getId('select').value = preferredVideoQuality
}
if (localStorage.getItem("preferredAudioQuality")) {
preferredAudioQuality = localStorage.getItem("preferredAudioQuality");
getId("audioSelect").value = preferredAudioQuality;
}

let foldernameFormat = "%(playlist_title)s";
let filenameFormat = "%(playlist_index)s.%(title)s.%(ext)s";
let playlistIndex = 1;
Expand Down Expand Up @@ -663,3 +672,14 @@ getId("matrixTxt").textContent = i18n.__("Matrix");
getId("githubTxt").textContent = i18n.__("Github");
getId("latteTxt").textContent = i18n.__("Latte");
getId("solarizedDarkTxt").textContent = i18n.__("Solarized Dark");

getId("audioQualitySelectTxt").textContent = i18n.__("Select Quality")
getId("audioQualityAuto").textContent = i18n.__("Auto")
getId("audioQualityNormal").textContent = i18n.__("Normal")
getId("audioQualityBest").textContent = i18n.__("Best")
getId("audioQualityGood").textContent = i18n.__("Good")
getId("audioQualityBad").textContent = i18n.__("Bad")
getId("audioQualityWorst").textContent = i18n.__("Worst")

getId("subHeader").textContent = i18n.__("Subtitles");
getId("subTxt").textContent = i18n.__("Download subtitles if available");
4 changes: 2 additions & 2 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ async function getInfo(url) {
format.video_ext !== "none" &&
format.audio_ext === "none"
) {
if (size !== "Unknown size") {
if (size !== i18n.__("Unknown size")) {
size = (Number(size) + 0 || Number(audioSize)).toFixed(
1
);
Expand Down Expand Up @@ -462,7 +462,7 @@ async function getInfo(url) {
format.audio_ext !== "none" ||
(format.acodec !== "none" && format.video_ext === "none")
) {
size = size + " MB";
size = size !== i18n.__("Unknown size") ? size + " MB" : i18n.__("Unknown size");
let audio_ext;

if (format.audio_ext === "webm") {
Expand Down
2 changes: 1 addition & 1 deletion translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"Maximum number of active downloads": "Максимальное количество одновременных загрузок",
"Preferred video quality": "Предпочтительное качество видео",
"Preferred audio format": "Предпочитаемый аудиоформат",
"Best": "Лучший",
"Best": "Лучшее",
"File saved.": "Файл сохранен.",
"Open download folder": "Открыть папку загрузок",
"Path:": "Путь:",
Expand Down

0 comments on commit 1514a95

Please sign in to comment.