1
tracks
Anna Schumaker edited this page 2023-05-10 14:49:35 -04:00
Table of Contents
The tracks
table holds information about each Track. The tracks_active_trigger
is used to enforce only one active Track at a time.
Columns
Name | Type | Default | Description |
---|---|---|---|
trackid | INTEGER | The unique id of a single track | |
libraryid | INTEGER | The libraryid of this track's library | |
mediumid | INTEGER | The mediumid of this track's medium | |
year | INTEGER | The year of this track's release | |
path | PATH | The filepath of this track | |
mbid | TEXT | The MusicBrainz ID of this track | |
title | TEXT | The title of this track | |
number | INTEGER | The number of this track on the medium | |
length | REAL | The length of this track in seconds | |
artist | TEXT | The artist string for this track | |
mtime | REAL | The last known mtime for this track | |
active | BOOLEAN | FALSE | The active status of this track |
favorite | BOOLEAN | FALSE | The favorite status of this track |
playcount | INTEGER | 0 | The number of times this track has been played |
added | DATE | CURRENT_DATE | The UTC date when this track was added |
laststarted | TIMESTAMP | NULL | The UTC timestamp when this track was last started for playback |
lastplayed | TIMESTAMP | NULL | The UTC timestamp when this track last finished playback |
Triggers
Name | When | Description |
---|---|---|
tracks_active_trigger | After update | Set tracks.active = FALSE for all other tracks |
The track_info_view
The track_info_view
joins the tracks table with the media, albums, and libraries table so we can filter tracks based on information displayed in each of the columns of the UI.
Column | Description |
---|---|
trackid | The trackid of this track |
mediumid | The mediumid of this track's medium |
number | The track number of this track |
length | The length of this track in seconds |
playcount | The number of timse this track has been played |
laststarted | The UTC timestamp when this track was last started |
lastplayed | The UTC timestamp when this track last finished playback |
title | The title of this track |
artist | The artist string for this track |
filepath | The filepath of this track |
mediumno | The medium number of this track's medium |
medium | The medium name of this track's medium (or "" if name is NULL) |
albumid | The albumid of this track's album |
album | The album name of this track's album (or "" if name is NULL) |
release | The album release date of this track's album |
albumartist | The album artist string of this track's album |
deleting | The deleting status of this track's library |