Skip to content

Commit

Permalink
Merge pull request #61 from Polochon-street/replace-dedup-by-no-dedup
Browse files Browse the repository at this point in the history
Make deduplication the default for playlists
  • Loading branch information
Polochon-street authored Jun 14, 2024
2 parents 167fd24 + 97bc789 commit 6e909db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## blissify 0.4.0
* Default to deduplicating songs when making playlist; add a "--no-deduplication" option.

## blissify 0.3.12
* Use window / offset to read the list of MPD files to avoid timeout errors.

Expand Down
28 changes: 10 additions & 18 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,10 @@ Useful to avoid a too heavy load on a machine.")
)
.takes_value(false)
)
.arg(Arg::with_name("dedup")
.long("deduplicate-songs")
.arg(Arg::with_name("no-dedup")
.long("no-deduplication")
.help(
"Deduplicate songs based both on the title / artist and their sheer proximity."
"Do not deduplicate songs based both on the title / artist and their sheer proximity."
)
.takes_value(false)
)
Expand Down Expand Up @@ -801,21 +801,13 @@ Defaults to 3, cannot be more than 9."
false => closest_to_songs,
true => song_to_song,
};
if sub_m.is_present("dedup") {
library.queue_from_current_song_custom(
number_songs,
&distance_metric,
sort,
true,
)?;
} else {
library.queue_from_current_song_custom(
number_songs,
&distance_metric,
sort,
false,
)?;
}
let no_dedup = sub_m.is_present("no-dedup");
library.queue_from_current_song_custom(
number_songs,
&distance_metric,
sort,
!no_dedup,
)?;
}
} else if let Some(sub_m) = matches.subcommand_matches("interactive-playlist") {
let number_choices: usize = sub_m.value_of("choices").unwrap_or("3").parse()?;
Expand Down

0 comments on commit 6e909db

Please sign in to comment.