mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

* feat: add playback history provider * feat: implement recently played section * refactor: use route names * feat: add stats summary and top tracks/artists/albums * feat: add top date based filtering * feat: add stream money calculation * refactor: place search in mobile navbar and settings in home appbar * feat: add individual minutes and streams page * feat(stats): add individual minutes and streams page * chore: default period to 1 month * feat: add text to explain user how hypothetical fees are calculated * chore: ensure usage of route names instead of direct paths * cd: add cache key * cd: remove media_kit_event_loop from git
36 lines
803 B
Dart
36 lines
803 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
|
|
part 'state.freezed.dart';
|
|
part 'state.g.dart';
|
|
|
|
enum HistoryDuration {
|
|
allTime,
|
|
days7,
|
|
days30,
|
|
months6,
|
|
year,
|
|
years2,
|
|
}
|
|
|
|
@freezed
|
|
class PlaybackHistoryItem with _$PlaybackHistoryItem {
|
|
factory PlaybackHistoryItem.playlist({
|
|
required DateTime date,
|
|
required PlaylistSimple playlist,
|
|
}) = PlaybackHistoryPlaylist;
|
|
|
|
factory PlaybackHistoryItem.album({
|
|
required DateTime date,
|
|
required AlbumSimple album,
|
|
}) = PlaybackHistoryAlbum;
|
|
|
|
factory PlaybackHistoryItem.track({
|
|
required DateTime date,
|
|
required Track track,
|
|
}) = PlaybackHistoryTrack;
|
|
|
|
factory PlaybackHistoryItem.fromJson(Map<String, dynamic> json) =>
|
|
_$PlaybackHistoryItemFromJson(json);
|
|
}
|