This commit is contained in:
Chocobozzz 2020-07-30 14:54:31 +02:00 committed by Chocobozzz
parent 7abb5c5da1
commit f0af38e696
6 changed files with 135 additions and 130 deletions

View File

@ -14,7 +14,7 @@ initDatabaseModels(true)
console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME) console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME)
const STORAGE = CONFIG.STORAGE const STORAGE = CONFIG.STORAGE
Promise.mapSeries(Object.keys(STORAGE), storage => { return Promise.mapSeries(Object.keys(STORAGE), storage => {
const storageDir = STORAGE[storage] const storageDir = STORAGE[storage]
return new Promise((res, rej) => { return new Promise((res, rej) => {
@ -28,3 +28,7 @@ initDatabaseModels(true)
}) })
.then(() => process.exit(0)) .then(() => process.exit(0))
}) })
.catch(err => {
console.error(err)
process.exit(-1)
})

View File

@ -1,10 +1,6 @@
import { registerTSPaths } from '../server/helpers/register-ts-paths' import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths() registerTSPaths()
import { doRequest } from '../server/helpers/requests'
import { readFileSync } from 'fs-extra'
import { uniqBy } from 'lodash'
import { execCLI } from '@shared/extra-utils' import { execCLI } from '@shared/extra-utils'
run() run()
@ -50,124 +46,124 @@ async function getGitContributors () {
// Zanata is dead, don't loose the contributors name // Zanata is dead, don't loose the contributors name
function getZanataContributors () { function getZanataContributors () {
return [ { 'username': 'abdhessuk', 'name': 'Abd Hessuk' }, { 'username': 'abidin24', 'name': 'abidin toumi' }, { return [ { username: 'abdhessuk', name: 'Abd Hessuk' }, { username: 'abidin24', name: 'abidin toumi' }, {
'username': 'aditoo', username: 'aditoo',
'name': 'Lorem Ipsum' name: 'Lorem Ipsum'
}, { 'username': 'alice', 'name': 'Alice' }, { 'username': 'anastasia', 'name': 'Anastasia' }, { }, { username: 'alice', name: 'Alice' }, { username: 'anastasia', name: 'Anastasia' }, {
'username': 'autom', username: 'autom',
'name': 'Filip Bengtsson' name: 'Filip Bengtsson'
}, { 'username': 'balaji', 'name': 'Balaji' }, { 'username': 'bristow', 'name': 'Cédric F.' }, { }, { username: 'balaji', name: 'Balaji' }, { username: 'bristow', name: 'Cédric F.' }, {
'username': 'butterflyoffire', username: 'butterflyoffire',
'name': 'ButterflyOfFire' name: 'ButterflyOfFire'
}, { 'username': 'chocobozzz', 'name': 'Chocobozzz' }, { 'username': 'claichou', 'name': 'Claire Mohin' }, { }, { username: 'chocobozzz', name: 'Chocobozzz' }, { username: 'claichou', name: 'Claire Mohin' }, {
'username': 'degrange', username: 'degrange',
'name': 'Degrange Mathieu' name: 'Degrange Mathieu'
}, { 'username': 'dibek', 'name': 'Giuseppe Di Bella' }, { 'username': 'edu', 'name': 'eduardo' }, { }, { username: 'dibek', name: 'Giuseppe Di Bella' }, { username: 'edu', name: 'eduardo' }, {
'username': 'ehsaan', username: 'ehsaan',
'name': 'ehsaan' name: 'ehsaan'
}, { 'username': 'esoforte', 'name': 'Ondřej Kotas' }, { 'username': 'fkohrt', 'name': 'Florian Kohrt' }, { }, { username: 'esoforte', name: 'Ondřej Kotas' }, { username: 'fkohrt', name: 'Florian Kohrt' }, {
'username': 'giqtaqisi', username: 'giqtaqisi',
'name': 'Ian Townsend' name: 'Ian Townsend'
}, { 'username': 'goofy', 'name': 'goofy' }, { 'username': 'gorkaazk', 'name': 'Gorka Azkarate Zubiaur' }, { }, { username: 'goofy', name: 'goofy' }, { username: 'gorkaazk', name: 'Gorka Azkarate Zubiaur' }, {
'username': 'gwendald', username: 'gwendald',
'name': 'GwendalD' name: 'GwendalD'
}, { 'username': 'h3zjp', 'name': 'h3zjp' }, { 'username': 'jfblanc', 'name': 'Joan Francés Blanc' }, { }, { username: 'h3zjp', name: 'h3zjp' }, { username: 'jfblanc', name: 'Joan Francés Blanc' }, {
'username': 'jhertel', username: 'jhertel',
'name': 'Jean Hertel' name: 'Jean Hertel'
}, { 'username': 'jmf', 'name': 'Jan-Michael Franz' }, { 'username': 'jorropo', 'name': 'Jorropo' }, { }, { username: 'jmf', name: 'Jan-Michael Franz' }, { username: 'jorropo', name: 'Jorropo' }, {
'username': 'kairozen', username: 'kairozen',
'name': 'Geoffrey Baudelet' name: 'Geoffrey Baudelet'
}, { 'username': 'kedemferre', 'name': 'Kédem Ferré' }, { 'username': 'kousha', 'name': 'Kousha Zanjani' }, { }, { username: 'kedemferre', name: 'Kédem Ferré' }, { username: 'kousha', name: 'Kousha Zanjani' }, {
'username': 'krkk', username: 'krkk',
'name': 'Karol Kosek' name: 'Karol Kosek'
}, { 'username': 'landrok', 'name': 'Landrok' }, { 'username': 'leeroyepold48', 'name': 'Leeroy Epold' }, { }, { username: 'landrok', name: 'Landrok' }, { username: 'leeroyepold48', name: 'Leeroy Epold' }, {
'username': 'm4sk1n', username: 'm4sk1n',
'name': 'marcin mikołajczak' name: 'marcin mikołajczak'
}, { 'username': 'matograine', 'name': 'tom ngr' }, { 'username': 'medow', 'name': 'Mahir Ahmed' }, { }, { username: 'matograine', name: 'tom ngr' }, { username: 'medow', name: 'Mahir Ahmed' }, {
'username': 'mhu', username: 'mhu',
'name': 'Max Hübner' name: 'Max Hübner'
}, { 'username': 'midgard', 'name': 'Midgard' }, { 'username': 'nbrucy', 'name': 'N. B.' }, { }, { username: 'midgard', name: 'Midgard' }, { username: 'nbrucy', name: 'N. B.' }, {
'username': 'nitai', username: 'nitai',
'name': 'nitai bezerra' name: 'nitai bezerra'
}, { 'username': 'noncommutativegeo', 'name': 'Andrea Panontin' }, { 'username': 'nopsidy', 'name': 'McFlat' }, { }, { username: 'noncommutativegeo', name: 'Andrea Panontin' }, { username: 'nopsidy', name: 'McFlat' }, {
'username': 'nvivant', username: 'nvivant',
'name': 'Nicolas Vivant' name: 'Nicolas Vivant'
}, { 'username': 'osoitz', 'name': 'Osoitz' }, { 'username': 'outloudvi', 'name': 'Outvi V' }, { }, { username: 'osoitz', name: 'Osoitz' }, { username: 'outloudvi', name: 'Outvi V' }, {
'username': 'quentin', username: 'quentin',
'name': 'Quentí' name: 'Quentí'
}, { 'username': 'quentind', 'name': 'Quentin Dupont' }, { 'username': 'rafaelff', 'name': 'Rafael Fontenelle' }, { }, { username: 'quentind', name: 'Quentin Dupont' }, { username: 'rafaelff', name: 'Rafael Fontenelle' }, {
'username': 'rigelk', username: 'rigelk',
'name': 'Rigel Kent' name: 'Rigel Kent'
}, { 'username': 's8321414', 'name': 'Jeff Huang' }, { 'username': 'sato_ss', 'name': 'Satoshi Shirosaka' }, { }, { username: 's8321414', name: 'Jeff Huang' }, { username: 'sato_ss', name: 'Satoshi Shirosaka' }, {
'username': 'sercom_kc', username: 'sercom_kc',
'name': 'SerCom_KC' name: 'SerCom_KC'
}, { 'username': 'severo', 'name': 'Sylvain Lesage' }, { 'username': 'silkevicious', 'name': 'Sylke Vicious' }, { }, { username: 'severo', name: 'Sylvain Lesage' }, { username: 'silkevicious', name: 'Sylke Vicious' }, {
'username': 'sosha', username: 'sosha',
'name': 'Sosha' name: 'Sosha'
}, { 'username': 'spla', 'name': 'spla' }, { 'username': 'strubbl', 'name': 'Sven' }, { }, { username: 'spla', name: 'spla' }, { username: 'strubbl', name: 'Sven' }, {
'username': 'swedneck', username: 'swedneck',
'name': 'Tim Stahel' name: 'Tim Stahel'
}, { 'username': 'tagomago', 'name': 'Tagomago' }, { 'username': 'talone', 'name': 'TitiAlone' }, { }, { username: 'tagomago', name: 'Tagomago' }, { username: 'talone', name: 'TitiAlone' }, {
'username': 'thibaultmartin', username: 'thibaultmartin',
'name': 'Thibault Martin' name: 'Thibault Martin'
}, { 'username': 'tirifto', 'name': 'Tirifto' }, { 'username': 'tuxayo', 'name': 'Victor Grousset/tuxayo' }, { }, { username: 'tirifto', name: 'Tirifto' }, { username: 'tuxayo', name: 'Victor Grousset/tuxayo' }, {
'username': 'unextro', username: 'unextro',
'name': 'Ondřej Pokorný' name: 'Ondřej Pokorný'
}, { 'username': 'unzarida', 'name': 'unzarida' }, { 'username': 'vincent', 'name': 'Vincent Laporte' }, { }, { username: 'unzarida', name: 'unzarida' }, { username: 'vincent', name: 'Vincent Laporte' }, {
'username': 'wanhua', username: 'wanhua',
'name': 'wanhua' name: 'wanhua'
}, { 'username': 'xinayder', 'name': 'Alexandre' }, { 'username': 'xosem', 'name': 'Xosé M.' }, { }, { username: 'xinayder', name: 'Alexandre' }, { username: 'xosem', name: 'Xosé M.' }, {
'username': 'zveryok', username: 'zveryok',
'name': 'Nikitin Stanislav' name: 'Nikitin Stanislav'
}, { 'username': '6543', 'name': '6543' }, { 'username': 'aasami', 'name': 'Miroslav Ďurian' }, { }, { username: '6543', name: '6543' }, { username: 'aasami', name: 'Miroslav Ďurian' }, {
'username': 'alidemirtas', username: 'alidemirtas',
'name': 'Ali Demirtas' name: 'Ali Demirtas'
}, { 'username': 'alpha', 'name': 'Alpha' }, { 'username': 'ariasuni', 'name': 'Mélanie Chauvel' }, { }, { username: 'alpha', name: 'Alpha' }, { username: 'ariasuni', name: 'Mélanie Chauvel' }, {
'username': 'bfonton', username: 'bfonton',
'name': 'Baptiste Fonton' name: 'Baptiste Fonton'
}, { 'username': 'c0dr', 'name': 'c0dr lnx' }, { 'username': 'canony', 'name': 'canony' }, { }, { username: 'c0dr', name: 'c0dr lnx' }, { username: 'canony', name: 'canony' }, {
'username': 'cat', username: 'cat',
'name': 'Cat' name: 'Cat'
}, { 'username': 'clerie', 'name': 'Clemens Riese' }, { 'username': 'curupira', 'name': 'Curupira' }, { }, { username: 'clerie', name: 'Clemens Riese' }, { username: 'curupira', name: 'Curupira' }, {
'username': 'dhsets', username: 'dhsets',
'name': 'djsets' name: 'djsets'
}, { 'username': 'digitalkiller', 'name': 'Digital Killer' }, { 'username': 'dwsage', 'name': 'd.w. sage' }, { }, { username: 'digitalkiller', name: 'Digital Killer' }, { username: 'dwsage', name: 'd.w. sage' }, {
'username': 'flauta', username: 'flauta',
'name': 'Andrea Primiani' name: 'Andrea Primiani'
}, { 'username': 'frankstrater', 'name': 'Frank Sträter' }, { 'username': 'gillux', 'name': 'gillux' }, { }, { username: 'frankstrater', name: 'Frank Sträter' }, { username: 'gillux', name: 'gillux' }, {
'username': 'gunchleoc', username: 'gunchleoc',
'name': 'GunChleoc' name: 'GunChleoc'
}, { 'username': 'jaidedtd', 'name': 'Jenga Phoenix' }, { 'username': 'joss2lyon', 'name': 'Josselin' }, { }, { username: 'jaidedtd', name: 'Jenga Phoenix' }, { username: 'joss2lyon', name: 'Josselin' }, {
'username': 'kekkotranslates', username: 'kekkotranslates',
'name': 'Francesco' name: 'Francesco'
}, { 'username': 'kingu', 'name': 'Allan Nordhøy' }, { 'username': 'kittybecca', 'name': 'Rivka bat Tsvi' }, { }, { username: 'kingu', name: 'Allan Nordhøy' }, { username: 'kittybecca', name: 'Rivka bat Tsvi' }, {
'username': 'knuxify', username: 'knuxify',
'name': 'knuxify' name: 'knuxify'
}, { 'username': 'lapor', 'name': 'Kristijan Tkalec' }, { 'username': 'laufor', 'name': 'Lau For' }, { }, { username: 'lapor', name: 'Kristijan Tkalec' }, { username: 'laufor', name: 'Lau For' }, {
'username': 'lstamellos', username: 'lstamellos',
'name': 'Loukas Stamellos' name: 'Loukas Stamellos'
}, { 'username': 'lw1', 'name': 'Lukas Winkler' }, { 'username': 'mablr', 'name': 'Mablr' }, { }, { username: 'lw1', name: 'Lukas Winkler' }, { username: 'mablr', name: 'Mablr' }, {
'username': 'marcinmalecki', username: 'marcinmalecki',
'name': 'Marcin Małecki' name: 'Marcin Małecki'
}, { 'username': 'mayana', 'name': 'Mayana' }, { 'username': 'mikeorlov', 'name': 'Michael Orlov' }, { }, { username: 'mayana', name: 'Mayana' }, { username: 'mikeorlov', name: 'Michael Orlov' }, {
'username': 'nin', username: 'nin',
'name': 'nz' name: 'nz'
}, { 'username': 'norbipeti', 'name': 'NorbiPeti' }, { 'username': 'ppnplus', 'name': 'Phongpanot Phairat' }, { }, { username: 'norbipeti', name: 'NorbiPeti' }, { username: 'ppnplus', name: 'Phongpanot Phairat' }, {
'username': 'predatorix', username: 'predatorix',
'name': 'Predatorix' name: 'Predatorix'
}, { 'username': 'robin', 'name': 'Robin Lahtinen' }, { 'username': 'rond', 'name': 'rondnelly nunes' }, { }, { username: 'robin', name: 'Robin Lahtinen' }, { username: 'rond', name: 'rondnelly nunes' }, {
'username': 'secreet', username: 'secreet',
'name': 'Secreet' name: 'Secreet'
}, { 'username': 'sftblw', 'name': 'sftblw' }, { 'username': 'sporiff', 'name': 'Ciarán Ainsworth' }, { }, { username: 'sftblw', name: 'sftblw' }, { username: 'sporiff', name: 'Ciarán Ainsworth' }, {
'username': 'tekuteku', username: 'tekuteku',
'name': 'tekuteku' name: 'tekuteku'
}, { 'username': 'thecatjustmeow', 'name': 'Nguyen Huynh Hung' }, { 'username': 'tmota', 'name': 'Tiago Mota' }, { }, { username: 'thecatjustmeow', name: 'Nguyen Huynh Hung' }, { username: 'tmota', name: 'Tiago Mota' }, {
'username': 'uranix', username: 'uranix',
'name': 'Michal Mauser' name: 'Michal Mauser'
}, { 'username': 'wakutiteo', 'name': 'Markel' }, { }, { username: 'wakutiteo', name: 'Markel' }, {
'username': 'wonderingdane', username: 'wonderingdane',
'name': 'Nicolai Ireneo-Larsen' name: 'Nicolai Ireneo-Larsen'
}, { 'username': 'zeynepeliacik', 'name': 'Zeynep Can' } ] }, { username: 'zeynepeliacik', name: 'Zeynep Can' } ]
} }
function getContributorsBlacklist () { function getContributorsBlacklist () {

View File

@ -50,18 +50,18 @@ values(VIDEO_CATEGORIES)
'Sorry', 'Sorry',
'This video is not available because the remote instance is not responding.' 'This video is not available because the remote instance is not responding.'
]) ])
.forEach(v => serverKeys[v] = v) .forEach(v => { serverKeys[v] = v })
// More keys // More keys
Object.assign(serverKeys, { Object.assign(serverKeys, {
'Misc': 'Misc', Misc: 'Misc',
'Unknown': 'Unknown' Unknown: 'Unknown'
}) })
// ISO 639 keys // ISO 639 keys
const languageKeys: any = {} const languageKeys: any = {}
const languages = buildLanguages() const languages = buildLanguages()
Object.keys(languages).forEach(k => languageKeys[languages[k]] = languages[k]) Object.keys(languages).forEach(k => { languageKeys[languages[k]] = languages[k] })
Object.assign(serverKeys, languageKeys) Object.assign(serverKeys, languageKeys)

