Skip to content

Commit

Permalink
Fixed bug where changing the profile wouldn't get pushed back to MB
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Nov 7, 2022
1 parent 0d4d15a commit 51e9f81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MB_SubSonic/Subsonic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public static List<SubsonicSettings> LoadSettingsFromFile()
return settings;
}

public static void ChangeServerProfile(SubsonicSettings settings)
{
_currentSettings = SettingsHelper.SanitizeSettings(new List<SubsonicSettings> { settings }).First();
_serverName = BuildServerUri(_currentSettings);
_validSettings = true;
}

public static bool PingServer(SubsonicSettings settings)
{
_currentSettings = SettingsHelper.SanitizeSettings(new List<SubsonicSettings>{settings}).First();
Expand Down
2 changes: 2 additions & 0 deletions MB_SubSonic/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private void ButtonSave_Click(object sender, EventArgs e)
{
StoreCurrentSettings();
Subsonic.CurrentProfile = _currentProfile;
Subsonic.ChangeServerProfile(GetCurrentSettings());
PersistValues();
Hide();
}
Expand All @@ -149,6 +150,7 @@ private void btnApply_Click(object sender, EventArgs e)
{
StoreCurrentSettings();
Subsonic.CurrentProfile = _currentProfile;
Subsonic.ChangeServerProfile(GetCurrentSettings());
}

private void ButtonPing_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 51e9f81

Please sign in to comment.