feat(downloads): offline download feature for movies and episodes#280
feat(downloads): offline download feature for movies and episodes#280chillpill244 wants to merge 2 commits into
Conversation
|
I really like the idea, great pr! and offline downloads would be a strong feature, but I’m worried about Play Store risk. I want ARVIO to stay the same version on Play Store and GitHub. I don’t want a “Play Store version” and a separate “GitHub version”. Because of that, we have to follow the stricter Play Store rules. The problem is that this PR allows downloading video files from general streaming sources like IPTV/Stremio/Debrid/unknown links. Even if the user adds the source themselves, Google can still see the app as enabling users to save copyrighted movies/episodes locally without permission. Play Store policy is very strict about apps that stream or download copyrighted content without authorization, and this could risk rejection or even app suspension. For self-owned sources like Jellyfin/local media it is much safer, because the user controls the server/content. But “download any stream” is too broad for a Play Store app. So I don’t think we should merge this as-is. If we keep it, it should be limited to clearly self-hosted/owned sources only, or redesigned as temporary playback cache instead of a visible offline download library. Otherwise I think it is better to skip full offline downloads so ARVIO stays safe for Play Store. If you have any other suggestions about this let me know, you could also look into the policies more, it really falls into a green or grey zone we could include this feature. |
|
Hey @ProdigyV21, addressed this with two changes:
|
Adds end-to-end offline download support for mobile users. Downloaded content is persisted in a local Room database and playable without an internet connection. Tested with IPTV and Jellyfin sources. **Core infrastructure** - Room database (`DownloadEntity`, `DownloadDao`, `ArflixDatabase`) tracking download state, progress, file path, and metadata - `DownloadsRepository` — insert, query, pause/resume/cancel/delete/retry helpers - `DownloadWorker` — streams via OkHttp with `Range` header support for pause/resume, foreground notifications with live progress **Downloads UI** - `DownloadsTab` — horizontal card rows for movies and series with poster/backdrop layout; long-press or MoreVert opens an actions sheet - `DownloadActionsSheet` — bottom sheet with pause, resume, cancel, delete, and retry actions - `DownloadedEpisodesScreen` — per-series episode list reachable from the Downloads tab - Series long-press shows a "Delete all downloads" sheet **Entry points** - Bottom bar shows a Downloads tab on mobile when any download exists - Details screen shows a Download / Downloading / Downloaded / Retry button below Play - Context menu on watchlist/catalog cards gains a Download option **Player** - Chromecast disabled for offline (`file://`) streams **Watchlist tab** - Apple TV-style animated pill segmented control (mobile-only) - Tab selection preserved across navigation with `rememberSaveable` **Stream headers & subtitles** - Stream header forwarding for authenticated sources - Subtitle track preferences persisted per profile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onfigured Limits the download stream picker to streams from user-controlled local servers (Jellyfin, Emby, Plex) to comply with Play Store policy. IPTV, Stremio addon, and Debrid streams are filtered out of the picker — the full infrastructure remains in place so support can be expanded later by removing the isLocalServerStream() guard. Also injects HomeServerRepository into DetailsViewModel and observes the connections flow to surface hasHomeServer in UiState. The Download button on the details screen and the Download option in the episode context menu are only shown when the user has a usable Jellyfin/Emby/Plex connection set up. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Adds end-to-end offline download support for mobile users. Downloads are restricted to user-controlled local servers (Jellyfin, Emby, Plex) to comply with Play Store policy.
What's included
Core infrastructure
DownloadEntity,DownloadDao,ArflixDatabase) — tracks download status, progress percentage, local file path, and artwork metadata (poster, backdrop, TMDB ID, season/episode numbers)DownloadsRepository— provides insert, query, pause/resume/cancel/delete/retry operations; deletes the on-disk file when a download is removedDownloadWorker—CoroutineWorkerthat streams the file over OkHttp withRangeheader support for true pause/resume, posts a persistent foreground notification with live progress, and handles Android 12+ foreground service restrictions gracefullyDownloads UI
DownloadsTab— horizontal card rows split into Movies and Series sections; artwork respects the user's existing poster/backdropCardLayoutModesettingDownloadActionsSheet— bottom sheet offering pause, resume, cancel, delete, and retry — actions available depend on the currentDownloadStatusDownloadedEpisodesScreen— per-series episode list, navigable from the Downloads tabEntry points
x%/ Downloaded / Paused / Retry button below the primary Play button, styled with a subtle glass outline to match the Trailer button; tapping a completed download prompts deletionPlayer
file://) streams — Chromecast devices cannot access local device storageWatchlist / Downloads tab navigation
TabRowwith an Apple TV-style animated pill segmented control — smooth background and text color transitions between tabsrememberSaveableso returning from Details always restores the tab the user was onAdditional improvements
Referer,Authorization, etc.) from Stremio addonbehaviorHints.proxyHeadersare forwarded toDownloadWorker, matching the credentials ExoPlayer uses during playbackSet-Cookieare shown as unavailable for download rather than silently failingRange: bytes=0-0GET fallback for IPTV/Xtream Codes servers that omitContent-Lengthon HEAD; resolved size appears next to the Download buttondefault_subtitle/secondary_subtitlefrom Settings, filtering the list and auto-selecting a matching trackformatBytesextracted tocom.arflix.tv.util.DownloadUtils; subtitle matching helpers extracted tocom.arflix.tv.util.SubtitleLanguageMatcher— removes identical private copies across multiple filesPlay Store compliance
DownloadSheetonly surfaces streams whereaddonId == "home_server"(Jellyfin, Emby, Plex). The user sees "Downloads are only available for your local server (Jellyfin, Emby, or Plex)" if no local server streams are present.Test plan
🤖 Generated with Claude Code