4 releases (2 breaking)

0.3.0 Nov 26, 2020
0.2.0 Nov 25, 2020
0.1.1 Nov 7, 2020
0.1.0 Nov 5, 2020

#755 in Audio

27 downloads per month

MIT license

21KB
374 lines

metadata-filter

Crate Documentation

A Rust library to clean up music metadata such as artist, album and song names. This is a Rust port of the metadata-filter TypeScript library.

Currently, this library is mostly a collection of predefined filtering rules along with the apply_rules function which can apply a list of rules to a text.


lib.rs:

A library to clean up music metadata such as artist, album and song names. This is a Rust port of the metadata-filter TypeScript library.

Currently, this library is mostly a collection of predefined filtering rules along with the apply_rules function which can apply a list of rules to a text.

See the rules module for the lists of available filter rules.

Example

Generally you will want to combine several filter rules and then apply them to some text:

use metadata_filter::rules::{remastered_filter_rules, trim_whitespace_filter_rules};
use metadata_filter::filters::apply_rules;

let rules = [remastered_filter_rules(), trim_whitespace_filter_rules()].concat();
let filtered = apply_rules("Here Comes The Sun (Remastered)", &rules);

assert_eq!(filtered, "Here Comes The Sun");

Dependencies

~2–3MB
~53K SLoC