Merge branch 'f0ckdev' into 'master'

+quickfick

See merge request !33
This commit is contained in:
Flummi 2016-11-07 01:52:21 +00:00
commit 303d6ccc3d
2 changed files with 7 additions and 2 deletions

View File

@ -185,10 +185,12 @@ module.exports = (lib) => {
lib.checkRepostCheckSum(cbcs, (cbcrcs) => { lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
if(cbcrcs === true) { if(cbcrcs === true) {
var mime = fileType(readChunk.sync('./b/' + tmpdest, 0, 262)); var mime = fileType(readChunk.sync('./b/' + tmpdest, 0, 262));
info.ext = mime.ext;
info.mime = mime.mime;
if(lib.cfg.main.allowedMimes.hasOwnProperty(mime.mime) || info.type === 'soundcloud') if(lib.cfg.main.allowedMimes.hasOwnProperty(mime.mime) || info.type === 'soundcloud')
cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs }); cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs });
else else
cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+mime+')' }); cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+mime.mime+')' });
} }
else else
cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs }); cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs });

View File

@ -77,7 +77,8 @@ function Websrv(tlib) {
'.mp3': 'audio/mpeg', '.mp3': 'audio/mpeg',
'.mp4': 'video/mp4', '.mp4': 'video/mp4',
'.webm': 'video/webm', '.webm': 'video/webm',
'.ogg': 'audio/ogg' '.ogg': 'audio/ogg',
'.mov': 'video/quicktime'
}; };
if(filePath == "./index.html") { // mainpage if(filePath == "./index.html") { // mainpage
var tpl = swig.compile(templates.index); var tpl = swig.compile(templates.index);
@ -124,6 +125,7 @@ function Websrv(tlib) {
break; break;
case "video/webm": case "video/webm":
case "video/mp4": case "video/mp4":
case "video/quicktime":
data.item = 'video'; data.item = 'video';
break; break;
case "audio/mpeg": case "audio/mpeg":
@ -182,6 +184,7 @@ function Websrv(tlib) {
switch(contentType) { switch(contentType) {
case "video/webm": case "video/webm":
case "video/mp4": case "video/mp4":
case "video/quicktime":
case "audio/mpeg": case "audio/mpeg":
case "audio/ogg": case "audio/ogg":
var start = 0; var start = 0;