diff --git a/bump_version.dart b/bump_version.dart index a92fa24c..c86044d1 100644 --- a/bump_version.dart +++ b/bump_version.dart @@ -75,18 +75,19 @@ Future _buildAPK({required bool verbose}) async { Future _runGitAdd({required String oldLine, required String newLine, required List args}) async { bool added = false; + bool executedFirstCommand = false; final success = await _runProcess( program: 'git', command: 'add pubspec.yaml -p', onOutput: (data, stdinStream) { - final requiredChangeDetect = "-$oldLine\n+$newLine"; - if (data.contains(requiredChangeDetect)) { - stdinStream.writeln('y'); - added = true; - print('git: added version change'); - } else { - stdinStream.writeln('n'); - } + if (executedFirstCommand) return; + executedFirstCommand = true; + stdinStream.writeln('s'); + stdinStream.writeln('/'); + stdinStream.writeln('^version: '); + stdinStream.writeln('y'); + stdinStream.writeln('q'); + added = true; }, ); return success && added; diff --git a/lib/controller/settings.youtube.dart b/lib/controller/settings.youtube.dart index e80e2f0c..b2c12947 100644 --- a/lib/controller/settings.youtube.dart +++ b/lib/controller/settings.youtube.dart @@ -5,6 +5,7 @@ class _YoutubeSettings with SettingsFileWriter { final ytVisibleShorts = {}.obs; final ytVisibleMixes = {}.obs; + final showChannelWatermarkFullscreen = true.obs; int addToPlaylistsTabIndex = 0; bool markVideoWatched = true; @@ -13,6 +14,7 @@ class _YoutubeSettings with SettingsFileWriter { bool enableDimInLightMode = true; void save({ + bool? showChannelWatermarkFullscreen, int? addToPlaylistsTabIndex, bool? markVideoWatched, InnertubeClients? innertubeClient, @@ -20,6 +22,7 @@ class _YoutubeSettings with SettingsFileWriter { bool? whiteVideoBGInLightMode, bool? enableDimInLightMode, }) { + if (showChannelWatermarkFullscreen != null) this.showChannelWatermarkFullscreen.value = showChannelWatermarkFullscreen; if (addToPlaylistsTabIndex != null) this.addToPlaylistsTabIndex = addToPlaylistsTabIndex; if (markVideoWatched != null) this.markVideoWatched = markVideoWatched; if (innertubeClient != null || setDefaultInnertubeClient) this.innertubeClient = innertubeClient; @@ -43,6 +46,7 @@ class _YoutubeSettings with SettingsFileWriter { if (json == null) return; try { json as Map; + showChannelWatermarkFullscreen.value = json['showChannelWatermarkFullscreen'] ?? showChannelWatermarkFullscreen.value; ytVisibleShorts.value = (json['ytVisibleShorts'] as Map?)?.map((key, value) => MapEntry(YTVisibleShortPlaces.values.getEnum(key)!, value)) ?? ytVisibleShorts.value; ytVisibleMixes.value = (json['ytVisibleMixes'] as Map?)?.map((key, value) => MapEntry(YTVisibleMixesPlaces.values.getEnum(key)!, value)) ?? ytVisibleMixes.value; addToPlaylistsTabIndex = json['addToPlaylistsTabIndex'] ?? addToPlaylistsTabIndex; @@ -57,6 +61,7 @@ class _YoutubeSettings with SettingsFileWriter { @override Object get jsonToWrite => { + 'showChannelWatermarkFullscreen': showChannelWatermarkFullscreen, 'ytVisibleShorts': ytVisibleShorts.map((key, value) => MapEntry(key.convertToString, value)), 'ytVisibleMixes': ytVisibleMixes.map((key, value) => MapEntry(key.convertToString, value)), 'addToPlaylistsTabIndex': addToPlaylistsTabIndex, diff --git a/lib/core/translations/keys.dart b/lib/core/translations/keys.dart index 4a926965..09b7e558 100644 --- a/lib/core/translations/keys.dart +++ b/lib/core/translations/keys.dart @@ -579,6 +579,7 @@ abstract class LanguageKeys { String get SHOULD_DUCK_NOTE => _getKey('SHOULD_DUCK_NOTE'); String get SHOULD_PAUSE => _getKey('SHOULD_PAUSE'); String get SHOULD_PAUSE_NOTE => _getKey('SHOULD_PAUSE_NOTE'); + String get SHOW_CHANNEL_WATERMARK_IN_FULLSCREEN => _getKey('SHOW_CHANNEL_WATERMARK_IN_FULLSCREEN'); String get SHOW_HIDE_UNKNOWN_FIELDS => _getKey('SHOW_HIDE_UNKNOWN_FIELDS'); String get SHOW_MIX_PLAYLISTS_IN => _getKey('SHOW_MIX_PLAYLISTS_IN'); String get SHOW_MORE => _getKey('SHOW_MORE'); diff --git a/lib/ui/widgets/settings/youtube_settings.dart b/lib/ui/widgets/settings/youtube_settings.dart index b189a7fb..f4099556 100644 --- a/lib/ui/widgets/settings/youtube_settings.dart +++ b/lib/ui/widgets/settings/youtube_settings.dart @@ -26,6 +26,7 @@ enum _YoutubeSettingKeys { showMixesIn, topComments, preferNewComments, + showChannelWatermarkFullscreen, dimMiniplayerAfter, dimIntensity, downloadsMetadataTags, @@ -49,6 +50,7 @@ class YoutubeSettings extends SettingSubpageProvider { _YoutubeSettingKeys.showMixesIn: [lang.SHOW_MIX_PLAYLISTS_IN], _YoutubeSettingKeys.topComments: [lang.TOP_COMMENTS, lang.TOP_COMMENTS_SUBTITLE], _YoutubeSettingKeys.preferNewComments: [lang.YT_PREFER_NEW_COMMENTS, lang.YT_PREFER_NEW_COMMENTS_SUBTITLE], + _YoutubeSettingKeys.showChannelWatermarkFullscreen: [lang.SHOW_CHANNEL_WATERMARK_IN_FULLSCREEN], _YoutubeSettingKeys.dimMiniplayerAfter: [lang.DIM_MINIPLAYER_AFTER_SECONDS], _YoutubeSettingKeys.dimIntensity: [lang.DIM_INTENSITY], _YoutubeSettingKeys.seekbar: [lang.SEEKBAR, lang.TAP_TO_SEEK, lang.DRAG_TO_SEEK], @@ -174,6 +176,23 @@ class YoutubeSettings extends SettingSubpageProvider { ), ), ), + getItemWrapper( + key: _YoutubeSettingKeys.showChannelWatermarkFullscreen, + child: ObxO( + rx: settings.youtube.showChannelWatermarkFullscreen, + builder: (showChannelWatermarkFullscreen) => CustomSwitchListTile( + bgColor: getBgColor(_YoutubeSettingKeys.showChannelWatermarkFullscreen), + leading: const StackedIcon( + baseIcon: Broken.profile_circle, + secondaryIcon: Broken.drop, + secondaryIconSize: 12.0, + ), + title: lang.SHOW_CHANNEL_WATERMARK_IN_FULLSCREEN, + value: showChannelWatermarkFullscreen, + onChanged: (isTrue) => settings.youtube.save(showChannelWatermarkFullscreen: !isTrue), + ), + ), + ), getItemWrapper( key: _YoutubeSettingKeys.showShortsIn, child: _ShowItemInListTile( diff --git a/lib/ui/widgets/video_widget.dart b/lib/ui/widgets/video_widget.dart index 04bce447..75339c3d 100644 --- a/lib/ui/widgets/video_widget.dart +++ b/lib/ui/widgets/video_widget.dart @@ -624,6 +624,13 @@ class NamidaVideoControlsState extends State with TickerPro final shouldShowSeekBar = widget.isFullScreen; final view = View.of(context); + String? channelOverlayUrl; + + if (widget.isFullScreen && settings.youtube.showChannelWatermarkFullscreen.value) { + final channelOverlay = YoutubeInfoController.current.currentYTStreams.value?.overlay; + channelOverlayUrl = channelOverlay?.overlays.pick()?.url; + } + return Listener( onPointerDown: (event) { _pointerDownedOnRight = event.position.dx > context.width / 2; @@ -1653,6 +1660,15 @@ class NamidaVideoControlsState extends State with TickerPro ), ], ], + + if (channelOverlayUrl != null) + Positioned( + right: 12.0, + bottom: 12.0, + child: _YTChannelOverlayThumbnail( + channelOverlayUrl: channelOverlayUrl, + ), + ), ], ), ), @@ -1772,3 +1788,44 @@ class __SpeedsEditorDialogState extends State<_SpeedsEditorDialog> { ); } } + +class _YTChannelOverlayThumbnail extends StatefulWidget { + final String channelOverlayUrl; + const _YTChannelOverlayThumbnail({required this.channelOverlayUrl}); + + @override + State<_YTChannelOverlayThumbnail> createState() => __YTChannelOverlayThumbnailState(); +} + +class __YTChannelOverlayThumbnailState extends State<_YTChannelOverlayThumbnail> { + bool _isHighlighted = false; + + @override + Widget build(BuildContext context) { + final channelOverlayUrl = widget.channelOverlayUrl; + return TapDetector( + onTap: null, + initializer: (instance) { + instance + ..onTapDown = (d) { + if (mounted) setState(() => _isHighlighted = true); + } + ..onTapUp = (d) { + if (mounted) setState(() => _isHighlighted = false); + }; + }, + child: AnimatedOpacity( + duration: const Duration(milliseconds: 300), + opacity: _isHighlighted ? 1 : 0.35, + child: YoutubeThumbnail( + key: ValueKey(channelOverlayUrl), + width: 38.0, + isImportantInCache: true, + borderRadius: 0, + type: ThumbnailType.channel, + customUrl: channelOverlayUrl, + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index eae84d5f..01d7d36c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: namida description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter publish_to: "none" -version: 3.6.65-beta+240725235 +version: 3.6.7-beta+240725238 environment: sdk: ">=3.4.0 <4.0.0"