feat: complete rework with postgresql local-first, system audio capture, live search, and real harmonic suggestions
This commit is contained in:
1 parent
f79843d5b6
commit
f854944dc1
1088 files changed
+2119
-198536
No files matched your search
+91
-14
@@ -1,20 +1,97 @@
|
||||
-- Schema for KeySelector and AcousticBrainz data
|
||||
-- Schema for KeySelector with PostgreSQL
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tracks (
|
||||
id SERIAL PRIMARY KEY,
|
||||
mbid VARCHAR(36) UNIQUE NOT NULL, -- MusicBrainz ID
|
||||
title VARCHAR(255),
|
||||
artist VARCHAR(255),
|
||||
camelot_key VARCHAR(3),
|
||||
bpm INTEGER,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
title VARCHAR(255) NOT NULL,
|
||||
artist VARCHAR(255) NOT NULL,
|
||||
camelot_key VARCHAR(5) NOT NULL,
|
||||
bpm INTEGER NOT NULL,
|
||||
music_key VARCHAR(10),
|
||||
cover_url TEXT,
|
||||
preview_url TEXT,
|
||||
tags TEXT[] DEFAULT '{}',
|
||||
is_corrected BOOLEAN DEFAULT FALSE,
|
||||
source VARCHAR(50) DEFAULT 'manual',
|
||||
play_count INTEGER DEFAULT 1,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT unique_track UNIQUE (artist, title)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS track_tags (
|
||||
track_id INTEGER REFERENCES tracks(id),
|
||||
tag VARCHAR(100),
|
||||
PRIMARY KEY (track_id, tag)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_tracks_camelot ON tracks(camelot_key);
|
||||
CREATE INDEX IF NOT EXISTS idx_tracks_bpm ON tracks(bpm);
|
||||
CREATE INDEX IF NOT EXISTS idx_tracks_artist ON tracks(artist);
|
||||
CREATE INDEX IF NOT EXISTS idx_tracks_title ON tracks(title);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_camelot_key ON tracks(camelot_key);
|
||||
CREATE INDEX IF NOT EXISTS idx_bpm ON tracks(bpm);
|
||||
-- Initial curated seed data across all 24 Camelot keys
|
||||
INSERT INTO tracks (artist, title, camelot_key, bpm, music_key, tags, source) VALUES
|
||||
-- 1B & 1A (C-Dur / A-Moll)
|
||||
('Axwell /\\ Ingrosso', 'More Than You Know', '1B', 123, 'C', ARRAY['house', 'edm'], 'seed'),
|
||||
('Avicii', 'The Nights', '1B', 126, 'C', ARRAY['dance', 'melodic'], 'seed'),
|
||||
('Tiësto', 'The Business', '1A', 120, 'Am', ARRAY['deep house', 'bass'], 'seed'),
|
||||
('Meduza', 'Piece Of Your Heart', '1A', 124, 'Am', ARRAY['house', 'electronic'], 'seed'),
|
||||
|
||||
-- 2B & 2A (G-Dur / E-Moll)
|
||||
('Calvin Harris', 'Summer', '2B', 128, 'G', ARRAY['dance', 'summer'], 'seed'),
|
||||
('David Guetta ft. Sia', 'Titanium', '2B', 126, 'G', ARRAY['edm', 'pop'], 'seed'),
|
||||
('Martin Garrix', 'Animals', '2A', 128, 'Em', ARRAY['big room', 'electro'], 'seed'),
|
||||
('Fisher', 'Losing It', '2A', 125, 'Em', ARRAY['tech house', 'club'], 'seed'),
|
||||
|
||||
-- 3B & 3A (D-Dur / H-Moll)
|
||||
('Swedish House Mafia', 'Don''t You Worry Child', '3B', 129, 'D', ARRAY['progressive', 'anthem'], 'seed'),
|
||||
('Alesso', 'Heroes (we could be)', '3B', 126, 'D', ARRAY['edm', 'euphoric'], 'seed'),
|
||||
('ACRAZE', 'Do It To It', '3A', 125, 'Bm', ARRAY['house', 'viral'], 'seed'),
|
||||
('Faithless', 'Insomnia', '3A', 127, 'Bm', ARRAY['classic', 'trance'], 'seed'),
|
||||
|
||||
-- 4B & 4A (A-Dur / F#-Moll)
|
||||
('Daft Punk', 'One More Time', '4B', 123, 'A', ARRAY['french house', 'disco'], 'seed'),
|
||||
('Alphaville', 'Big in Japan', '4B', 118, 'A', ARRAY['80s', 'synth-pop'], 'seed'),
|
||||
('Dua Lipa', 'Don''t Start Now', '4A', 124, 'F#m', ARRAY['nu-disco', 'dance'], 'seed'),
|
||||
('The Weeknd', 'Blinding Lights', '4A', 171, 'F#m', ARRAY['synthwave', '80s'], 'seed'),
|
||||
|
||||
-- 5B & 5A (E-Dur / C#-Moll)
|
||||
('Avicii', 'Wake Me Up', '5B', 124, 'E', ARRAY['folk-dance', 'anthem'], 'seed'),
|
||||
('Otto Knows', 'Million Voices', '5B', 126, 'E', ARRAY['progressive house'], 'seed'),
|
||||
('Fred again..', 'Delilah (pull me out of this)', '5A', 134, 'C#m', ARRAY['electronic', 'club'], 'seed'),
|
||||
('Robin Schulz', 'Sugar', '5A', 123, 'C#m', ARRAY['deep house', 'pop'], 'seed'),
|
||||
|
||||
-- 6B & 6A (H-Dur / G#-Moll)
|
||||
('Galantis', 'Runaway (U & I)', '6B', 126, 'B', ARRAY['electro pop', 'edm'], 'seed'),
|
||||
('Kygo', 'Firestone', '6B', 114, 'B', ARRAY['tropical house'], 'seed'),
|
||||
('CamelPhat & Elderbrook', 'Cola', '6A', 122, 'G#m', ARRAY['tech house', 'deep house'], 'seed'),
|
||||
('Peggy Gou', '(It Goes Like) Nanana', '6A', 130, 'G#m', ARRAY['house', 'summer'], 'seed'),
|
||||
|
||||
-- 7B & 7A (F#-Dur / D#-Moll)
|
||||
('Disclosure ft. Sam Smith', 'Latch', '7B', 122, 'F#', ARRAY['garage', 'house'], 'seed'),
|
||||
('Major Lazer', 'Lean On', '7B', 98, 'F#', ARRAY['dancehall', 'moombahton'], 'seed'),
|
||||
('Eric Prydz', 'Opus', '7A', 126, 'D#m', ARRAY['progressive house', 'masterpiece'], 'seed'),
|
||||
('Darude', 'Sandstorm', '7A', 136, 'D#m', ARRAY['trance', 'classic'], 'seed'),
|
||||
|
||||
-- 8B & 8A (Db-Dur / B-Moll)
|
||||
('Calvin Harris', 'Feel So Close', '8B', 128, 'Db', ARRAY['dance', 'pop'], 'seed'),
|
||||
('Gigi D''Agostino', 'L''Amour Toujours', '8A', 138, 'Bbm', ARRAY['italo dance', 'classic'], 'seed'),
|
||||
('Paul Kalkbrenner', 'Sky and Sand', '8A', 122, 'Bbm', ARRAY['minimal', 'berlin techno'], 'seed'),
|
||||
|
||||
-- 9B & 9A (Ab-Dur / F-Moll)
|
||||
('Clean Bandit', 'Rather Be', '9B', 121, 'Ab', ARRAY['deep house', 'classical crossover'], 'seed'),
|
||||
('Swedish House Mafia', 'One', '9A', 125, 'Fm', ARRAY['electro house', 'classic'], 'seed'),
|
||||
('Alan Walker', 'Faded', '9A', 90, 'Fm', ARRAY['electro', 'melodic'], 'seed'),
|
||||
|
||||
-- 10B & 10A (Eb-Dur / C-Moll)
|
||||
('deadmau5', 'Strobe', '10B', 128, 'Eb', ARRAY['progressive house'], 'seed'),
|
||||
('Bicep', 'Glue', '10B', 130, 'Eb', ARRAY['breakbeat', 'ambient'], 'seed'),
|
||||
('Benny Benassi', 'Satisfaction', '10A', 130, 'Cm', ARRAY['electro house', 'legend'], 'seed'),
|
||||
('Kungs vs Cookin'' on 3 Burners', 'This Girl', '10A', 122, 'Cm', ARRAY['funk house', 'brass'], 'seed'),
|
||||
|
||||
-- 11B & 11A (Bb-Dur / G-Moll)
|
||||
('Modjo', 'Lady (Hear Me Tonight)', '11B', 126, 'Bb', ARRAY['french touch', 'filter house'], 'seed'),
|
||||
('Fatboy Slim', 'Praise You', '11B', 110, 'Bb', ARRAY['big beat', 'breakbeat'], 'seed'),
|
||||
('Robin S', 'Show Me Love', '11A', 120, 'Gm', ARRAY['90s house', 'anthem'], 'seed'),
|
||||
('Robert Miles', 'Children', '11A', 138, 'Gm', ARRAY['dream trance', '90s'], 'seed'),
|
||||
|
||||
-- 12B & 12A (F-Dur / D-Moll)
|
||||
('Shouse', 'Love Tonight', '12B', 123, 'F', ARRAY['indie dance', 'choir'], 'seed'),
|
||||
('Stardust', 'Music Sounds Better With You', '12B', 124, 'F', ARRAY['french house', 'disco'], 'seed'),
|
||||
('Faithless', 'God Is a DJ', '12A', 131, 'Dm', ARRAY['dance anthem', 'classic'], 'seed'),
|
||||
('Paul van Dyk', 'For an Angel', '12A', 138, 'Dm', ARRAY['trance', 'berlin'], 'seed')
|
||||
ON CONFLICT (artist, title) DO NOTHING;
|
||||
Reference in new issue
Block a user