sources info
This commit is contained in:
parent
234fea1a71
commit
2eb902255e
@ -358,7 +358,10 @@
|
|||||||
const status = await apiJson("/api/library/status");
|
const status = await apiJson("/api/library/status");
|
||||||
state.libraryStatus = status;
|
state.libraryStatus = status;
|
||||||
if (status.ready) {
|
if (status.ready) {
|
||||||
updateProgress(100, `Local H2 sources are ready (${formatLoadedAt(status.loadedAt)}).`);
|
updateProgress(
|
||||||
|
100,
|
||||||
|
`Local H2 sources are ready (${formatLoadedAt(status.loadedAt)}). ${formatSourceCounts(status.counts)}`
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
const counts = status.counts || {};
|
const counts = status.counts || {};
|
||||||
updateProgress(
|
updateProgress(
|
||||||
@ -392,12 +395,28 @@
|
|||||||
await refreshLibraryStatus();
|
await refreshLibraryStatus();
|
||||||
await loadAllLibraryData();
|
await loadAllLibraryData();
|
||||||
updateProgress(100, `Done. Sources saved in H2 (${new Date().toLocaleString("en-US")}).`);
|
updateProgress(100, `Done. Sources saved in H2 (${new Date().toLocaleString("en-US")}).`);
|
||||||
setSettingsMessage("Sources were loaded and saved to the local H2 database.", "ok");
|
setSettingsMessage(
|
||||||
|
`Sources were loaded and saved to the local H2 database. ${formatSourceCounts(state.libraryStatus?.counts)}`,
|
||||||
|
"ok"
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
el.loadSources.disabled = false;
|
el.loadSources.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatSourceCounts(countsRaw) {
|
||||||
|
const counts = countsRaw || {};
|
||||||
|
const liveCategories = Number(counts.liveCategories || 0);
|
||||||
|
const liveStreams = Number(counts.liveStreams || 0);
|
||||||
|
const vodCategories = Number(counts.vodCategories || 0);
|
||||||
|
const vodStreams = Number(counts.vodStreams || 0);
|
||||||
|
const seriesCategories = Number(counts.seriesCategories || 0);
|
||||||
|
const seriesItems = Number(counts.seriesItems || 0);
|
||||||
|
return `Live: ${liveCategories} categories / ${liveStreams} streams, `
|
||||||
|
+ `VOD: ${vodCategories} categories / ${vodStreams} items, `
|
||||||
|
+ `Series: ${seriesCategories} categories / ${seriesItems} series.`;
|
||||||
|
}
|
||||||
|
|
||||||
async function loadAllLibraryData() {
|
async function loadAllLibraryData() {
|
||||||
await Promise.all([loadLiveData(), loadVodData(), loadSeriesData()]);
|
await Promise.all([loadLiveData(), loadVodData(), loadSeriesData()]);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user