From 4f7f9cb60d8050d31ef06830bb363535839ee439 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Tue, 25 Aug 2020 20:05:44 +1200 Subject: [PATCH] Detecting youtube URI types, fixes #595 --- src/js/util/helpers.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/js/util/helpers.js b/src/js/util/helpers.js index 545a2944..9a01e9d0 100755 --- a/src/js/util/helpers.js +++ b/src/js/util/helpers.js @@ -150,6 +150,18 @@ const uriType = function (uri) { return 'playlist'; } + if (exploded[0] === 'yt') { + return 'track'; + } + + if (exploded[0] === 'youtube') { + const youtubeParts = exploded[1].split('/'); + if (youtubeParts[0] === 'video') { + return 'track'; + } + return youtubeParts[0]; + } + if (exploded[0] === 'iris') { return exploded[1]; }