Skip to content

Commit

Permalink
Merge pull request #71 from kotlinsyntax/master
Browse files Browse the repository at this point in the history
Fixed my errors
  • Loading branch information
Dawsson authored Jul 1, 2024
2 parents 277eeea + a6d4a08 commit e59e618
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ data class Plugin(
val name: String,
val platforms: Map<MarketplacePlatform, PlatformPlugin>,
) {
val highestPriorityPlatform by lazy {
MarketplacePlatform.entries.find { platforms.containsKey(it) } ?: platforms.keys.first()
}

val highestPriorityPlatform get() = MarketplacePlatform.entries.find(platforms::containsKey) ?: platforms.keys.first()

val downloadableName = name.replace(Regex("[/\\\\]"), "")

val downloadableName by lazy {
name.replace(Regex("[/\\\\]"), "")
}

fun getFirstPlatform(): PlatformPlugin? = platforms.values.firstOrNull()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ fun sendPluginListMessage(audience: Audience, message: String, plugins: List<Plu

val platform = plugin.highestPriorityPlatform
val name = plugin.name.shortenToLine(23 + plugin.totalDownloads.format().pixelLength() + plugin.platformString.pixelLength())

audience.sendMessage(
textSecondary(" - ").appendPrimary("$name - ${plugin.totalDownloads.format()}")
.append(text("", AQUA, TextDecoration.UNDERLINED))
Expand Down

0 comments on commit e59e618

Please sign in to comment.