selene-core 0.3.0

selene-core is the backend for Selene, a local-first music player
Documentation
use std::path::PathBuf;

use crate::{
    config::common::CommonConfig, container::ContainerFormat, utils::recurse_list_from_root,
};

impl CommonConfig {
    /// Returns all supported audio files from the configured source directories
    #[must_use]
    pub fn get_source_files(&self) -> Vec<PathBuf> {
        self.source_dirs
            .iter()
            .flat_map(|path| -> Vec<PathBuf> {
                recurse_list_from_root(path, false)
                    .filter(|f| ContainerFormat::from_file(f).is_some_and(|c| c.is_supported()))
                    .collect()
            })
            .collect()
    }
}