Skip to content

Commit

Permalink
Fixed playlist loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Seneral committed Jun 13, 2024
1 parent 81794af commit 7ea2d52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2059,18 +2059,18 @@ function yt_selectThumbnail (thumbnails) {
return url;
}
function yt_parseDateText (dateText) {
dateText = dateText || "";
dateText = String(dateText) || "";
var usMatch = dateText.match(/([a-zA-Z]+\s*[0-9]+\s*,\s*[0-9]{4})/);
if (usMatch) return new Date(usMatch[1]);
var euMatch = dateText.match(/([0-9]{2})\.([0-9]{2})\.([0-9]{4})/);
if (euMatch) return new Date(parseInt(euMatch[3]), parseInt(euMatch[2])-1, parseInt(euMatch[1]));
}
function yt_parseLabel (label) {
return label?.runs?.reduce((t, r) => t += r.text, "") || label?.simpleText || label?.accessibility?.accessibilityData.label || label || "";
return label?.runs?.reduce((t, r) => t += r.text, "") || label?.simpleText || label?.accessibility?.accessibilityData.label || String(label) || "";
// Used to prefer accessibility data since numbers were more detailed, but now, some accessibility texts are longer (e.g. title by uploader instead of title)
}
function yt_parseText (text) {
return (text || "").replace(/</g,'&lt;').replace(/>/g,'&gt;');
return (String(text) || "").replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
function yt_parseFormattedRuns(runs) {
runs = runs || [];
Expand Down
2 changes: 1 addition & 1 deletion sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Licensed under AGPLv3
See https://github.com/Seneral/FlagPlayer for details
*/

var VERSION = 38;
var VERSION = 39;
var APP_CACHE = "flagplayer-cache-1";
var IMG_CACHE = "flagplayer-thumbs";
var MEDIA_CACHE = "flagplayer-media";
Expand Down

0 comments on commit 7ea2d52

Please sign in to comment.