4625 lines
86 KiB
JavaScript
4625 lines
86 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tracks = db.tracks;
|
|
|
|
const Artists = db.artists;
|
|
|
|
const TrackArtists = db.track_artists;
|
|
|
|
const Platforms = db.platforms;
|
|
|
|
const TrackLinks = db.track_links;
|
|
|
|
const TrackAnalysis = db.track_analysis;
|
|
|
|
const TrackLineageItems = db.track_lineage_items;
|
|
|
|
const SearchSessions = db.search_sessions;
|
|
|
|
const BulkRuns = db.bulk_runs;
|
|
|
|
const BulkRunItems = db.bulk_run_items;
|
|
|
|
const Libraries = db.libraries;
|
|
|
|
const LibraryItems = db.library_items;
|
|
|
|
const SharePayloads = db.share_payloads;
|
|
|
|
const StreamingSyncJobs = db.streaming_sync_jobs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TracksData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Midnight Signal",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"primary_artist_name": "KORA",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"album_name": "Neon District",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_year": 2022,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_date": new Date('2022-09-16T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"isrc": "USQX92200011",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_ms": 215000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content_rating": "unknown",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_source": "itunes",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_external_key": "1567001123",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"universal_link": "https://song.link/i/1567001123",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preview_url": "https://audio-preview.traxlinx.fm/midnight-signal.m4a",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_video_key": "dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_primary_hex": "#0B1020",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_secondary_hex": "#2A2F55",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_accent_hex": "#38BDF8",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Glass Pulse (Extended Mix)",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"primary_artist_name": "Astra Mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"album_name": "Glass Pulse",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_year": 2021,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_date": new Date('2021-05-07T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"isrc": "GBLFP2100042",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_ms": 392000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content_rating": "explicit",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_source": "spotify",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_external_key": "3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"universal_link": "https://song.link/s/3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preview_url": "https://audio-preview.traxlinx.fm/glass-pulse-extended.mp3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_video_key": "kJQP7kiw5Fk",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_primary_hex": "#070A0F",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_secondary_hex": "#1F2937",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_accent_hex": "#A78BFA",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Desert Transit",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"primary_artist_name": "Tamar Azul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"album_name": "Night Drive Tel Aviv",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_year": 2020,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"release_date": new Date('2020-11-20T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"isrc": "ILTA02000007",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"duration_ms": 184000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"content_rating": "clean",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_source": "apple_music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"canonical_external_key": "1499123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"universal_link": "https://song.link/i/1499123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preview_url": "https://audio-preview.traxlinx.fm/desert-transit.m4a",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_video_key": "9bZkp7q19f0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_primary_hex": "#0A0A0A",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_secondary_hex": "#27272A",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"color_accent_hex": "#F97316",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const ArtistsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "KORA",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "Israel",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"genres": "Melodic techno, progressive",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"short_bio": "KORA is an electronic music producer known for polished melodic techno and cinematic arrangements.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wikipedia_url": "https://en.wikipedia.org/wiki/Kora_(musician)",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"official_website_url": "https://kora.example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instagram_url": "https://instagram.com/kora.music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"twitter_url": "https://x.com/koramusic",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_url": "https://youtube.com/@koramusic",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"songkick_url": "https://www.songkick.com/artists/10100001-kora",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_url": "https://musicbrainz.org/artist/8b1f1f1a-1111-4c1a-9c1a-aaaa0000bbbb",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"discogs_url": "https://www.discogs.com/artist/9999001-KORA",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"theaudiodb_key": "112233",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_key": "8b1f1f1a-1111-4c1a-9c1a-aaaa0000bbbb",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Astra Mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "United Kingdom",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"genres": "Tech house, club",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"short_bio": "Astra Mode creates peak-time club records blending crisp percussion with glossy synth hooks.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wikipedia_url": "https://en.wikipedia.org/wiki/Astra_Mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"official_website_url": "https://astramode.example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instagram_url": "https://instagram.com/astramode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"twitter_url": "https://x.com/astramode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_url": "https://youtube.com/@astramode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"songkick_url": "https://www.songkick.com/artists/10100002-astra-mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_url": "https://musicbrainz.org/artist/2c2d2e2f-2222-4b2b-8d2b-bbbb0000cccc",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"discogs_url": "https://www.discogs.com/artist/9999002-Astra-Mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"theaudiodb_key": "223344",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_key": "2c2d2e2f-2222-4b2b-8d2b-bbbb0000cccc",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Tamar Azul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "Israel",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"genres": "Electronica, downtempo",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"short_bio": "Tamar Azul is an electronic artist whose work fuses warm pads, subtle percussion, and desert-inspired textures.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"wikipedia_url": "https://en.wikipedia.org/wiki/Tamar_Azul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"official_website_url": "https://tamarazul.example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instagram_url": "https://instagram.com/tamarazul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"twitter_url": "https://x.com/tamarazul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"youtube_url": "https://youtube.com/@tamarazul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"songkick_url": "https://www.songkick.com/artists/10100003-tamar-azul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_url": "https://musicbrainz.org/artist/3d3e3f40-3333-4c3c-9e3c-cccc0000dddd",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"discogs_url": "https://www.discogs.com/artist/9999003-Tamar-Azul",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"theaudiodb_key": "334455",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musicbrainz_key": "3d3e3f40-3333-4c3c-9e3c-cccc0000dddd",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const TrackArtistsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_role": "writer",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_order": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_display": "KORA",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_role": "remixer",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_order": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_display": "Astra Mode",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_role": "unknown",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_order": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"credit_display": "Tamar Azul",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const PlatformsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Spotify",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"kind": "social",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"domain": "open.spotify.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"brand_color_hex": "#1DB954",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Apple Music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"kind": "streaming",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"domain": "music.apple.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"brand_color_hex": "#FA243C",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 2,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "YouTube",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"kind": "store",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"domain": "youtube.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"brand_color_hex": "#FF0000",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_active": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sort_order": 3,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const TrackLinksData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"url": "https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"external_key": "3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_preserved": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"resolved_at": new Date('2026-03-28T10:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "resolved",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"url": "https://music.apple.com/us/album/midnight-signal/1567001123",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"external_key": "1567001123",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_preserved": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"resolved_at": new Date('2026-03-28T10:05:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "missing",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"external_key": "dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"is_preserved": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"resolved_at": new Date('2026-03-28T10:05:15Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "resolved",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const TrackAnalysisData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"bpm": 124.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musical_key": "C minor",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"energy": 0.78,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"danceability": 0.64,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instrumentalness": 0.72,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"vocalness": 0.12,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"valence": 0.41,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"acousticness": 0.04,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"liveness": 0.09,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analyzed_at": new Date('2026-03-28T10:06:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analysis_source": "spotify",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"bpm": 128.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musical_key": "F minor",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"energy": 0.86,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"danceability": 0.74,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instrumentalness": 0.81,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"vocalness": 0.05,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"valence": 0.52,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"acousticness": 0.02,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"liveness": 0.11,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analyzed_at": new Date('2026-03-20T14:23:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analysis_source": "spotify",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"bpm": 98.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"musical_key": "A minor",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"energy": 0.44,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"danceability": 0.49,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"instrumentalness": 0.63,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"vocalness": 0.18,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"valence": 0.36,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"acousticness": 0.21,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"liveness": 0.08,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analyzed_at": new Date('2026-03-19T12:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"analysis_source": "spotify",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const TrackLineageItemsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lineage_type": "remix_of",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_title": "Night Bus",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_artist_name": "Sable Avenue",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_release_name": "City Loops",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_year": 2004,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_name": "musicbrainz",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_url": "https://musicbrainz.org/recording/11111111-2222-3333-4444-555555555555",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"confidence": 0.62,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Reported as a drum loop sample in community notes.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lineage_type": "covered_by",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_title": "Midnight Signal",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_artist_name": "KORA",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_release_name": "Midnight Signal Remixes",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_year": 2023,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_name": "deezer",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_url": "https://www.deezer.com/track/2222222222",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"confidence": 0.74,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Alternate remix listing found via release group.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lineage_type": "sampled_from",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_title": "Glass Pulse",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_artist_name": "Astra Mode",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_release_name": "Glass Pulse",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"related_year": 2021,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_name": "musicbrainz",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"source_url": "https://musicbrainz.org/recording/66666666-7777-8888-9999-000000000000",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"confidence": 0.81,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Radio edit and extended mix appear as separate recordings.",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SearchSessionsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "soundcloud",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_type": "url",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-28T10:04:50Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-03-28T10:06:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "running",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "apple_music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_type": "url",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-20T14:21:40Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-03-20T14:23:20Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "success",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://music.apple.com/us/album/desert-transit/1499123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_type": "url",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-19T12:09:20Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"completed_at": new Date('2026-03-19T12:10:30Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "partial",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "Some platforms returned no results",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const BulkRunsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Purim Warmup Links",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_text": "https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-27T20:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-27T20:02:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "failed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total_inputs": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_count": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"success_count": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_count": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Label A Audit",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_text": "https://music.apple.com/us/album/afterhours-architect/1670019988 https://soundcloud.com/lumenfield/circuit-bloom",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-26T15:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-26T15:04:30Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "cancelled",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total_inputs": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_count": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"success_count": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_count": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "WhatsApp Group Batch",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_text": "https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb https://music.apple.com/us/album/desert-transit/1499123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"started_at": new Date('2026-03-25T09:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-25T09:31:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total_inputs": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_count": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"success_count": 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_count": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const BulkRunItemsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "soundcloud",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "failed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_at": new Date('2026-03-27T20:01:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "soundcloud",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "skipped",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_at": new Date('2026-03-27T20:01:40Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_url": "https://open.spotify.com/track/7GhIk7Il098yCjg4BQjzvb",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"input_platform": "other",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "running",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "Track not found on resolver",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"processed_at": new Date('2026-03-25T09:30:30Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const LibrariesData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "DJ Set Candidates",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "private",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_slug": "dj-set-candidates-yael",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Shortlist for upcoming club set and radio mix.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Production References",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "public",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_slug": "production-references-omer",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Tracks to reference for mixdowns, arrangement, and sound design.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"name": "Team QA Playlist",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"visibility": "private",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_slug": "team-qa-playlist",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Internal list used for regression testing and link validation.",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const LibraryItemsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"saved_at": new Date('2026-03-28T10:07:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"save_reason": "later",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Strong opener energy and clean breakdown.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"saved_at": new Date('2026-03-28T10:08:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"save_reason": "research",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Extended mix works well at 128 BPM.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"saved_at": new Date('2026-03-19T12:11:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"save_reason": "dj_set",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"note": "Great texture layering and space usage.",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SharePayloadsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"channel": "copy",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"format": "compact",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_text": "Midnight Signal - KORA https://song.link/i/1567001123",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"shared_at": new Date('2026-03-28T10:09:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"channel": "whatsapp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"format": "detailed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_text": "Glass Pulse (Extended Mix) - Astra Mode Spotify https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp Apple Music https://song.link/s/3n3Ppam7vgaVa1iaRUc9Lp",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"shared_at": new Date('2026-03-26T15:05:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"channel": "native",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"format": "compact",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"share_text": "Desert Transit - Tamar Azul https://song.link/i/1499123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"shared_at": new Date('2026-03-19T12:12:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const StreamingSyncJobsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_service": "apple_music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_name": "TRAXLINX DJ Set Candidates",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_url": "https://open.spotify.com/playlist/37i9dQZF1DX0XUsuxWHRQd",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"queued_at": new Date('2026-03-28T10:12:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-28T10:13:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_service": "apple_music",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_name": "Production References",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_url": "https://music.apple.com/us/playlist/production-references/pl.u-1234567890",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "failed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"queued_at": new Date('2026-03-26T15:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-26T15:10:30Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "None",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_service": "spotify",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_name": "QA Regression Tracks",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"target_playlist_url": "https://open.spotify.com/playlist/0QARegress123456",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "failed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"queued_at": new Date('2026-03-25T09:35:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"finished_at": new Date('2026-03-25T09:36:10Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"error_message": "Token expired during sync",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateTrackArtistWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackArtist0 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackArtist0?.setTrack)
|
|
{
|
|
await
|
|
TrackArtist0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackArtist1 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackArtist1?.setTrack)
|
|
{
|
|
await
|
|
TrackArtist1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackArtist2 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackArtist2?.setTrack)
|
|
{
|
|
await
|
|
TrackArtist2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateTrackArtistWithArtist() {
|
|
|
|
const relatedArtist0 = await Artists.findOne({
|
|
offset: Math.floor(Math.random() * (await Artists.count())),
|
|
});
|
|
const TrackArtist0 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackArtist0?.setArtist)
|
|
{
|
|
await
|
|
TrackArtist0.
|
|
setArtist(relatedArtist0);
|
|
}
|
|
|
|
const relatedArtist1 = await Artists.findOne({
|
|
offset: Math.floor(Math.random() * (await Artists.count())),
|
|
});
|
|
const TrackArtist1 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackArtist1?.setArtist)
|
|
{
|
|
await
|
|
TrackArtist1.
|
|
setArtist(relatedArtist1);
|
|
}
|
|
|
|
const relatedArtist2 = await Artists.findOne({
|
|
offset: Math.floor(Math.random() * (await Artists.count())),
|
|
});
|
|
const TrackArtist2 = await TrackArtists.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackArtist2?.setArtist)
|
|
{
|
|
await
|
|
TrackArtist2.
|
|
setArtist(relatedArtist2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateTrackLinkWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLink0 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackLink0?.setTrack)
|
|
{
|
|
await
|
|
TrackLink0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLink1 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackLink1?.setTrack)
|
|
{
|
|
await
|
|
TrackLink1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLink2 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackLink2?.setTrack)
|
|
{
|
|
await
|
|
TrackLink2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateTrackLinkWithPlatform() {
|
|
|
|
const relatedPlatform0 = await Platforms.findOne({
|
|
offset: Math.floor(Math.random() * (await Platforms.count())),
|
|
});
|
|
const TrackLink0 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackLink0?.setPlatform)
|
|
{
|
|
await
|
|
TrackLink0.
|
|
setPlatform(relatedPlatform0);
|
|
}
|
|
|
|
const relatedPlatform1 = await Platforms.findOne({
|
|
offset: Math.floor(Math.random() * (await Platforms.count())),
|
|
});
|
|
const TrackLink1 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackLink1?.setPlatform)
|
|
{
|
|
await
|
|
TrackLink1.
|
|
setPlatform(relatedPlatform1);
|
|
}
|
|
|
|
const relatedPlatform2 = await Platforms.findOne({
|
|
offset: Math.floor(Math.random() * (await Platforms.count())),
|
|
});
|
|
const TrackLink2 = await TrackLinks.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackLink2?.setPlatform)
|
|
{
|
|
await
|
|
TrackLink2.
|
|
setPlatform(relatedPlatform2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateTrackAnalysiWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackAnalysi0 = await TrackAnalysis.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackAnalysi0?.setTrack)
|
|
{
|
|
await
|
|
TrackAnalysi0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackAnalysi1 = await TrackAnalysis.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackAnalysi1?.setTrack)
|
|
{
|
|
await
|
|
TrackAnalysi1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackAnalysi2 = await TrackAnalysis.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackAnalysi2?.setTrack)
|
|
{
|
|
await
|
|
TrackAnalysi2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateTrackLineageItemWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLineageItem0 = await TrackLineageItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (TrackLineageItem0?.setTrack)
|
|
{
|
|
await
|
|
TrackLineageItem0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLineageItem1 = await TrackLineageItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (TrackLineageItem1?.setTrack)
|
|
{
|
|
await
|
|
TrackLineageItem1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const TrackLineageItem2 = await TrackLineageItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (TrackLineageItem2?.setTrack)
|
|
{
|
|
await
|
|
TrackLineageItem2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSearchSessionWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SearchSession0 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SearchSession0?.setUser)
|
|
{
|
|
await
|
|
SearchSession0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SearchSession1 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SearchSession1?.setUser)
|
|
{
|
|
await
|
|
SearchSession1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SearchSession2 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SearchSession2?.setUser)
|
|
{
|
|
await
|
|
SearchSession2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSearchSessionWithResolved_track() {
|
|
|
|
const relatedResolved_track0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SearchSession0 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SearchSession0?.setResolved_track)
|
|
{
|
|
await
|
|
SearchSession0.
|
|
setResolved_track(relatedResolved_track0);
|
|
}
|
|
|
|
const relatedResolved_track1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SearchSession1 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SearchSession1?.setResolved_track)
|
|
{
|
|
await
|
|
SearchSession1.
|
|
setResolved_track(relatedResolved_track1);
|
|
}
|
|
|
|
const relatedResolved_track2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SearchSession2 = await SearchSessions.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SearchSession2?.setResolved_track)
|
|
{
|
|
await
|
|
SearchSession2.
|
|
setResolved_track(relatedResolved_track2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateBulkRunWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const BulkRun0 = await BulkRuns.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (BulkRun0?.setUser)
|
|
{
|
|
await
|
|
BulkRun0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const BulkRun1 = await BulkRuns.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (BulkRun1?.setUser)
|
|
{
|
|
await
|
|
BulkRun1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const BulkRun2 = await BulkRuns.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (BulkRun2?.setUser)
|
|
{
|
|
await
|
|
BulkRun2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateBulkRunItemWithBulk_run() {
|
|
|
|
const relatedBulk_run0 = await BulkRuns.findOne({
|
|
offset: Math.floor(Math.random() * (await BulkRuns.count())),
|
|
});
|
|
const BulkRunItem0 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (BulkRunItem0?.setBulk_run)
|
|
{
|
|
await
|
|
BulkRunItem0.
|
|
setBulk_run(relatedBulk_run0);
|
|
}
|
|
|
|
const relatedBulk_run1 = await BulkRuns.findOne({
|
|
offset: Math.floor(Math.random() * (await BulkRuns.count())),
|
|
});
|
|
const BulkRunItem1 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (BulkRunItem1?.setBulk_run)
|
|
{
|
|
await
|
|
BulkRunItem1.
|
|
setBulk_run(relatedBulk_run1);
|
|
}
|
|
|
|
const relatedBulk_run2 = await BulkRuns.findOne({
|
|
offset: Math.floor(Math.random() * (await BulkRuns.count())),
|
|
});
|
|
const BulkRunItem2 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (BulkRunItem2?.setBulk_run)
|
|
{
|
|
await
|
|
BulkRunItem2.
|
|
setBulk_run(relatedBulk_run2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateBulkRunItemWithResolved_track() {
|
|
|
|
const relatedResolved_track0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const BulkRunItem0 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (BulkRunItem0?.setResolved_track)
|
|
{
|
|
await
|
|
BulkRunItem0.
|
|
setResolved_track(relatedResolved_track0);
|
|
}
|
|
|
|
const relatedResolved_track1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const BulkRunItem1 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (BulkRunItem1?.setResolved_track)
|
|
{
|
|
await
|
|
BulkRunItem1.
|
|
setResolved_track(relatedResolved_track1);
|
|
}
|
|
|
|
const relatedResolved_track2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const BulkRunItem2 = await BulkRunItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (BulkRunItem2?.setResolved_track)
|
|
{
|
|
await
|
|
BulkRunItem2.
|
|
setResolved_track(relatedResolved_track2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateLibraryWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Library0 = await Libraries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Library0?.setUser)
|
|
{
|
|
await
|
|
Library0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Library1 = await Libraries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Library1?.setUser)
|
|
{
|
|
await
|
|
Library1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Library2 = await Libraries.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Library2?.setUser)
|
|
{
|
|
await
|
|
Library2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateLibraryItemWithLibrary() {
|
|
|
|
const relatedLibrary0 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const LibraryItem0 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (LibraryItem0?.setLibrary)
|
|
{
|
|
await
|
|
LibraryItem0.
|
|
setLibrary(relatedLibrary0);
|
|
}
|
|
|
|
const relatedLibrary1 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const LibraryItem1 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (LibraryItem1?.setLibrary)
|
|
{
|
|
await
|
|
LibraryItem1.
|
|
setLibrary(relatedLibrary1);
|
|
}
|
|
|
|
const relatedLibrary2 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const LibraryItem2 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (LibraryItem2?.setLibrary)
|
|
{
|
|
await
|
|
LibraryItem2.
|
|
setLibrary(relatedLibrary2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateLibraryItemWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const LibraryItem0 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (LibraryItem0?.setTrack)
|
|
{
|
|
await
|
|
LibraryItem0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const LibraryItem1 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (LibraryItem1?.setTrack)
|
|
{
|
|
await
|
|
LibraryItem1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const LibraryItem2 = await LibraryItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (LibraryItem2?.setTrack)
|
|
{
|
|
await
|
|
LibraryItem2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateSharePayloadWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SharePayload0 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SharePayload0?.setUser)
|
|
{
|
|
await
|
|
SharePayload0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SharePayload1 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SharePayload1?.setUser)
|
|
{
|
|
await
|
|
SharePayload1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const SharePayload2 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SharePayload2?.setUser)
|
|
{
|
|
await
|
|
SharePayload2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateSharePayloadWithTrack() {
|
|
|
|
const relatedTrack0 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SharePayload0 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (SharePayload0?.setTrack)
|
|
{
|
|
await
|
|
SharePayload0.
|
|
setTrack(relatedTrack0);
|
|
}
|
|
|
|
const relatedTrack1 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SharePayload1 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (SharePayload1?.setTrack)
|
|
{
|
|
await
|
|
SharePayload1.
|
|
setTrack(relatedTrack1);
|
|
}
|
|
|
|
const relatedTrack2 = await Tracks.findOne({
|
|
offset: Math.floor(Math.random() * (await Tracks.count())),
|
|
});
|
|
const SharePayload2 = await SharePayloads.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (SharePayload2?.setTrack)
|
|
{
|
|
await
|
|
SharePayload2.
|
|
setTrack(relatedTrack2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateStreamingSyncJobWithUser() {
|
|
|
|
const relatedUser0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const StreamingSyncJob0 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (StreamingSyncJob0?.setUser)
|
|
{
|
|
await
|
|
StreamingSyncJob0.
|
|
setUser(relatedUser0);
|
|
}
|
|
|
|
const relatedUser1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const StreamingSyncJob1 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (StreamingSyncJob1?.setUser)
|
|
{
|
|
await
|
|
StreamingSyncJob1.
|
|
setUser(relatedUser1);
|
|
}
|
|
|
|
const relatedUser2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const StreamingSyncJob2 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (StreamingSyncJob2?.setUser)
|
|
{
|
|
await
|
|
StreamingSyncJob2.
|
|
setUser(relatedUser2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateStreamingSyncJobWithLibrary() {
|
|
|
|
const relatedLibrary0 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const StreamingSyncJob0 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (StreamingSyncJob0?.setLibrary)
|
|
{
|
|
await
|
|
StreamingSyncJob0.
|
|
setLibrary(relatedLibrary0);
|
|
}
|
|
|
|
const relatedLibrary1 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const StreamingSyncJob1 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (StreamingSyncJob1?.setLibrary)
|
|
{
|
|
await
|
|
StreamingSyncJob1.
|
|
setLibrary(relatedLibrary1);
|
|
}
|
|
|
|
const relatedLibrary2 = await Libraries.findOne({
|
|
offset: Math.floor(Math.random() * (await Libraries.count())),
|
|
});
|
|
const StreamingSyncJob2 = await StreamingSyncJobs.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (StreamingSyncJob2?.setLibrary)
|
|
{
|
|
await
|
|
StreamingSyncJob2.
|
|
setLibrary(relatedLibrary2);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Tracks.bulkCreate(TracksData);
|
|
|
|
|
|
|
|
|
|
await Artists.bulkCreate(ArtistsData);
|
|
|
|
|
|
|
|
|
|
await TrackArtists.bulkCreate(TrackArtistsData);
|
|
|
|
|
|
|
|
|
|
await Platforms.bulkCreate(PlatformsData);
|
|
|
|
|
|
|
|
|
|
await TrackLinks.bulkCreate(TrackLinksData);
|
|
|
|
|
|
|
|
|
|
await TrackAnalysis.bulkCreate(TrackAnalysisData);
|
|
|
|
|
|
|
|
|
|
await TrackLineageItems.bulkCreate(TrackLineageItemsData);
|
|
|
|
|
|
|
|
|
|
await SearchSessions.bulkCreate(SearchSessionsData);
|
|
|
|
|
|
|
|
|
|
await BulkRuns.bulkCreate(BulkRunsData);
|
|
|
|
|
|
|
|
|
|
await BulkRunItems.bulkCreate(BulkRunItemsData);
|
|
|
|
|
|
|
|
|
|
await Libraries.bulkCreate(LibrariesData);
|
|
|
|
|
|
|
|
|
|
await LibraryItems.bulkCreate(LibraryItemsData);
|
|
|
|
|
|
|
|
|
|
await SharePayloads.bulkCreate(SharePayloadsData);
|
|
|
|
|
|
|
|
|
|
await StreamingSyncJobs.bulkCreate(StreamingSyncJobsData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateTrackArtistWithTrack(),
|
|
|
|
|
|
|
|
|
|
await associateTrackArtistWithArtist(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateTrackLinkWithTrack(),
|
|
|
|
|
|
|
|
|
|
await associateTrackLinkWithPlatform(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateTrackAnalysiWithTrack(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateTrackLineageItemWithTrack(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSearchSessionWithUser(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSearchSessionWithResolved_track(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateBulkRunWithUser(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateBulkRunItemWithBulk_run(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateBulkRunItemWithResolved_track(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateLibraryWithUser(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateLibraryItemWithLibrary(),
|
|
|
|
|
|
|
|
|
|
await associateLibraryItemWithTrack(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateSharePayloadWithUser(),
|
|
|
|
|
|
|
|
|
|
await associateSharePayloadWithTrack(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateStreamingSyncJobWithUser(),
|
|
|
|
|
|
|
|
|
|
await associateStreamingSyncJobWithLibrary(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('tracks', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('artists', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('track_artists', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('platforms', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('track_links', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('track_analysis', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('track_lineage_items', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('search_sessions', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('bulk_runs', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('bulk_run_items', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('libraries', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('library_items', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('share_payloads', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('streaming_sync_jobs', null, {});
|
|
|
|
|
|
},
|
|
}; |