Skip to content

Commit

Permalink
chore(yt): some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Jul 9, 2024
1 parent 3391ac2 commit d84bea7
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 33 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ jobs:
run: |
mkdir -p build_final
flutter build apk --target-platform android-arm64 --release
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build_final/namida-v${{ steps.extract_version.outputs.version}}-beta-arm64-v8a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build_final/namida-v${{ steps.extract_version.outputs.version}}-arm64-v8a.apk
flutter build apk --target-platform android-arm --release
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build_final/namida-v${{ steps.extract_version.outputs.version}}-beta-armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build_final/namida-v${{ steps.extract_version.outputs.version}}-armeabi-v7a.apk
- name: Creating clone repo & apks
run: |
Expand All @@ -82,9 +82,9 @@ jobs:
echo ${{ secrets.ANDROID_SIGNING_KEY_PROPERTIES }} | base64 --decode > android/key.properties
mkdir -p ../build_final
flutter build apk --target-platform android-arm64 --release
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ../build_final/namida-v${{ steps.extract_version.outputs.version}}-beta-clone-arm64-v8a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ../build_final/namida-v${{ steps.extract_version.outputs.version}}-clone-arm64-v8a.apk
flutter build apk --target-platform android-arm --release
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ../build_final/namida-v${{ steps.extract_version.outputs.version}}-beta-clone-armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ../build_final/namida-v${{ steps.extract_version.outputs.version}}-clone-armeabi-v7a.apk
cd ../
- name: Get the previous release date
Expand All @@ -99,14 +99,18 @@ jobs:
run: |
REPO_URL="https://github.com/namidaco/namida/commit/"
COMMITS=$(git log --pretty=format:"%H %s" --decorate --no-abbrev-commit --after="$PREVIOUS_RELEASE_DATE")
CHANGELOG_FILE="CHANGELOG_temp.md"
: > $CHANGELOG_FILE
CHANGELOG=""
while IFS= read -r line; do
HASH=$(echo "$line" | awk '{print $1}')
MESSAGE=$(echo "$line" | cut -d' ' -f2-)
echo "$REPO_URL$HASH $MESSAGE" >> $CHANGELOG_FILE
CHANGELOG="$CHANGELOG$REPO_URL$HASH $MESSAGE\n"
done <<< "$COMMITS"
echo "CHANGELOG_FILE=$CHANGELOG_FILE" >> $GITHUB_ENV
# Encode special characters
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "CHANGELOG=$CHANGELOG" >> $GITHUB_ENV
- name: Creating Snapshot Release at namida-snapshots
uses: softprops/action-gh-release@v2
Expand All @@ -115,7 +119,7 @@ jobs:
make_latest: true
draft: false
tag_name: ${{ steps.extract_version.outputs.version}}
body_path: ${{ env.CHANGELOG_FILE}}
body: ${{ env.CHANGELOG}}
files: |
build_final/*
token: ${{ secrets.SNAPSHOTS_REPO_SECRET }}
Expand Down
4 changes: 2 additions & 2 deletions lib/youtube/pages/youtube_home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class YouTubeHomeView extends StatelessWidget with NamidaRouteWidget {
tabWidgets: YTHomePages.values
.map(
(e) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Tooltip(
message: e.toText(),
child: Icon(
e.toIcon(),
size: 18.0,
size: 20.0,
),
),
),
Expand Down
8 changes: 6 additions & 2 deletions lib/youtube/widgets/yt_card.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';

import 'package:namida/class/color_m.dart';
import 'package:namida/core/dimensions.dart';
import 'package:namida/core/utils.dart';
import 'package:namida/ui/widgets/custom_widgets.dart';
Expand All @@ -19,12 +20,13 @@ class YoutubeCard extends StatelessWidget {
final String? channelID;
final bool displayChannelThumbnail;
final bool displaythirdLineText;
final List<Widget> Function(double width, double height)? onTopWidgets;
final List<Widget> Function(double width, double height, NamidaColor? imageColors)? onTopWidgets;
final String? smallBoxText;
final bool? checkmarkStatus;
final double thumbnailWidthPercentage;
final IconData? smallBoxIcon;
final bool extractColor;
final void Function(NamidaColor? color)? onColorReady;
final List<NamidaPopupItem> Function()? menuChildrenDefault;
final bool isCircle;
final List<Widget> bottomRightWidgets;
Expand Down Expand Up @@ -54,6 +56,7 @@ class YoutubeCard extends StatelessWidget {
this.thumbnailWidthPercentage = 1.0,
this.smallBoxIcon,
this.extractColor = false,
this.onColorReady,
this.menuChildrenDefault,
this.isCircle = false,
this.bottomRightWidgets = const [],
Expand Down Expand Up @@ -98,10 +101,11 @@ class YoutubeCard extends StatelessWidget {
width: thumbnailWidth,
height: thumbnailHeight,
borderRadius: 10.0,
onTopWidgets: onTopWidgets?.call(thumbnailWidth, thumbnailHeight) ?? [],
onTopWidgets: onTopWidgets == null ? null : (imageColors) => onTopWidgets!(thumbnailWidth, thumbnailHeight, imageColors),
smallBoxText: smallBoxText,
smallBoxIcon: smallBoxIcon,
extractColor: extractColor,
onColorReady: onColorReady,
isCircle: isCircle,
type: thumbnailType,
),
Expand Down
3 changes: 2 additions & 1 deletion lib/youtube/widgets/yt_notification_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:namida/core/translations/language.dart';
import 'package:namida/core/utils.dart';
import 'package:namida/ui/widgets/custom_widgets.dart';
import 'package:namida/youtube/class/youtube_id.dart';
import 'package:namida/youtube/controller/youtube_info_controller.dart';
import 'package:namida/youtube/widgets/yt_shimmer.dart';
import 'package:namida/youtube/widgets/yt_thumbnail.dart';
import 'package:namida/youtube/yt_utils.dart';
Expand Down Expand Up @@ -190,7 +191,7 @@ class _YoutubeVideoCardNotificationState extends State<YoutubeVideoCardNotificat
customUrl: videoThumbnail,
width: thumbnailWidth,
height: thumbnailHeight,
borderRadius: 10.0,
borderRadius: 8.0,
),
),
NamidaPopupWrapper(
Expand Down
6 changes: 3 additions & 3 deletions lib/youtube/widgets/yt_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class YoutubeThumbnail extends StatefulWidget {
final EdgeInsetsGeometry? margin;
final void Function(File? imageFile)? onImageReady;
final void Function(NamidaColor? color)? onColorReady;
final List<Widget> onTopWidgets;
final List<Widget> Function(NamidaColor? color)? onTopWidgets;
final String? smallBoxText;
final IconData? smallBoxIcon;
final bool displayFallbackIcon;
Expand All @@ -66,7 +66,7 @@ class YoutubeThumbnail extends StatefulWidget {
this.margin,
this.onImageReady,
this.onColorReady,
this.onTopWidgets = const <Widget>[],
this.onTopWidgets,
this.smallBoxText,
this.smallBoxIcon,
this.displayFallbackIcon = true,
Expand Down Expand Up @@ -211,7 +211,7 @@ class _YoutubeThumbnailState extends State<YoutubeThumbnail> with LoadingItemsDe
forceSquared: widget.forceSquared,
// cacheHeight: (widget.height?.round() ?? widget.width.round()) ~/ 1.2,
onTopWidgets: [
...widget.onTopWidgets,
...?widget.onTopWidgets?.call(imageColors),
if (widget.smallBoxText != null || widget.smallBoxIcon != null)
Positioned(
bottom: 0.0,
Expand Down
5 changes: 3 additions & 2 deletions lib/youtube/widgets/yt_video_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ class YoutubeVideoCard extends StatelessWidget {
smallBoxText: video.durSeconds?.secondsLabel,
bottomRightWidgets: YTUtils.getVideoCacheStatusIcons(videoId: videoId, context: context),
menuChildrenDefault: getMenuItems,
extractColor: false,
onTopWidgets: percentageWatched == null
? null
: (thumbWidth, thumbHeight) => [
: (thumbWidth, thumbHeight, imageColors) => [
Positioned(
bottom: 0,
left: 0,
Expand All @@ -117,7 +118,7 @@ class YoutubeVideoCard extends StatelessWidget {
width: thumbWidth * percentageWatched,
child: const DecoratedBox(
decoration: BoxDecoration(
color: Color.fromARGB(190, 255, 20, 20),
color: Color.fromARGB(140, 255, 20, 20),
),
),
),
Expand Down
20 changes: 7 additions & 13 deletions lib/youtube/yt_miniplayer_comments_subpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,13 @@ class _YTMiniplayerCommentsSubpageState extends State<YTMiniplayerCommentsSubpag
return SliverList.builder(
itemCount: comments.length,
itemBuilder: (context, i) {
final comment = comments[i];
return ShimmerWrapper(
transparent: false,
shimmerDurationMS: 550,
shimmerDelayMS: 250,
shimmerEnabled: comment == null,
child: YTCommentCard(
key: Key("${comment == null}_${comment?.commentId}"),
margin: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
comment: comment,
mainList: () => comments,
videoId: currentId,
),
final comment = comments.items[i];
return YTCommentCard(
key: Key(comment.commentId),
margin: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
comment: comment,
mainList: () => comments,
videoId: currentId,
);
},
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.1.2-beta+240709208
version: 3.1.3-beta+240709225

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit d84bea7

Please sign in to comment.