Author Topic: old news? PMM.DB is a sqlite database  (Read 10554 times)

0 Members and 1 Guest are viewing this topic.

Offline Wood

  • Newbie
  • Posts: 2
old news? PMM.DB is a sqlite database
« on: October 28, 2005, 02:22:35 am »
Downloading  http://www.sqlite.org/sqlite-2_8_16.zip allows you to do command line queries.  Copy sqlite.exe to the directory with your PMM.DB and run 'sqllite PMM.DB'

Now, what to do with this?  If you turned off the auto-update tag reader, perhaps you could do updates to fix the Various Artists problem, add music without using PMM.

I'm not sure that the versions are compatible, but I was able to succesfully read my PMM.DB.  I'd backup before trying to write.

.schema, once connected to the DB will return the schema of all of the tables.

Wood

Offline Wood

  • Newbie
  • Posts: 2
Re: old news? PMM.DB is a sqlite database
« Reply #1 on: October 28, 2005, 02:41:11 am »
Talking to myself, but this is probably helpful...

CREATE table albums (
             albumid INTEGER PRIMARY KEY,
             phoneticid integer default 0,
             name TEXT UNIQUE,
             name_sort_as TEXT,
             name_key TEXT,
             name_lower TEXT,
             item_order INTEGER default 0,
             media_count INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE table artists (
             artistid INTEGER PRIMARY KEY,
             phoneticid integer default 0,
             name TEXT UNIQUE,
             name_sort_as TEXT,
             name_key TEXT,
             name_lower TEXT,
             item_order INTEGER default 0,
             media_count INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE TABLE audible_media (
             mediaid INTEGER PRIMARY KEY,
             subscriptionid TEXT,
             publish_date TEXT);

CREATE table db_version (
             version_num INTEGER PRIMARY KEY);

CREATE table devices (
             deviceid INTEGER PRIMARY KEY,
             deviceid_string TEXT UNIQUE,
             name TEXT UNIQUE,
             name_key TEXT,
             status INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE table dirs (
             driveid INTEGER,
             dirid INTEGER PRIMARY KEY,
             name TEXT,
             name_key TEXT,
             name_lower TEXT,
             md5 TEXT,
             status INTEGER,
             field1 TEXT,
             field2 TEXT);

CREATE table drives (
             deviceid INTEGER default 0,
             driveid INTEGER PRIMARY KEY,
             name TEXT,
             name_key TEXT,
             name_lower TEXT,
             volume INTEGER default 0,
             status INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE table genres (
             genreid INTEGER PRIMARY KEY,
             phoneticid integer default 0,
             name TEXT UNIQUE,
             name_sort_as TEXT,
             name_key TEXT,
             name_lower TEXT,
             item_order INTEGER default 0,
             media_count INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE table locale (localeid INTEGER PRIMARY KEY);

CREATE table media (
             mediaid INTEGER PRIMARY KEY,
             artistid INTEGER default 0,
             albumid INTEGER default 0,
             genreid INTEGER default 0,
             playlistid INTEGER default 0,
             dirid INTEGER default 0,
             guid TEXT,
             filename TEXT,
             filename_key TEXT,
             filename_lower TEXT,
             title TEXT,
             title_sort_as TEXT,
             title_key TEXT,
             title_lower TEXT,
             year TEXT,
             comment TEXT,
             comment_key TEXT,
             comment_lower TEXT,
             narrator TEXT,
             coverart TEXT default 'NotFound.jpg',
             bitrate INTEGER default 0,
             bits_per_sample INTEGER default 0,
             frequency INTEGER default 0,
             filesize INTEGER default 0,
             duration INTEGER default 0,
             audio_format INTEGER default 0,
             video_format INTEGER default 100,
             stereo_mode INTEGER default 0,
             track_number INTEGER default 0,
             host_path TEXT,
             playcount INTEGER default 0,
             rating INTEGER default 0,
             status INTEGER default 0,
             sync INTEGER default 0,
             ssa INTEGER default 0,
             vbr INTEGER default 0,
             drm INTEGER default 0,
             last_played TIMESTAMP,
             created TIMESTAMP,
             imported TIMESTAMP,
             phoneticid integer default 0,
             date_modified TIMESTAMP,
             flags INTEGER default 0,
             sections TEXT,
             frame_rate INTEGER default 1,
             frame_width INTEGER default 1,
             frame_height INTEGER default 1,
             cd_toc TEXT,
             field1 TEXT,
             field2 TEXT);

CREATE TABLE phonetics (
             phoneticid INTEGER PRIMARY KEY,
             phrase TEXT,
             hint TEXT,
             field1 TEXT,
             field2 TEXT);

CREATE table playlist_media (
             playlist_mediaid INTEGER PRIMARY KEY,
             playlistid INTEGER default 0,
             mediaid INTEGER default 0,
             status INTEGER default 0,
             sync INTEGER default 0,
             item_order INTEGER default 0,
             date_modified TIMESTAMP,
             name TEXT,
             start_time INTEGER default -1,
             end_time INTEGER default -1,
             flags INTEGER default 0,
             field1 TEXT,
             field2 TEXT);

CREATE table playlists (
             playlistid INTEGER PRIMARY KEY,
             guid TEXT,
             name TEXT,
             name_key TEXT,
             m3u_path TEXT,
             status INTEGER default 0,
             sync INTEGER default 0,
             item_order INTEGER default -1,
             media_count INTEGER default 0,
             date_modified TIMESTAMP,
             dynamic INTEGER default 0,
             resume_enabled INTEGER default 0,
             resume_track INTEGER default 0,
             resume_seconds INTEGER default 0,
             include_in_mag_random INTEGER default 1,
             force_random INTEGER default 0,
             coverart TEXT default 'NotFound.jpg',
             display_pattern TEXT default '$Artist$ - $Title$',
             phoneticid integer default 0,
             flags INTEGER default 0,
             field1 TEXT,
             field2 TEXT,
             content_type INTEGER default 1,
             protected INTEGER default 0,
             package_name TEXT);

CREATE INDEX idx_albums_id ON albums (albumid, name, name_key);
CREATE INDEX idx_albums_item_order ON albums (item_order);
CREATE INDEX idx_albums_name ON albums (name, name_key);
CREATE INDEX idx_artists_id ON artists (artistid, name, name_key);
CREATE INDEX idx_artists_item_order ON artists (item_order);
CREATE INDEX idx_artists_name ON artists (name, name_key);
CREATE INDEX idx_devices_deviceid_string ON devices (deviceid_string);
CREATE INDEX idx_dirs_driveid ON dirs (driveid);
CREATE INDEX idx_dirs_name ON dirs (name, name_key);
CREATE INDEX idx_drives_deviceid ON drives (deviceid);
CREATE INDEX idx_drives_name ON drives (name, name_key);
CREATE INDEX idx_genres_id ON genres (genreid, name, name_key);
CREATE INDEX idx_genres_item_order ON genres (item_order);
CREATE INDEX idx_genres_name ON genres (name, name_key);
CREATE INDEX idx_media_albumid ON media (albumid);
CREATE INDEX idx_media_artistid ON media (artistid);
CREATE INDEX idx_media_big_query ON media (status, artistid, albumid, genreid, dirid);
CREATE INDEX idx_media_dirid ON media (dirid);
CREATE INDEX idx_media_filename ON media (filename);
CREATE INDEX idx_media_genre_query ON media (status, genreid);
CREATE INDEX idx_media_genreid ON media (genreid);
CREATE INDEX idx_media_status ON media (status);
CREATE INDEX idx_playlist_media_playlistid_item_order ON playlist_media (playlistid, item_order);
CREATE INDEX idx_playlist_name ON playlists (name, name_key);
CREATE INDEX idx_subs_productid ON audible_media (subscriptionid);

Offline SteveC

  • Moderator
  • Getting the hang of things.
  • *****
  • Posts: 79
Re: old news? PMM.DB is a sqlite database
« Reply #2 on: October 28, 2005, 02:43:42 pm »
Actually, I think this is pretty useful stuff. Good work.

I've always wanted to rewrite the database generation code to deal with multiple artist and genre tags correctly. Unfortunately, the roadblock is free time, which doesn't seem to be improving any time soon.
« Last Edit: October 28, 2005, 02:44:45 pm by SteveC »