trying out rust
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
gallery-dl/*.sqlite3
|
gallery-dl/*.sqlite3
|
||||||
gallery-dl/log.txt
|
gallery-dl/log.txt
|
||||||
Artists
|
Artists
|
||||||
|
/target
|
||||||
|
7
Cargo.toml
Normal file
7
Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[package]
|
||||||
|
name = "Hentai"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
postgres = "0.19.9"
|
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
for dir in /mnt/nsfb/Hentai/Artists/*/ ; do
|
for dir in /mnt/nsfb/Hentai/Artists/*/ ; do
|
||||||
cd "$dir"
|
[[ -f $dir/Links.md ]] || cp /home/rene/projects/Hentai/Links.md "$dir"
|
||||||
[[ -f Links.md ]] || cp /home/rene/projects/Hentai/Links.md .
|
|
||||||
done
|
done
|
||||||
|
15
src/main.rs
Normal file
15
src/main.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use postgres::{Client, NoTls};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut client = Client::connect("host=192.168.0.10 port=28945 user=hentai password=h99nqaNPhpfbuuhCDwQXLpZAnoVTjSQP7taoqmQhpzc2rPLVC4JUAKxAHfuuhuU9", NoTls).unwrap();
|
||||||
|
let output = client.query("SELECT * FROM get_urls_and_paths('Rule34');", &[]).unwrap();
|
||||||
|
let mut url: &str;
|
||||||
|
let mut path: &str;
|
||||||
|
|
||||||
|
for row in output {
|
||||||
|
url = row.get(0);
|
||||||
|
path = row.get(1);
|
||||||
|
|
||||||
|
println!("{} {}", url, path);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user