View File

@ -79,7 +79,7 @@ function run () {
// Don't know why but loggerFormat does not remove splat key // Don't know why but loggerFormat does not remove splat key
Object.assign(log, { splat: undefined }) Object.assign(log, { splat: undefined })
logLevels[ log.level ](log) logLevels[log.level](log)
}) })
stream.once('close', () => res()) stream.once('close', () => res())
@ -90,7 +90,7 @@ function run () {
async function getNewestFile (files: string[], basePath: string) { async function getNewestFile (files: string[], basePath: string) {
const sorted = await mtimeSortFilesDesc(files, basePath) const sorted = await mtimeSortFilesDesc(files, basePath)
return (sorted.length > 0) ? sorted[ 0 ].file : '' return (sorted.length > 0) ? sorted[0].file : ''
} }
function toTimeFormat (time: string) { function toTimeFormat (time: string) {

View File

@ -161,7 +161,8 @@ async function askConfirmation () {
} }
prompt.get(schema, function (err, result) { prompt.get(schema, function (err, result) {
if (err) return rej(err) if (err) return rej(err)
return res(result.confirm && result.confirm.match(/y/) !== null)
return res(result.confirm?.match(/y/) !== null)
}) })
}) })
} }

View File

@ -53,3 +53,7 @@ initDatabaseModels(true)
.finally(() => process.exit(0)) .finally(() => process.exit(0))
}) })
}) })
.catch(err => {
console.error(err)
process.exit(-1)
})