|
@@ -87,11 +87,22 @@ app.post("/theme/upload/", [multer(newThemeFileOptions).single("newTheme"), func
|
87
|
87
|
var width = req.body.newWidth;
|
88
|
88
|
var height = req.body.newHeight;
|
89
|
89
|
var themes = JSON.parse(data);
|
|
90
|
+
|
90
|
91
|
themes[caption] = {
|
91
|
92
|
"backgroundImage": req.file.filename,
|
92
|
93
|
"width": parseInt(width),
|
93
|
94
|
"height": parseInt(height)
|
94
|
95
|
};
|
|
96
|
+
|
|
97
|
+ var subtitleLeft = (req.body.newSubtitleLeft) ? req.body.newSubtitleLeft : 0;
|
|
98
|
+ var subtitleRight = (req.body.newSubtitleRight) ? req.body.newSubtitleRight : 0;
|
|
99
|
+ if (subtitleLeft > 0) {
|
|
100
|
+ themes[caption]["subtitleLeft"] = parseInt(subtitleLeft);
|
|
101
|
+ }
|
|
102
|
+ if (subtitleRight > 0) {
|
|
103
|
+ themes[caption]["subtitleRight"] = parseInt(subtitleRight);
|
|
104
|
+ }
|
|
105
|
+
|
95
|
106
|
var jt = JSON.stringify(themes);
|
96
|
107
|
fs.writeFile(themesFile, jt, "utf8", function (err) {
|
97
|
108
|
if (err) {
|