og:thumb gefixt

This commit is contained in:
root 2017-10-20 12:08:48 +02:00
parent a5a98dcab1
commit c7bdf67436
2 changed files with 7 additions and 3 deletions

View File

@ -9,7 +9,7 @@
<link rel="icon" type="image/gif" href="./s/favicon.gif" /> <link rel="icon" type="image/gif" href="./s/favicon.gif" />
<meta name="Description" content="f0cked by {{ username }}" /> <meta name="Description" content="f0cked by {{ username }}" />
<meta property="og:image" content="{{ thumb }}" /> <meta property="og:image" content="{{ thumbnail }}" />
<meta charset="utf-8" /> <meta charset="utf-8" />
</head> </head>
<body> <body>

View File

@ -107,6 +107,7 @@ function Websrv(tlib) {
userchannel: '', userchannel: '',
usernetwork: '', usernetwork: '',
thumb: null, thumb: null,
thumbnail: null,
next: null, next: null,
prev: null prev: null
}; };
@ -125,8 +126,8 @@ function Websrv(tlib) {
break; break;
case "audio/mpeg": case "audio/mpeg":
case "audio/ogg": case "audio/ogg":
case "audio/flac": case "audio/flac":
case "audio/x-flac": case "audio/x-flac":
data.item = 'audio'; data.item = 'audio';
break; break;
} }
@ -135,6 +136,7 @@ function Websrv(tlib) {
data.srcurl = e.src; data.srcurl = e.src;
data.src = urlm.parse(e.src).hostname; data.src = urlm.parse(e.src).hostname;
data.thumb = (e.thumb != '' && e.thumb.match(/sndcdn\.com/i))?e.thumb:null; data.thumb = (e.thumb != '' && e.thumb.match(/sndcdn\.com/i))?e.thumb:null;
data.thumbnail = `${lib.cfg.main.url}/t/${e.id}.png`;
data.dest = e.dest; data.dest = e.dest;
data.mime = e.mime; data.mime = e.mime;
data.size = lib.formatSize(e.size); data.size = lib.formatSize(e.size);
@ -282,6 +284,7 @@ function Websrv(tlib) {
size: e.size, size: e.size,
userchannel: e.userchannel, userchannel: e.userchannel,
usernetwork: e.usernetwork, usernetwork: e.usernetwork,
thumb: lib.cfg.main.url + "/t/" + e.id + ".png",
next: null, next: null,
prev: null prev: null
}; };
@ -306,6 +309,7 @@ function Websrv(tlib) {
else { else {
res.writeHead(403); res.writeHead(403);
res.end('403 - forbidden'); res.end('403 - forbidden');
console.log(req.connection.remoteAddress);
} }
}).listen(lib.cfg.websrv.port); }).listen(lib.cfg.websrv.port);
} }