youtube_explode/lib/src/playlists/playlist.dart

43 lines
954 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
import '../common/common.dart';
import 'playlist_id.dart';
part 'playlist.freezed.dart';
/// YouTube playlist metadata.
@freezed
class Playlist with _$Playlist {
/// Initializes an instance of [Playlist].
const factory Playlist(
/// Playlist ID.
PlaylistId id,
/// Playlist title.
String title,
/// Playlist author.
/// Can be null if it's a system playlist (e.g. Video Mix, Topics, etc.).
String author,
/// Playlist description.
String description,
/// Available thumbnails for this playlist.
/// Can be null if the playlist is empty.
ThumbnailSet thumbnails,
/// Engagement statistics.
Engagement engagement,
/// Total videos in this playlist.
int? videoCount,
) = _Playlist;
const Playlist._();
/// Playlist URL.
String get url =>
'http://127.0.0.1:8080/www.youtube.com:443/playlist?list=$id';
}