From 6d484b738584b07497ec93f7457dee443436dac6 Mon Sep 17 00:00:00 2001 From: MSOB7YY Date: Mon, 20 Nov 2023 04:32:44 +0200 Subject: [PATCH] chore: few tweaks --- lib/controller/current_color.dart | 1 + lib/controller/ffmpeg_controller.dart | 2 +- lib/packages/miniplayer.dart | 2 +- lib/youtube/pages/yt_downloads_page.dart | 50 ++++++++++++------------ pubspec.lock | 8 ++-- pubspec.yaml | 6 +-- 6 files changed, 36 insertions(+), 33 deletions(-) diff --git a/lib/controller/current_color.dart b/lib/controller/current_color.dart index 914189d3..d802dc1d 100644 --- a/lib/controller/current_color.dart +++ b/lib/controller/current_color.dart @@ -143,6 +143,7 @@ class CurrentColor { NamidaColor? namidaColor; final trColors = await getTrackColors(track.track); + if (track.track != Player.inst.nowPlayingTrack) return; // -- check current track _namidaColorMiniplayer.value = trColors.color; if (settings.autoColor.value) { diff --git a/lib/controller/ffmpeg_controller.dart b/lib/controller/ffmpeg_controller.dart index e8961197..ec1ca5d6 100644 --- a/lib/controller/ffmpeg_controller.dart +++ b/lib/controller/ffmpeg_controller.dart @@ -273,7 +273,7 @@ class NamidaFFMPEG { ); } } - dio.close(); + dio.close(force: true); currentOperations[OperationType.ytdlpThumbnailFix]!.value.currentFilePath = null; } diff --git a/lib/packages/miniplayer.dart b/lib/packages/miniplayer.dart index 55d35247..76a7d828 100644 --- a/lib/packages/miniplayer.dart +++ b/lib/packages/miniplayer.dart @@ -2172,7 +2172,7 @@ class _TrackImage extends StatelessWidget { return ArtworkWidget( key: Key(track.path), path: track.pathToImage, - thumbnailSize: Get.width, + thumbnailSize: context.width, compressed: false, borderRadius: 6.0 + 10.0 * cp, forceSquared: settings.forceSquaredTrackThumbnail.value, diff --git a/lib/youtube/pages/yt_downloads_page.dart b/lib/youtube/pages/yt_downloads_page.dart index d11e5f03..cf86a8e9 100644 --- a/lib/youtube/pages/yt_downloads_page.dart +++ b/lib/youtube/pages/yt_downloads_page.dart @@ -121,7 +121,7 @@ class YTDownloadsPage extends StatelessWidget { Obx( () => _isOnGoingSelected.value != null ? Padding( - padding: const EdgeInsets.only(bottom: 6.0), + padding: const EdgeInsets.symmetric(vertical: 12.0), child: Row( children: [ const SizedBox(width: 24.0), @@ -129,29 +129,31 @@ class YTDownloadsPage extends StatelessWidget { YoutubeController.inst.youtubeDownloadTasksTempList.length.displayVideoKeyword, style: context.textTheme.displayMedium?.copyWith(fontSize: 20.0.multipliedFontScale), ), - const Spacer(), - IconButton.filledTonal( - padding: EdgeInsets.zero, - onPressed: () { - YoutubeController.inst.youtubeDownloadTasksTempList.loop((e, index) { - YoutubeController.inst.resumeDownloadTasks(groupName: e.$1); - }); - }, - icon: const Icon(Broken.play, size: 20.0), - ), - IconButton.filledTonal( - padding: EdgeInsets.zero, - onPressed: () { - YoutubeController.inst.youtubeDownloadTasksTempList.loop((e, index) { - YoutubeController.inst.pauseDownloadTask( - itemsConfig: [], - groupName: e.$1, - allInGroupName: true, - ); - }); - }, - icon: const Icon(Broken.pause, size: 20.0), - ), + if (_isOnGoingSelected.value == true) ...[ + const Spacer(), + NamidaIconButton( + icon: Broken.play, + iconSize: 24.0, + onPressed: () { + YoutubeController.inst.youtubeDownloadTasksTempList.loop((e, index) { + YoutubeController.inst.resumeDownloadTasks(groupName: e.$1); + }); + }, + ), + NamidaIconButton( + icon: Broken.pause, + iconSize: 24.0, + onPressed: () { + YoutubeController.inst.youtubeDownloadTasksTempList.loop((e, index) { + YoutubeController.inst.pauseDownloadTask( + itemsConfig: [], + groupName: e.$1, + allInGroupName: true, + ); + }); + }, + ), + ], const SizedBox(width: 12.0), ], ), diff --git a/pubspec.lock b/pubspec.lock index 5ca8ee9f..42708564 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -306,10 +306,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "21145c9c268d54b1f771d8380c195d2d6f655e0567dc1ca2f9c134c02c819e0a" + sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" url: "https://pub.dev" source: hosted - version: "5.3.3" + version: "6.1.1" flutter: dependency: "direct main" description: flutter @@ -517,8 +517,8 @@ packages: dependency: "direct main" description: path: "." - ref: "05eca4cb4009bc49d16ec5af2e5973cf55596239" - resolved-ref: "05eca4cb4009bc49d16ec5af2e5973cf55596239" + ref: "0484c632d26d768e85003480bce316b28d3c2933" + resolved-ref: "0484c632d26d768e85003480bce316b28d3c2933" url: "https://github.com/namidaco/history_manager" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index fbd27cc9..24463d2a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: history_manager: git: url: https://github.com/namidaco/history_manager - ref: 05eca4cb4009bc49d16ec5af2e5973cf55596239 + ref: 0484c632d26d768e85003480bce316b28d3c2933 flutter_html: git: url: https://github.com/zhourengui/flutter_html @@ -69,9 +69,9 @@ dependencies: # ---- Path/File Providers ---- path_provider: ^2.0.14 external_path: ^1.0.3 - file_picker: ^5.3.3 + file_picker: "6.1.1" - # ----Audio Indexing & Playback ---- + # ---- Audio Indexing & Playback ---- just_audio: git: url: https://github.com/MSOB7YY/just_audio