maxrave-dev / maxrave-dev/SimpMusic

Intelligent Offline Library Manager with Dynamic Downloads

Open
#2,385 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
11.4k
Forks
599
Avg merge
3d 18h
Merged PRs (30d)
7

Description

Problem Description

Managing offline downloads manually becomes increasingly difficult as a user's music library grows. Users may download hundreds or thousands of songs, but their listening habits continuously change over time.

A song that was frequently played several months ago may no longer be relevant, while songs that the user currently listens to frequently may not be available offline.

Currently, users have to manually decide which songs to download, remove, or replace when available storage becomes limited. This creates several problems:

  • Offline storage can become occupied by songs that are rarely or no longer played.
  • Frequently listened-to songs may not be available offline when needed.
  • Users must repeatedly manage downloads as their listening habits change.
  • Users may exceed their preferred storage limit.
  • Manually downloaded playlists can become outdated over time.
  • There is no convenient way to balance listening preferences, storage constraints, and download priorities automatically.

The underlying problem is that the offline library is static, while the user's listening behavior is dynamic.

An intelligent system could continuously evaluate listening history and automatically maintain an optimized offline library based on the user's preferences, available storage, and configured rules.

Proposed Solution

Introduce an intelligent Auto-Managed Offline Library that dynamically decides which songs should remain downloaded based on user-defined limits and listening behavior.

Users could configure either:

  1. A maximum storage limit (e.g. 2 GB, 5 GB, 10 GB, etc.)
  2. A maximum number of downloaded songs (e.g. 100, 500, 1,000)
  3. Or potentially both, with the more restrictive limit taking precedence.

The system would assign each eligible song an Offline Priority Score based on configurable factors such as:

  • Most played
  • Recently played
  • Play frequency
  • Favorite/liked status
  • Listening streak
  • Recently added
  • Playlist priority
  • Artist preference
  • How recently the song was downloaded
  • Historical listening consistency

Users could customize the weighting of these factors or choose from predefined modes such as Balanced, Recently Played, Most Played, Favorites First, or Custom.

The system would periodically recalculate priorities and intelligently maintain the offline library. When the configured limit is reached, lower-priority songs could be removed to make room for higher-priority songs.

Important safeguards
The system should never unexpectedly remove protected content. Users should be able to:

  • Pin songs as Never Remove
  • Protect manually downloaded songs from automatic deletion
  • Exclude specific playlists, albums, artists, or songs
  • Set a minimum amount of free storage to preserve on the device
  • Configure a grace period before a recently downloaded song becomes eligible for removal

Download controls
Users should also be able to configure:

  • Enable/disable automatic downloads
  • Wi-Fi only / Wi-Fi + mobile data
  • Download only while charging
  • Download quality
  • Manual Refresh Offline Library action
  • Maximum number of songs added during a single refresh
Image

Smart replacement

Instead of simply deleting songs whenever the limit is reached, the system should compare candidates before making changes. For example, if a frequently played song becomes highly relevant while an old rarely played song occupies storage, the system could remove the lower-priority song and download the higher-priority one.

To prevent excessive download/delete cycles, the system should use a minimum priority difference or cooldown period before replacing an existing download.

Transparency

The user should be able to see why a song was selected or removed. For example:

Downloaded because: Frequently played + Liked + Recently played

Removed because: Not played for 90 days + Low priority

This would make the automation predictable and give users confidence in the system.

The result would be a self-maintaining offline library that continuously adapts to actual listening behavior while respecting the user's storage, network, and download preferences.

Alternative Solutions

Several alternative approaches could be considered:

  1. Smart Downloads based primarily on listening history

The application could automatically download frequently played or recently played songs without allowing users to configure a complex scoring system. This would provide a simpler user experience but offer less control.

  1. Playlist-based automatic downloads

Users could select specific playlists and have the application automatically maintain those playlists offline. This would be easier to implement but would not adapt as intelligently to individual song-level listening behavior.

  1. Recently Played cache

The application could maintain a rolling offline cache containing the user's most recently played songs. For example, the last 100 or 500 songs could automatically remain available offline. This is simple and predictable but does not account for songs that are heavily played but not recently played.

  1. Favorites-first approach

The system could prioritize liked/favorite songs and then fill the remaining storage with frequently or recently played songs. This would provide a simpler priority model while still being useful.

  1. Fully automatic recommendation-based downloads

The system could also incorporate recommended songs or algorithmically generated playlists into the offline library. However, this should probably remain optional because users may not want automatically downloaded content they have never intentionally listened to.

The proposed solution could support these approaches as predefined modes while still allowing advanced users to create their own custom priority rules.

Additional Context

The goal is not simply to download more music automatically, but to create a self-maintaining offline library that reflects how the user actually listens to music.

A key consideration is avoiding unnecessary download/delete cycles. The system should use safeguards such as a priority threshold, cooldown period, and minimum retention period so that a song is not repeatedly downloaded and removed because of small changes in listening behavior.

A possible priority model could be conceptually represented as:

Offline Priority Score =
Play Frequency + Recency + Like/Favorite Status + Listening Streak + Playlist Priority + Other User-Selected Factors

The exact scoring algorithm does not necessarily need to be exposed to the user, but the user should be able to control the relative importance of the factors.

It would also be useful to distinguish between:

Automatically managed downloads
Manually downloaded/protected downloads
Pinned downloads
Excluded content

This would prevent the automatic system from interfering with downloads that the user explicitly wants to keep.

Another useful feature would be an Offline Library Preview before enabling automatic management. The application could show something like:

Your 5 GB limit would contain:

684 songs
71% frequently played
18% recently played
11% favorites

Users could then review the proposed library before allowing the system to manage it.

The system should also handle temporary situations gracefully. For example, if the device is offline, storage is almost full, the user is on mobile data, or a download fails, it should avoid aggressively removing existing offline content just because a higher-priority song cannot currently be downloaded.

Ideally, automatic management should happen during appropriate background conditions, such as Wi-Fi connectivity, charging, and sufficient battery/storage, depending on the user's settings.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified in the issue. First, the maintainer would need to narrow the proposal into a defined offline-download scope and identify the relevant entry points; done would require an agreed behavior for limits, prioritization, protections, refreshes, and replacement safeguards.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.