Skip to content

Commit

Permalink
fix: opening external youtube links
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Dec 21, 2023
1 parent ff7e78c commit 3c703d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/core/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final RegExp kYoutubeRegex = RegExp(
caseSensitive: false,
);
final RegExp kYoutubeRegexPlaylists = RegExp(
r'\b(?:https?://)?(?:www\.)?(?:youtube\.com/playlist\?list=|youtu\.be/)([\w\-]+)(?:\S+)?',
r'\b(?:https?://)?(?:www\.)?(?:youtube\.com/playlist\?list=)([\w\-]+)(?:\S+)?',
caseSensitive: false,
);

Expand Down
19 changes: 13 additions & 6 deletions lib/core/namida_converter_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,20 @@ extension OnYoutubeLinkOpenActionUtils on OnYoutubeLinkOpenAction {
child: Column(
children: [
if (playlistToOpen != null)
...newVals.map(
(e) => CustomListTile(
icon: e.toIcon(),
title: e.toText(),
onTap: () => onTap(e),
),
CustomListTile(
icon: Broken.export_2,
title: lang.OPEN,
onTap: () {
NamidaNavigator.inst.navigateTo(YTHostedPlaylistSubpage(playlist: playlistToOpen));
},
),
...newVals.map(
(e) => CustomListTile(
icon: e.toIcon(),
title: e.toText(),
onTap: () => onTap(e),
),
),
if (playlistNameToAddAs != '')
ObxValue<RxBool>(
(didAdd) => CustomListTile(
Expand Down

0 comments on commit 3c703d4

Please sign in to comment.