mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-19 00:37:22 +01:00
New: Added automated tasks for Sync and Backups - Backups run every 24hrs, Sync runs every 10 minutes Added switcher to switch between 12hr/24hr time formats Added sorting to Activity Tables Added Version Checking and indicators Added logging on Tasks + Log Page Added Recently Added view to Home page Added background images to item banners Added Proxy for Device Images in session card Changed Navbar to be a side bar Fixes: Fixed Jellyfin API returning Empty folder as library item CSS File to add breakpoints to bootstrap-width Other: Various CSS changes Temporarily removed Websockets due to Proxy Errors Changed Activity View Playback conversion function to more accurately display Playback Duration Backend changes to sum Playback Durations to show more accurate information in thee collapsed summarized view
36 lines
590 B
JavaScript
36 lines
590 B
JavaScript
const db = require("../db");
|
|
|
|
const sync = require("../sync");
|
|
|
|
async function SyncTask(interval) {
|
|
console.log("LibraryMonitor Interval: " + interval);
|
|
|
|
|
|
setInterval(async () => {
|
|
try {
|
|
const { rows: config } = await db.query(
|
|
'SELECT * FROM app_config where "ID"=1'
|
|
);
|
|
|
|
|
|
|
|
if (config.length===0 || config[0].JF_HOST === null || config[0].JF_API_KEY === null) {
|
|
return;
|
|
}
|
|
|
|
sync.fullSync();
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
// console.log(error);
|
|
return [];
|
|
}
|
|
}, interval);
|
|
}
|
|
|
|
module.exports = {
|
|
SyncTask,
|
|
};
|