Change syntax for bliss: distance bliss to advanced bliss

This commit is contained in:
NGnius (Graham) 2022-01-25 20:00:15 -05:00
parent 6e853ed634
commit f88efaf6d5
5 changed files with 9 additions and 9 deletions

View file

@ -131,9 +131,9 @@ Operations to sort the items in an iterable: iterable~(sorter) OR iterable.sort(
Sort by a MpsItem field. Valid field names change depending on what information is available when the MpsItem is populated, but usually title, artist, album, genre, track, filename are valid fields. Items with a missing/incomparable fields will be sorted to the end.
#### distance bliss -- e.g. iterable~(distance bliss)
#### advanced bliss -- e.g. iterable~(advanced bliss)
Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators.
Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators. This requires the `advanced` feature to be enabled (without the feature enabled this is still valid syntax but doesn't change the order).
License: LGPL-2.1-only OR GPL-2.0-or-later

View file

@ -210,7 +210,7 @@ pub struct BlissSorterFactory;
impl MpsSorterFactory<BlissSorter> for BlissSorterFactory {
fn is_sorter(&self, tokens: &VecDeque<&MpsToken>) -> bool {
tokens.len() == 2 && check_name("distance", &tokens[0]) && check_name("bliss", &tokens[1])
tokens.len() == 2 && check_name("advanced", &tokens[0]) && check_name("bliss", &tokens[1])
}
fn build_sorter(
@ -218,7 +218,7 @@ impl MpsSorterFactory<BlissSorter> for BlissSorterFactory {
tokens: &mut VecDeque<MpsToken>,
_dict: &MpsLanguageDictionary,
) -> Result<BlissSorter, SyntaxError> {
assert_name("distance", tokens)?;
assert_name("advanced", tokens)?;
assert_name("bliss", tokens)?;
Ok(BlissSorter::default())
}

View file

@ -129,9 +129,9 @@
//!
//! Sort by a MpsItem field. Valid field names change depending on what information is available when the MpsItem is populated, but usually title, artist, album, genre, track, filename are valid fields. Items with a missing/incomparable fields will be sorted to the end.
//!
//! ### distance bliss -- e.g. iterable~(distance bliss)
//! ### advanced bliss -- e.g. iterable~(advanced bliss)
//!
//! Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators.
//! Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators. This requires the `advanced` feature to be enabled (without the feature enabled this is still valid syntax but doesn't change the order).
//!
mod context;

View file

@ -362,7 +362,7 @@ fn execute_fieldsort_line() -> Result<(), Box<dyn MpsLanguageError>> {
#[test]
fn execute_blisssort_line() -> Result<(), Box<dyn MpsLanguageError>> {
execute_single_line(
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(distance bliss)",
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(advanced bliss)",
false,
true,
)

View file

@ -70,5 +70,5 @@ Operations to sort the items in an iterable: iterable~(sorter) OR iterable.sort(
field -- e.g. iterable~(filename)
Sort by a MpsItem field. Valid field names change depending on what information is available when the MpsItem is populated, but usually title, artist, album, genre, track, filename are valid fields. Items with a missing/incomparable fields will be sorted to the end.
distance bliss -- e.g. iterable~(distance bliss)
Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the bliss music analyser, which is a very slow operation and can cause music playback interruptions for large iterators.";
advanced bliss -- e.g. iterable~(advanced bliss)
Sort by the distance (similarity) between songs. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the bliss music analyser, which is a very slow operation and can cause music playback interruptions for large iterators. Requires `advanced` mps-interpreter feature.";