Skip to main content

Offline Downloads & Storage Management

Audience: End users and technical evaluators Last Updated: 2026-04-04 Version: 2.0.0


Overview​

Llamafin's download system enables complete offline music listening with intelligent download management, automatic quality selection, cache management, and robust error recovery. Download albums, artists, playlists, or entire genres for playback without an internet connection.


Download Types​

Container Downloads​

Download organised collections of music:

TypeWhat DownloadsUse Case
AlbumAll tracks + artwork + metadataComplete album listening
ArtistAll songs by artist + discographyArtist deep dives
PlaylistAll playlist tracksCurated collections
GenreAll songs in genreMood-based listening

Individual Components​

Each download includes:

  • Audio Files: The actual music (highest quality available)
  • Artwork: Album art, artist images, backdrops
  • Lyrics: Synchronised lyrics files (if enabled)
  • Metadata: Track info, artist details, album data
  • Sonic Analysis: Audio fingerprints for similarity matching (if enabled)

Download Process​

How Downloads Work​

Step 1: Queue Download

  • Click download button on any album, artist, playlist, or genre
  • System validates the request

Step 2: Pre-flight Checks

  • Verifies storage space available
  • Checks network permissions
  • Validates file system access
  • Estimates total download size

Step 3: Blueprint Generation

  • Creates detailed task list for every component
  • Prioritises assets (images first, then audio, then extras)
  • Sets up retry logic for failed components

Step 4: Download Execution

  • Downloads each component systematically
  • Tracks progress per item
  • Retries failed downloads automatically (up to 3 attempts)
  • Adapts quality based on network conditions

Step 5: Completion & Verification

  • Verifies all components downloaded
  • Checks file integrity
  • Marks container as complete
  • Available for offline playback

Smart Quality Selection (LlamaSense)​

Automatic Quality optimisation​

LlamaSense intelligently selects the best download quality:

How It Works:

  1. Measures your network speed (historical and real-time)
  2. Checks device capabilities (CPU, memory, storage)
  3. Selects optimal quality for your situation
  4. Chooses best download method (direct or transcoded)

Quality Thresholds:

Network SpeedSelected QualityDownload Method
>20 MbpsMaximum (original)Direct download
10-20 Mbps2048 kbpsTranscode if needed
5-10 Mbps1024 kbpsTranscode if needed
3-5 Mbps320 kbpsTranscode if needed
1-3 Mbps128-256 kbpsTranscode if needed
<1 Mbps96 kbpsTranscode if needed

Codec Override:

  • If your device doesn't support the original format
  • Automatically transcodes to compatible format
  • Maintains highest possible quality

Worker Strategy​

Smart Thread Selection:

  • Auto Mode: Checks CPU and memory usage
    • CPU >80% or RAM <250MB free → Uses background worker
    • Otherwise → Uses main thread (faster)
  • Always: Always uses worker (conserves main thread)
  • Never: Never uses worker (maximum speed)
  • Numeric: Uses worker if file > X MB

Download Methods​

Direct Download​

When Used:

  • Server supports direct file access
  • Format is compatible with your device
  • Network speed is sufficient

Benefits:

  • Fastest method (no server processing)
  • Original quality preserved
  • Lower server load

Transcoded Download​

When Used:

  • Format conversion needed
  • Quality adjustment requested
  • Device compatibility requires different format

How It Works:

  1. Server converts audio to compatible format
  2. Downloads converted segments
  3. Reconstructs into single file
  4. Saves to your device

Benefits:

  • Compatible with all devices
  • Adjustable quality
  • Smaller file sizes

Concurrent Chunk Download​

High-Performance Downloading:

  • Splits file into multiple chunks
  • Downloads chunks simultaneously
  • Reassembles on completion
  • Significantly faster than sequential

Configuration:

  • Concurrent downloads: 3-8 chunks (configurable)
  • Chunk size: 1-10 MB (configurable)
  • Automatic retry on failed chunks
  • Progress tracking per chunk

Download Management​

Download Controls​

ControlFunction
PauseTemporarily stop download
ResumeContinue paused download
CancelStop and delete partial download
RetryRetry failed download
RepairSmart-resume: only re-download missing files
ResetHard reset: start over completely
RefreshSync with server, add new tracks
SyncBidirectional sync with server

Download States​

