use anyhow::{Result, bail};
use async_trait::async_trait;

use super::super::provider::MetadataProvider;
use super::super::types::MediaMetadata;
use crate::types::{Provider, ProviderStatus};

pub struct ImdbProvider {
    enabled: bool,
}

impl ImdbProvider {
    #[must_use]
    pub const fn new() -> Self {
        Self { enabled: false }
    }
}

impl Default for ImdbProvider {
    fn default() -> Self {
        Self::new()
    }
}

#[async_trait]
impl Provider for ImdbProvider {
    fn key(&self) -> &'static str {
        "imdb"
    }

    fn name(&self) -> &'static str {
        "IMDb"
    }

    async fn health_check(&self) -> ProviderStatus {
        ProviderStatus::Unhealthy
    }
}

#[async_trait]
impl MetadataProvider for ImdbProvider {
    fn is_enabled(&self) -> bool {
        self.enabled
    }

    async fn search(&self, _query: &str) -> Result<MediaMetadata> {
        bail!("IMDB provider not yet implemented")
    }
}
