Tamed’s library is backed by a Room database (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/calmerism/Tamed/llms.txt
Use this file to discover all available pages before exploring further.
MusicDatabase) accessed through DatabaseDao. It stores every track, album, artist, and playlist as a set of related entities, tracks listening history and play counts, and keeps local data in sync with YouTube Music when an account is connected.
Library Entities
The core data model is a set of Room entities and their aggregated view types:Song / SongEntity
A single track.
Song is the aggregated view, composed of a SongEntity (id, title, duration, thumbnail, liked status, inLibrary date) plus its related ArtistEntity list, AlbumEntity, and FormatEntity.Album / AlbumEntity
An album or collection.
Album includes the AlbumEntity (id, title, year, thumbnail, song count, duration) and a list of ArtistEntity objects. Listening stats (songCountListened, timeListened) are joined at query time.Artist / ArtistEntity
A music artist.
ArtistEntity stores the id, name, and optional thumbnail. Joined into Artist with song count and play-time aggregates.Playlist / PlaylistEntity
A user or synced playlist.
Playlist includes PlaylistEntity (id, name, optional thumbnail URL) along with a songCount and a preview list of song thumbnail URLs for mosaic cover generation.Junction Maps & Views
Relationships between entities are maintained via junction tables and database views:SongArtistMap— raw song-to-artist associations (table);SortedSongArtistMapis a@DatabaseViewover this table that orders rows byposition, used by theSongrelationSongAlbumMap— song-to-album mappingAlbumArtistMap— album-to-artist mappingPlaylistSongMap— playlist membership (table);PlaylistSongMapPreviewis a@DatabaseViewlimited to the first four positions for mosaic cover generation
View Types & Grid Size
ArtistViewTypeKey, AlbumViewTypeKey, and PlaylistViewTypeKey. Grid density is controlled by GridItemsSizeKey.
Filters
Song Filter
Artist Filter
Album Filter
Sort Types
- Songs
- Albums
- Artists
- Playlists
...SortDescendingKey boolean to reverse the order.
Auto-Playlists
Tamed generates four smart playlists automatically. Each can be shown or hidden:| Auto-Playlist | Visibility Key | Description |
|---|---|---|
| Liked Songs | ShowLikedPlaylistKey | All songs with liked = true |
| Downloaded | ShowDownloadedPlaylistKey | All locally cached songs |
| Top | ShowTopPlaylistKey | Top played tracks in a configurable time window |
| Cached | ShowCachedPlaylistKey | Songs in the ExoPlayer cache |
Play Count & Listening Stats
Every completed (or sufficiently long) playback is recorded as anEvent entity in the database. PlayCountEntity aggregates these events per song. The MyTopFilter enum defines the time window for the Top playlist and stats screen:
PauseListenHistoryKey.
Playlist Management
Playlists can be created, renamed, reordered, and their tracks rearranged.PlaylistEditLockKey adds a confirmation step before destructive edits, preventing accidental changes.
Playlists support tags for filtering. PlaylistTagsFilterKey stores the active tag filter as a serialised string. Tags are shown in the library when ShowTagsInLibraryKey is enabled.
YouTube Music Sync
When a YouTube Music account is connected, Tamed keeps the library in sync bidirectionally:| Key | Description |
|---|---|
YtmSyncKey | Enable automatic sync |
SelectedYtmPlaylistsKey | Comma-separated list of YTM playlist IDs to sync |
| Key | Tracks Last Sync Of |
|---|---|
LastLikeSongSyncKey | Liked songs |
LastLibSongSyncKey | Library songs |
LastAlbumSyncKey | Saved albums |
LastArtistSyncKey | Followed artists |
LastPlaylistSyncKey | Playlists |
Downloads
| Key | Type | Description |
|---|---|---|
AutoDownloadOnLikeKey | Boolean | Download a track automatically when it is liked |
ExternalDownloaderEnabledKey | Boolean | Hand off downloads to a third-party app |
ExternalDownloaderPackageKey | String | Package name of the external downloader |
Search
The search source is toggled between local library and online YouTube Music viaSearchSourceKey:
PauseSearchHistoryKey while leaving existing history intact.
Backup & Restore
BackupRestoreViewModel handles serialising the entire database state (library songs, albums, artists, playlists, liked items, and settings) to a portable backup file, and restoring from one. This allows migrating between devices or reinstalling without losing local library metadata.