caesura 0.20.0

An all-in-one command line tool to **transcode FLAC** audio files and **upload to gazelle** based indexers/trackers.
Documentation
use crate::formats::ExistingFormat;
use std::fmt::{Display, Formatter};
use SourceFormat::*;

/// Format of a [Source].
#[derive(Clone, Copy, Debug)]
pub enum SourceFormat {
    Flac24,
    Flac,
}

impl SourceFormat {
    #[must_use]
    pub fn get_name(&self) -> &str {
        match self {
            Flac24 => "FLAC 24bit",
            Flac => "FLAC",
        }
    }

    #[must_use]
    pub fn to_existing(self) -> ExistingFormat {
        match self {
            Flac24 => ExistingFormat::Flac24,
            Flac => ExistingFormat::Flac,
        }
    }
    #[must_use]
    pub fn get_title(&self) -> &str {
        match self {
            Flac24 => "FLAC 24bit Lossless",
            Flac => "FLAC Lossless",
        }
    }
}

impl Display for SourceFormat {
    #[allow(clippy::absolute_paths)]
    fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
        write!(formatter, "{}", self.get_name())
    }
}