diff --git a/doc/MANUAL.md b/doc/MANUAL.md index 824f2d62..c191f872 100644 --- a/doc/MANUAL.md +++ b/doc/MANUAL.md @@ -52,6 +52,7 @@ The text that will be searched for is given after the selector. - *e*: edition. - *v*: volume. - *n*: number. +- *i*: identifier. ### State selectors diff --git a/src/metadata.rs b/src/metadata.rs index 7cf75411..59f44b1f 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -459,6 +459,7 @@ pub struct BookQuery { pub edition: Option, pub volume: Option, pub number: Option, + pub identifier: Option, pub reading: Option, pub new: Option, pub finished: Option, @@ -492,6 +493,7 @@ impl BookQuery { Some('e') => { buf.reverse(); query.edition = make_query(&buf.join(" ")); buf.clear(); }, Some('v') => { buf.reverse(); query.volume = make_query(&buf.join(" ")); buf.clear(); }, Some('n') => { buf.reverse(); query.number = make_query(&buf.join(" ")); buf.clear(); }, + Some('i') => { buf.reverse(); query.identifier = make_query(&buf.join(" ")); buf.clear(); }, Some('R') => query.reading = Some(!invert), Some('N') => query.new = Some(!invert), Some('F') => query.finished = Some(!invert), @@ -529,6 +531,7 @@ impl BookQuery { query.edition.is_none() && query.volume.is_none() && query.number.is_none() && + query.identifier.is_none() && query.reading.is_none() && query.new.is_none() && query.finished.is_none() && @@ -560,6 +563,7 @@ impl BookQuery { self.edition.as_ref().map(|re| re.is_match(&info.edition)) != Some(false) && self.volume.as_ref().map(|re| re.is_match(&info.volume)) != Some(false) && self.number.as_ref().map(|re| re.is_match(&info.number)) != Some(false) && + self.identifier.as_ref().map(|re| re.is_match(&info.identifier)) != Some(false) && self.reading.as_ref().map(|eq| info.simple_status().eq(&SimpleStatus::Reading) == *eq) != Some(false) && self.new.as_ref().map(|eq| info.simple_status().eq(&SimpleStatus::New) == *eq) != Some(false) && self.finished.as_ref().map(|eq| info.simple_status().eq(&SimpleStatus::Finished) == *eq) != Some(false) &&