Skip to content

Commit

Permalink
Merge branch 'main-(insider_bloom)' of https://github.com/Rise-Softwa…
Browse files Browse the repository at this point in the history
…re/Rise-Media-Player into main-(insider_bloom)
  • Loading branch information
josephbeattie committed Mar 8, 2022
2 parents 514f959 + b900eb9 commit 27bf775
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Rise Media Player Dev/ViewModels/SongPropertiesViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Rise.Data.ViewModels;
using Rise.Common.Constants;
using Rise.Data.ViewModels;
using System;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -112,7 +113,7 @@ public async Task<bool> SaveChangesAsync()

if (songFile != null)
{
// Get song properties.
// Get WinRT music properties
var musicProps = await songFile.Properties.GetMusicPropertiesAsync();

musicProps.Title = Title;
Expand All @@ -123,9 +124,17 @@ public async Task<bool> SaveChangesAsync()
musicProps.Year = Year;
musicProps.Rating = Rating * 20;

// We can't set MusicProperties.Genres, so
// we use the Win32 prop here
var genreProp = await songFile.Properties.
RetrievePropertiesAsync(new string[] { SystemMusic.Genre });
genreProp[SystemMusic.Genre] = Genres.Split("; ")[0];

try
{
await musicProps.SavePropertiesAsync();
await songFile.Properties.SavePropertiesAsync(genreProp);

result = true;
}
catch (Exception ex)
Expand Down

0 comments on commit 27bf775

Please sign in to comment.