Skip to content

Commit

Permalink
release: 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Nov 16, 2023
2 parents 6f6cce6 + c2e88be commit 2a6a190
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 40 deletions.
14 changes: 7 additions & 7 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Project Dependencies
Package: riprip
Version: 0.2.1
Generated: 2023-11-07 03:46:42 UTC
Version: 0.2.2
Generated: 2023-11-16 21:12:10 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.6 | [Tom Kaitchuck](mailto:[email protected]) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.6.8 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [base64](https://github.com/marshallpierce/rust-base64) | 0.21.5 | [Alice Maz](mailto:[email protected]) and [Marshall Pierce](mailto:[email protected]) | Apache-2.0 or MIT |
| [block-buffer](https://github.com/RustCrypto/utils) | 0.10.4 | RustCrypto Developers | Apache-2.0 or MIT |
| [bytecount](https://github.com/llogiq/bytecount) | 0.6.4 | [Andre Bogus](mailto:[email protected]) and [Joshua Landau](mailto:[email protected]) | Apache-2.0 or MIT |
| [cdtoc](https://github.com/Blobfolio/cdtoc) | 0.3.2 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [bytecount](https://github.com/llogiq/bytecount) | 0.6.7 | [Andre Bogus](mailto:[email protected]) and [Joshua Landau](mailto:[email protected]) | Apache-2.0 or MIT |
| [cdtoc](https://github.com/Blobfolio/cdtoc) | 0.3.3 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [crc32fast](https://github.com/srijs/rust-crc32fast) | 1.3.2 | [Sam Rijs](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [crypto-common](https://github.com/RustCrypto/traits) | 0.1.6 | RustCrypto Developers | Apache-2.0 or MIT |
Expand All @@ -20,7 +20,7 @@
| [faster-hex](https://github.com/NervosFoundation/faster-hex) | 0.8.1 | [zhangsoledad](mailto:[email protected]) | MIT |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.0.1 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 or MIT |
| [form_urlencoded](https://github.com/servo/rust-url) | 1.2.0 | The rust-url developers | Apache-2.0 or MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.11.7 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.11.8 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [generic-array](https://github.com/fizyk20/generic-array.git) | 0.14.7 | [Bartłomiej Kamiński](mailto:[email protected]) and [Aaron Trent](mailto:[email protected]) | MIT |
| [idna](https://github.com/servo/rust-url/) | 0.4.0 | The rust-url developers | Apache-2.0 or MIT |
| [itoa](https://github.com/dtolnay/itoa) | 1.0.9 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
Expand All @@ -29,7 +29,7 @@
| [once_cell](https://github.com/matklad/once_cell) | 1.18.0 | [Aleksey Kladov](mailto:[email protected]) | Apache-2.0 or MIT |
| [oxford_join](https://github.com/Blobfolio/oxford_join) | 0.2.9 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [percent-encoding](https://github.com/servo/rust-url/) | 2.3.0 | The rust-url developers | Apache-2.0 or MIT |
| [riprip_core](https://github.com/Blobfolio/riprip) | 0.2.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [riprip_core](https://github.com/Blobfolio/riprip) | 0.2.2 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [sha1](https://github.com/RustCrypto/hashes) | 0.10.6 | RustCrypto Developers | Apache-2.0 or MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.8.1 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | Apache-2.0 or MIT |
| [term_size](https://github.com/kbknapp/term_size-rs.git) | 0.3.2 | [Kevin K.](mailto:[email protected]) and [Benjamin Sago](mailto:[email protected]) | Apache-2.0 or MIT |
Expand All @@ -43,4 +43,4 @@
| [ureq](https://github.com/algesten/ureq) | 2.8.0 | [Martin Algesten](mailto:[email protected]) and [Jacob Hoffman-Andrews](mailto:[email protected]) | Apache-2.0 or MIT |
| [url](https://github.com/servo/rust-url) | 2.4.1 | The rust-url developers | Apache-2.0 or MIT |
| [utc2k](https://github.com/Blobfolio/utc2k) | 0.7.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.25 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.26 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
1 change: 1 addition & 0 deletions release/completions/riprip.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _basher___riprip() {
[[ " ${COMP_LINE} " =~ " --no-rip " ]] || opts+=("--no-rip")
[[ " ${COMP_LINE} " =~ " --no-summary " ]] || opts+=("--no-summary")
[[ " ${COMP_LINE} " =~ " --reset " ]] || opts+=("--reset")
[[ " ${COMP_LINE} " =~ " --status " ]] || opts+=("--status")
[[ " ${COMP_LINE} " =~ " --strict " ]] || opts+=("--strict")
[[ " ${COMP_LINE} " =~ " sync " ]] || opts+=("sync")
if [[ ! " ${COMP_LINE} " =~ " -v " ]] && [[ ! " ${COMP_LINE} " =~ " --verbose " ]]; then
Expand Down
7 changes: 5 additions & 2 deletions release/man/riprip.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.TH "RIP RIP HOORAY!" "1" "November 2023" "Rip Rip Hooray! v0.2.1" "User Commands"
.TH "RIP RIP HOORAY!" "1" "November 2023" "Rip Rip Hooray! v0.2.2" "User Commands"
.SH NAME
Rip Rip Hooray! \- Manual page for riprip v0.2.1.
Rip Rip Hooray! \- Manual page for riprip v0.2.2.
.SH DESCRIPTION
A specialized audio CD\-ripper optimized for incremental data recovery.
.SS USAGE:
Expand Down Expand Up @@ -29,6 +29,9 @@ Skip the drive and disc summary and jump straight to ripping.
\fB\-\-reset\fR
Flip 'likely' samples back to 'maybe', keeping their values, but resetting all counts to one. This is a softer alternative to \-\-no\-resume, and will not affect tracks confirmed by AccurateRip/CUETools.
.TP
\fB\-\-status\fR
Print the status of the individual track rips (that you presumably already started) to STDERR and exit. Note that only the \-\-no\-summary, \-\-confidence, and \-r/\-\-rereads options have any meaning in this mode.
.TP
\fB\-\-strict\fR
Consider C2 errors an all\-or\-nothing proposition for the sector as a whole, marking all samples bad if any of them are bad. This is most effective when applied consistently from the initial rip and onward.
.TP
Expand Down
6 changes: 5 additions & 1 deletion riprip/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riprip"
version = "0.2.1"
version = "0.2.2"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down Expand Up @@ -61,6 +61,10 @@ description = "Skip the drive and disc summary and jump straight to ripping."
long = "--reset"
description = "Flip 'likely' samples back to 'maybe', keeping their values, but resetting all counts to one. This is a softer alternative to --no-resume, and will not affect tracks confirmed by AccurateRip/CUETools."

[[package.metadata.bashman.switches]]
long = "--status"
description = "Print the status of the individual track rips (that you presumably already started) to STDERR and exit. Note that only the --no-summary, --confidence, and -r/--rereads options have any meaning in this mode."

[[package.metadata.bashman.switches]]
long = "--strict"
description = "Consider C2 errors an all-or-nothing proposition for the sector as a whole, marking all samples bad if any of them are bad. This is most effective when applied consistently from the initial rip and onward."
Expand Down
110 changes: 81 additions & 29 deletions riprip/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,18 @@ fn _main() -> Result<(), RipRipError> {
// Go ahead and leave if there's no ripping to do.
if args.switch(b"--no-rip") { return Ok(()); }

// Set up the ripper!
let opts = parse_rip_options(&args, drivevendormodel, &disc)?;
// Set up progress and killswitch in case they're needed.
let progress = Progless::default();
let killed = KillSwitch::default();
sigint(killed.inner(), Some(progress.clone()));

// Summarize.
// Just checking the status?
if let Some(opts) = parse_rip_status_options(&args, &disc)? {
return disc.status(&opts, &progress, &killed);
}

// Parse the options.
let opts = parse_rip_options(&args, drivevendormodel, &disc)?;
rip_summary(&disc, &opts)?;

// Log header.
Expand Down Expand Up @@ -235,39 +240,16 @@ fn parse_rip_options(args: &Argue, drive: Option<DriveVendorModel>, disc: &Disc)
opts = opts.with_cache(v);
}

if let Some(v) = args.option(b"--confidence") {
let confidence = u8::btou(v).ok_or(RipRipError::CliParse("--confidence"))?;
opts = opts.with_confidence(confidence);
if let Some(v) = parse_rip_option_confidence(args)? {
opts = opts.with_confidence(v);
}

if let Some(v) = args.option2(b"-p", b"--passes").or_else(|| args.option(b"--pass")) {
let passes = u8::btou(v).ok_or(RipRipError::CliParse("-p/--passes"))?;
opts = opts.with_passes(passes);
}

// Rereads are kinda annoying.
if let Some(v) = args.option2(b"-r", b"--rereads").or_else(|| args.option(b"--reread")) {
// Default.
let mut a = 2;
let mut b = 2;

// If there's a comma, there could be up to two values. Keep the
// default if either is omitted.
if let Some(pos) = v.iter().position(|b| b','.eq(b)) {
let tmp = &v[..pos];
if ! tmp.is_empty() {
a = u8::btou(tmp).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}
let tmp = &v[pos + 1..];
if ! tmp.is_empty() {
b = u8::btou(tmp).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}
}
// A number by itself affects only the first part.
else {
a = u8::btou(v).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}

if let Some((a, b)) = parse_rip_option_reread(args)? {
opts = opts.with_rereads(a, b);
}

Expand Down Expand Up @@ -323,6 +305,72 @@ fn parse_rip_options(args: &Argue, drive: Option<DriveVendorModel>, disc: &Disc)
Ok(opts)
}

/// # Parse Rip (Status) Options.
///
/// Return (mostly) default options if `--status` is set.
fn parse_rip_status_options(args: &Argue, disc: &Disc)
-> Result<Option<RipOptions>, RipRipError> {
if args.switch(b"--status") {
// Make a generic options with all the tracks.
let mut opts = RipOptions::default();

if let Some(v) = parse_rip_option_confidence(args)? {
opts = opts.with_confidence(v);
}

if let Some((a, b)) = parse_rip_option_reread(args)? {
opts = opts.with_rereads(a, b);
}

// Add all tracks from the disc.
let toc = disc.toc();
if toc.htoa().is_some() { opts = opts.with_track(0); }
for t in toc.audio_tracks() { opts = opts.with_track(t.number()); }

Ok(Some(opts))
}
else { Ok(None) }
}

/// # Parse Confidence Option.
fn parse_rip_option_confidence(args: &Argue) -> Result<Option<u8>, RipRipError> {
if let Some(v) = args.option(b"--confidence") {
let confidence = u8::btou(v).ok_or(RipRipError::CliParse("--confidence"))?;
Ok(Some(confidence))
}
else { Ok(None) }
}

/// # Parse Re-read Option.
fn parse_rip_option_reread(args: &Argue) -> Result<Option<(u8, u8)>, RipRipError> {
// Rereads are kinda annoying.
if let Some(v) = args.option2(b"-r", b"--rereads").or_else(|| args.option(b"--reread")) {
// Default.
let mut a = 2;
let mut b = 2;

// If there's a comma, there could be up to two values. Keep the
// default if either is omitted.
if let Some(pos) = v.iter().position(|b| b','.eq(b)) {
let tmp = &v[..pos];
if ! tmp.is_empty() {
a = u8::btou(tmp).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}
let tmp = &v[pos + 1..];
if ! tmp.is_empty() {
b = u8::btou(tmp).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}
}
// A number by itself affects only the first part.
else {
a = u8::btou(v).ok_or(RipRipError::CliParse("-r/--rereads"))?;
}

Ok(Some((a, b)))
}
else { Ok(None) }
}

/// # Rip Summary.
///
/// Summarize and confirm the chosen settings before proceeding.
Expand Down Expand Up @@ -542,6 +590,10 @@ MISCELLANEOUS:
exit (without ripping anything).
--no-summary Skip the drive and disc summary and jump straight to
ripping.
--status Print the status of the individual track rips (that you
presumably already started) to STDERR and exit. Note that
only the --no-summary, --confidence, and -r/--rereads
options have any meaning in this mode.
EARLY EXIT:
If you don't have time to let a rip finish naturally, press "#, "\x1b[38;5;208mCTRL\x1b[0m+\x1b[38;5;208mC\x1b[0m to stop
Expand Down
2 changes: 1 addition & 1 deletion riprip_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riprip_core"
version = "0.2.1"
version = "0.2.2"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down
17 changes: 17 additions & 0 deletions riprip_core/src/disc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,23 @@ impl Disc {

Ok(())
}

/// # Status.
///
/// Print the status information for each track, if any.
///
/// ## Errors
///
/// This will return an error if there are I/O problems or the user aborts.
pub fn status(&self, opts: &RipOptions, progress: &Progless, killed: &KillSwitch)
-> Result<(), RipRipError> {
// Load the ripper.
let mut rip = Ripper::new(self, opts)?;
rip.status(progress, killed)?;
rip.summarize_status();

Ok(())
}
}


Expand Down
Loading

0 comments on commit 2a6a190

Please sign in to comment.