mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Add notice & warning that an anonymous or non-premium account may result to incomplete results with search (#288)
This commit is contained in:
parent
444dc65a29
commit
3b9fc52890
2 changed files with 9 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ use anyhow::{bail, Result};
|
|||
use crunchyroll_rs::common::StreamExt;
|
||||
use crunchyroll_rs::search::QueryResults;
|
||||
use crunchyroll_rs::{Episode, Locale, MediaCollection, MovieListing, MusicVideo, Series};
|
||||
use log::warn;
|
||||
|
||||
#[derive(Debug, clap::Parser)]
|
||||
#[clap(about = "Search in videos")]
|
||||
|
|
@ -102,6 +103,10 @@ pub struct Search {
|
|||
|
||||
impl Execute for Search {
|
||||
async fn execute(self, ctx: Context) -> Result<()> {
|
||||
if !ctx.crunchy.premium() {
|
||||
warn!("Using `search` anonymously or with a non-premium account may return incomplete results")
|
||||
}
|
||||
|
||||
let input = if crunchyroll_rs::parse::parse_url(&self.input).is_some() {
|
||||
match parse_url(&ctx.crunchy, self.input.clone(), true).await {
|
||||
Ok(ok) => vec![ok],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue