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
|
|
|
|
|
|
|
/// Metadata related to a search query result (video).
|
2020-09-21 17:34:03 +02:00
|
|
|
class SearchVideo extends BaseSearchContent {
|
2021-02-27 18:58:42 +01:00
|
|
|
/// Video ID.
|
|
|
|
final VideoId id;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
/// Video title.
|
2021-02-27 18:58:42 +01:00
|
|
|
final String title;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
/// Video author.
|
2021-02-27 18:58:42 +01:00
|
|
|
final String author;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
/// Video description snippet. (Part of the full description if too long)
|
2021-02-27 18:58:42 +01:00
|
|
|
final String description;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
/// Video duration as String, HH:MM:SS
|
2021-02-27 18:58:42 +01:00
|
|
|
final String duration;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
/// Video View Count
|
2021-02-27 18:58:42 +01:00
|
|
|
final int viewCount;
|
2020-06-13 22:54:53 +02:00
|
|
|
|
2020-10-18 11:55:35 +02:00
|
|
|
/// Video thumbnail
|
2021-02-27 18:58:42 +01:00
|
|
|
final List<Thumbnail> thumbnails;
|
|
|
|
|
|
|
|
/// Video upload date - As string: 5 years ago.
|
2021-03-11 14:20:10 +01:00
|
|
|
final String? uploadDate;
|
2021-02-27 18:58:42 +01:00
|
|
|
|
|
|
|
/// True if this video is a live stream.
|
|
|
|
final bool isLive;
|
2020-09-23 08:27:23 +02:00
|
|
|
|
2021-03-24 10:40:22 +01:00
|
|
|
/// Channel id
|
|
|
|
final String channelId;
|
|
|
|
|
2020-07-10 22:28:19 +02:00
|
|
|
/// Initialize a [SearchVideo] instance.
|
2020-09-23 08:27:23 +02:00
|
|
|
const SearchVideo(
|
2021-02-27 18:59:25 +01:00
|
|
|
this.id,
|
|
|
|
this.title,
|
|
|
|
this.author,
|
|
|
|
this.description,
|
|
|
|
this.duration,
|
|
|
|
this.viewCount,
|
|
|
|
this.thumbnails,
|
|
|
|
this.uploadDate,
|
2021-03-24 10:40:22 +01:00
|
|
|
this.isLive, // ignore: avoid_positional_boolean_parameters
|
|
|
|
this.channelId);
|
2020-06-13 22:54:53 +02:00
|
|
|
|
|
|
|
@override
|
2021-02-27 18:58:42 +01:00
|
|
|
String toString() => '(Video) $title ($id)';
|
2020-06-13 22:54:53 +02:00
|
|
|
}
|