Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to cloofy. The format follows [Keep a Changelog](https://kee

## [Unreleased]

## [0.5.1] - 2026-11-05

cloofy takes on your terminal's colors or your own, and song notifications reach every terminal on Linux.

### Added

- **Your terminal's colors.** Settings has Colors now. **Terminal** takes your terminal's background and text, with the shades in between mixed from them, so cloofy looks at home in a purple Ptyxis on Ubuntu or any other theme. **Auto** stays as before: Omarchy's theme there, cloofy's own dark colors elsewhere, which **cloofy** keeps everywhere.
Expand All @@ -22,6 +26,7 @@ All notable changes to cloofy. The format follows [Keep a Changelog](https://kee
- **Spotify's mixes in your library.** The playlists Spotify makes for you, like Club Mix, Hip Hop Mix, the Daily Mixes and Discover Weekly, show up in your library once you've saved them in Spotify, in the order you picked there. So do the other Spotify playlists you follow. Spotify's Web API leaves them out, so cloofy now lists your library the way Spotify's own apps do.
- **Spotify's mixes in search.** Searching for "synthwave" or "club mix" finds your Synthwave Mix or Club Mix first, as in Spotify, and shows the song count wherever Spotify gives it.
- **`cloofy doctor`** checks both.
- **`CLOOFY_LOG` with a trailing comma,** as in `info,`, logs at that level instead of errors only.

### Security

Expand Down Expand Up @@ -141,7 +146,8 @@ The first release.
- **Session restore.** The page, the selection and the last track come back after a restart.
- **Installer.** It sets everything up step by step.

[Unreleased]: https://github.com/parda21/cloofy/compare/v0.5.0...HEAD
[Unreleased]: https://github.com/parda21/cloofy/compare/v0.5.1...HEAD
[0.5.1]: https://github.com/parda21/cloofy/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/parda21/cloofy/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/parda21/cloofy/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/parda21/cloofy/compare/v0.2.0...v0.3.0
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = ["crates/*"]
exclude = ["vendor"]

[workspace.package]
version = "0.5.0"
version = "0.5.1"
edition = "2024"
rust-version = "1.90"
license = "MIT"
Expand Down
29 changes: 23 additions & 6 deletions crates/cloofy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,7 @@ fn services(paths: &Paths, named: Option<&str>) -> Result<Vec<Service>> {

/// Logs go to stderr for CLI commands; the TUI owns the screen, so it logs to a file.
fn init_logging(paths: &Paths, tui: bool) -> Result<()> {
// Same syntax as before, such as `info,librespot=debug`, without EnvFilter's regexes.
let filter = std::env::var("CLOOFY_LOG")
.ok()
.and_then(|filter| filter.parse::<Targets>().ok())
.unwrap_or_else(|| Targets::new().with_default(tracing::Level::ERROR));
let logs = tracing_subscriber::registry().with(filter);
let logs = tracing_subscriber::registry().with(log_filter(std::env::var("CLOOFY_LOG").ok().as_deref()));
if tui {
std::fs::create_dir_all(&paths.cache)?;
std::fs::File::create(paths.log_file())?;
Expand Down Expand Up @@ -300,12 +295,34 @@ fn link_service(input: &str) -> Option<Service> {
}
}

/// What `CLOOFY_LOG` asks for, with the same syntax as before, such as `info,librespot=debug`,
/// without EnvFilter's regexes; errors only when it's unset or unreadable. Empty directives, as in
/// a trailing comma, are left out: `Targets` reads one as errors only for everything, so
/// `info,` logged errors only.
fn log_filter(spec: Option<&str>) -> Targets {
let errors = || Targets::new().with_default(tracing::Level::ERROR);
let directives: Vec<&str> = spec.unwrap_or_default().split(',').map(str::trim).filter(|d| !d.is_empty()).collect();
if directives.is_empty() { errors() } else { directives.join(",").parse().unwrap_or_else(|_| errors()) }
}

#[cfg(test)]
mod tests {
use clap::CommandFactory;

use super::*;

#[test]
fn log_filters_leave_out_empty_directives() {
use tracing::Level;
let on = |spec, target, level| log_filter(spec).would_enable(target, &level);
assert!(on(None, "cloofy", Level::ERROR) && !on(None, "cloofy", Level::WARN));
assert!(on(Some(""), "cloofy", Level::ERROR), "empty is unset");
assert!(on(Some("info,"), "cloofy", Level::INFO), "a trailing comma keeps info");
assert!(on(Some(" info , librespot=debug"), "librespot", Level::DEBUG));
assert!(!on(Some("info,librespot=debug"), "cloofy", Level::DEBUG));
assert!(on(Some("=not a level"), "cloofy", Level::ERROR), "unreadable is unset");
}

#[test]
fn links_go_to_their_service() {
assert_eq!(link_service("https://open.spotify.com/album/2noRn2Aes5aoNVsU6iWThc"), Some(Service::Spotify));
Expand Down
Loading