#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SearchType {
Video,
MediaBangumi,
MediaFt,
Live,
LiveRoom,
LiveUser,
Article,
BiliUser,
}
impl SearchType {
pub fn as_str(&self) -> &'static str {
match self {
SearchType::Video => "video",
SearchType::MediaBangumi => "media_bangumi",
SearchType::MediaFt => "media_ft",
SearchType::Live => "live",
SearchType::LiveRoom => "live_room",
SearchType::LiveUser => "live_user",
SearchType::Article => "article",
SearchType::BiliUser => "bili_user",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SearchOrder {
TotalRank,
Click,
PubDate,
Dm,
Stow,
Scores,
Attention, Online,
LiveTime,
Default,
Fans,
Level,
}
impl SearchOrder {
pub fn as_str(&self) -> &'static str {
match self {
SearchOrder::TotalRank => "totalrank",
SearchOrder::Click => "click",
SearchOrder::PubDate => "pubdate",
SearchOrder::Dm => "dm",
SearchOrder::Stow => "stow",
SearchOrder::Scores => "scores",
SearchOrder::Attention => "attention",
SearchOrder::Online => "online",
SearchOrder::LiveTime => "live_time",
SearchOrder::Default => "0",
SearchOrder::Fans => "fans",
SearchOrder::Level => "level",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum OrderSort {
Descending, Ascending, }
impl OrderSort {
pub fn as_num(&self) -> u8 {
match self {
OrderSort::Descending => 0,
OrderSort::Ascending => 1,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum UserType {
All,
Up,
Normal,
Verified,
}
impl UserType {
pub fn as_num(&self) -> u8 {
match self {
UserType::All => 0,
UserType::Up => 1,
UserType::Normal => 2,
UserType::Verified => 3,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Duration {
All,
Under10,
From10To30,
From30To60,
Over60,
}
impl Duration {
pub fn as_num(&self) -> u8 {
match self {
Duration::All => 0,
Duration::Under10 => 1,
Duration::From10To30 => 2,
Duration::From30To60 => 3,
Duration::Over60 => 4,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CategoryId {
All,
Animation,
Game,
Movie,
Life,
Interest,
LightNovel,
Technology,
Huayou, Photography, }
impl CategoryId {
pub fn as_num(&self) -> u8 {
match self {
CategoryId::All => 0,
CategoryId::Animation => 2,
CategoryId::Game => 1,
CategoryId::Movie => 28,
CategoryId::Life => 3,
CategoryId::Interest => 29,
CategoryId::LightNovel => 16,
CategoryId::Technology => 17,
CategoryId::Huayou => 1,
CategoryId::Photography => 2,
}
}
}