@@ -21,14 +21,14 @@ import { matchPattern } from "../tools/matchpattern.js";
2121 * @returns {Promise<string> } Une promesse contenant le lien du _fichier_.
2222 */
2323const dispatchVideo = async ( videoId , { incognito } ) => {
24- const addons = new Set ( await kodi . addons . getAddons ( "video" ) ) ;
25- if ( addons . has ( "plugin.video.youtube" ) ) {
24+ const addons = await kodi . addons . getAddons ( "video" ) ;
25+ if ( addons . some ( ( a ) => "plugin.video.youtube" === a . addonid ) ) {
2626 return youtubePlugin . generateVideoUrl ( videoId , incognito ) ;
2727 }
28- if ( addons . has ( "plugin.video.tubed" ) ) {
28+ if ( addons . some ( ( a ) => "plugin.video.tubed" === a . addonid ) ) {
2929 return tubedPlugin . generateVideoUrl ( videoId ) ;
3030 }
31- if ( addons . has ( "plugin.video.sendtokodi" ) ) {
31+ if ( addons . some ( ( a ) => "plugin.video.sendtokodi" === a . addonid ) ) {
3232 return sendtokodiPlugin . generateUrl (
3333 new URL ( `https://www.youtube.com/watch?v=${ videoId } ` ) ,
3434 ) ;
@@ -47,14 +47,14 @@ const dispatchVideo = async (videoId, { incognito }) => {
4747 * @returns {Promise<string> } Une promesse contenant le lien du _fichier_.
4848 */
4949const dispatchPlaylist = async ( playlistId , { incognito } ) => {
50- const addons = new Set ( await kodi . addons . getAddons ( "video" ) ) ;
51- if ( addons . has ( "plugin.video.youtube" ) ) {
50+ const addons = await kodi . addons . getAddons ( "video" ) ;
51+ if ( addons . some ( ( a ) => "plugin.video.youtube" === a . addonid ) ) {
5252 return await youtubePlugin . generatePlaylistUrl ( playlistId , incognito ) ;
5353 }
54- if ( addons . has ( "plugin.video.tubed" ) ) {
54+ if ( addons . some ( ( a ) => "plugin.video.tubed" === a . addonid ) ) {
5555 return tubedPlugin . generatePlaylistUrl ( playlistId ) ;
5656 }
57- if ( addons . has ( "plugin.video.sendtokodi" ) ) {
57+ if ( addons . some ( ( a ) => "plugin.video.sendtokodi" === a . addonid ) ) {
5858 return sendtokodiPlugin . generateUrl (
5959 new URL ( `https://www.youtube.com/playlist?list=${ playlistId } ` ) ,
6060 ) ;
@@ -73,11 +73,11 @@ const dispatchPlaylist = async (playlistId, { incognito }) => {
7373 * @returns {Promise<string> } Une promesse contenant le lien du _fichier_.
7474 */
7575const dispatchClip = async ( clipId , { incognito } ) => {
76- const addons = new Set ( await kodi . addons . getAddons ( "video" ) ) ;
77- if ( addons . has ( "plugin.video.youtube" ) ) {
76+ const addons = await kodi . addons . getAddons ( "video" ) ;
77+ if ( addons . some ( ( a ) => "plugin.video.youtube" === a . addonid ) ) {
7878 return youtubePlugin . generateClipUrl ( clipId , incognito ) ;
7979 }
80- if ( addons . has ( "plugin.video.sendtokodi" ) ) {
80+ if ( addons . some ( ( a ) => "plugin.video.sendtokodi" === a . addonid ) ) {
8181 return sendtokodiPlugin . generateUrl (
8282 new URL ( `https://www.youtube.com/clip/${ clipId } ` ) ,
8383 ) ;
0 commit comments