Skip to content

Commit

Permalink
Some more small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Jul 27, 2023
1 parent f344d2d commit 024b4f6
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sealed class Capability(open val showInNotification: Boolean = true) {
val notificationOptions: NofiticationActionOptions? = null
) : Capability()

data class SetRating(val type: Int) : Capability()
data class SetRating(val type: Int) : Capability(showInNotification = false)
}


Expand All @@ -63,12 +63,5 @@ data class CapabilitiesConfig(

/** Custom extension to filter out only those capabilities that are supported by the notification */
fun List<Capability>.filterForNotification(): List<Capability> {
return this.filter {
(it is Capability.PlayPause && it.showInNotification)
|| (it is Capability.Stop && it.showInNotification)
|| (it is Capability.Next && it.showInNotification)
|| (it is Capability.Previous && it.showInNotification)
|| (it is Capability.Forward && it.showInNotification)
|| (it is Capability.Backward && it.showInNotification)
} ?: emptyList()
return this.filter { it.showInNotification }
}

0 comments on commit 024b4f6

Please sign in to comment.