Skip to content

Commit

Permalink
freaking rekordbox man 😐
Browse files Browse the repository at this point in the history
  • Loading branch information
alii committed Feb 27, 2024
1 parent caa1e25 commit 86b06da
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/pages/experiments/rekordbox-history-parser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {useState} from 'react';

export default function RekordboxHistoryParser() {
const [state, setState] = useState('');

const result = state
.split('\n')
.map(l => l.split('\t'))
.slice(1)
.map(l => {
const [, title, artist, album, bpm, time, key] = l as [
string,
string,
string,
string,
string,
string,
string,
];

return {
title,
artist,
album,
bpm,
time,
key,
};
})
.map(l => `${l.title} - ${l.artist}`)
.join('\n');

return (
<div className="flex space-x-4">
<textarea value={state} className="bg-neutral-800" onChange={e => setState(e.target.value)} />

<pre>{result}</pre>
</div>
);
}

0 comments on commit 86b06da

Please sign in to comment.