mirror of
https://github.com/UiO-Gaming/infoscreen3.git
synced 2026-11-05 13:56:52 +01:00
adding feature: timed slides!
This commit is contained in:
1 parent
cc3fb8b1cc
commit
9a036b8e05
9 files changed
+366
-247
No files matched your search
@@ -539,6 +539,8 @@ export default class admin {
|
||||
type: "slide",
|
||||
index: bundle.allSlides.length,
|
||||
transition: transition,
|
||||
epochStart: data.epochStart,
|
||||
epochEnd: data.epochEnd
|
||||
};
|
||||
|
||||
let obj = bundle.findSlideByUuid(filename);
|
||||
@@ -549,6 +551,8 @@ export default class admin {
|
||||
obj.duration = duration;
|
||||
obj.displayTime = data.displayTime;
|
||||
obj.transition = transition;
|
||||
obj.epochStart = data.epochStart,
|
||||
obj.epochEnd = data.epochEnd;
|
||||
}
|
||||
|
||||
bundle.save();
|
||||
|
||||
@@ -159,11 +159,34 @@ export default class bundleClass {
|
||||
}
|
||||
}
|
||||
|
||||
getEnabledSlides() {
|
||||
this.sync();
|
||||
return this.enabledSlides;
|
||||
}
|
||||
|
||||
|
||||
sync() {
|
||||
this.enabledSlides = [];
|
||||
this.disabledSlides = [];
|
||||
this.allSlides.sort(sortByProperty('index'));
|
||||
let time = Date.parse(new Date().toISOString());
|
||||
for (let slide of this.allSlides) {
|
||||
|
||||
if (slide.epochEnd != -1 && time >= slide.epochEnd) {
|
||||
slide.enabled = false;
|
||||
this.disabledSlides.push(slide.uuid.replace(".json", ""));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slide.epochStart != -1) {
|
||||
slide.enabled = false;
|
||||
if (time >= slide.epochStart) {
|
||||
slide.enabled = true;
|
||||
this.enabledSlides.push(slide.uuid.replace(".json", ""));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (slide.enabled) {
|
||||
this.enabledSlides.push(slide.uuid.replace(".json", ""));
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -205,7 +205,7 @@ export default class display {
|
||||
this.serverOptions.announceMeta = {};
|
||||
|
||||
let bundle = this.getBundle();
|
||||
let slides = bundle.enabledSlides;
|
||||
let slides = bundle.getEnabledSlides();
|
||||
|
||||
if (slides.length >= 0) {
|
||||
let lIndex = this.serverOptions.loopIndex;
|
||||
@@ -214,7 +214,7 @@ export default class display {
|
||||
this.serverOptions.loopIndex = idx;
|
||||
this.serverOptions.currentFile = slides[idx];
|
||||
this.serverOptions.slideDuration = bundle.findSlideByUuid(slides[idx]).duration || bundle.getBundleData().duration;
|
||||
this.serverOptions.currentId = bundle.enabledSlides.indexOf(this.serverOptions.currentFile);
|
||||
this.serverOptions.currentId = slides.indexOf(this.serverOptions.currentFile);
|
||||
this.serverOptions.currentMeta = bundle.findSlideByUuid(slides[idx]);
|
||||
this.serverOptions.displayTime = bundle.bundleData.displayTime;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user