Generic function for playing MusicItem

I'm attempting to write a function similar to the example shared over in https://developer.apple.com/forums/thread/700683 for playing a MusicItem using the SystemMusicPlayer. Currently, this function starts like this:

    func play<MusicItemType>(item: MusicItemType) async throws
        where
        MusicItemType: FilterableMusicItem,
        MusicItemType: Decodable,
        MusicItemType: PlayableMusicItem
    {
        var queue : MusicKit.MusicPlayer.Queue?
        switch MusicItemType.self {
        case is Playlist.Type:
            let request = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: MusicItemID("\(item.id)"))
            let response = try await request.response()
            if let responseItem = response.items.first {
                queue = MusicKit.MusicPlayer.Queue(for: [responseItem])
            }
        case is Album.Type:
            let request = MusicCatalogResourceRequest<Album>(matching: \.id, equalTo: MusicItemID("\(item.id)"))
            let response = try await request.response()
            if let responseItem = response.items.first {
                queue = MusicKit.MusicPlayer.Queue(for: [responseItem])
            }
    ...

I'd love to clean up this case statement and instead construct a MusicCatalogResourceRequest using the generic MusicItemType type parameter, but I haven't yet been able to figure how to construct a KeyPath that matches the KeyPath<MusicItemType.FilterType, Value> type expected. Does anyone have any examples of interacting with MusicCatalogResourceRequest in a generic fashion that they'd be willing to share? Thanks!

I am trying to achieve something similar and am too much of a newbie with generics and associated types to understand what is going on. Definitely following this.

Generic function for playing MusicItem
 
 
Q