Compare commits

...

8 Commits

Author SHA1 Message Date
Kasper Rynning-Tønnesen
b3a7b95fd6 Removed some commented code 2019-07-29 15:54:41 +02:00
Kasper Rynning-Tønnesen
f9b05c11e0 Fix for 404 not routing to 404 page 2019-07-29 15:52:27 +02:00
Kasper Rynning-Tønnesen
e8d49c77df Merge pull request #516 from zoff-music/fix/viewcount
Fix for view-count
2019-07-26 13:12:55 +02:00
Kasper Rynning-Tønnesen
07164153b0 Merge pull request #515 from zoff-music/refactor/prettifier
Styling-fixes
2019-07-26 10:46:00 +02:00
Kasper Rynning-Tønnesen
206321a46f Merge pull request #514 from zoff-music/refactor/prettifier
Refactor/prettifier
2019-07-26 10:27:18 +02:00
Kasper Rynning-Tønnesen
460d0138f0 Merge pull request #512 from zoff-music/refactor/prettifier
More prettier missing files
2019-07-26 08:51:06 +02:00
Kasper Rynning-Tønnesen
4d96763545 Merge pull request #511 from zoff-music/refactor/prettifier
Prettified som more files and fixed some logging of missing files so …
2019-07-26 08:46:42 +02:00
Kasper Rynning-Tønnesen
d3e72202ce Merge pull request #510 from zoff-music/fix/audit
Removed gulp-util and lodash-template
2019-07-25 16:54:42 +02:00

View File

@@ -13,7 +13,6 @@ var Functions = require(pathThumbnails + "/handlers/functions.js");
var Frontpage = require(pathThumbnails + "/handlers/frontpage.js");
var db = require(pathThumbnails + "/handlers/db.js");
//var db = require(pathThumbnails + '/handlers/db.js');
try {
google = require(path.join(
@@ -168,10 +167,6 @@ function root(req, res, next) {
var subdomain = req.headers["x-forwarded-host"]
? req.headers["x-forwarded-host"].split(".")
: req.headers.host.split(":")[0].split(".");
/*if(url != "zoff.me" && url != "admin.localhost" && url != "admin.zoff.me" && url != "remote.zoff.me" && url != "fb.zoff.me" && url != "remote.localhost" && url != "localhost") {
res.redirect("https://zoff.me");
return;
}*/
if (subdomain[0] == "remote") {
var data = {
year: year,
@@ -228,7 +223,6 @@ function root(req, res, next) {
}
} catch (e) {
console.log(e);
//res.redirect("https://zoff.me");
}
}
@@ -240,10 +234,6 @@ function channel(req, res, next) {
var subdomain = req.headers["x-forwarded-host"]
? req.headers["x-forwarded-host"].split(".")
: req.headers.host.split(":")[0].split(".");
/*if(url != "zoff.me" && url != "admin.localhost" && url != "admin.zoff.me" && url != "remote.zoff.me" && url != "fb.zoff.me" && url != "remote.localhost" && url != "localhost") {
res.redirect("https://zoff.me");
return;
}*/
if (subdomain[0] == "remote") {
var data = {
year: year,
@@ -264,22 +254,9 @@ function channel(req, res, next) {
} else {
if (req.params.channel_name == "o_callback") {
res.redirect("/api/oauth");
//res.sendFile(path.join(pathThumbnails, '/public/assets/html/callback.html'));
} else {
/*db.collection("frontpage_lists").find({"_id": Functions.encodeChannelName(req.params.channel_name)}, function(err, docs) {
console.log(docs);
var og_image = "https://zoff.me/assets/images/small-square.jpg";
if(docs.length == 1) {
if(docs[0].hasOwnProperty("thumbnail")) {
if(docs[0].thumbnail.indexOf("mqdefault.jpg") > -1) docs[0].thumbnail = docs[0].thumbnail.replace("mqdefault", "hqdefault");
og_image = docs[0].thumbnail;
} else {
og_image = "https://img.youtube.com/vi/" + docs[0].id + "/hqdefault.jpg";
}
}*/
var data = {
title: "404: File Not Found",
//list_name: capitalizeFirstLetter(Functions.decodeChannelName(req.params.channel_name)),
list_name: capitalizeFirstLetter(req.params.channel_name),
year: year,
javascript_file: "main.min.js",
@@ -296,11 +273,7 @@ function channel(req, res, next) {
if (subdomain[0] == "client") {
data.client = true;
}
if (req.params.channel_name == "404") {
res.status(404);
}
res.render("layouts/client/channel", data);
//});
}
}
} catch (e) {