Support creation of immich-to-slideshow

This commit is contained in:
2024-11-23 22:27:26 -07:00
parent 766bc77e25
commit 1033df0303
8 changed files with 25 additions and 13 deletions

View File

@ -5,6 +5,7 @@
var _RootAlt;
var _ImageZero;
var _DataDirectory;
var _RandomPathsUrl;
var _Pause = 0;
var _Images = [];
@ -24,13 +25,14 @@
if (window.location.href.indexOf('time') > 0) {
time.innerText = mm + '-' + dd + '.json';
}
var url = _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2024-11-16-09-19';
var url = _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2024-11-23-22-25';
console.log(url);
$.getJSON(url, function (data) {
console.log('success', data.length);
_Images = [];
$.each(data, function (_, value) {
_Images.push(value.replaceAll("\\", "/"));
// _Images.push(value.replaceAll("\\", "/"));
_Images.push(value);
});
})
.done(function () { console.log('second success'); })
@ -62,7 +64,7 @@
if (_Images.length > 0 && _Pause === 0) {
var currentDate = new Date();
var currentHours = currentDate.getHours();
if (currentHours >= 22 || currentHours <= 6) {
if (currentHours >= 23 || currentHours <= 6) {
_DeviceReadyDiv.attr('style', 'background-color: #191717;');
}
else {
@ -167,7 +169,7 @@
}
if (window.location.href.indexOf('last') > 0) {
var url = '../log-nginx/access.log?nocache=2024-11-16-09-19';
var url = '../log-nginx/access.log?nocache=2024-11-23-22-25';
$.get(url, function (data) {
var arrayOfUrl = [];
var arrayOfIndex = [];
@ -196,7 +198,7 @@
document.addEventListener('keyup', getInput, false);
var url = '../slideshow/index.json?nocache=2024-11-16-09-19';
var url = '../slideshow/index.json?nocache=2024-11-23-22-25';
console.log(url);
var _ = $.getJSON(url, function (data) {
console.log(url + ' downloaded successfully');