Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a2263b4
docs(watch-party): plan the Android Watch Party against the current c…
Quick104 Sep 25, 2026
0dc41fd
feat(watch-party): adopt the current room contract in the shared room…
Quick104 Sep 25, 2026
2a8dc7e
feat(watch-party): cache availability and remember the recent party
Quick104 Sep 25, 2026
65836e0
feat(watch-party): add the shared room playback binding
Quick104 Sep 25, 2026
36420ba
feat(watch-party): start room playback on the room's exact file and p…
Quick104 Sep 25, 2026
cbd5e17
feat(watch-party): add the player-side Watch Party coordinator
Quick104 Sep 25, 2026
8ae15a8
feat(watch-party): share hub, lobby, and picker state between phone a…
Quick104 Sep 25, 2026
144b60e
feat(watch-party): add the device-local Experimental toggle
Quick104 Sep 25, 2026
2631a09
test(watch-party): expose party state to the playback harness
Quick104 Sep 25, 2026
596cb01
fix(watch-party): never let the HTTP engine resend start, select, or …
Quick104 Sep 25, 2026
dd907ba
feat(watch-party): drive the phone player from the room binding
Quick104 Sep 25, 2026
b526d24
fix(watch-party): hold room commands during a mount and while suspended
Quick104 Sep 25, 2026
f0a54e1
feat(watch-party): drive the TV player from the room binding
Quick104 Sep 25, 2026
04fd751
fix(watch-party): refuse SiloCast handoffs while the TV is in a party
Quick104 Sep 25, 2026
cd96209
feat(watch-party): phone hub, lobby, picker, party panel, and invitat…
Quick104 Sep 25, 2026
2f06c5e
feat(watch-party): TV hub, lobby, picker, party panel, and settings t…
Quick104 Sep 25, 2026
430fcbd
feat(watch-party): report why the last room socket ended in the debug…
Quick104 Sep 25, 2026
baa90f4
fix(watch-party): issues found in live phone and TV qualification
Quick104 Sep 25, 2026
e70ff73
refactor(watch-party): report the server's raw refusal reason on phone
Quick104 Sep 25, 2026
199ef98
chore(watch-party): remove the Watch Together entry leftovers
Quick104 Sep 25, 2026
f3ffa56
docs: describe Watch Party as experimental behind the Settings toggle
Quick104 Sep 25, 2026
920b29c
fix(harness): measure party spread from the fresh player position
Quick104 Sep 25, 2026
a1bcee6
fix(watch-party): stop remembering a party as it closes
Quick104 Sep 25, 2026
be7bc11
fix(watch-party): a dead room socket can no longer stop the playback …
Quick104 Sep 25, 2026
9c5bef8
fix(watch-party): stop a phone guest from fighting the room's seeks
Quick104 Sep 25, 2026
61e8baa
fix(watch-party): keep party invitations through sign-in
Quick104 Sep 25, 2026
bf37ece
fix(watch-party): start each membership with a fresh server clock
Quick104 Sep 25, 2026
8d2da39
fix(watch-party): offer TV "Add to party" only when the server stages
Quick104 Sep 25, 2026
ce775f3
fix(watch-party): repair command timing and party transitions
Quick104 Sep 25, 2026
1822994
fix(watch-party): undo every denied outside seek on a guest
Quick104 Sep 25, 2026
96ddc2a
fix(watch-party): show only movies, series, and episodes in picker rows
Quick104 Sep 25, 2026
a5b6cbb
fix(watch-party): restore every denied external seek
Quick104 Sep 25, 2026
b1f1f1f
feat(watch-party): match the iOS and tvOS Watch Party design
Quick104 Sep 25, 2026
50c4a02
fix(watch-party): close three review gaps in party commands and entry
Quick104 Sep 25, 2026
716e8d1
fix(watch-party): suggest in playing vote rooms and await TV departure
Quick104 Sep 25, 2026
f4b0b7e
fix(watch-party): re-check server support whenever the hub is shown
Quick104 Sep 25, 2026
e7c9085
fix(watch-party): reconcile instead of running unknown room actions
Quick104 Sep 25, 2026
450d6b6
fix(watch-party): tighten room commands, host entry, and outside play…
Quick104 Sep 25, 2026
97d0ba9
fix(watch-party): hide detail-page hosting on servers that can't host
Quick104 Sep 25, 2026
770f5c3
fix(watch-party): wait for the hub re-check and reuse in-flight sugge…
Quick104 Sep 25, 2026
e971250
fix(watch-party): fresh start per title, TV host re-check, lobby sugg…
Quick104 Sep 25, 2026
2c1b151
fix(watch-party): harden room sync after review
Quick104 Oct 6, 2026
512c2cb
Merge main into the Watch Party branch
Quick104 Oct 6, 2026
433bf8b
Merge main into the Watch Party branch
Quick104 Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ This repository contains only the Silo Android clients. Shared Kotlin logic live
- Ebooks/Reading are phone-only. Do not expose ebooks or Reading on Android TV.
- Android mobile navigation is Home, Libraries, For You, Calendar, and Downloads only when the active profile has downloads. Video, Audio, and Reading are library modes reached through Libraries, not bottom-nav tabs.
- Android TV navigation is Home, available media-type tabs from server libraries, For You (with its Watchlist/Favorites dropdown, mirroring tvOS `.recommendations`), Calendar, and Requests while the server enables it (mirroring tvOS `.requests`), plus search and profile actions. Reading/ebooks are excluded.
- Requests is live on phone and TV, server-gated by `requests_enabled` (phone: profile menu + search; TV: a top-bar tab + search, matching Apple). Admins who can moderate requests approve, decline, and retry them in the Requests screens, as on Apple; limits and auto-approval stay in web admin. Other admin surfaces are not exposed in the Android clients — no STATS dashboard, and none of the richer admin screens (users/sessions/logs/scans) — and neither is Watch Together. Session management (seeing where you are signed in and signing other devices out) is not exposed either; device pairing stays. This is a deliberate divergence from Apple, which does surface the STATS dashboard. Do not add any of it back to menus without an explicit product decision.
- Requests is live on phone and TV, server-gated by `requests_enabled` (phone: profile menu + search; TV: a top-bar tab + search, matching Apple). Admins who can moderate requests approve, decline, and retry them in the Requests screens, as on Apple; limits and auto-approval stay in web admin. Other admin surfaces are not exposed in the Android clients — no STATS dashboard, and none of the richer admin screens (users/sessions/logs/scans). Session management (seeing where you are signed in and signing other devices out) is not exposed either; device pairing stays. This is a deliberate divergence from Apple, which does surface the STATS dashboard. Do not add any of it back to menus without an explicit product decision.
- Watch Party (synchronized playback) is experimental on phone and TV. Its entry points (profile menu, the detail page's party action, and phone `silo://watch-party` invitations) appear only while Settings → Experimental → Watch Party is on, a device-local toggle that defaults on in debug builds and off in release builds, and it works only when the server advertises the room and playback capabilities. Keep it behind the toggle until the qualification matrix in `docs/watch-party-implementation-plan.md` passes.

## Build, Test, and Development Commands

Expand Down
20 changes: 12 additions & 8 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ A detailed inventory of what the Android **phone** and **TV** clients do today.
- ✅ implemented
- 🟡 partial / basic ("bones-level") — works but slated for improvement
- 🚧 planned (design/plan exists, not built)
- 🧪 experimental — built, behind Settings → Experimental
- ➖ not present on this platform (by design or not yet built)

File pointers are repository-relative.

> **Important exposure note:** Requests is live on both Android surfaces, gated by the server's `requests_enabled` flag (`/api/v2/requests/status`), and reached from the profile menu and search on phone and from a top-bar tab and search on TV — matching the Apple clients. Admins who can moderate approve, decline, and retry requests there. The richer admin screens (users/sessions/logs/scans) and Watch Together remain inaccessible.
> **Important exposure note:** Requests is live on both Android surfaces, gated by the server's `requests_enabled` flag (`/api/v2/requests/status`), and reached from the profile menu and search on phone and from a top-bar tab and search on TV — matching the Apple clients. Admins who can moderate approve, decline, and retry requests there. The richer admin screens (users/sessions/logs/scans) remain inaccessible. Watch Party is experimental, behind Settings → Experimental → Watch Party.

---

Expand Down Expand Up @@ -47,15 +48,18 @@ File pointers are repository-relative.
| Landscape-on-play (auto-rotate aware) | 🚧 | ➖ | Implemented then reverted; pending re-apply |
| Picture-in-Picture | ✅ | ✅ | `SiloPictureInPictureCoordinator`; enters on home-press during playback |

## Watch Together (not exposed)
## Watch Party (experimental)

Shown only while Settings → Experimental → Watch Party is on (default on in debug builds, off in release builds) and the server advertises Watch Party.

| Feature | Phone | TV | Notes |
|---|:---:|:---:|---|
| Create / join / leave room | 🚧 | 🚧 | Code/design artifacts exist, but users cannot access this flow |
| Clock sync (NTP-style) + drift correction | 🚧 | 🚧 | Shared infrastructure exists but is not a live feature |
| Host vs guest transport gating | 🚧 | 🚧 | Not reachable from production navigation |
| Room snapshots / member list / suggestions / voting | 🚧 | 🚧 | Not reachable from production navigation |
| Graceful reconnect + host-closed auto-exit | 🚧 | 🚧 | Not reachable from production navigation |
| Hub: host, join by code, Return to Party, Rejoin | 🧪 | 🧪 | Profile menu; detail page party action |
| Lobby: staged title, Host Picks or voting, lobby Ready, suggestions | 🧪 | 🧪 | Only the room's phase opens the player |
| Invitations | 🧪 | 🧪 | Phone: share/copy link, `silo://watch-party`; TV: code and QR |
| Synced playback (server clock, rate convergence, catch-up) | 🧪 | 🧪 | Shared `RoomPlaybackBinding` |
| Party panel on Back: Leave, Return everyone to lobby, End | 🧪 | 🧪 | Host-only actions per role |
| Reconnect, socket rotation, same-profile replacement | 🧪 | 🧪 | Room socket owned by `RoomSession` |

## Offline & Downloads

Expand Down Expand Up @@ -154,6 +158,6 @@ File pointers are repository-relative.

**TV** is a 10-foot, D-pad client focused on browsing and playback, including audiobooks, calendar, the subtitle suite, person detail, and system Watch Next integration. It intentionally omits ebooks/reading and downloads management.

**Not currently exposed on either Android surface:** the admin stats dashboard, full admin management (users/sessions/logs/scans), and Watch Together. Request moderation (approve, decline, retry) is the one admin action the Requests screens offer.
**Not currently exposed on either Android surface:** the admin stats dashboard and full admin management (users/sessions/logs/scans). **Experimental:** Watch Party, behind Settings → Experimental. Request moderation (approve, decline, retry) is the one admin action the Requests screens offer.

Both apps share the same networking, auth, repositories, most ViewModels, and the entire Media3 playback/capability stack.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Built as a Kotlin Multiplatform project: one shared business-logic core, two Jet

> **Status:** WIP (`v0.3.x`). Silo Android is pre-1.0 and some areas remain under active development (see [Roadmap](#roadmap)).
>
> **Current exposure note:** Requests is live on both Android surfaces, gated by the server's `requests_enabled` flag (`/api/v2/requests/status`), and reached from the profile menu and search on phone and from a top-bar tab and search on TV — matching the Apple clients. Admins who can moderate approve, decline, and retry requests there. Other admin surfaces, session management, and Watch Together are not exposed in the Android clients.
> **Current exposure note:** Requests is live on both Android surfaces, gated by the server's `requests_enabled` flag (`/api/v2/requests/status`), and reached from the profile menu and search on phone and from a top-bar tab and search on TV — matching the Apple clients. Admins who can moderate approve, decline, and retry requests there. Other admin surfaces and session management are not exposed in the Android clients. Watch Party is experimental, behind Settings → Experimental → Watch Party (on in debug builds, off in release builds).

---

Expand Down Expand Up @@ -71,8 +71,8 @@ A condensed tour. For the exhaustive, per-feature checklist (with phone/TV cover
- **Tracks & subtitles** — audio-track switching (incl. mid-stream), subtitle selection with **styling, position, and sync offset**, plus a subtitle suite: provider **search & download** and **AI transcription/translation** with quota tracking.
- **System integration** — single Media3 `MediaSession` powers lock-screen / notification / headset / Assistant controls; TV adds D-pad transport, an info HUD, a chapter scrubber, and HDMI EDID-driven display-mode selection.

### Watch Together
Not currently exposed on Android phone or Android TV. Shared sync infrastructure and design notes may exist in the repository, but users cannot create or join Watch Together sessions from the apps on this branch.
### Watch Party
Experimental on Android phone and Android TV. Turn on Settings → Experimental → Watch Party (on by default in debug builds, off in release builds); the server must also advertise Watch Party. Host from a title's page or the profile menu, pick what everyone watches in the lobby (Host Picks or voting), and invite others with the party code (phone: share or copy the invitation link; TV: code and QR). Playback stays in sync across devices, and Back during a party opens the party panel instead of leaving. See [`docs/watch-party-implementation-plan.md`](docs/watch-party-implementation-plan.md).

### ⬇️ Offline & Downloads (phone)
WorkManager-backed downloads of video, audiobooks, and books to public device storage (scoped `MediaStore` on API 30+), preserving original filenames/formats so other apps can discover and open them. Metadata lives in Room, local playback/read paths work without a server session, and the app can boot straight to Downloads when launched offline. Download monitoring supports subscription-style queues and **Reclaim Watched** cleanup for completed items that have been watched/read/listened.
Expand All @@ -84,7 +84,7 @@ WorkManager-backed downloads of video, audiobooks, and books to public device st
- **Browse** with genre/rating filters, sorting, and infinite-scroll grids; **collections** are browse-only in the Android clients, while collection authoring/management remains web-only.
- **Item detail** for movies and series includes seasons → episodes, multi-version files, cast/crew, local download controls, and phone-to-TV playback handoff.
- **Search** scoped by media type, debounced and paginated.
- **Requests** — live on phone and TV behind the server's `requests_enabled` flag (phone: profile menu + search; TV: top-bar tab + search), with request moderation for admins. **Not exposed** — other admin surfaces, session management, and Watch Together are not reachable app surfaces today.
- **Requests** — live on phone and TV behind the server's `requests_enabled` flag (phone: profile menu + search; TV: top-bar tab + search), with request moderation for admins. **Experimental** — Watch Party, behind Settings → Experimental. **Not exposed** — other admin surfaces and session management are not reachable app surfaces today.

### 📖 Reading & 🎧 Audio
- **Ebook reader (phone only)** — EPUB, PDF, CBZ (comics), TXT/Markdown, FB2/FBZ, plus MOBI/AZW/AZW3 when the server can convert to EPUB; CBR and unsupported originals can be downloaded/opened externally. Themes, text size, margins, table of contents, bookmarks, and progress are supported.
Expand Down Expand Up @@ -238,9 +238,9 @@ Active design work lives in `docs/superpowers/specs/` with phased plans in `docs

- **Audiobook polish** — the phone and TV players have chapter-aware UI, speed, bookmarks, and sleep timers. Remaining work includes skip-silence, volume normalization, rich notification polish, Android Auto, and a phone widget.
- **Ebook reader enhancements** — in-text search, highlights, and notes, with coordinated server work where the shared contract changes.
- **Admin management (users/sessions/logs/scans), Watch Together** — code/design work exists, but these are not currently exposed to users in the Android apps and need product/navigation decisions before being treated as live features.
- **Admin management (users/sessions/logs/scans)** — code/design work exists, but these are not currently exposed to users in the Android apps and need product/navigation decisions before being treated as live features.

Known gaps the docs track: TV has no reader/ebooks and no downloads management by design; admin surfaces other than request moderation, session management, and Watch Together are not accessible on either Android surface today.
Known gaps the docs track: TV has no reader/ebooks and no downloads management by design; admin surfaces other than request moderation, and session management, are not accessible on either Android surface today, and Watch Party is experimental.

---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package org.siloserver.silo.common.di

import android.content.SharedPreferences
import org.siloserver.silo.network.DurableLoginAuthorityProvider
import org.siloserver.silo.network.TokenManager
import org.siloserver.silo.network.api.WatchTogetherApi
import org.siloserver.silo.network.apiv2.PlaybackV2Api
import org.siloserver.silo.repository.WatchTogetherRepository
import org.siloserver.silo.watchtogether.RecentPartyOwner
import org.siloserver.silo.watchtogether.RecentWatchParties
import org.siloserver.silo.watchtogether.SharedPreferencesRecentWatchPartyStorage
import org.siloserver.silo.watchtogether.WatchPartyAvailabilityRepository
import org.siloserver.silo.watchtogether.WatchPartyRecentsRecorder
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import org.koin.dsl.module

/**
* Watch Party wiring shared by the phone and TV apps: capability discovery
* and the recent-party store. The room owner itself lives in the shared
* repository module.
*/
val watchPartyModule = module {
single {
val tokens = get<TokenManager>()
val playback = get<PlaybackV2Api>()
val api = get<WatchTogetherApi>()
WatchPartyAvailabilityRepository(
roomCapabilities = { scope -> api.capabilities(scope) },
playbackCapabilities = { scope -> playback.capabilities(scope) },
authScopeProvider = { tokens.snapshotCurrentScope() },
)
}
single {
val authorities = get<TokenManager>() as? DurableLoginAuthorityProvider
RecentWatchParties(
// The app-level SharedPreferences binding is the encrypted store.
storage = SharedPreferencesRecentWatchPartyStorage(get<SharedPreferences>()),
owner = {
authorities?.snapshotDurableLoginAuthority()?.let { authority ->
val serverId = authority.scope.serverId
val profileId = authority.scope.profileId
if (serverId.isBlank() || profileId.isNullOrBlank()) null
else RecentPartyOwner(serverId, authority.loginId, profileId)
}
},
)
}
single(createdAtStart = true) {
val repository = get<WatchTogetherRepository>()
WatchPartyRecentsRecorder(
recents = get(),
room = repository.roomSnapshot,
ended = repository.ended,
scope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
identityTransitions = get(),
closedByThisDevice = repository.closedByThisDevice,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1069,4 +1069,6 @@ data class StartParams(
val qualityPreference: String? = null,
val startPosition: Double? = null,
val clientPlaybackContext: ClientPlaybackContext,
/** Watch Party starts pin the file (false); renewals must keep that. */
val allowAlternateVersions: Boolean? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ open class PlaybackSessionManager(
progressPersistence: ProgressPersistenceV3 = ProgressPersistenceV3.SERVER,
deferPublication: Boolean = false,
expectedMetadataOwner: AuthScopeSnapshot? = null,
/** False pins [fileId] through every replan (Watch Party). Null keeps the server default. */
allowAlternateVersions: Boolean? = null,
): ApiResult<VideoSessionStartV3> = contentStartMutex.withLock {
if (!tokenManager.acceptsMetadataOwner(expectedMetadataOwner, profileId))
return@withLock ApiResult.Error(0, "identity_changed", "The metadata viewer changed before playback admission.")
Expand Down Expand Up @@ -375,6 +377,7 @@ open class PlaybackSessionManager(
bandwidthCapKbps = maxBitrateKbps?.takeIf { it > 0 },
capabilities = capabilities,
clientPlaybackContext = clientPlaybackContext,
allowAlternateVersions = allowAlternateVersions,
)
if (!tokenManager.acceptsMetadataOwner(expectedMetadataOwner, profileId))
return@withLock ApiResult.Error(0, "identity_changed", "The metadata viewer changed before playback admission.")
Expand Down
Loading
Loading