Steam Music Database

From girlwiki
Revision as of 18:25, 13 July 2023 by Flurry (talk | contribs) (Created page with "{{WIP|Literally any information other than the SQL schema}} Found in <code>$STEAM_HOME/music/_database/musicdatabase_XXXX.db</code>. Not sure what determines the <code>XXXX</code> yet, but mine is <code>0016</code>. <syntaxhighlight lang="sql"> CREATE TABLE localartist ( artistid INTEGER PRIMARY KEY, artistname TEXT, artistsortname TEXT, artistinsertname TEXT ); CREATE INDEX artistid_index ON localartist ( artistid ); CREATE INDEX artistname_index ON lo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Found in $STEAM_HOME/music/_database/musicdatabase_XXXX.db. Not sure what determines the XXXX yet, but mine is 0016.

CREATE TABLE localartist (
    artistid INTEGER PRIMARY KEY,
    artistname TEXT,
    artistsortname TEXT,
    artistinsertname TEXT
);
CREATE INDEX artistid_index ON localartist ( artistid );
CREATE INDEX artistname_index ON localartist ( artistid, artistname );

CREATE TABLE localalbum (
    albumid INTEGER PRIMARY KEY,
    albumdirectory TEXT,
    albumname TEXT,
    artistname TEXT,
    albumsortname TEXT,
    artistsortname TEXT,
    trackcount INTEGER,
    discnumber INTEGER,
    multipleartist INTEGER,
    addedtime INTEGER
);
CREATE INDEX albumid_index ON localalbum( albumid );
CREATE INDEX albumdirectory_index ON localalbum( albumdirectory, albumname, discnumber );

CREATE TABLE localtrack (
    trackid INTEGER PRIMARY KEY,
    trackfile TEXT,
    trackposition INTEGER,
    lasttouchedtime INTEGER,
    trackname TEXT,
    albumname TEXT,
    artistname TEXT,
    albumartist TEXT,
    trackyear INTEGER,
    tracktrack INTEGER,
    lengthinmilliseconds INTEGER,
    bitrate INTEGER,
    samplerate INTEGER,
    channels INTEGER,
    discnumber INTEGER,
    genre TEXT,
    playcount INTEGER,
    lastplayedtime INTEGER,
    trackalbum INTEGER REFERENCES localalbum( albumid ) ON UPDATE CASCADE,
    trackartist INTEGER REFERENCES localartist( artistid ) ON UPDATE CASCADE,
    trackalbumartist INTEGER REFERENCES localartist( artistid ) ON UPDATE CASCADE,
    providescover INTEGER,
    coverurl TEXT
);
CREATE INDEX trackid_index ON localtrack( trackid );
CREATE INDEX trackfile_index ON localtrack( trackfile, trackname, lengthinmilliseconds, lasttouchedtime );

CREATE TABLE localplaylist (
    playlistid INTEGER PRIMARY KEY,
    playlistname TEXT,
    position INTEGER,
    tag TEXT,
    totaltime INTEGER,
    trackcount INTEGER,
    playcount INTEGER,
    lastplayedtime INTEGER
);
CREATE INDEX playlistid_index ON localplaylist( playlistid );
CREATE INDEX playlistname_index ON localplaylist( playlistname );

CREATE TABLE localplaylist_localtrack (
    id INTEGER PRIMARY KEY,
    playlistid INTEGER REFERENCES localplaylist( playlistid ) ON UPDATE CASCADE,
    trackfile TEXT,
    position INTEGER,
    active INTEGER,
    providescover INTEGER
);