From 33dc1e942f18dbe761ab16f519b7cf1699ba418e Mon Sep 17 00:00:00 2001 From: Zarg <62082797+Zaarrg@users.noreply.github.com> Date: Tue, 4 Feb 2025 04:35:27 +0100 Subject: [PATCH] Fix Initial volume always being 50 - Fixed current volume not being save to settings.ini causing initial volume to always be 50. [Issue: https://github.com/Zaarrg/stremio-desktop-v5/issues/42] --- src/utils/config.cpp | 1 + src/utils/config.h | 1 + src/utils/crashlog.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/utils/config.cpp b/src/utils/config.cpp index ef8eb80..35d681f 100644 --- a/src/utils/config.cpp +++ b/src/utils/config.cpp @@ -53,6 +53,7 @@ void SaveSettings() WritePrivateProfileStringW(L"General", L"PauseOnMinimize", pauseMinVal, iniPath.c_str()); WritePrivateProfileStringW(L"General", L"PauseOnLostFocus", pauseFocVal, iniPath.c_str()); WritePrivateProfileStringW(L"General", L"AllowZoom", allowZoomVal, iniPath.c_str()); + WriteIntToIni(L"MPV", L"InitialVolume", g_currentVolume, iniPath); } static void WriteIntToIni(const std::wstring §ion, const std::wstring &key, int value, const std::wstring &iniPath) diff --git a/src/utils/config.h b/src/utils/config.h index 61c58b1..b52cfe3 100644 --- a/src/utils/config.h +++ b/src/utils/config.h @@ -5,4 +5,5 @@ void LoadSettings(); void SaveSettings(); void SaveWindowPlacement(const WINDOWPLACEMENT &wp); bool LoadWindowPlacement(WINDOWPLACEMENT &wp); +static void WriteIntToIni(const std::wstring §ion, const std::wstring &key, int value, const std::wstring &iniPath); #endif // CONFIG_H diff --git a/src/utils/crashlog.cpp b/src/utils/crashlog.cpp index 3daa391..8d51bef 100644 --- a/src/utils/crashlog.cpp +++ b/src/utils/crashlog.cpp @@ -10,6 +10,8 @@ #include #include +#include "config.h" + static std::wstring GetDailyCrashLogPath() { std::time_t t = std::time(nullptr); @@ -49,6 +51,8 @@ void AppendToCrashLog(const std::string& message) void Cleanup() { + //Save Settings + SaveSettings(); // Shut down mpv CleanupMPV(); // Shut down Node