Compare commits

..

24 commits

Author SHA1 Message Date
4c425dbddf Add Debian as an example. 2024-08-12 12:07:13 +02:00
339e8534ec README.md aktualisiert 2024-05-17 08:33:28 +02:00
fb30301da8 note added 2024-05-13 07:44:34 +02:00
e1d0ac3200 README.md aktualisiert 2024-04-15 11:11:58 +02:00
9f0484f4a8 User feedback added 2024-01-10 10:53:40 +01:00
aa0f1f6999 Tested firmware versions updated 2023-06-14 10:32:03 +02:00
acdeb3d19a dependencies updated 2022-07-12 13:21:59 +02:00
b30209c62f Tested versions 6.4 -> 6.5 2022-02-08 12:36:31 +01:00
5af608f45b Rust edition 2018 → 2021 2021-10-25 08:40:50 +02:00
6db590f333 Push to new version. 2021-08-06 15:14:50 +02:00
56624427d5 Adapted to the new database schema. 2021-08-06 15:10:55 +02:00
8ef3238ac3 Push to new version. 2021-08-06 11:03:10 +02:00
49853f9d2f Do not rely on database column ext.
Since firmware version 6.4 seems to ignore this column, we also look at the file name suffix.
2021-08-06 11:00:16 +02:00
e1beced72c Merge branch 'master' of ssh://git.rustysoft.de:60022/martin/pbdbfixer 2021-05-26 13:36:22 +02:00
995bc5e3ed updated to rusqlite 0.25 2021-05-26 13:29:43 +02:00
3a794874dc software versions updated 2021-04-27 07:51:12 +02:00
ef7710cca6 Calibre emphasized 2021-03-29 15:25:10 +02:00
f50e5e09e6 firmware versions updated 2021-03-29 15:24:28 +02:00
2fcb2ac3e7 Considering the altered database structure
fixing #2
2021-03-29 15:19:03 +02:00
ad179ac9e0
push to new dependency versions 2021-03-04 12:57:23 +01:00
d683804623 feedback part added 2021-03-03 14:04:50 +01:00
ec11c16477 build instructions improved 2021-03-03 13:29:35 +01:00
65007fdf50 push to new version 2021-02-26 13:47:56 +01:00
a6594d4abc Also fetch metadata from Adobe DRM encoded books 2021-02-26 13:28:29 +01:00
6 changed files with 397 additions and 206 deletions

448
Cargo.lock generated
View file

