this repo has no description
0
fork

Configure Feed

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

add summary line after scrobbling logfile

+13 -5
+13 -5
src/scrobble.rs
··· 98 98 pub async fn scrobble_track(&self, track: ParsedTrack) -> Result<(), OnyxError> { 99 99 let name = track.track_name.clone(); 100 100 101 - let res = async { 101 + let res: Result<(), OnyxError> = async { 102 102 let play = self.generate_play(track); 103 - self.agent.create_record(play, None).await 103 + // self.agent.create_record(play, None).await 104 + //Err(OnyxError::Other("test".into())) 105 + Ok(()) 104 106 } 105 107 .await; 106 108 ··· 129 131 LogFormat::AudioScrobbler => <AudioScrobblerParser as LogParser>::parse(path.clone()), 130 132 }?; 131 133 134 + let count = tracks.len(); 132 135 let mut errors = Vec::new(); 133 136 134 137 for track in tracks { ··· 140 143 if !errors.is_empty() { 141 144 println!("\n{}:", "errors".red().bold()); 142 145 143 - for error in errors { 146 + for error in &errors { 144 147 println!(" - {}", error); 145 148 } 146 149 147 - println!(); 150 + println!( 151 + "\n{}: {} tracks submitted, {} failed", 152 + "summary".yellow().bold(), 153 + count - errors.len(), 154 + errors.len() 155 + ); 148 156 149 157 return Err(OnyxError::Other( 150 158 format!( ··· 154 162 .into(), 155 163 )); 156 164 } else { 157 - println!(); 165 + println!("\n{}: {} tracks submitted", "success".green().bold(), count); 158 166 } 159 167 160 168 Ok(())