youtube_explode/lib/src/playlists/playlist.dart

43 lines
954 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,
2021-08-29 13:26:21 +02:00
/// Total videos in this playlist.
int? videoCount,
) = _Playlist;
2020-06-03 23:02:21 +02:00
const Playlist._();
/// Playlist URL.
2022-04-30 17:49:34 +02:00
String get url =>
'http://127.0.0.1:8080/www.youtube.com:443/playlist?list=$id';
2020-06-03 23:02:21 +02:00
}