2021-07-19 00:47:22 +02:00
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
|
2020-10-18 11:55:35 +02:00
|
|
|
import '../common/common.dart';
|
2020-06-13 22:54:53 +02:00
|
|
|
import '../videos/video_id.dart';
|
2020-09-21 17:34:03 +02:00
|
|
|
import 'base_search_content.dart';
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
part 'search_video.freezed.dart';
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Metadata related to a search query result (video).
|
|
|
|
@freezed
|
|
|
|
class SearchVideo with _$SearchVideo, BaseSearchContent {
|
|
|
|
/// Initialize a [SearchVideo] instance.
|
2022-02-28 12:26:56 +01:00
|
|
|
//@With<BaseSearchContent>()
|
2021-07-19 00:47:22 +02:00
|
|
|
const factory SearchVideo(
|
|
|
|
/// Video ID.
|
|
|
|
VideoId id,
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video title.
|
|
|
|
String title,
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video author.
|
|
|
|
String author,
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video description snippet. (Part of the full description if too long)
|
|
|
|
String description,
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video duration as String, HH:MM:SS
|
|
|
|
String duration,
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video View Count
|
|
|
|
int viewCount,
|
2021-02-27 18:58:42 +01:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video thumbnail
|
|
|
|
List<Thumbnail> thumbnails,
|
2021-02-27 18:58:42 +01:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Video upload date - As string: 5 years ago.
|
|
|
|
String? uploadDate,
|
2020-09-23 08:27:23 +02:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// True if this video is a live stream.
|
2021-07-23 12:54:29 +02:00
|
|
|
// ignore: avoid_positional_boolean_parameters
|
2021-07-19 00:47:22 +02:00
|
|
|
bool isLive,
|
2021-03-24 10:40:22 +01:00
|
|
|
|
2021-07-19 00:47:22 +02:00
|
|
|
/// Channel id
|
|
|
|
String channelId,
|
|
|
|
) = _SearchVideo;
|
2020-06-13 22:54:53 +02:00
|
|
|
}
|