Skip to content

Commit

Permalink
fix: smol bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Sep 4, 2024
1 parent 9ee8f27 commit 5263714
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions lib/controller/folders_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class Folders<T extends Folder> {

if (trackToScrollTo != null) {
indexToScrollTo.value = folder.tracks().indexOf(trackToScrollTo);
} else {
indexToScrollTo.value = null;
}
_scrollJump(jumpTo);
}
Expand Down
1 change: 1 addition & 0 deletions lib/controller/playlist_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class PlaylistController extends PlaylistManager<TrackWithDate, Track> {
if (forPaths.isEmpty && addAsM3U && !settings.enableM3USyncStartup.value) {
if (_addedM3UPlaylists) PlaylistController.inst.playlistsMap.removeWhere((key, value) => value.m3uPath != null && value.m3uPath != '');
_addedM3UPlaylists = false;
if (!_m3uPlaylistsCompleter.isCompleted) _m3uPlaylistsCompleter.complete(true);
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/core/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ Future<String?> showNamidaBottomSheetWithTextField({
},
);
Future.delayed(const Duration(milliseconds: 2000), () {
if (localController is! BottomSheetTextFieldConfigWC) localController.dispose();
if (localController.runtimeType == BottomSheetTextFieldConfig) localController.dispose();
focusNode.dispose();
});
return finalText;
Expand Down
9 changes: 5 additions & 4 deletions lib/ui/pages/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class SearchPage extends StatelessWidget {
(context) {
final activeList = settings.activeSearchMediaTypes.valueR;

final tracksSearchTemp = SearchSortController.inst.trackSearchTemp.valueR;
final albumSearchTemp = SearchSortController.inst.albumSearchTemp.valueR;
final artistSearchTemp = SearchSortController.inst.artistSearchTemp.valueR;
final albumArtistSearchTemp = SearchSortController.inst.albumArtistSearchTemp.valueR;
Expand Down Expand Up @@ -404,12 +405,12 @@ class SearchPage extends StatelessWidget {
],

// == Tracks ==
if (activeList.contains(MediaType.track) && SearchSortController.inst.trackSearchTemp.isNotEmpty) ...[
if (activeList.contains(MediaType.track) && tracksSearchTemp.isNotEmpty) ...[
SliverToBoxAdapter(
child: Tooltip(
message: lang.TRACK_PLAY_MODE,
child: SearchPageTitleRow(
title: '${lang.TRACKS} • ${SearchSortController.inst.trackSearchTemp.length}',
title: '${lang.TRACKS} • ${tracksSearchTemp.length}',
icon: Broken.music_circle,
subtitleWidget: Row(
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down Expand Up @@ -463,10 +464,10 @@ class SearchPage extends StatelessWidget {
),
const SliverPadding(padding: EdgeInsets.only(bottom: 8.0)),
SliverFixedExtentList.builder(
itemCount: SearchSortController.inst.trackSearchTemp.length,
itemCount: tracksSearchTemp.length,
itemExtent: Dimensions.inst.trackTileItemExtent,
itemBuilder: (context, i) {
final track = SearchSortController.inst.trackSearchTemp[i];
final track = tracksSearchTemp[i];
return AnimatingTile(
position: i,
child: TrackTile(
Expand Down
10 changes: 7 additions & 3 deletions lib/ui/widgets/video_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2058,9 +2058,13 @@ class _YTVideoEndcardsState extends State<_YTVideoEndcards> {
double maxHeightFinal = maxHeight;
final keyContext = widget.videoConstraintsKey.currentContext;
if (keyContext != null) {
final box = keyContext.findRenderObject() as RenderBox;
if (box.size.width < maxWidthFinal) maxWidthFinal = box.size.width;
if (box.size.height < maxHeightFinal) maxHeightFinal = box.size.height;
try {
final box = keyContext.findRenderObject() as RenderBox;
if (box.size.width < maxWidthFinal) maxWidthFinal = box.size.width;
if (box.size.height < maxHeightFinal) maxHeightFinal = box.size.height;
} catch (_) {
// layout error (not laid out yet)
}
}
return Stack(
alignment: Alignment.center,
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: 4.0.9-beta+240904013
version: 4.0.95-beta+240904013

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

0 comments on commit 5263714

Please sign in to comment.