Fixed issue with embedded player, and trying to get better error-logs

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-22 18:56:03 +02:00
parent 3ef8a43c3c
commit ef92068ea6
3 changed files with 33 additions and 22 deletions

View File

@@ -73,8 +73,19 @@ app.get('/robots.txt', function (req, res) {
app.use(function (req, res, next) {
var cookie = req.cookies._uI;
if(req.originalUrl.split("/").length > 3) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
} else {
if (cookie === undefined) {
console.error((new Date), "couldn't fetch cookie for some reason, maybe no cookie exists?", req, "couldn't fetch cookie for some reason, maybe no cookie exists?");
try {
console.error((new Date), "originalUrl", req.originalUrl);
console.error((new Date), "couldn't fetch cookie for some reason, maybe no cookie exists?", req.get('origin'), "couldn't fetch cookie for some reason, maybe no cookie exists?");
} catch(e) {
console.error((new Date), "couldn't fetch origin");
}
var user_name = Functions.hash_pass(Functions.rndName(uniqid.time(), 15));
res.cookie('_uI', user_name, {
maxAge: 365 * 10000 * 3600000,
@@ -94,6 +105,7 @@ app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
}
});
app.use('/service-worker.js', function(req, res) {

View File

@@ -3432,10 +3432,9 @@ nav ul li:hover, nav ul li.active {
.title-container{
background-color: rgba(0,0,0,0.1);
display: inline-block;
display: block;
top:56px !important;
width: 100vw;
background: #2d2d2d;
}
.title-container li {

View File

@@ -566,7 +566,7 @@ var Player = {
//var elem = document.getElementById('song-title');
//var getTitleViews = document.getElementById('viewers');
if(!client) {
if(!client && !embed) {
document.getElementById("host-title").innerText = title;
}
document.getElementById("song-title").innerText = title;