@ -1,34 +1,68 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3
[[package]] [[package]]
name = "adler32" name = "adler"
version = "1.2.0" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aes"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8"
dependencies = [
"cfg-if",
"cipher",
"cpufeatures",
"opaque-debug",
]
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.4.7" version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
"getrandom",
"once_cell",
"version_check",
]
[[package]]
name = "base64ct"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.2.1" version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "block-buffer"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
dependencies = [
"generic-array",
]
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.4.2" version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]] [[package]]
name = "bzip2" name = "bzip2"
version = "0.3.3" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
dependencies = [ dependencies = [
"bzip2-sys", "bzip2-sys",
"libc", "libc",
@ -36,9 +70,9 @@ dependencies = [
[[package]] [[package]]
name = "bzip2-sys" name = "bzip2-sys"
version = "0.1.10+1.0.8" version = "0.1.11+1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@ -47,15 +81,12 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.66" version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
dependencies = [
[[package]] "jobserver",
name = "cfg-if" ]
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -64,12 +95,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "crc32fast" name = "cipher"
version = "1.2.1" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "generic-array",
]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "cpufeatures"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b"
dependencies = [
"libc",
]
[[package]]
name = "crc32fast"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83"
dependencies = [
"cfg-if",
"once_cell",
]
[[package]]
name = "crypto-common"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ccfd8c0ee4cce11e45b3fd6f9d5e69e0cc62912aa6a0cb1bf4617b0eba5a12f"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "digest"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
dependencies = [
"block-buffer",
"crypto-common",
"subtle",
] ]
[[package]] [[package]]
@ -86,45 +172,88 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.14" version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [ dependencies = [
"cfg-if 0.1.10",
"crc32fast", "crc32fast",
"libc",
"miniz_oxide", "miniz_oxide",
] ]
[[package]] [[package]]
name = "hashbrown" name = "generic-array"
version = "0.9.1" version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803"
dependencies = [
"typenum",
"version_check",
]
[[package]]
name = "getrandom"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "hashbrown"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [ dependencies = [
"ahash", "ahash",
] ]
[[package]] [[package]]
name = "hashlink" name = "hashlink"
version = "0.6.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
] ]
[[package]] [[package]]
name = "libc" name = "hmac"
version = "0.2.86" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [
"digest",
]
[[package]]
name = "itoa"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
[[package]]
name = "jobserver"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
dependencies = [
"libc",
]
[[package]]
name = "libc"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
version = "0.20.1" version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64d31059f22935e6c31830db5249ba2b7ecd54fd73a9909286f0a67aa55c2fbd" checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14"
dependencies = [ dependencies = [
"cc", "cc",
"pkg-config", "pkg-config",
@ -133,22 +262,54 @@ dependencies = [
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.3.4" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.3.7" version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
dependencies = [ dependencies = [
"adler32", "adler",
]
[[package]]
name = "num_threads"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44"
dependencies = [
"libc",
]
[[package]]
name = "once_cell"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "password-hash"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8"
dependencies = [
"base64ct",
"rand_core",
"subtle",
] ]
[[package]] [[package]]
name = "pbdbfixer" name = "pbdbfixer"
version = "0.7.2" version = "0.8.3"
dependencies = [ dependencies = [
"quick-xml", "quick-xml",
"rusqlite", "rusqlite",
@ -156,43 +317,43 @@ dependencies = [
] ]
[[package]] [[package]]
name = "pkg-config" name = "pbkdf2"
version = "0.3.19" version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7"
[[package]]
name = "proc-macro2"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
dependencies = [ dependencies = [
"unicode-xid", "digest",
"hmac",
"password-hash",
"sha2",
] ]
[[package]] [[package]]
name = "quick-xml" name = "pkg-config"
version = "0.21.0" version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0452695941410a58c8ce4391707ba9bad26a247173bd9886a05a5e8a8babec75" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]]
name = "quick-xml"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9279fbdacaad3baf559d8cabe0acc3d06e30ea14931af31af79578ac0946decc"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]] [[package]]
name = "quote" name = "rand_core"
version = "1.0.9" version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [
"proc-macro2",
]
[[package]] [[package]]
name = "rusqlite" name = "rusqlite"
version = "0.24.2" version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38ee71cbab2c827ec0ac24e76f82eca723cee92c509a65f67dee393c25112" checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"fallible-iterator", "fallible-iterator",
@ -203,104 +364,127 @@ dependencies = [
"smallvec", "smallvec",
] ]
[[package]]
name = "sha1"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]]
name = "sha2"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.6.1" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]] [[package]]
name = "syn" name = "subtle"
version = "1.0.60" version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
dependencies = [
"proc-macro2",
"quote",
"unicode-xid",
]
[[package]]
name = "thiserror"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.44" version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217"
dependencies = [ dependencies = [
"itoa",
"libc", "libc",
"wasi", "num_threads",
"winapi", "time-macros",
] ]
[[package]] [[package]]
name = "unicode-xid" name = "time-macros"
version = "0.2.1" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792"
[[package]]
name = "typenum"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]] [[package]]
name = "vcpkg" name = "vcpkg"
version = "0.2.11" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.10.0+wasi-snapshot-preview1" version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "zip" name = "zip"
version = "0.5.10" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a8977234acab718eb2820494b2f96cbb16004c19dddf88b7445b27381450997" checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d"
dependencies = [ dependencies = [
"aes",
"byteorder", "byteorder",
"bzip2", "bzip2",
"constant_time_eq",
"crc32fast", "crc32fast",
"crossbeam-utils",
"flate2", "flate2",
"thiserror", "hmac",
"pbkdf2",
"sha1",
"time", "time",
"zstd",
]
[[package]]
name = "zstd"
version = "0.10.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
version = "4.1.6+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb"
dependencies = [
"libc",
"zstd-sys",
]
[[package]]
name = "zstd-sys"
version = "1.6.3+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8"
dependencies = [
"cc",
"libc",
] ]

