Skip to content

Commit

Permalink
Fix: Failing to parse ExtraInfo because of missing URL in ModInfo
Browse files Browse the repository at this point in the history
Fix: Add padding to description in mod list
  • Loading branch information
0ffz committed Mar 8, 2024
1 parent 0339406 commit c77c6fd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=com.mineinabyss
version=2.0.0-alpha.7
version=2.0.0-alpha.8
idofrontVersion=0.22.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import kotlinx.serialization.Serializable
@Serializable
data class ModInfo(
val name: String,
val license: String = "Unknown",
val license: String = "",
val homepage: String = "",
val desc: String = "",
val url: String,
val url: String = "",
val configUrl: String = "",
val configDesc: String = "",
val forceConfigDownload: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data class ExtraInfoFormat(
val originalGroups = originalMods.modGroups.mapValues {
it.value.filterTo(mutableSetOf()) { mod -> mod !in foundMods }
}
return Mods(originalGroups + mods)
return Mods((originalGroups + mods)
.filter { (_, mods) -> mods.isNotEmpty() })
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.mineinabyss.launchy.data.modpacks.formats

import com.mineinabyss.launchy.data.modpacks.ModInfo
import com.mineinabyss.launchy.data.modpacks.Mod
import com.mineinabyss.launchy.data.modpacks.ModInfo
import com.mineinabyss.launchy.data.modpacks.Mods
import com.mineinabyss.launchy.data.modpacks.PackDependencies
import kotlinx.serialization.Serializable
Expand All @@ -26,7 +26,7 @@ data class ModrinthPackFormat(
packDir,
ModInfo(
name = path.removePrefix("mods/").removeSuffix(".jar"),
desc = "Unknown",
desc = "",
url = downloads.single(),
downloadPath = path,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun ModInfoDisplay(group: Group, mod: Mod) {
val configTabState by animateFloatAsState(targetValue = if (configExpanded) 180f else 0f)

Surface(
modifier = Modifier.fillMaxWidth(),
modifier = Modifier.fillMaxWidth().padding(end = 8.dp),
color = when (mod) {
in state.downloads.failed -> MaterialTheme.colorScheme.error
in state.queued.deletions -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.25f)
Expand Down

0 comments on commit c77c6fd

Please sign in to comment.