Skip to content

Commit

Permalink
(#58) Fix theme preference not saving + misc. AppCenter bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Difegue committed Sep 25, 2022
1 parent 097e9b8 commit 971a517
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
7 changes: 6 additions & 1 deletion Sources/Stylophone.Common/ViewModels/PlaylistViewModel.cs
Expand Up @@ -248,7 +248,12 @@ public async Task LoadDataAsync(string playlistName)
DominantColor = (art?.DominantColor?.Color).GetValueOrDefault();
if (DominantColor == default(SKColor))
DominantColor = _interop.GetAccentColor();
{
await _dispatcherService.ExecuteOnUIThreadAsync(() =>
{
DominantColor = _interop.GetAccentColor();
});
}
IsLight = (!art?.DominantColor?.IsDark).GetValueOrDefault();
}
Expand Down
17 changes: 8 additions & 9 deletions Sources/Stylophone.Common/ViewModels/QueueViewModel.cs
Expand Up @@ -206,18 +206,17 @@ private async void MPDConnectionService_QueueChanged(object sender, EventArgs e)
}
else
{
// PlChanges gives the full list of files starting from the change, so we delete all existing tracks from the source after that change, and swap the new ones in.
// PlChanges gives the full list of files starting from the change,
// so we delete all existing tracks from the source after that change, and swap the new ones in.
// If the response is empty, that means the last file in the source was removed.
var initialPosition = response.Count() == 0 ? Source.Count - 1 : response.First().Position;
while (Source.Count != initialPosition)
{
await _dispatcherService.ExecuteOnUIThreadAsync(() => {
// Make sure
if (Source.Count != initialPosition)
Source.RemoveAt(initialPosition);
});
}
await _dispatcherService.ExecuteOnUIThreadAsync(() => {
while (Source.Count > initialPosition)
{
Source.RemoveAt(initialPosition);
}
});
var toAdd = new List<TrackViewModel>();
foreach (var item in response)
Expand Down
6 changes: 1 addition & 5 deletions Sources/Stylophone.Common/ViewModels/SettingsViewModel.cs
Expand Up @@ -78,11 +78,7 @@ public partial class SettingsViewModel : ViewModelBase
partial void OnElementThemeChanged(Theme value)
{
Task.Run (async () => await _interop.SetThemeAsync(value));

if (value != _elementTheme)
{
_applicationStorageService.SetValue(nameof(ElementTheme), value.ToString());
}
_applicationStorageService.SetValue(nameof(ElementTheme), value.ToString());
}

partial void OnServerHostChanged(string value)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Stylophone/Package.appxmanifest
Expand Up @@ -12,7 +12,7 @@
<Identity
Name="StylophoneDebug"
Publisher="CN=B2F6FFCA-07C7-479C-AC33-2C75463C7DCE"
Version="2.5.2.0" />
Version="2.5.5.0" />

<mp:PhoneIdentity PhoneProductId="b9cbe0bc-1e9d-42c8-abf1-85c63af45f83" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down
2 changes: 1 addition & 1 deletion Sources/Stylophone/Package.tt
Expand Up @@ -2,7 +2,7 @@
<#@ output extension=".appxmanifest" #>
<#@ parameter type="System.String" name="BuildConfiguration" #>
<#
string version = "2.5.2.0";
string version = "2.5.5.0";

// Get configuration name at Build time
string configName = Host.ResolveParameterValue("-", "-", "BuildConfiguration");
Expand Down

0 comments on commit 971a517

Please sign in to comment.