StateMeaning
QueuedWaiting to start
DownloadingActively downloading
PausedTemporarily stopped
CompletedAll files downloaded
ErrorDownload failed
Paused (WiFi)Waiting for WiFi connection

Progress Tracking​

Multi-Level Progress:

  • Container Level: Overall download progress (0-100%)
  • Item Level: Progress per track
  • Asset Level: Progress per component (image, audio, lyrics, analysis)
  • Chunk Level: Progress per download chunk (for concurrent downloads)

Progress Indicators:

  • Visual progress bar
  • Downloaded size / total size
  • Number of files completed
  • Estimated time remaining (based on current speed)

Smart Downloads​

Network-Aware Behaviour​

Cellular Protection:

  • Downloads can be blocked on cellular data
  • Automatic pause when switching to cellular
  • Auto-resume when WiFi returns
  • Per-setting: allow or block cellular downloads

WiFi Auto-Resume:

  • Paused downloads automatically resume on WiFi
  • No manual intervention needed
  • Respects your download queue order
  • Notifications when downloads resume

Storage Management​

Pre-flight Check: Before starting download:

  1. Checks available storage space
  2. Compares to estimated download size
  3. Blocks if insufficient space
  4. Prompts to free up space if needed

Low Storage Protection:

  • Monitors free space during downloads
  • Auto-pauses downloads if space < 500MB
  • Notifies you of low storage
  • Auto-resumes when space is freed

Cache System​

Rolling Cache​

What It Is:

  • Automatic temporary downloads around your current playback position
  • Keeps upcoming tracks available offline
  • Removes old tracks to save space
  • Completely automatic, no manual management needed

How It Works:

[Old Tracks] → [Current Track] → [Upcoming Tracks]
↓ ↓
Deleted when Downloaded before
too far behind you reach them

Cache Window:

  • Behind Current: Keeps 2 tracks for skip-back
  • Ahead of Current: Downloads N tracks ahead (configurable)
  • Repeat Mode: Wraps around to cache tracks from beginning

Cache Settings:

  • Next Track Only: Cache just 1 upcoming track
  • Numeric: Cache specific number (5, 10, 20, etc.)
  • Unlimited: Cache entire remaining queue
  • Separate settings for WiFi and cellular

Cache Healing​

