Commit graph

19 commits

Author SHA1 Message Date
KhooLy
0227d8697a Implement iOS offline downloads matching Android's actual feature set
Android's download engine turned out to be simpler than "full parity"
implied: enqueue, progress, cancel - no pause/resume, no WiFi-only
gating, no auto-delete (none of those exist on Android either, despite
a dead "paused" status branch). Mirror that scope on iOS:

- FluxaAppleDownloadManager: background URLSession-based download
  engine, UserDefaults+JSON persisted (same pattern as other Apple*
  managers in this codebase), pushes state into Kotlin via a new
  updateDownloads bridge call.
- AppleLibraryDataSource now reuses the existing commonMain
  OfflineDownloadItem model and OfflineDownloadGrouping/formatting
  logic directly (same code Android uses) instead of reimplementing
  grouping/status-label/size-label logic in Swift.
- FluxaAppleDetailStartup.downloadEpisode/downloadSeason resolve a
  playable stream through the existing addon resource loader, then
  hand off to the download manager.

Known gap: no application(_:handleEventsForBackgroundURLSession:)
AppDelegate hook, so downloads won't reliably resume/report after the
app is fully killed by the OS - only while backgrounded, not
terminated. Also unverified like the rest of the iOS work this
session: no Xcode/Swift toolchain in this environment to compile
against.
2026-08-12 01:44:21 +03:00
KhooLy
2926da8732 Parse season/episode data and wire it into iOS detail startup
FluxaAppleDetailStartup now caches the meta response's videos/
seasonsCount per content id, exposes real availableSeasons/
selectedSeason/seasonEpisodes, and adds selectSeason/loadSources to
answer the new AppleDetailDataSource callbacks (season switch filters
the cached episode list locally; loadSources fetches per-episode
streams through the existing addon resource loader). Addon-filter and
download callbacks are wired but still no-ops on the Swift side -
downloads have no iOS engine yet.

Unverified: no Xcode/Swift toolchain available in this environment,
so this has not been compiled. Needs an xcodebuild pass to catch any
ObjC/Swift interop mistakes (numeric bridging, argument order) before
relying on it.
2026-08-12 01:35:47 +03:00
KhooLy
b22ac04d07 Wire local media, watch-together, external player, and plugin catalog
into the app shell and home

FluxaAppHost/FluxaHomeContent/HomeViewModel and friends now route to the
features landed in the preceding commits (local media, watch together,
external player, Nuvio plugin catalog, provider-adapter library sync),
plus the matching iOS platform data sources and i18n keys for all of it.

CorePolicyModels.kt/FluxaCoreNative.kt in this commit also carry the
NativeDeviceResourceBudget model and FluxaCoreNative.deviceResourceBudget
accessor added earlier this session for the unified memory-budget work;
they were sitting in the same files as pre-existing uncommitted changes
and weren't worth a separate hunk-level split.
2026-08-10 16:16:34 +03:00
KhooLy
5cb1bb75db Wire Addon Store screen to real networking on iOS
FluxaAppleAddonStoreManager fetches manifests over URLSession and
persists the local addon list plus enabled/disabled state via
FluxaAppleAddonConfigurationStore. FluxaAppleAddonStoreStartup routes
AppleAddonStoreActionSnapshot actions from the shared UI to it and
pushes merged state back to Kotlin. FluxaIosApp constructs and
registers it, restoring/refreshing on launch. Users can now actually
add, toggle, reorder, and remove Stremio addons on iOS.
2026-07-20 15:05:37 +03:00
KhooLy
f72b6f1623 Wire Plugins settings screen to real networking on iOS
FluxaApplePluginsStartup routes ApplePluginsActionSnapshot actions
from the shared UI to FluxaApplePluginRepositoryManager and pushes
merged state back to Kotlin. FluxaIosApp constructs and registers it
alongside the other feature startups, restoring persisted repos on
launch.
2026-07-20 14:43:50 +03:00
KhooLy
7d431cb6cb Avoid capturing app state in callbacks 2026-07-14 21:08:15 +03:00
KhooLy
278f0f1f9b Avoid capturing app value in callback 2026-07-14 20:42:54 +03:00
KhooLy
b5510e3b84 Import shared iOS bridge 2026-07-14 20:15:30 +03:00
KhooLy
20476761a9 Migrate shared UI and Apple playback to KMP 2026-07-14 18:14:18 +03:00
KhooLy
a9f6e65b36 Migrate shared Apple UI bridges to KMP 2026-07-14 16:55:16 +03:00
KhooLy
909906fab3 Build real Stremio login for iOS Auth, Keychain-backed session storage
Fixes AppleAuthDataSource: continueWithNuvio/continueWithStremio/
continueWithoutAccount were incorrectly routed through Swift
notifications - Android handles all three as pure local UI-state
transitions (no network), so this matches that instead of adding
unnecessary indirection.

submit() for the Credentials stage now posts a real request that
FluxaAppleAuthStartup.swift picks up: FluxaAppleStremioAuthClient
mirrors StremioService.kt's api.strem.io/api/login and /api/register
endpoints via URLSession, and the resulting session (id/email/authKey)
is persisted through FluxaAppleAuthStore using the Keychain generic-
password API (kSecClassGenericPassword, accessible-after-first-unlock),
not UserDefaults - this is the first credential-bearing data iOS
persists, unlike the existing UserDefaults-backed local stores.

Nuvio login/import is out of scope here: Android's version pulls
profile/addons/library/progress/history/collections through
NuvioAccountImportCoordinator, which needs library and addon-store
integration iOS doesn't have yet. The Nuvio stage transition works
(continueWithNuvio), but submitting Nuvio credentials currently has no
Swift listener - same "reachable but inert" scope already established
for AddonStore.

The error-state message on failed Stremio login is a hardcoded English
string rather than routed through AppStrings, since calling Kotlin's
AppStrings.t() from pure Swift needs framework-export verification I
can't perform without Xcode.

Caveat: this Swift code (Keychain access, URLSession networking) is
unverified - no Xcode/macOS toolchain available in this environment.
Only the Kotlin side (AppleAuthDataSource, all Gradle targets) is
compile-checked. Needs a real Xcode build and device/simulator test
before shipping.
2026-07-14 13:56:30 +03:00
KhooLy
c4123c77e3 Add shared Apple search flow 2026-07-13 17:39:50 +03:00
KhooLy
eca5306fa6 Route Apple catalog selections to shared details 2026-07-13 16:21:16 +03:00
KhooLy
58ef97d97c Initialize Apple runtime before catalog startup 2026-07-13 16:06:21 +03:00
KhooLy
a33abcae83 Route Apple home loading through headless effects 2026-07-13 16:05:18 +03:00
KhooLy
d4f5dfd49f Add Apple addon catalog bootstrap 2026-07-13 15:59:01 +03:00
KhooLy
5cc93c4d9f Initialize Apple Rust headless runtime 2026-07-13 15:46:26 +03:00
KhooLy
cb99b2b1e8 Add shared catalog action boundary 2026-07-13 15:08:20 +03:00
KhooLy
45c45b0ce6 Add Apple multiplatform foundation 2026-07-13 03:47:45 +03:00