moerfixes

This commit is contained in:
TheXamlGuy
2024-02-02 21:11:13 +00:00
parent 4edb0a7eb5
commit 221c46218f
24 changed files with 97 additions and 69 deletions
@@ -97,9 +97,15 @@ public class MediaController :
GlobalSystemMediaTransportControlsSessionMediaProperties mediaProperties =
await session.TryGetMediaPropertiesAsync();
IRandomAccessStreamWithContentType randomAccessStream = await mediaProperties.Thumbnail.OpenReadAsync();
IRandomAccessStreamWithContentType? randomAccessStream = null;
if (mediaProperties.Thumbnail is not null)
{
randomAccessStream =
await mediaProperties.Thumbnail.OpenReadAsync();
}
await mediator.PublishAsync(new Changed<MediaInformation>(new MediaInformation(mediaProperties.Title,
mediaProperties.Artist, randomAccessStream.AsStream())));
mediaProperties.Artist, randomAccessStream is not null ? randomAccessStream.AsStream() : default)));
}
catch
{