mirror of
https://github.com/FluxaMedia/fluxa.git
synced 2026-08-17 12:44:53 +00:00
fix: move Apple catalog/detail/discover/search snapshot DTOs from shared to core
Xcode's embedAndSignAppleFrameworkForXcode task for :shared: is intermittently disabled by the Kotlin Gradle Plugin's own IDE/index-build detection (onlyIf 'Task is enabled' is false), silently skipping the framework embed and leaving these types unavailable to Swift. core's framework already embeds reliably for iOS (matching tvOS), so these plain DTOs move there instead; the Compose-dependent DataSource wrappers stay in shared, which already re-exports core.
This commit is contained in:
parent
b44ebec2d9
commit
a0db322fed
10 changed files with 117 additions and 98 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import Foundation
|
||||
import FluxaCore
|
||||
|
||||
final class FluxaAppleAddonResourceLoader {
|
||||
private let resolver: FluxaAppleAddonCatalogResolver
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import Foundation
|
||||
import FluxaCore
|
||||
|
||||
struct FluxaAppleCatalogRequest: Sendable {
|
||||
let id: String
|
||||
|
|
|
|||
|
|
@ -32,8 +32,11 @@ targets:
|
|||
- name: Build Fluxa Rust Core
|
||||
script: scripts/build-rust-core-xcframework.sh
|
||||
basedOnDependencyAnalysis: false
|
||||
- name: Build FluxaCore
|
||||
script: ../gradlew -p .. :core:embedAndSignAppleFrameworkForXcode
|
||||
basedOnDependencyAnalysis: false
|
||||
- name: Build FluxaShared
|
||||
script: ../gradlew -p .. :shared:embedAndSignAppleFrameworkForXcode --info
|
||||
script: ../gradlew -p .. :shared:embedAndSignAppleFrameworkForXcode
|
||||
basedOnDependencyAnalysis: false
|
||||
FluxaTvos:
|
||||
type: application
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ kotlin {
|
|||
|
||||
targets
|
||||
.withType<KotlinNativeTarget>()
|
||||
.matching { it.name.startsWith("tvos") }
|
||||
.matching { it.name.startsWith("tvos") || it.name.startsWith("ios") }
|
||||
.configureEach {
|
||||
binaries.framework {
|
||||
baseName = "FluxaCore"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,90 @@
|
|||
package com.fluxa.app.core.apple
|
||||
|
||||
data class AppleCatalogHomeSnapshot(
|
||||
val rows: List<AppleCatalogRowSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
||||
data class AppleCatalogRowSnapshot(
|
||||
val id: String,
|
||||
val title: String,
|
||||
val items: List<AppleCatalogItemSnapshot>,
|
||||
val canLoadMore: Boolean = false
|
||||
)
|
||||
|
||||
data class AppleCatalogItemSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val title: String,
|
||||
val subtitle: String = "",
|
||||
val artworkUrl: String? = null,
|
||||
val logoUrl: String? = null,
|
||||
val addonTransportUrl: String? = null,
|
||||
val catalogType: String? = null,
|
||||
val progress: Float? = null,
|
||||
val topTenRank: Int? = null
|
||||
)
|
||||
|
||||
data class AppleDetailRequestSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val addonTransportUrl: String? = null,
|
||||
val catalogType: String? = null,
|
||||
val title: String? = null
|
||||
)
|
||||
|
||||
data class AppleDetailStreamSnapshot(
|
||||
val addonName: String,
|
||||
val title: String,
|
||||
val playableUrl: String,
|
||||
val requestHeadersJson: String = "{}"
|
||||
)
|
||||
|
||||
data class AppleDetailSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val title: String,
|
||||
val description: String = "",
|
||||
val posterUrl: String? = null,
|
||||
val backgroundUrl: String? = null,
|
||||
val logoUrl: String? = null,
|
||||
val releaseLabel: String = "",
|
||||
val ratingLabel: String = "",
|
||||
val isInWatchlist: Boolean = false,
|
||||
val isLoading: Boolean = false,
|
||||
val errorKey: String? = null,
|
||||
val streams: List<AppleDetailStreamSnapshot> = emptyList(),
|
||||
val hasStreamProviders: Boolean = true
|
||||
)
|
||||
|
||||
data class ApplePlaybackRequestSnapshot(
|
||||
val playableUrl: String,
|
||||
val title: String,
|
||||
val resumePositionMs: Long = 0L,
|
||||
val requestHeadersJson: String = "{}"
|
||||
)
|
||||
|
||||
data class AppleDiscoverRequestSnapshot(
|
||||
val contentType: String,
|
||||
val catalogKey: String? = null,
|
||||
val genre: String? = null
|
||||
)
|
||||
|
||||
data class AppleDiscoverFilterOptionSnapshot(
|
||||
val id: String? = null,
|
||||
val label: String
|
||||
)
|
||||
|
||||
data class AppleDiscoverSnapshot(
|
||||
val request: AppleDiscoverRequestSnapshot,
|
||||
val catalogOptions: List<AppleDiscoverFilterOptionSnapshot> = emptyList(),
|
||||
val genreOptions: List<AppleDiscoverFilterOptionSnapshot> = emptyList(),
|
||||
val results: List<AppleCatalogItemSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
||||
data class AppleSearchSnapshot(
|
||||
val query: String,
|
||||
val results: List<AppleCatalogItemSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
|
@ -2,17 +2,17 @@ package com.fluxa.app.shared
|
|||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.window.ComposeUIViewController
|
||||
import com.fluxa.app.shared.platform.AppleCatalogHomeSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleSearchSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleDiscoverRequestSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleDiscoverSnapshot
|
||||
import com.fluxa.app.core.apple.AppleCatalogHomeSnapshot
|
||||
import com.fluxa.app.core.apple.AppleSearchSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDiscoverRequestSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDiscoverSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleCalendarSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleAuthSubmitSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleAuthSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleLibrarySnapshot
|
||||
import com.fluxa.app.shared.platform.AppleDetailRequestSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleDetailSnapshot
|
||||
import com.fluxa.app.shared.platform.ApplePlaybackRequestSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDetailRequestSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDetailSnapshot
|
||||
import com.fluxa.app.core.apple.ApplePlaybackRequestSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleAddonStoreActionSnapshot
|
||||
import com.fluxa.app.shared.platform.AppleAddonStoreDataSource
|
||||
import com.fluxa.app.shared.platform.AppleAddonStoreSnapshot
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.fluxa.app.shared.platform
|
||||
|
||||
import com.fluxa.app.core.apple.AppleCatalogHomeSnapshot
|
||||
import com.fluxa.app.core.apple.AppleCatalogItemSnapshot
|
||||
import com.fluxa.app.core.apple.AppleCatalogRowSnapshot
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogHomeDataSource
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogHomeUiState
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogItemUiModel
|
||||
|
|
@ -11,31 +14,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
data class AppleCatalogHomeSnapshot(
|
||||
val rows: List<AppleCatalogRowSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
||||
data class AppleCatalogRowSnapshot(
|
||||
val id: String,
|
||||
val title: String,
|
||||
val items: List<AppleCatalogItemSnapshot>,
|
||||
val canLoadMore: Boolean = false
|
||||
)
|
||||
|
||||
data class AppleCatalogItemSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val title: String,
|
||||
val subtitle: String = "",
|
||||
val artworkUrl: String? = null,
|
||||
val logoUrl: String? = null,
|
||||
val addonTransportUrl: String? = null,
|
||||
val catalogType: String? = null,
|
||||
val progress: Float? = null,
|
||||
val topTenRank: Int? = null
|
||||
)
|
||||
|
||||
class AppleCatalogHomeDataSource : CatalogHomeDataSource {
|
||||
private val state = MutableStateFlow(CatalogHomeUiState())
|
||||
private var onRefreshRequested: () -> Unit = {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.fluxa.app.shared.platform
|
||||
|
||||
import com.fluxa.app.core.apple.AppleDetailRequestSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDetailSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDetailStreamSnapshot
|
||||
import com.fluxa.app.core.apple.ApplePlaybackRequestSnapshot
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogItemUiModel
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogSourceUiModel
|
||||
import com.fluxa.app.shared.feature.detail.DetailDataSource
|
||||
|
|
@ -15,45 +19,6 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
||||
data class AppleDetailRequestSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val addonTransportUrl: String? = null,
|
||||
val catalogType: String? = null,
|
||||
val title: String? = null
|
||||
)
|
||||
|
||||
data class AppleDetailSnapshot(
|
||||
val id: String,
|
||||
val type: String,
|
||||
val title: String,
|
||||
val description: String = "",
|
||||
val posterUrl: String? = null,
|
||||
val backgroundUrl: String? = null,
|
||||
val logoUrl: String? = null,
|
||||
val releaseLabel: String = "",
|
||||
val ratingLabel: String = "",
|
||||
val isInWatchlist: Boolean = false,
|
||||
val isLoading: Boolean = false,
|
||||
val errorKey: String? = null,
|
||||
val streams: List<AppleDetailStreamSnapshot> = emptyList(),
|
||||
val hasStreamProviders: Boolean = true
|
||||
)
|
||||
|
||||
data class ApplePlaybackRequestSnapshot(
|
||||
val playableUrl: String,
|
||||
val title: String,
|
||||
val resumePositionMs: Long = 0L,
|
||||
val requestHeadersJson: String = "{}"
|
||||
)
|
||||
|
||||
data class AppleDetailStreamSnapshot(
|
||||
val addonName: String,
|
||||
val title: String,
|
||||
val playableUrl: String,
|
||||
val requestHeadersJson: String = "{}"
|
||||
)
|
||||
|
||||
class AppleDetailDataSource(
|
||||
private val watchlistStore: WatchlistStore
|
||||
) : DetailDataSource {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.fluxa.app.shared.platform
|
||||
|
||||
import com.fluxa.app.core.apple.AppleCatalogItemSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDiscoverFilterOptionSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDiscoverRequestSnapshot
|
||||
import com.fluxa.app.core.apple.AppleDiscoverSnapshot
|
||||
import com.fluxa.app.shared.feature.discover.DiscoverDataSource
|
||||
import com.fluxa.app.shared.feature.discover.DiscoverFilterOptionUiModel
|
||||
import com.fluxa.app.shared.feature.discover.DiscoverFiltersUiModel
|
||||
|
|
@ -12,25 +16,6 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
||||
data class AppleDiscoverRequestSnapshot(
|
||||
val contentType: String,
|
||||
val catalogKey: String? = null,
|
||||
val genre: String? = null
|
||||
)
|
||||
|
||||
data class AppleDiscoverFilterOptionSnapshot(
|
||||
val id: String? = null,
|
||||
val label: String
|
||||
)
|
||||
|
||||
data class AppleDiscoverSnapshot(
|
||||
val request: AppleDiscoverRequestSnapshot,
|
||||
val catalogOptions: List<AppleDiscoverFilterOptionSnapshot> = emptyList(),
|
||||
val genreOptions: List<AppleDiscoverFilterOptionSnapshot> = emptyList(),
|
||||
val results: List<AppleCatalogItemSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
||||
class AppleDiscoverDataSource : DiscoverDataSource {
|
||||
private val state = MutableStateFlow(DiscoverUiState())
|
||||
private var onDiscoverRequested: (AppleDiscoverRequestSnapshot) -> Unit = {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.fluxa.app.shared.platform
|
||||
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.fluxa.app.core.apple.AppleCatalogItemSnapshot
|
||||
import com.fluxa.app.core.apple.AppleSearchSnapshot
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogItemUiModel
|
||||
import com.fluxa.app.shared.feature.catalog.CatalogSourceUiModel
|
||||
import com.fluxa.app.shared.feature.search.SearchDataSource
|
||||
|
|
@ -15,12 +17,6 @@ import kotlinx.serialization.encodeToString
|
|||
import kotlinx.serialization.decodeFromString
|
||||
import platform.Foundation.NSUserDefaults
|
||||
|
||||
data class AppleSearchSnapshot(
|
||||
val query: String,
|
||||
val results: List<AppleCatalogItemSnapshot> = emptyList(),
|
||||
val isLoading: Boolean = false
|
||||
)
|
||||
|
||||
class AppleSearchDataSource : SearchDataSource {
|
||||
private val defaults = NSUserDefaults.standardUserDefaults
|
||||
private val state = MutableStateFlow(SearchUiState(recentItems = readHistory()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue