Explorar el Código

Fix JavaScript ReferenceError: formatDuration is not defined

The real issue was that the JavaScript code was calling formatDuration() which doesn't exist.
The JellyStat plugin has its own formatJellyStatDuration() function that should be used instead.

This fixes the 'Uncaught ReferenceError: formatDuration is not defined' error that was preventing
the JellyStat homepage widget from displaying data after it successfully loaded from the API.
mgomon hace 1 año
padre
commit
edcc857d40
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      api/homepage/jellystat.php

+ 1 - 1
api/homepage/jellystat.php

@@ -461,7 +461,7 @@ trait JellyStatHomepageItem
                 
                 
                 Object.keys(stats.library_totals.type_breakdown).forEach(function(type) {
                 Object.keys(stats.library_totals.type_breakdown).forEach(function(type) {
                     var breakdown = stats.library_totals.type_breakdown[type];
                     var breakdown = stats.library_totals.type_breakdown[type];
-                    var playTimeFormatted = breakdown.play_time > 0 ? formatDuration(breakdown.play_time) : "0 min";
+                    var playTimeFormatted = breakdown.play_time > 0 ? formatJellyStatDuration(breakdown.play_time) : "0 min";
                     
                     
                     html += "<tr>";
                     html += "<tr>";
                     html += "<td><strong>" + breakdown.label + "</strong></td>";
                     html += "<td><strong>" + breakdown.label + "</strong></td>";