Go back to bktree index.

This commit is contained in:
Syfaro 2020-01-07 03:05:51 -06:00
parent 478c9a6720
commit e1133b21db
3 changed files with 7 additions and 13 deletions

6
Cargo.lock generated
View File

@ -275,7 +275,7 @@ name = "fa-watcher"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"furaffinity-rs 0.1.0 (git+https://git.huefox.com/syfaro/furaffinity-rs?rev=fb0a65a1619e6f9bfecdcb4badcfc8be1e78911f)", "furaffinity-rs 0.1.0 (git+https://git.huefox.com/syfaro/furaffinity-rs?rev=75254a58385b3a8ea7fde0c86ff764fd1688bad9)",
"postgres 0.17.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", "postgres 0.17.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)",
"r2d2 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
"r2d2_postgres 0.16.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2_postgres 0.16.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -334,7 +334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "furaffinity-rs" name = "furaffinity-rs"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.huefox.com/syfaro/furaffinity-rs?rev=fb0a65a1619e6f9bfecdcb4badcfc8be1e78911f#fb0a65a1619e6f9bfecdcb4badcfc8be1e78911f" source = "git+https://git.huefox.com/syfaro/furaffinity-rs?rev=75254a58385b3a8ea7fde0c86ff764fd1688bad9#75254a58385b3a8ea7fde0c86ff764fd1688bad9"
dependencies = [ dependencies = [
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2155,7 +2155,7 @@ dependencies = [
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum furaffinity-rs 0.1.0 (git+https://git.huefox.com/syfaro/furaffinity-rs?rev=fb0a65a1619e6f9bfecdcb4badcfc8be1e78911f)" = "<none>" "checksum furaffinity-rs 0.1.0 (git+https://git.huefox.com/syfaro/furaffinity-rs?rev=75254a58385b3a8ea7fde0c86ff764fd1688bad9)" = "<none>"
"checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" "checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b"
"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" "checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987"
"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" "checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86"

View File

@ -15,4 +15,4 @@ chrono = "0.4"
[dependencies.furaffinity-rs] [dependencies.furaffinity-rs]
git = "https://git.huefox.com/syfaro/furaffinity-rs" git = "https://git.huefox.com/syfaro/furaffinity-rs"
rev = "fb0a65a1619e6f9bfecdcb4badcfc8be1e78911f" rev = "75254a58385b3a8ea7fde0c86ff764fd1688bad9"

View File

@ -73,15 +73,9 @@ fn insert_submission(
let hash = sub.hash.clone(); let hash = sub.hash.clone();
let url = sub.content.url(); let url = sub.content.url();
if hash.is_some() { client.execute("INSERT INTO submission (id, artist_id, url, filename, hash, rating, posted_at, description, hash_int) VALUES ($1, $2, $3, $4, decode($5, 'base64'), $6, $7, $8, $9)", &[
client.execute("INSERT INTO submission (id, artist_id, url, filename, hash, rating, posted_at, description, c) VALUES ($1, $2, $3, $4, decode($5, 'base64'), $6, $7, $8, CUBE(ARRAY[get_byte(decode($5, 'base64'), 0), get_byte(decode($5, 'base64'), 1), get_byte(decode($5, 'base64'), 2), get_byte(decode($5, 'base64'), 3), get_byte(decode($5, 'base64'), 4), get_byte(decode($5, 'base64'), 5), get_byte(decode($5, 'base64'), 6), get_byte(decode($5, 'base64'), 7)]::smallint[]))", &[ &sub.id, &artist_id, &url, &sub.filename, &hash, &sub.rating.serialize(), &sub.posted_at, &sub.description, &sub.hash_num,
&sub.id, &artist_id, &url, &sub.filename, &hash, &sub.rating.serialize(), &sub.posted_at, &sub.description,
])?; ])?;
} else {
client.execute("INSERT INTO submission (id, artist_id, url, filename, hash, rating, posted_at, description) VALUES ($1, $2, $3, $4, decode($5, 'base64'), $6, $7, $8)", &[
&sub.id, &artist_id, &url, &sub.filename, &hash, &sub.rating.serialize(), &sub.posted_at, &sub.description,
])?;
}
let stmt = client.prepare( let stmt = client.prepare(
"INSERT INTO tag_to_post (tag_id, post_id) VALUES ($1, $2) ON CONFLICT DO NOTHING", "INSERT INTO tag_to_post (tag_id, post_id) VALUES ($1, $2) ON CONFLICT DO NOTHING",