Selaa lähdekoodia

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 11 kuukautta sitten
vanhempi
commit
edcc857d40
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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) {
                     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 += "<td><strong>" + breakdown.label + "</strong></td>";