Compare commits

...

5 Commits

Author SHA1 Message Date
Richard Hajek
17faa2953e
Merge 42e954428b into ecc0bdcc42 2025-09-09 00:45:30 +06:00
Richard Hajek
42e954428b feat: added filtering duplicates in recent 2025-01-18 18:01:26 +01:00
Kingkor Roy Tirtho
8c1337d1fc
Merge pull request #2118 from KRTirtho/dev
chore: release 3.9.0
2024-12-09 00:04:29 +06:00
Kingkor Roy Tirtho
94e704087f Merge branch 'dev' 2024-10-09 16:38:23 +06:00
Kingkor Roy Tirtho
8e287ab1e5
Merge pull request #1981 from KRTirtho/dev
Release 3.8.3
2024-10-09 15:39:31 +06:00

View File

@ -9,7 +9,7 @@ import 'package:spotube/provider/history/recent.dart';
class HomeRecentlyPlayedSection extends HookConsumerWidget { class HomeRecentlyPlayedSection extends HookConsumerWidget {
const HomeRecentlyPlayedSection({super.key}); const HomeRecentlyPlayedSection({super.key});
@override @override
Widget build(BuildContext context, ref) { Widget build(BuildContext context, ref) {
final history = ref.watch(recentlyPlayedItems); final history = ref.watch(recentlyPlayedItems);
@ -20,17 +20,20 @@ class HomeRecentlyPlayedSection extends HookConsumerWidget {
return const SizedBox(); return const SizedBox();
} }
final uniqueItems = <dynamic>{};
final filteredItems = [
for (final item in historyData)
if (item.playlist != null && item.playlist?.id != null && uniqueItems.add(item.playlist!.id!))
item.playlist
else if (item.album != null && item.album?.id != null && uniqueItems.add(item.album?.id))
item.album
];
return Skeletonizer( return Skeletonizer(
enabled: history.isLoading, enabled: history.isLoading,
child: HorizontalPlaybuttonCardView( child: HorizontalPlaybuttonCardView(
title: Text(context.l10n.recently_played), title: Text(context.l10n.recently_played),
items: [ items: filteredItems,
for (final item in historyData)
if (item.playlist != null)
item.playlist
else if (item.album != null)
item.album
],
hasNextPage: false, hasNextPage: false,
isLoadingNextPage: false, isLoadingNextPage: false,
onFetchMore: () {}, onFetchMore: () {},