diff --git a/MediaKeySyncServer/MediaControl.cs b/MediaKeySyncServer/MediaControl.cs index 4ecb973..95ce73f 100644 --- a/MediaKeySyncServer/MediaControl.cs +++ b/MediaKeySyncServer/MediaControl.cs @@ -59,7 +59,7 @@ public async void Next() public async Task Info() { - return new MediaProperties(await GetMediaProperties(session), session.SourceAppUserModelId); + return new MediaProperties(await GetMediaProperties(session), removeFileExtension(session.SourceAppUserModelId)); } private static async Task GetSystemMediaTransportControlsSessionManager() => @@ -67,6 +67,14 @@ private static async Task GetS private static async Task GetMediaProperties(GlobalSystemMediaTransportControlsSession session) => await session.TryGetMediaPropertiesAsync(); + + private string removeFileExtension(string filename) + { + var index = filename.LastIndexOf("."); + if (index > 0) + filename = filename.Substring(0, index); + return filename; + } } public class MediaChangeEventArgs : EventArgs