Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 1.6 KB

File metadata and controls

71 lines (44 loc) · 1.6 KB

Storage Management API

There is no single StorageManager class in the Android app. Storage behavior is split across repositories, workers, and helper utilities.

SettingsRepository

data/SettingsRepository.kt

Backed by DataStore Preferences.

Main responsibilities:

  • expose settingsFlow
  • persist GPU, cache, theme, debug, preset, and battery-saver options
  • provide small update methods such as setGpuEnabled and setCacheSettings

VideoJobRepository

data/VideoJobRepository.kt

Main responsibilities:

  • enqueue enhancement jobs through WorkManager
  • expose live job status flows
  • cancel jobs
  • prune completed jobs
  • delete finished output files and hide removed job cards

Status mapping type:

  • VideoJobStatus

DownloadJobRepository

data/DownloadJobRepository.kt

Main responsibilities:

  • enqueue YouTube download jobs
  • expose WorkManager job state as DownloadJobInfo
  • cancel and prune download work

Worker-owned file storage

Worker Directory
VideoEnhancementWorker filesDir/enhanced_videos/
VideoDownloadWorker filesDir/downloads/

These locations are app-private and intentionally simple.

Sharing helper

util/VideoShareUtil.kt

This helper wraps FileProvider.getUriForFile(...) so processed videos can be shared without moving them out of app-private storage.

Provider path config:

  • res/xml/file_paths.xml

Design summary

The storage subsystem is intentionally narrow:

  • DataStore for preferences
  • WorkManager for durable background job state
  • app-private files for downloads and generated media
  • FileProvider for export or sharing