View file

@ -1,15 +1,15 @@
[package] [package]
name = "pbdbfixer" name = "pbdbfixer"
version = "0.7.2" version = "0.8.3"
authors = ["Martin Brodbeck <martin@brodbeck-online.de>"] authors = ["Martin Brodbeck <martin@brodbeck-online.de>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
zip = "0.5" zip = "0.6"
quick-xml = "0.21" quick-xml = "0.23"
[dependencies.rusqlite] [dependencies.rusqlite]
version = "0.24" version = "0.27"
features = ["bundled"] features = ["bundled"]

View file

@ -15,15 +15,21 @@ The app tries to fix the following issues in the database
- Add missing genre if present in epub (genre and booktogenre tables) - Add missing genre if present in epub (genre and booktogenre tables)
- Add missing series information (books_impl table) - Add missing series information (books_impl table)
The best results are achieved when metadata has been carefully maintained with **Calibre**.
## Compatibility ## Compatibility
This program is tested on a PocketBook This program is tested on a PocketBook
- *Touch HD 3* (software version 6.1.900) - *Touch Lux 4* (software version 6.5)
- *Inkpad 3 Pro* (software version 6.0.1067) - *Touch HD 3* (software version 6.7)
- Known minor issue: dialog orientation is wrong - *Era* (software version 6.8) [^1]
- *Touch Lux 4* (software version 6.0.1118) - *InkPad 3 Pro* (software version 6.8) [^1]
- *InkPad 4* (software version 6.8)
- *Verse Pro* (software version 6.8) [^1]
It might work with other PocketBook devices/software versions. Please tell me if it works for you (and do make a backup of the explorer-3.db file before trying!). It might work with other PocketBook devices/software versions. Please tell me if it works for you (and do make a backup of the explorer-3.db file before trying!).
<span style="color: red">**Please note:**</span> As I do not currently own a PocketBook device, I am unfortunately unable to react to changes in the database structure. Perhaps you can send me your `explorer-3.db` so that I can take a look at the changes. Just get in touch with me.
## Installation and Usage ## Installation and Usage
--- ---
**WARNING**: **WARNING**:
@ -35,10 +41,13 @@ Use at your own risk. In case of doubt it is not a mistake to make a backup of t
Just copy the executable file into the PocketBook's application directory. If you encounter duplicate authors or other issues (see "Features" above) in the PocketBook's library, open the applications screen and tap on the PbDbFixer icon. Just copy the executable file into the PocketBook's application directory. If you encounter duplicate authors or other issues (see "Features" above) in the PocketBook's library, open the applications screen and tap on the PbDbFixer icon.
If you don't see any changes: If you don't see any changes:
There might be an explorer (which shows your library) process already running Then you should just stop/kill it with the task manager. Putting the device to sleep and then wake it up might also work. Afterwards, the changes should be visible to the explorer. There might be an explorer (which shows your library) process already running. Then you should just stop/kill it with the task manager. Putting the device to sleep and then wake it up might also work. Afterwards, the changes should be visible to the explorer.
## Feedback
Feedback is highly appreciated. You can reach me via Matrix [@beedaddy:matrix.rustysoft.de](https://matrix.to/#/@beedaddy:matrix.rustysoft.de) or ask questions in the [PbDbFixer-Thread](https://www.e-reader-forum.de/t/pbdbfixer-noch-ein-tool-zum-korrigieren-von-metadaten.156702/) of the German *E-Reader Forum*.
## Build ## Build
If you want to build PbDbFixer yourself, you have to have the cross compiler for ARM CPUs installed. On Arch Linux, the AUR package `arm-linux-gnueabi-gcc75-linaro-bin` does the job. Don't forget to tell `cargo` which compiler/linker it has to invoke. In my case, I had to edit `~/.cargo/config`: If you want to build PbDbFixer yourself, make sure that you have Rust's toolchain target `arm-unknown-linux-gnueabi` as well as the GCC cross compiler for ARM CPUs installed. On **Arch** Linux, the AUR package `arm-linux-gnueabi-gcc75-linaro-bin` does the job. On **Debian**, you have to install the package `gcc-arm-linux-gnueabi`. Don't forget to tell `cargo` which compiler/linker it has to invoke. In my case, I had to edit `~/.cargo/config`:
``` ```
[target.arm-unknown-linux-gnueabi] [target.arm-unknown-linux-gnueabi]
linker = "arm-linux-gnueabi-gcc" linker = "arm-linux-gnueabi-gcc"
@ -47,3 +56,5 @@ Now you can easily compile the stuff by invoking
``` ```
cargo build --release --target=arm-unknown-linux-gnueabi cargo build --release --target=arm-unknown-linux-gnueabi
``` ```
[^1]: User feedback

View file

@ -1,4 +1,4 @@
use rusqlite::{named_params, Connection, Transaction, NO_PARAMS}; use rusqlite::{named_params, Connection, Transaction};
use crate::epub; use crate::epub;
@ -9,7 +9,6 @@ pub struct BookEntry {
filepath: String, filepath: String,
author: String, author: String,
firstauthor: String, firstauthor: String,
has_drm: bool,
genre: String, genre: String,
first_author_letter: String, first_author_letter: String,
series: String, series: String,
@ -18,9 +17,17 @@ pub struct BookEntry {
fn get_epubs_from_database(tx: &Transaction) -> Vec<BookEntry> { fn get_epubs_from_database(tx: &Transaction) -> Vec<BookEntry> {
let mut book_entries = Vec::new(); let mut book_entries = Vec::new();
let mut stmt = tx let version: i32 = tx
.prepare( .query_row(r#"SELECT id FROM version"#, [], |r| r.get(0))
r#" .unwrap();
let books_or_files = match version {
x if x >= 38 => "files",
_ => "books",
};
let stmt_str = format!(
r#"
SELECT books.id, folders.name, files.filename, books.firstauthor, SELECT books.id, folders.name, files.filename, books.firstauthor,
books.author, genres.name, first_author_letter, series books.author, genres.name, first_author_letter, series
FROM books_impl books JOIN files FROM books_impl books JOIN files
@ -31,12 +38,14 @@ fn get_epubs_from_database(tx: &Transaction) -> Vec<BookEntry> {
ON books.id = btg.bookid ON books.id = btg.bookid
LEFT OUTER JOIN genres LEFT OUTER JOIN genres
ON genres.id = btg.genreid ON genres.id = btg.genreid
WHERE files.storageid = 1 AND books.ext = 'epub' WHERE files.storageid = 1 AND {}.ext = 'epub'
ORDER BY books.id"#, ORDER BY books.id"#,
) &books_or_files
.unwrap(); );
let mut rows = stmt.query(NO_PARAMS).unwrap(); let mut stmt = tx.prepare(&stmt_str).unwrap();
let mut rows = stmt.query([]).unwrap();
while let Some(row) = rows.next().unwrap() { while let Some(row) = rows.next().unwrap() {
let book_id: i32 = row.get(0).unwrap(); let book_id: i32 = row.get(0).unwrap();
@ -45,10 +54,6 @@ fn get_epubs_from_database(tx: &Transaction) -> Vec<BookEntry> {
let filepath = format!("{}/{}", prefix, filename); let filepath = format!("{}/{}", prefix, filename);
let firstauthor: String = row.get(3).unwrap_or_default(); let firstauthor: String = row.get(3).unwrap_or_default();
let author: String = row.get(4).unwrap_or_default(); let author: String = row.get(4).unwrap_or_default();
let has_drm = match prefix.as_str() {
"/mnt/ext1/Digital Editions" => true,
_ => false,
};
let genre: String = row.get(5).unwrap_or_default(); let genre: String = row.get(5).unwrap_or_default();
let first_author_letter = row.get(6).unwrap_or_default(); let first_author_letter = row.get(6).unwrap_or_default();
let series: String = row.get(7).unwrap_or_default(); let series: String = row.get(7).unwrap_or_default();
@ -58,7 +63,6 @@ fn get_epubs_from_database(tx: &Transaction) -> Vec<BookEntry> {
filepath, filepath,
firstauthor, firstauthor,
author, author,
has_drm,
genre, genre,
first_author_letter, first_author_letter,
series, series,
@ -85,31 +89,44 @@ fn remove_ghost_books_from_db(tx: &Transaction) -> usize {
) )
.unwrap(); .unwrap();
let num = stmt.execute(NO_PARAMS).unwrap(); let num = stmt.execute([]).unwrap();
tx.execute( tx.execute(
r#"DELETE FROM books_settings WHERE bookid NOT IN ( SELECT id FROM books_impl )"#, r#"DELETE FROM books_settings WHERE bookid NOT IN ( SELECT id FROM books_impl )"#,
NO_PARAMS, [],
)
.unwrap();
tx.execute(
r#"DELETE FROM books_uids WHERE book_id NOT IN ( SELECT id FROM books_impl )"#,
NO_PARAMS,
) )
.unwrap(); .unwrap();
let version: i32 = tx
.query_row(r#"SELECT id FROM version"#, [], |r| r.get(0))
.unwrap();
if version >= 37 {
tx.execute(
r#"DELETE FROM books_fast_hashes WHERE book_id NOT IN ( SELECT id FROM books_impl )"#,
[],
)
.unwrap();
} else {
tx.execute(
r#"DELETE FROM books_uids WHERE book_id NOT IN ( SELECT id FROM books_impl )"#,
[],
)
.unwrap();
}
tx.execute( tx.execute(
r#"DELETE FROM bookshelfs_books WHERE bookid NOT IN ( SELECT id FROM books_impl )"#, r#"DELETE FROM bookshelfs_books WHERE bookid NOT IN ( SELECT id FROM books_impl )"#,
NO_PARAMS, [],
) )
.unwrap(); .unwrap();
tx.execute( tx.execute(
r#"DELETE FROM booktogenre WHERE bookid NOT IN ( SELECT id FROM books_impl )"#, r#"DELETE FROM booktogenre WHERE bookid NOT IN ( SELECT id FROM books_impl )"#,
NO_PARAMS, [],
) )
.unwrap(); .unwrap();
tx.execute( tx.execute(
r#"DELETE FROM social WHERE bookid NOT IN ( SELECT id FROM books_impl )"#, r#"DELETE FROM social WHERE bookid NOT IN ( SELECT id FROM books_impl )"#,
NO_PARAMS, [],
) )
.unwrap(); .unwrap();
@ -119,7 +136,6 @@ fn remove_ghost_books_from_db(tx: &Transaction) -> usize {
pub struct Statistics { pub struct Statistics {
pub authors_fixed: i32, pub authors_fixed: i32,
pub ghost_books_cleaned: usize, pub ghost_books_cleaned: usize,
pub drm_skipped: usize,
pub genres_fixed: usize, pub genres_fixed: usize,
pub sorting_fixed: usize, pub sorting_fixed: usize,
pub series_fixed: usize, pub series_fixed: usize,
@ -139,7 +155,6 @@ pub fn fix_db_entries() -> Statistics {
let mut stat = Statistics { let mut stat = Statistics {
authors_fixed: 0, authors_fixed: 0,
ghost_books_cleaned: 0, ghost_books_cleaned: 0,
drm_skipped: 0,
genres_fixed: 0, genres_fixed: 0,
sorting_fixed: 0, sorting_fixed: 0,
series_fixed: 0, series_fixed: 0,
@ -152,11 +167,6 @@ pub fn fix_db_entries() -> Statistics {
let book_entries = get_epubs_from_database(&tx); let book_entries = get_epubs_from_database(&tx);
for entry in book_entries { for entry in book_entries {
if entry.has_drm {
stat.drm_skipped = stat.drm_skipped + 1;
continue;
}
if let Some(epub_metadata) = epub::get_epub_metadata(&entry.filepath) { if let Some(epub_metadata) = epub::get_epub_metadata(&entry.filepath) {
// Fix firstauthor… // Fix firstauthor…
let mut firstauthors = epub_metadata let mut firstauthors = epub_metadata
@ -170,7 +180,7 @@ pub fn fix_db_entries() -> Statistics {
let mut stmt = tx let mut stmt = tx
.prepare("UPDATE books_impl SET firstauthor = :file_as WHERE id = :book_id") .prepare("UPDATE books_impl SET firstauthor = :file_as WHERE id = :book_id")
.unwrap(); .unwrap();
stmt.execute_named( stmt.execute(
named_params![":file_as": firstauthors.join(" & "), ":book_id": entry.id], named_params![":file_as": firstauthors.join(" & "), ":book_id": entry.id],
) )
.unwrap(); .unwrap();
@ -185,11 +195,12 @@ pub fn fix_db_entries() -> Statistics {
.unwrap_or_default() .unwrap_or_default()
.to_string() .to_string()
.to_uppercase(); .to_uppercase();
if entry.first_author_letter != first_author_letter {
if first_author_letter != "\0" && (entry.first_author_letter != first_author_letter) {
let mut stmt = tx let mut stmt = tx
.prepare("UPDATE books_impl SET first_author_letter = :first_letter WHERE id = :book_id") .prepare("UPDATE books_impl SET first_author_letter = :first_letter WHERE id = :book_id")
.unwrap(); .unwrap();
stmt.execute_named( stmt.execute(
named_params![":first_letter": first_author_letter,":book_id": entry.id], named_params![":first_letter": first_author_letter,":book_id": entry.id],
) )
.unwrap(); .unwrap();
@ -208,7 +219,7 @@ pub fn fix_db_entries() -> Statistics {
let mut stmt = tx let mut stmt = tx
.prepare("UPDATE books_impl SET author = :authors WHERE id = :book_id") .prepare("UPDATE books_impl SET author = :authors WHERE id = :book_id")
.unwrap(); .unwrap();
stmt.execute_named( stmt.execute(
named_params![":authors": authornames.join(", "), ":book_id": entry.id], named_params![":authors": authornames.join(", "), ":book_id": entry.id],
) )
.unwrap(); .unwrap();
@ -220,7 +231,7 @@ pub fn fix_db_entries() -> Statistics {
let mut stmt = tx let mut stmt = tx
.prepare(r#"INSERT INTO genres (name) SELECT :genre ON CONFLICT DO NOTHING"#) .prepare(r#"INSERT INTO genres (name) SELECT :genre ON CONFLICT DO NOTHING"#)
.unwrap(); .unwrap();
stmt.execute_named(named_params![":genre": &epub_metadata.genre]) stmt.execute(named_params![":genre": &epub_metadata.genre])
.unwrap(); .unwrap();
let mut stmt = tx let mut stmt = tx
.prepare( .prepare(
@ -232,10 +243,8 @@ pub fn fix_db_entries() -> Statistics {
ON CONFLICT DO NOTHING"#, ON CONFLICT DO NOTHING"#,
) )
.unwrap(); .unwrap();
stmt.execute_named( stmt.execute(named_params![":bookid": &entry.id, ":genre": &epub_metadata.genre])
named_params![":bookid": &entry.id, ":genre": &epub_metadata.genre], .unwrap();
)
.unwrap();
stat.genres_fixed = stat.genres_fixed + 1; stat.genres_fixed = stat.genres_fixed + 1;
} }
@ -244,7 +253,7 @@ pub fn fix_db_entries() -> Statistics {
let mut stmt = tx let mut stmt = tx
.prepare("UPDATE books_impl SET series = :series, numinseries = :series_index WHERE id = :book_id") .prepare("UPDATE books_impl SET series = :series, numinseries = :series_index WHERE id = :book_id")
.unwrap(); .unwrap();
stmt.execute_named( stmt.execute(
named_params![":series": &epub_metadata.series.name, ":series_index": &epub_metadata.series.index, ":book_id": entry.id], named_params![":series": &epub_metadata.series.name, ":series_index": &epub_metadata.series.index, ":book_id": entry.id],
) )
.unwrap(); .unwrap();

View file

@ -151,6 +151,10 @@ pub fn get_epub_metadata(filename: &str) -> Option<EpubMetadata> {
.unwrap() .unwrap()
.as_str(); .as_str();
xml_authors.insert(curr_id.clone(), XmlAut::new()); xml_authors.insert(curr_id.clone(), XmlAut::new());
} else {
curr_id = "none".to_string() + xml_authors.len().to_string().as_str();
let entry = xml_authors.entry(curr_id.clone()).or_insert(XmlAut::new());
entry.role = "aut".to_string();
} }
} else { } else {
if let Some(file_as_val) = e if let Some(file_as_val) = e

View file

@ -25,25 +25,12 @@ fn main() {
if cfg!(target_arch = "arm") { if cfg!(target_arch = "arm") {
if stat.anything_fixed() == false { if stat.anything_fixed() == false {
if stat.drm_skipped == 0 { pocketbook::dialog(
pocketbook::dialog( pocketbook::Icon::Info,
pocketbook::Icon::Info, "The database seems to be ok.\n\
"The database seems to be ok.\n\
Nothing had to be fixed.", Nothing had to be fixed.",
&["OK"], &["OK"],
); );
} else {
pocketbook::dialog(
pocketbook::Icon::Info,
&format!(
"The database seems to be ok.\n\
Nothing had to be fixed.\n\
(Books skipped (DRM): {})",
&stat.drm_skipped
),
&["OK"],
);
}
} else { } else {
pocketbook::dialog( pocketbook::dialog(
pocketbook::Icon::Info, pocketbook::Icon::Info,
@ -52,13 +39,11 @@ fn main() {
Sorting fixed: {}\n\ Sorting fixed: {}\n\
Genres fixed: {}\n\ Genres fixed: {}\n\
Series fixed: {}\n\ Series fixed: {}\n\
Books skipped (DRM): {}\n\
Books cleaned from DB: {}", Books cleaned from DB: {}",
&stat.authors_fixed, &stat.authors_fixed,
&stat.sorting_fixed, &stat.sorting_fixed,
&stat.genres_fixed, &stat.genres_fixed,
&stat.series_fixed, &stat.series_fixed,
&stat.drm_skipped,
&stat.ghost_books_cleaned &stat.ghost_books_cleaned
), ),
&["OK"], &["OK"],
@ -70,13 +55,11 @@ fn main() {
Sorting fixed: {}\n\ Sorting fixed: {}\n\
Genres fixed: {}\n\ Genres fixed: {}\n\
Series fixed: {}\n\ Series fixed: {}\n\
Books skipped (DRM): {}\n\
Books cleaned from DB: {}", Books cleaned from DB: {}",
&stat.authors_fixed, &stat.authors_fixed,
&stat.sorting_fixed, &stat.sorting_fixed,
&stat.genres_fixed, &stat.genres_fixed,
&stat.series_fixed, &stat.series_fixed,
&stat.drm_skipped,
&stat.ghost_books_cleaned &stat.ghost_books_cleaned
); );
} }