SearchFilter constructor
- @Assert('limit <= 50', 'The limit cannot be greater than 50')
- @JsonKey(name: 'sort', toJson: searchSortToString) @Default(SearchSort.newest) SearchSort sort,
- @JsonKey(toJson: languageListToStringList, name: 'lang') @Default([]) List<
Language> languages, - @Default([SearchTarget.clip, SearchTarget.stream]) @JsonKey(name: 'target', toJson: searchTargetToStringList) List<
SearchTarget> targets, - @JsonKey(name: 'topic') @Default([]) List<
String> topics, - @JsonKey(name: 'vch') @Default([]) List<
String> videoChannels, - @JsonKey(name: 'org', toJson: organizationListToStringList) @Default([]) List<
Organization> organizations, - @Default(true) bool paginated,
- @JsonKey(toJson: intToString) @Default(0) int offset,
- @JsonKey(toJson: intToString) @Default(25) int limit,
Filter the results returns by the Holodex API channel endpoints
Implementation
@Assert('limit <= 50', 'The limit cannot be greater than 50')
const factory SearchFilter({
/// Sort by newest or oldest
@JsonKey(name: 'sort', toJson: searchSortToString)
@Default(SearchSort.newest)
SearchSort sort,
/// If set, will filter clips to only show clips with these languages + all vtuber streams
/// (provided searchTargets is not set to filter out streams)
@JsonKey(toJson: languageListToStringList, name: 'lang')
@Default([])
List<Language> languages,
/// Target types of videos
@Default([SearchTarget.clip, SearchTarget.stream])
@JsonKey(name: 'target', toJson: searchTargetToStringList)
List<SearchTarget> targets,
/// Return videos that match one of the provided topics
@JsonKey(name: 'topic') @Default([]) List<String> topics,
/// Videos with all of the specified channel ids. If two or more channel IDs are specified,
/// will only return their collabs, or if one channel is a clipper, it will only show clips
/// of the other vtubers made by this clipper.
@JsonKey(name: 'vch') @Default([]) List<String> videoChannels,
/// Videos of channels in any of the specified organizations, or clips that involve a channel
/// in the specified organization.
@JsonKey(name: 'org', toJson: organizationListToStringList)
@Default([])
List<Organization> organizations,
/// If paginated is set to true, returns [List]<[VideoFull]> with total, otherwise returns [List]<[VideoFull]> without the total.
@Default(true) bool paginated,
/// Offset results
@JsonKey(toJson: intToString) @Default(0) int offset,
/// Result limit
@JsonKey(toJson: intToString) @Default(25) int limit,
}) = _SearchFilter;