Support creation of immich-to-slideshow

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

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ node_modules
Images-c9dbce3b-Results Images-c9dbce3b-Results
Results Results
slideshow/random-results
sync.ffs_db sync.ffs_db

View File

@ -1,5 +1,6 @@
{ {
"cSpell.words": [ "cSpell.words": [
"Immich",
"onlinepngtools" "onlinepngtools"
], ],
"files.watcherExclude": { "files.watcherExclude": {

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -11,10 +11,10 @@
<body> <body>
<div id="deviceReady"> <div id="deviceReady">
<p><a href='slideshow/index.html?b=2024-11-16-09-19'>Slideshow</a></p> <p><a href='slideshow/index.html?b=2024-11-23-22-25'>Slideshow</a></p>
<p><a href='slideshow/index.html?a=last&b=2024-11-16-09-19'>Slideshow (Last)</a></p> <p><a href='slideshow/index.html?a=last&b=2024-11-23-22-25'>Slideshow (Last)</a></p>
<p><a href='slideshow/index.html?a=time&b=2024-11-16-09-19'>Slideshow (Time)</a></p> <p><a href='slideshow/index.html?a=time&b=2024-11-23-22-25'>Slideshow (Time)</a></p>
<p><a href='slideshow/index.html?a=noSleep&b=2024-11-16-09-19'>Slideshow (No Sleep)</a></p> <p><a href='slideshow/index.html?a=noSleep&b=2024-11-23-22-25'>Slideshow (No Sleep)</a></p>
</div> </div>
</body> </body>

BIN
slideshow/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -21,7 +21,7 @@
<script src="scripts/jquery-1.9.1.min.js"></script> <script src="scripts/jquery-1.9.1.min.js"></script>
<script src="scripts/bootstrap.min.js"></script> <script src="scripts/bootstrap.min.js"></script>
<script src="scripts/jquery.bgswitcher.js"></script> <script src="scripts/jquery.bgswitcher.js"></script>
<script type="text/javascript" src="scripts/index.js?nocache=2024-11-16-09-19"></script> <script type="text/javascript" src="scripts/index.js?nocache=2024-11-23-22-25"></script>
</body> </body>
</html> </html>

View File

@ -1,9 +1,17 @@
{ {
"ImageInterval": 21234, "ImageIntervalX": 9123,
"ImageIntervalXX": 21234,
"ImageInterval": 15123,
"JsonInterval": 59000, "JsonInterval": 59000,
"ImageZero": "images/1x1_00000000.png", "ImageZero": "images/1x1_00000000.png",
"DataDirectoryX": "../.random", "DataDirectoryX": "../.random",
"DataDirectory": "../Images-c9dbce3b-Results/F)Random/c9dbce3b/[]", "DataDirectoryXX": "../Images-c9dbce3b-Results/F)Random/c9dbce3b/[]",
"DataDirectory": "random-results",
"ImmichUrlX": "http://192.168.11.2:3001/api/assets/",
"ImmichUrlXX": "https://immich.phares.duckdns.org/api/assets/",
"RandomPathsUrlX": "http://192.168.11.2:5009/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/random-paths/",
"RandomPathsUrlXX": "https://immichtoslideshow.phares.duckdns.org/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/random-paths/",
"RootX": "../.original", "RootX": "../.original",
"Root": "../Images-c9dbce3b-Results/thumbs" "RootXX": "../Images-c9dbce3b-Results/thumbs",
"Root": "5f0b1052-466d-44de-a554-226d7256850d/"
} }

View File

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