Automatic Scanner:

  • Runs every 15 minutes
  • Finds cache items with missing files
  • Automatically re-downloads missing files
  • Low priority (doesn't interfere with user downloads)

Manual Scan:

  • Trigger cache healing manually
  • Identifies and repairs all stale cache entries
  • Useful after storage cleanup or file system changes

Reactive Healing:

  • If sonic analysis fails with "file not found"
  • Automatically strips stale references
  • Re-triggers download of missing files
  • No user intervention needed

Offline Playback​

Local Match Resolution​

How It Works:

  1. Before streaming a track, Llamafin checks for offline copy
  2. Searches all downloaded containers
  3. Finds matching track with valid file
  4. Plays local copy instead of streaming
  5. Zero network usage

Integrity Checks:

  • Only uses files marked as not corrupted
  • Verifies file exists on disk
  • Checks file accessibility
  • Falls back to streaming if local copy invalid

Offline Library Views​

When offline, you can still browse:

ViewWhat's Available
AlbumsDownloaded albums only
ArtistsArtists with downloaded content
SongsDownloaded songs
GenresGenres with downloaded songs
PlaylistsPlaylists with downloaded tracks
Recently AddedRecently downloaded albums
Recently PlayedRecently played offline songs
Frequently PlayedMost-played offline songs
  • Search within downloaded content
  • Works completely offline
  • Finds artists, albums, songs, playlists
  • Instant results (no network needed)

Download Settings​

Quality Settings​

SettingOptionsDescription
WiFi QualityAuto, 96-320 kbps, MaxDownload quality on WiFi
Cellular QualityAuto, 96-320 kbps, MaxDownload quality on cellular
Smart WorkersAuto, Always, Never, Numeric MBUse background workers
Concurrent Chunks3-8Parallel chunk downloads
Chunk Size1-10 MBSize per chunk

Download Behaviour​

SettingOptionsDescription
Prefer Downloaded MediaNever, WiFi Only, Cellular, AlwaysUse offline copies when available
Cellular DownloadsEnabled/DisabledAllow downloads on cellular
Download LyricsEnabled/DisabledAuto-download lyrics
Sonic AnalysisOff, Always, Auto, Post-CompletionWhen to run audio analysis

Cache Settings​

SettingOptionsDescription
WiFi Cache SizeDisabled, Next, 100MB-10GB, UnlimitedCache limit on WiFi
Cellular Cache SizeDisabled, Next, 100MB-10GB, UnlimitedCache limit on cellular
WiFi Track LimitDisabled, 5-100, UnlimitedMax cached tracks on WiFi
Cellular Track LimitDisabled, 5-100, UnlimitedMax cached tracks on cellular

Download Repair & Recovery​

Smart Repair (Repair Download)​

What It Does:

  • Identifies missing or corrupted files
  • Only re-downloads what's needed
  • Preserves successfully downloaded files
  • Resumes from first missing file

When to Use:

  • Download failed partway through
  • Some files missing after completion
  • Corruption detected in files
  • Incomplete download after app crash

Hard Reset (Reset Download)​

What It Does:

  • Deletes all downloaded files for container
  • Clears all progress
  • Starts download from scratch
  • Re-fetches all metadata

When to Use:

  • Smart repair didn't fix issue
  • Want to re-download at different quality
  • Severely corrupted container
  • Starting completely fresh

Refresh & Sync​

Refresh:

  • Checks server for new tracks
  • Adds new tracks to download
  • Doesn't remove existing tracks
  • Updates metadata

Sync:

  • Full bidirectional comparison
  • Identifies tracks to add
  • Identifies tracks to remove (deleted from server)
  • Updates container to match server

Deletion Management​

Deleting Downloads​

Single Item Deletion:

  • Remove individual tracks from container
  • Frees up space
  • Container remains downloaded
  • Can re-download later

Container Deletion:

  • Delete entire album/artist/playlist
  • Removes all files
  • Frees all space
  • Can re-download later

Protected Downloads​

Playback Protection:

  • Cannot delete tracks currently in playback queue
  • Protects current track + next/previous tracks
  • Prevents playback interruption
  • Clear queue first, then delete

Background Deletion​

How It Works:

  • Queued for background deletion
  • Processed in batches when scheduler is idle
  • Platform-optimised batch sizes:
    • Mobile: 3 items per batch
    • Desktop/Web: 10 items per batch
  • Retries failed deletions (up to 3 attempts)

Storage Statistics​

Download Statistics​

Track Metrics:

  • Total tracks downloaded
  • Total disk space used
  • Total playback time
  • Per-container breakdown

User vs Cache:

  • User Downloads: Content you explicitly downloaded
  • Cache Downloads: Automatically cached tracks
  • Separate statistics for each
  • Independent limits and management

Storage Management​

View Storage Usage:

  • See space used by each container
  • View cache size
  • Identify largest downloads
  • Track download trends over time

Integrity Validation:

  • Runs once at app startup
  • Recalculates all statistics from raw data
  • Corrects any discrepancies
  • Ensures accurate reporting

Error Handling​

Download Failures​

Automatic Retry:

  • Each component retries up to 3 times
  • Images: Skipped on failure (non-critical)
  • Audio files: Retried (critical)
  • Lyrics: Skipped on failure (optional)
  • Analysis: Retried later

Failure Notifications:

  • Notified when download fails
  • Error message explains issue
  • Retry button available
  • Can repair or reset download

Common Issues​

IssueCauseSolution
Insufficient StorageNot enough disk spaceFree up space, retry
Network ErrorConnection lostCheck connection, resume
Server ErrorJellyfin server issueWait and retry
Permission DeniedFile access blockedGrant storage permission
Corrupted FileDownload interruptedRepair or reset download

Technical Specifications​

SpecificationValue
Download MethodsDirect, Transcoded, Concurrent Chunks
Concurrent Chunk Limit3-8 (configurable)
Chunk Size Range1-10 MB (configurable)
Task Retry Limit3 attempts per component
Cache Healing Interval15 minutes
Low Storage Threshold500 MB
Background Deletion Batch (Mobile)3 items
Background Deletion Batch (Desktop)10 items
Cache Crossfade Buffer2 tracks
Sonic Analysis Corruption Threshold>5 seconds duration variance
Download QueueUnlimited containers
Offline ViewsAll library views supported
Local Match ResolutionAutomatic before streaming
Storage SystemIndexedDB + File System
Cache Container IDllamafin-cache-container