From 8643b3c030c3ddc310111dda9c607108317b6140 Mon Sep 17 00:00:00 2001 From: pjmp <11157420+pjmp@users.noreply.github.com> Date: Sun, 17 Sep 2023 21:26:59 +0545 Subject: [PATCH] deps: update --- Cargo.lock | 17 ++++++++--------- Cargo.toml | 4 ++-- README.md | 4 +++- TODO.md | 4 ++++ src/lib/utils.rs | 6 +++--- 5 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 TODO.md diff --git a/Cargo.lock b/Cargo.lock index 9780bb4..76f7cae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,29 +79,28 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.27" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "num-traits", ] [[package]] name = "clap" -version = "4.4.1" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c8d502cbaec4595d2e7d5f61e318f05417bd2b66fdc3809498f0d3fdf0bea27" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.4.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5891c7bc0edb3e1c2204fc5e94009affabeb1821c9e5fdc3959536c5c0bb984d" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstyle", "clap_lex", @@ -110,9 +109,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index a3ce1b9..5300cf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ path = "src/lib/mod.rs" [dependencies] anyhow = "1.0.75" -chrono = {version = "0.4.27", default-features = false} -clap = {version = "4.4.1", default-features = false, features = [ +chrono = {version = "0.4.31", default-features = false} +clap = {version = "4.4.3", default-features = false, features = [ "derive", "error-context", "help", diff --git a/README.md b/README.md index fe16bb3..5d81b09 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Sunny is hugely inspired by [SoundScrape](https://github.com/Miserlou/SoundScrap ### Format -By default files are saved in this structure in current directory if `--path` option is not passed. +By default, files are saved in this structure in current directory if `--path` option is not passed. ``` Artist @@ -123,3 +123,5 @@ Note: run --help to see full descriptions of each flags/options ## Contributing Contributions, issues and feature requests are welcome! + +Please have a look at [TODO.md](./TODO.md). \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..6b6a79b --- /dev/null +++ b/TODO.md @@ -0,0 +1,4 @@ +# TODO + +- Improve error handler/reporter +- Improve UI \ No newline at end of file diff --git a/src/lib/utils.rs b/src/lib/utils.rs index 4e4eb71..1952f79 100644 --- a/src/lib/utils.rs +++ b/src/lib/utils.rs @@ -56,10 +56,10 @@ pub fn track_path(track: &Track, root: &Path, track_format: &String) -> Result

Option { - use chrono::{Datelike, TimeZone, Timelike, Utc}; + use chrono::{DateTime, Datelike, Timelike}; // if String looks like this `28 Sep 2014 04:19:31 GMT` - match Utc.datetime_from_str(date_string, "%d %b %Y %T %Z") { + match DateTime::parse_from_str(date_string, "%d %b %Y %T %Z") { Ok(date) => Some(Timestamp { year: date.year(), month: Some(date.month() as u8), @@ -74,7 +74,7 @@ pub fn timestamp(date_string: &str) -> Option { let mut date_string = date_string.to_owned(); date_string.push_str(" 01:01:01"); - match Utc.datetime_from_str(&date_string, "released %B %d, %Y %T") { + match DateTime::parse_from_str(&date_string, "released %B %d, %Y %T") { Ok(date) => Some(Timestamp { year: date.year(), month: Some(date.month() as u8),