this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove excessive message colouring

+21 -42
+10 -23
src/main.rs
··· 228 228 (session_info 229 229 .handles 230 230 .first() 231 - .unwrap_or(&"(no handle)".to_string())) 231 + .unwrap_or(&"(no handle)".red().to_string())) 232 232 .magenta(), 233 233 format!(", {}", session_info.did).dimmed() 234 234 ); ··· 240 240 auth.logout().await?; 241 241 242 242 println!( 243 - "{}: logged out {}{}", 243 + "{}: logged out {}, {}", 244 244 "success".green().bold(), 245 245 (session_info 246 246 .handles 247 247 .first() 248 - .unwrap_or(&"(no handle)".to_string())) 249 - .magenta(), 250 - format!(", {}", session_info.did).dimmed(), 248 + .unwrap_or(&"(no handle)".red().to_string())), 249 + session_info.did, 251 250 ); 252 251 } 253 252 AuthCommands::Whoami => { ··· 262 261 }; 263 262 264 263 if session.is_ok() { 265 - println!( 266 - "{} {} {} {}", 267 - "status:".dimmed(), 268 - "logged in".green(), 269 - "via".dimmed(), 270 - method_str.blue() 271 - ); 264 + println!("status: {} via {}", "logged in".green().bold(), method_str); 272 265 } else { 273 - println!( 274 - "{} {} {} {}", 275 - "status:".dimmed(), 276 - "logged out".red().bold(), 277 - "via".dimmed(), 278 - method_str.blue() 279 - ); 266 + println!("status: {} via {}", "logged out".red().bold(), method_str); 280 267 } 281 268 282 - print!("{} ", "handles:".dimmed()); 269 + print!("handles: "); 283 270 284 271 if session_info.handles.is_empty() { 285 - println!("{}", "(no handle)".magenta()); 272 + println!("{}", "(no handle)".red()); 286 273 } else { 287 274 for handle in &session_info.handles { 288 - print!("{} ", handle.magenta()); 275 + print!("{} ", handle); 289 276 } 290 277 println!(); 291 278 } 292 279 293 - println!("{}", format!("did: {}", session_info.did).dimmed()); 280 + println!("did: {}", session_info.did); 294 281 } 295 282 }, 296 283 Commands::Scrobble { command } => match command {
+11 -19
src/status.rs
··· 116 116 pub fn display_status(&self, status: &TrackStatus, raw: bool, full: bool) { 117 117 // if both track name and artists are blank, probably nothing's playing 118 118 if status.track_name.is_empty() && status.artists.is_empty() && !raw { 119 - println!("{}", "nothing playing right now".dimmed()); 119 + println!("nothing playing right now"); 120 120 return; 121 121 } 122 122 123 - println!("{} {}", "track:".dimmed(), status.track_name.blue()); 123 + println!("track: {}", status.track_name); 124 124 125 125 if !status.artists.is_empty() || raw { 126 - print!("{} ", "artists:".dimmed()); 126 + print!("artists: "); 127 127 128 128 for i in 0..status.artists.len() { 129 - print!("{}", status.artists[i].artist_name.magenta()); 129 + print!("{}", status.artists[i].artist_name); 130 130 131 131 if i != status.artists.len() - 1 { 132 - print!("{} ", ",".dimmed()); 132 + print!(", "); 133 133 } 134 134 } 135 135 ··· 137 137 } 138 138 139 139 if let Some(release) = &status.release_name { 140 - println!("{} {}", "release:".dimmed(), release.red()); 140 + println!("release: {}", release); 141 141 } 142 142 143 143 if let Some(played_time) = &status.played_time { 144 144 if raw { 145 - println!( 146 - "{} {}", 147 - "played:".dimmed(), 148 - played_time.format("%Y-%m-%d %H:%M:%S %:z").yellow() 149 - ); 145 + println!("played: {}", played_time.format("%Y-%m-%d %H:%M:%S %:z")); 150 146 } else { 151 147 let local_dt = played_time.with_timezone(&chrono::Local); 152 - println!( 153 - "{} {}", 154 - "played:".dimmed(), 155 - local_dt.format("%Y-%m-%d %H:%M:%S").yellow() 156 - ); 148 + println!("played: {}", local_dt.format("%Y-%m-%d %H:%M:%S")); 157 149 } 158 150 } 159 151 160 152 if let Some(duration) = status.duration { 161 153 if raw { 162 - println!("{} {}", "duration:".dimmed(), duration.green()); 154 + println!("duration: {}", duration); 163 155 } else { 164 156 let hours = duration / 3600; 165 157 let minutes = (duration - (hours * 3600)) / 60; ··· 176 168 duration_str = format!("{}{:02}", duration_str, seconds); 177 169 } 178 170 179 - println!("{} {}", "duration:".dimmed(), duration_str.green()); 171 + println!("duration: {}", duration_str); 180 172 } 181 173 } 182 174 183 175 if let Some(client) = &status.client_id 184 176 && full 185 177 { 186 - println!("{} {}", "client:".dimmed(), client.cyan()); 178 + println!("client: {}", client); 187 179 } 188 180 } 189 181 }