2020-06-17 19:11:52 +02:00
|
|
|
import 'package:equatable/equatable.dart';
|
|
|
|
|
2020-06-03 23:02:21 +02:00
|
|
|
import '../common/common.dart';
|
|
|
|
import 'playlist_id.dart';
|
|
|
|
|
2020-06-05 20:08:04 +02:00
|
|
|
/// YouTube playlist metadata.
|
2020-06-17 19:11:52 +02:00
|
|
|
class Playlist with EquatableMixin {
|
2020-06-03 23:02:21 +02:00
|
|
|
/// Playlist ID.
|
|
|
|
final PlaylistId id;
|
|
|
|
|
|
|
|
/// Playlist URL.
|
|
|
|
String get url => 'https://www.youtube.com/playlist?list=$id';
|
|
|
|
|
|
|
|
/// Playlist title.
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
/// Playlist author.
|
|
|
|
/// Can be null if it's a system playlist (e.g. Video Mix, Topics, etc.).
|
|
|
|
final String author;
|
|
|
|
|
|
|
|
/// Playlist description.
|
|
|
|
final String description;
|
|
|
|
|
2020-06-30 15:00:00 +02:00
|
|
|
/// Available thumbnails for this playlist.
|
|
|
|
/// Can be null if the playlist is empty.
|
|
|
|
final ThumbnailSet thumbnails;
|
|
|
|
|
2020-06-03 23:02:21 +02:00
|
|
|
/// Engagement statistics.
|
|
|
|
final Engagement engagement;
|
|
|
|
|
|
|
|
/// Initializes an instance of [Playlist].
|
2020-06-30 15:00:00 +02:00
|
|
|
Playlist(this.id, this.title, this.author, this.description, this.thumbnails,
|
|
|
|
this.engagement);
|
2020-06-03 23:02:21 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => 'Playlist ($title)';
|
2020-06-17 19:11:52 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
List<Object> get props => [id];
|
2020-06-03 23:02:21 +02:00
|
|
|
}
|