You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: improve repository platform detection and data merging
- Refactor `CachedRepositoriesDataSourceImpl` to simplify the fetching logic by merging platform-specific requests and filtering results based on the requested platform.
- Update `CachedGithubRepoSummary` and its mapper to include and propagate `availablePlatforms`.
- Ensure that merging duplicate repositories from different platform-specific caches correctly aggregates their `availablePlatforms`.
- Refactor platform detection from asset names in `AppHeader.kt` to use sequential checks instead of a `when` block to support multiple platforms.
- Update `SearchRepositoryImpl` to exclude `DiscoveryPlatform.All` when detecting available platforms from asset names.
- Enhance the repository merging logic to preserve the highest trending scores, popularity scores, and latest release dates across duplicate entries.
Copy file name to clipboardExpand all lines: feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/components/AppHeader.kt
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,11 @@ fun AppHeader(
211
211
212
212
if (installedApp !=null&& installedApp.installedVersion != release?.tagName) {
213
213
Text(
214
-
text = stringResource(Res.string.installed_version, installedApp.installedVersion),
214
+
text =
215
+
stringResource(
216
+
Res.string.installed_version,
217
+
installedApp.installedVersion,
218
+
),
215
219
style =MaterialTheme.typography.bodySmall,
216
220
color =MaterialTheme.colorScheme.onSurfaceVariant,
217
221
)
@@ -257,18 +261,13 @@ private fun derivePlatformsFromAssets(release: GithubRelease?): List<DiscoveryPl
257
261
if (release ==null) return emptyList()
258
262
val names = release.assets.map { it.name.lowercase() }
Copy file name to clipboardExpand all lines: feature/home/data/src/commonMain/kotlin/zed/rainxch/home/data/data_source/impl/CachedRepositoriesDataSourceImpl.kt
0 commit comments