last final mod push

This commit is contained in:
Dooho Yi 2022-11-10 17:29:06 +09:00
parent 9180903557
commit 3e704559f5
2 changed files with 39 additions and 11 deletions

View file

@ -139,7 +139,12 @@ fastify.get("/fields", async function (request, reply) {
let folders = []; let folders = [];
for (const item of list) { for (const item of list) {
var fields = JSON.parse((await fs.readFile('/media/storage/public/sound-parade/' + item + '/fields.json')).toString('utf8')); let json = await fs.readFile('/media/storage/public/sound-parade/' + item + '/fields.json')
.catch((err) => {
console.error(err);
});
if (json != undefined) {
var fields = JSON.parse(json.toString('utf8'));
folders.push({ folders.push({
foldername: item, foldername: item,
group: fields.group, group: fields.group,
@ -147,6 +152,7 @@ fastify.get("/fields", async function (request, reply) {
comment: fields.comment, comment: fields.comment,
}); });
} }
}
reply.send(folders); reply.send(folders);
}); });
@ -311,6 +317,28 @@ io.on("connection", function(socket) {
io.emit("flow", req); io.emit("flow", req);
}); });
socket.on("info", async (fn) => {
//get list
let list = await fs.readdir('/media/storage/public/sound-parade/');
//list.reverse();
// console.log(list);
let folders = [];
for (const item of list) {
var fields = JSON.parse((await fs.readFile('/media/storage/public/sound-parade/' + item + '/fields.json')).toString('utf8'));
folders.push({
foldername: item,
group: fields.group,
title: fields.title,
comment: fields.comment,
});
}
fn(folders);
});
}); });
// //

View file

@ -133,12 +133,12 @@
"audio": "https://p.dianaband.info/public/sound-parade/" + list[flow] + "/audio.mp3", "audio": "https://p.dianaband.info/public/sound-parade/" + list[flow] + "/audio.mp3",
"alt": "알트", "alt": "알트",
"size": { "size": {
"base": 40, "base": 20,
"random": 20 "random": 5
}, },
"y": { "y": {
"base": 20, "base": 10,
"random": 10 "random": 50
}, },
"showtime": 20000 "showtime": 20000
}; };
@ -163,7 +163,7 @@
im.position( im.position(
windowWidth * (1 + fading_factor), windowWidth * (1 + fading_factor),
(windowHeight * (object.y.base + object.y.random * Math.random()) * 0.5) / 100 // 좀더 위로 위로 - 50% (ratio) (windowHeight * (object.y.base + object.y.random * Math.random()) * 0.75) / 100 // 좀더 위로 위로 - 50% (ratio)
); );
//그림의 크기와 초기 위치 ==> 세로 보기인 경우 //그림의 크기와 초기 위치 ==> 세로 보기인 경우