youtube_explode/lib/src/playlists/playlist.dart

39 lines
869 B
Dart
Raw Normal View History

import 'package:freezed_annotation/freezed_annotation.dart';
2020-06-03 23:02:21 +02:00
import '../common/common.dart';
import 'playlist_id.dart';
part 'playlist.freezed.dart';
2020-06-03 23:02:21 +02:00
/// YouTube playlist metadata.
@freezed
class Playlist with _$Playlist {
/// Initializes an instance of [Playlist].
const factory Playlist(
/// Playlist ID.
PlaylistId id,
2020-06-03 23:02:21 +02:00
/// Playlist title.
String title,
2020-06-03 23:02:21 +02:00
/// Playlist author.
/// Can be null if it's a system playlist (e.g. Video Mix, Topics, etc.).
String author,
2020-06-03 23:02:21 +02:00
/// Playlist description.
String description,
2020-06-30 15:00:00 +02:00
/// Available thumbnails for this playlist.
/// Can be null if the playlist is empty.
ThumbnailSet thumbnails,
2020-06-03 23:02:21 +02:00
/// Engagement statistics.
Engagement engagement,
) = _Playlist;
2020-06-03 23:02:21 +02:00
const Playlist._();
/// Playlist URL.
String get url => 'https://www.youtube.com/playlist?list=$id';
2020-06-03 23:02:21 +02:00
}