Skip to content

Commit

Permalink
chore: dont depend on playing id for mix playlists in related videos
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Nov 3, 2024
1 parent 341e5bd commit e4080fa
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/youtube/pages/youtube_feed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class YoutubeHomeFeedPage extends StatelessWidget {
thumbnailHeight: thumbnailHeight,
subtitle: item.subtitle,
playOnTap: true,
playingId: null,
isMixPlaylist: item.isMix,
),
_ => const YoutubeVideoCardDummy(
Expand Down
1 change: 0 additions & 1 deletion lib/youtube/pages/youtube_user_playlists_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class _YoutubeUserPlaylistsPageState extends State<YoutubeUserPlaylistsPage> {
thumbnailHeight: thumbnailHeight,
firstVideoID: null,
isMixPlaylist: playlist.isMix,
playingId: null,
playOnTap: false,
);
});
Expand Down
2 changes: 0 additions & 2 deletions lib/youtube/pages/yt_channel_subpage_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ class _YTChannelSubpageTabState extends State<YTChannelSubpageTab> {
thumbnailWidth: itemThumbnailWidth + paddingForThumbnail,
subtitle: subItem.subtitle,
firstVideoID: subItem.initialVideos.firstOrNull?.id,
playingId: null,
isMixPlaylist: subItem.isMix,
);
}
Expand Down Expand Up @@ -355,7 +354,6 @@ class _YTChannelSubpageTabState extends State<YTChannelSubpageTab> {
subtitle: item.subtitle,
playOnTap: false,
firstVideoID: item.initialVideos.firstOrNull?.id,
playingId: null,
isMixPlaylist: item.isMix,
),
const (YoutiPieChannelInfo) => YoutubeChannelCard(
Expand Down
1 change: 0 additions & 1 deletion lib/youtube/pages/yt_search_results_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ class YoutubeSearchResultsPageState extends State<YoutubeSearchResultsPage> with
firstVideoID: item.initialVideos.firstOrNull?.id,
subtitle: item.subtitle.isNotEmpty ? item.subtitle : item.initialVideos.firstOrNull?.title,
isMixPlaylist: item.isMix,
playingId: null,
),
const (YoutiPieChannelInfo) => YoutubeChannelCard(
channel: item as YoutiPieChannelInfo,
Expand Down
4 changes: 1 addition & 3 deletions lib/youtube/widgets/yt_playlist_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class YoutubePlaylistCard extends StatefulWidget {
final double? thumbnailHeight;
final bool playOnTap;
final String? firstVideoID;
final String Function()? playingId;
final bool isMixPlaylist;
final bool minimalCard;

Expand All @@ -44,7 +43,6 @@ class YoutubePlaylistCard extends StatefulWidget {
this.thumbnailHeight,
this.playOnTap = false,
required this.firstVideoID,
required this.playingId,
required this.isMixPlaylist,
this.minimalCard = false,
});
Expand All @@ -61,7 +59,7 @@ class _YoutubePlaylistCardState extends State<YoutubePlaylistCard> {
Future<YoutiPiePlaylistResultBase?> _fetchFunction({required bool forceRequest}) async {
final executeDetails = forceRequest ? ExecuteDetails.forceRequest() : ExecuteDetails.cache(CacheDecision.cacheOnly);
if (widget.isMixPlaylist) {
final videoId = widget.firstVideoID ?? widget.playingId?.call() ?? widget.playlist.id.substring(2);
final videoId = widget.firstVideoID ?? widget.playlist.id.substring(2);
if (videoId.isEmpty) return null;
return YoutubeInfoController.playlist.getMixPlaylist(
videoId: videoId,
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.6.49-beta+241103032
version: 4.6.49-beta+241103166

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

0 comments on commit e4080fa

Please sign in to comment.