diff --git a/tubearchivist/home/templates/home/settings.html b/tubearchivist/home/templates/home/settings.html
index 8d605f74..8a2256e8 100644
--- a/tubearchivist/home/templates/home/settings.html
+++ b/tubearchivist/home/templates/home/settings.html
@@ -9,7 +9,8 @@
{% endblock settings_content %}
diff --git a/tubearchivist/static/stats.js b/tubearchivist/static/stats.js
index eecf18b6..0bc5e402 100644
--- a/tubearchivist/static/stats.js
+++ b/tubearchivist/static/stats.js
@@ -70,8 +70,35 @@ function buildDownloadTile(responseData) {
return tile;
}
+function watchStats() {
+ let apiEndpoint = '/api/stats/watch/';
+ let responseData = apiRequest(apiEndpoint, 'GET');
+ let watchBox = document.getElementById('watchBox');
+
+ for (const property in responseData) {
+ let tile = buildWatchTile(property, responseData[property]);
+ watchBox.appendChild(tile);
+ }
+}
+
+function buildWatchTile(title, watchDetail) {
+ let tile = buildTile(`Total ${title}`);
+ let message = document.createElement('p');
+ message.innerHTML = `
+ ${watchDetail.items} Videos
+ ${watchDetail.duration} Seconds
+ ${watchDetail.duration_str} Playback
+ `;
+ if (watchDetail.progress) {
+ message.innerHTML += `
${Number(watchDetail.progress * 100).toFixed(2)}%`;
+ }
+ tile.appendChild(message);
+ return tile;
+}
+
function buildStats() {
primaryStats();
+ watchStats();
}
buildStats();