Skip to content

Commit

Permalink
chore: small fixes
Browse files Browse the repository at this point in the history
- for track tile separator
- nullable video stream duration
  • Loading branch information
MSOB7YY committed Aug 15, 2024
1 parent 84f561b commit 6b825ac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/controller/video_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class VideoController {
sizeInBytes: choosenStream.sizeInBytes,
frameratePrecise: choosenStream.fps.toDouble(),
creationTimeMS: 0,
durationMS: choosenStream.duration.inMilliseconds,
durationMS: choosenStream.duration?.inMilliseconds ?? 0,
bitrate: choosenStream.bitrate,
);
}
Expand Down
8 changes: 6 additions & 2 deletions lib/ui/widgets/library/track_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -517,24 +517,28 @@ class TrackTileManager {

static String joinTrackItems(TrackTilePosition? p1, TrackTilePosition? p2, TrackTilePosition? p3, Track track) {
var buffer = StringBuffer();
bool needsSeparator = false;
if (p1 != null) {
var info = getChoosenTrackTileItem(p1, track);
if (info.isNotEmpty) {
buffer.write(info);
needsSeparator = true;
}
}
if (p2 != null) {
var info = getChoosenTrackTileItem(p2, track);
if (info.isNotEmpty) {
buffer.write(_separator);
if (needsSeparator) buffer.write(_separator);
buffer.write(info);
needsSeparator = true;
}
}
if (p3 != null && settings.displayThirdItemInEachRow.value) {
var info = getChoosenTrackTileItem(p3, track);
if (info.isNotEmpty) {
buffer.write(_separator);
if (needsSeparator) buffer.write(_separator);
buffer.write(info);
needsSeparator = true;
}
}
return buffer.toString();
Expand Down
2 changes: 1 addition & 1 deletion lib/youtube/controller/youtube_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ class YoutubeController {
sizeInBytes: erabaretaStreamSizeInBytes,
frameratePrecise: erabaretaStream.fps.toDouble(),
creationTimeMS: creationDate?.millisecondsSinceEpoch ?? 0,
durationMS: erabaretaStream.duration.inMilliseconds,
durationMS: erabaretaStream.duration?.inMilliseconds ?? 0,
bitrate: erabaretaStream.bitrate,
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/youtube/functions/yt_playlist_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ extension PlaylistBasicInfoExt on PlaylistBasicInfo {
class _DisposableWidget extends StatefulWidget {
final Widget child;
final void Function() onDispose;
const _DisposableWidget({super.key, required this.child, required this.onDispose});
const _DisposableWidget({required this.child, required this.onDispose});

@override
State<_DisposableWidget> createState() => __DisposableWidgetState();
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.9.12-beta+240815231
version: 3.9.14-beta+240815231

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

0 comments on commit 6b825ac

Please sign in to comment.