Increment version and update documentation

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/7/head
trivernis 3 years ago
parent b82ecbef75
commit daffe24734
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,6 +1,6 @@
[package] [package]
name = "hydrus-api" name = "hydrus-api"
version = "0.4.0" version = "0.5.0"
authors = ["trivernis <trivernis@protonmail.com>"] authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018" edition = "2018"
license = "Apache-2.0" license = "Apache-2.0"

@ -23,6 +23,7 @@ use hydrus_api::wrapper::tag::Tag;
use hydrus_api::wrapper::service::ServiceName; use hydrus_api::wrapper::service::ServiceName;
use hydrus_api::wrapper::hydrus_file::FileStatus; use hydrus_api::wrapper::hydrus_file::FileStatus;
use hydrus_api::wrapper::page::PageIdentifier; use hydrus_api::wrapper::page::PageIdentifier;
use hydrus_api::wrapper::builders::search_builder::SortType;
use hydrus_api::wrapper::builders::tag_builder::{ use hydrus_api::wrapper::builders::tag_builder::{
SystemTagBuilder, Comparator SystemTagBuilder, Comparator
}; };
@ -33,11 +34,12 @@ async fn main() {
let access_key = env::var("HYDRUS_ACCESS_KEY").unwrap(); let access_key = env::var("HYDRUS_ACCESS_KEY").unwrap();
let hydrus = Hydrus::new(Client::new(hydrus_url, access_key)); let hydrus = Hydrus::new(Client::new(hydrus_url, access_key));
let files = hydrus.search(vec![ let files = hydrus.search()
Tag::from("character:megumin"), .add_tag(Tag::from("character:megumin"))
SystemTagBuilder::new().archive().build(), .add_tag(SystemTagBuilder::new().archive().build())
SystemTagBuilder::new().number_of_tags(Comparator::Greater, 12).build(), .add_tag(SystemTagBuilder::new().number_of_tags(Comparator::Greater, 12).build())
]).await.unwrap(); .sort(SortType::ModifiedTime)
.run().await.unwrap();
for mut file in files { for mut file in files {
file.add_tags(ServiceName::my_tags(), vec![Tag::from("ark mage")]).await.unwrap(); file.add_tags(ServiceName::my_tags(), vec![Tag::from("ark mage")]).await.unwrap();

@ -13,17 +13,20 @@
//! use hydrus_api::wrapper::hydrus_file::FileStatus; //! use hydrus_api::wrapper::hydrus_file::FileStatus;
//! use hydrus_api::wrapper::page::PageIdentifier; //! use hydrus_api::wrapper::page::PageIdentifier;
//! use hydrus_api::wrapper::builders::tag_builder::{SystemTagBuilder, Comparator}; //! use hydrus_api::wrapper::builders::tag_builder::{SystemTagBuilder, Comparator};
//! use hydrus_api::wrapper::builders::search_builder::SortType;
//! //!
//! # #[tokio::test] //! # #[tokio::test]
//! # async fn doctest() { //! # async fn doctest() {
//! let hydrus_url = env::var("HYDRUS_URL").unwrap(); //! let hydrus_url = env::var("HYDRUS_URL").unwrap();
//! let access_key = env::var("HYDRUS_ACCESS_KEY").unwrap(); //! let access_key = env::var("HYDRUS_ACCESS_KEY").unwrap();
//! let hydrus = Hydrus::new(Client::new(hydrus_url, access_key)); //! let hydrus = Hydrus::new(Client::new(hydrus_url, access_key));
//! let files = hydrus.search(vec![ //! let files = hydrus.search()
//! Tag::from("character:megumin"), //! .add_tag(Tag::from("character:megumin"))
//! SystemTagBuilder::new().archive().build(), //! .add_tag(SystemTagBuilder::new().archive().build())
//! SystemTagBuilder::new().tag_namespace_as_number("page", Comparator::Equal, 5).negate().build(), //! .add_tag(SystemTagBuilder::new().tag_namespace_as_number("page", Comparator::Equal, 5).negate().build())
//! ]).await.unwrap(); //! .sort_by(SortType::NumberOfPixels)
//! .sort_descending()
//! .run().await.unwrap();
//! //!
//! for mut file in files { //! for mut file in files {
//! file.add_tags(ServiceName::my_tags(), vec![Tag::from("ark mage")]).await.unwrap(); //! file.add_tags(ServiceName::my_tags(), vec![Tag::from("ark mage")]).await.unwrap();

Loading…
Cancel
Save