Skip to content

Commit

Permalink
Removed .exe file extension from app name
Browse files Browse the repository at this point in the history
Keepoccino committed Aug 21, 2021
1 parent 4aa4336 commit 332cdf6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MediaKeySyncServer/MediaControl.cs
Original file line number Diff line number Diff line change
@@ -59,14 +59,22 @@ public async void Next()

public async Task<MediaProperties> Info()
{
return new MediaProperties(await GetMediaProperties(session), session.SourceAppUserModelId);
return new MediaProperties(await GetMediaProperties(session), removeFileExtension(session.SourceAppUserModelId));
}

private static async Task<GlobalSystemMediaTransportControlsSessionManager> GetSystemMediaTransportControlsSessionManager() =>
await GlobalSystemMediaTransportControlsSessionManager.RequestAsync();

private static async Task<GlobalSystemMediaTransportControlsSessionMediaProperties> 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

0 comments on commit 332cdf6

Please sign in to comment.