rename dist to static, fixes #8

This commit is contained in:
teddit 2020-12-25 22:14:24 +01:00
parent d59bda42c8
commit 26f287ef4f
18 changed files with 5 additions and 5 deletions

2
app.js
View File

@ -125,7 +125,7 @@ if(config.trust_proxy) {
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(express.static(`${__dirname}/dist`))
app.use(express.static(`${__dirname}/static`))
app.set('views', './views')
app.set('view engine', 'pug')

View File

@ -57,8 +57,8 @@ module.exports = function(tools) {
resolve('')
} else {
let filename = `${temp_url.pathname.substr(1).split('/')[0]}.${file_ext}`
let path = `./dist/vids/${dir}${filename}`
let temp_path = `./dist/vids/${dir}temp_${filename}`
let path = `./static/vids/${dir}${filename}`
let temp_path = `./static/vids/${dir}temp_${filename}`
if(!fs.existsSync(path)) {
const download = await downloadFile(cleanUrl(url))
if(download.success === true) {
@ -73,7 +73,7 @@ module.exports = function(tools) {
}
const download_audio = await downloadFile(cleanUrl(audio_url))
if(download_audio.success === true) {
let audio_path = `./dist/vids/${dir}temp_audio_${filename}`
let audio_path = `./static/vids/${dir}temp_audio_${filename}`
const write_audio = await writeToDisk(download_audio.data, audio_path)
if(write_audio.success === true) {
let processVideo = spawn('ffmpeg', ['-y', '-i', temp_path, '-i', audio_path, '-c', 'copy', path])
@ -141,7 +141,7 @@ module.exports = function(tools) {
filename = `${file_prefix}w:${temp_url.searchParams.get('width')}_${temp_url.pathname.split('/').slice(-1)}`
}
}
path = `./dist/pics/${dir}${filename}`
path = `./static/pics/${dir}${filename}`
if(!fs.existsSync(path)) {
const download = await downloadFile(cleanUrl(url))
if(download.success === true) {

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 89 B

After

Width:  |  Height:  |  Size: 89 B