these changes were sitting for a while
This commit is contained in:
parent
3763a6b711
commit
87a424494b
@ -41,6 +41,14 @@ function getAvailableFileName(dir, name) {
|
||||
return availableBaseName + ext;
|
||||
}
|
||||
|
||||
function cleanTab(tab_text) {
|
||||
return tab_text
|
||||
.replace(/\[tab\]/g, '')
|
||||
.replace(/\[\/tab\]/g, '')
|
||||
.replace(/\[ch]/g, '')
|
||||
.replace(/\[\/ch\]/g, '');
|
||||
}
|
||||
|
||||
(async () => {
|
||||
// Clear out old output directory
|
||||
await fsExtra.emptyDir('./output/');
|
||||
@ -85,6 +93,7 @@ function getAvailableFileName(dir, name) {
|
||||
, tab_text
|
||||
FROM tabs
|
||||
WHERE tab_text IS NOT NULL
|
||||
ORDER BY rating * votes + votes
|
||||
`, (err, row) => {
|
||||
if (err) throw err;
|
||||
|
||||
@ -93,17 +102,17 @@ function getAvailableFileName(dir, name) {
|
||||
`${row.song_name} [${row.song_id}]: ${row.tab_url}
|
||||
By ${row.artist_name} [${row.artist_id}]: ${row.artist_url}
|
||||
Rating: ${row.rating}, Votes: ${row.votes}
|
||||
Date: ${row.date}
|
||||
Tab By: ${row.username} [${row.user_id}] (${row.user_iq} iq)
|
||||
Last Edit: ${new Date(row.date * 1000).toLocaleString()}${row.version_description ? '\n------------------------------------------------------------------------\n' + row.version_description : ''}
|
||||
------------------------------------------------------------------------
|
||||
${cleanTab(row.tab_text).trim()/* Remove [bbcode]tags[/bbcode] */}
|
||||
------------------------------------------------------------------------
|
||||
Tonality: ${row.tonality_name}
|
||||
Difficulty: ${row.difficulty}
|
||||
Tuning: ${row.tuning}
|
||||
Type: ${row.type_name}
|
||||
Tab By: ${row.username} [${row.user_id}] (${row.user_iq} iq)
|
||||
Verified: ${row.verified}
|
||||
Version ${row.version}
|
||||
${row.version_description || ''}
|
||||
|
||||
${row.tab_text}
|
||||
`;
|
||||
let typeDir = path.join('output', row.type_name ?? 'null');
|
||||
if (!fs.existsSync(typeDir)) {
|
||||
|
Loading…
Reference in New Issue
Block a user