summaryrefslogtreecommitdiff
path: root/dichroism/src/models/photo_set.rs
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-10-22 22:09:46 -0400
committerAdam T. Carpenter <atc@53hor.net>2020-10-22 22:09:46 -0400
commit5cb0869b94fc8b9aff564055af9a60046de7b028 (patch)
tree022cd909467d10747e9aa36d9455d47ea90b6c97 /dichroism/src/models/photo_set.rs
parent99dabd3f2f81ffcf0b6f2b59e13ebb4502b2ccac (diff)
downloadtheglassyladies-5cb0869b94fc8b9aff564055af9a60046de7b028.tar.xz
theglassyladies-5cb0869b94fc8b9aff564055af9a60046de7b028.zip
Skipped separate photo table; working handler for get all products
(lacking cats)
Diffstat (limited to 'dichroism/src/models/photo_set.rs')
-rw-r--r--dichroism/src/models/photo_set.rs25
1 files changed, 9 insertions, 16 deletions
diff --git a/dichroism/src/models/photo_set.rs b/dichroism/src/models/photo_set.rs
index 84fe0e1..7187c65 100644
--- a/dichroism/src/models/photo_set.rs
+++ b/dichroism/src/models/photo_set.rs
@@ -21,6 +21,15 @@ pub struct PhotoSet {
}
impl PhotoSet {
+ pub fn from_photos(original: Photo, fullsize: Photo, base: Photo, thumbnail: Photo) -> Self {
+ Self {
+ original,
+ fullsize,
+ base,
+ thumbnail,
+ }
+ }
+
pub fn from_data_uri(uri: &str) -> Result<Self> {
let data = DATA_URI_RE
.captures(uri)
@@ -50,19 +59,3 @@ impl PhotoSet {
})
}
}
-
-#[cfg(test)]
-mod tests {
- //use super::*;
-
- const TEST_DATA_URI: &str = include_str!("../unit_test_data/img_data_uri.txt");
- const TEST_DATA_BASE64: &str = include_str!("../unit_test_data/test_data_base64.txt");
-
- #[test]
- fn test_gen_product_images() {
- // PhotoSet::from_data_uri(TEST_DATA_URI.trim())
- // .unwrap()
- // .commit(".")
- // .unwrap();
- }
-}