bazarr-bulk 0.1.3

A bulk operation CLI tool for Bazarr
use clap::ValueEnum;
use serde::{Deserialize, Serialize};
use std::str::FromStr;

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, ValueEnum)]
pub enum MediaType {
    Movie,
    TVShow,
}

impl FromStr for MediaType {
    type Err = ();

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "movie" => Ok(MediaType::Movie),
            "tv-show" => Ok(MediaType::TVShow),
            _ => Err(()),
        }
    }
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ActionPayload {
    pub id: u32,
    #[serde(rename = "type")]
    pub media_type: String,
    pub language: String,
    pub path: String,
}