diff --git a/Cargo.lock b/Cargo.lock index c172d049e..068f058ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,6 +78,15 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anitomy" version = "0.1.2" @@ -118,26 +127,15 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-recursion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -183,6 +181,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "bit_field" version = "0.10.1" @@ -345,15 +349,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time 0.1.44", + "wasm-bindgen", "winapi", ] @@ -381,6 +387,16 @@ dependencies = [ "vec_map", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -396,6 +412,12 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + [[package]] name = "cpufeatures" version = "0.2.2" @@ -563,6 +585,50 @@ dependencies = [ "cipher", ] +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.13", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + [[package]] name = "darwin-libproc" version = "0.1.2" @@ -616,25 +682,22 @@ dependencies = [ name = "dim" version = "0.4.0-dev" dependencies = [ - "anitomy", - "async-recursion", "async-trait", "bytes 1.1.0", "cfg-if", "chrono", "criterion", - "dashmap", "dia-i18n", "dim-auth", "dim-database", "dim-events", + "dim-extern-api", "displaydoc", "dominant_color", "fdlimit", "fs_extra", "futures", "fuzzy-matcher", - "governor", "http", "hyper", "image", @@ -647,10 +710,8 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "percent-encoding", - "priority-queue", "rand", "reqwest", - "retry-block", "rusqlite", "rust-embed", "serde", @@ -663,7 +724,6 @@ dependencies = [ "thiserror", "tokio", "toml", - "torrent-name-parser", "tracing", "tracing-appender", "tracing-subscriber", @@ -683,7 +743,7 @@ name = "dim-auth" version = "0.4.0-dev" dependencies = [ "aes-gcm", - "base64", + "base64 0.13.0", "displaydoc", "once_cell", "rand", @@ -695,7 +755,7 @@ dependencies = [ name = "dim-database" version = "0.4.0-dev" dependencies = [ - "base64", + "base64 0.13.0", "cfg-if", "dim-auth", "displaydoc", @@ -723,6 +783,27 @@ dependencies = [ "serde_json", ] +[[package]] +name = "dim-extern-api" +version = "0.4.0-dev" +dependencies = [ + "anitomy", + "async-trait", + "chrono", + "dashmap", + "displaydoc", + "governor", + "rand", + "reqwest", + "retry-block", + "serde", + "serde_json", + "thiserror", + "tokio", + "torrent-name-parser", + "tracing", +] + [[package]] name = "displaydoc" version = "0.2.3" @@ -731,7 +812,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -771,7 +852,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.98", "synstructure", ] @@ -959,7 +1040,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1052,9 +1133,9 @@ dependencies = [ [[package]] name = "governor" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de1b4626e87b9eb1d603ed23067ba1e29ec1d0b35325a2b96c3fe1cf20871f56" +checksum = "c390a940a5d157878dd057c78680a33ce3415bcd05b4799509ea44210914b4d5" dependencies = [ "cfg-if", "dashmap", @@ -1123,7 +1204,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" dependencies = [ - "base64", + "base64 0.13.0", "bitflags", "bytes 1.1.0", "headers-core", @@ -1246,6 +1327,30 @@ dependencies = [ "tokio-rustls 0.23.4", ] +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.2.3" @@ -1403,9 +1508,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libsqlite3-sys" @@ -1430,6 +1535,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + [[package]] name = "lock_api" version = "0.4.8" @@ -1528,7 +1642,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1785,7 +1899,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1817,7 +1931,7 @@ checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -1902,16 +2016,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -[[package]] -name = "priority-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9cde7493f5f5d2d163b174be9f9a72d756b79b0f6ed85654128d238c347c1e" -dependencies = [ - "autocfg", - "indexmap", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1921,7 +2025,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "version_check", ] @@ -1938,9 +2042,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -1983,9 +2087,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.20" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -2099,12 +2203,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ "async-compression", - "base64", + "base64 0.21.0", "bytes 1.1.0", "encoding_rs", "futures-core", @@ -2116,9 +2220,9 @@ dependencies = [ "hyper-rustls", "ipnet", "js-sys", - "lazy_static", "log", "mime", + "once_cell", "percent-encoding", "pin-project-lite", "rustls 0.20.6", @@ -2202,7 +2306,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn", + "syn 1.0.98", "walkdir", ] @@ -2230,7 +2334,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64", + "base64 0.13.0", "log", "ring", "sct 0.6.1", @@ -2255,7 +2359,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64", + "base64 0.13.0", ] [[package]] @@ -2264,7 +2368,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" dependencies = [ - "base64", + "base64 0.13.0", ] [[package]] @@ -2321,6 +2425,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + [[package]] name = "sct" version = "0.6.1" @@ -2349,9 +2459,9 @@ checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.137" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] @@ -2368,20 +2478,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa 1.0.2", "ryu", @@ -2421,7 +2531,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.98", ] [[package]] @@ -2478,9 +2588,9 @@ checksum = "cc88c725d61fc6c3132893370cac4a0200e3fedf5da8331c570664b1987f5ca2" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2582,7 +2692,7 @@ dependencies = [ "sha2", "sqlx-core", "sqlx-rt", - "syn", + "syn 1.0.98", "url", ] @@ -2634,7 +2744,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -2654,6 +2764,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -2662,7 +2783,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "unicode-xid", ] @@ -2680,6 +2801,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -2691,22 +2821,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -2787,14 +2917,13 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.4" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb78f30e4b41e98ca4cce5acb51168a033839a7af9e42b380355808e14e98ee0" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes 1.1.0", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -2803,18 +2932,18 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "winapi", + "windows-sys 0.45.0", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -2887,9 +3016,9 @@ dependencies = [ [[package]] name = "torrent-name-parser" -version = "0.6.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6929a3697735f3a6460cab2109f43f3f304cbf771552e8b5d0637f1034d4236f" +checksum = "2a6f6dad604b645d307bb819bc30b43c444712879305d3162a90b3eccb779787" dependencies = [ "lazy_static", "regex", @@ -2903,9 +3032,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -2927,20 +3056,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -3013,7 +3142,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64", + "base64 0.13.0", "byteorder", "bytes 1.1.0", "http", @@ -3257,7 +3386,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-shared", ] @@ -3291,7 +3420,7 @@ checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3387,49 +3516,181 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-sys" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winreg" version = "0.10.1" @@ -3489,7 +3750,7 @@ checksum = "0972940e244acf1715d05b50b6e937d2ca97db4247437e9d07c5eaf0d978ebb0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e67dbeee8..2c42b1c1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,5 @@ -cargo-features = ["workspace-inheritance"] - [workspace] -members = ["dim", "dim-auth", "dim-database", "dim-events"] +members = ["dim", "dim-auth", "dim-database", "dim-events", "dim-extern-api"] [workspace.package] version = "0.4.0-dev" diff --git a/dim-extern-api/Cargo.toml b/dim-extern-api/Cargo.toml new file mode 100644 index 000000000..4e3f7cb61 --- /dev/null +++ b/dim-extern-api/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "dim-extern-api" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +anitomy = "0.1.2" +async-trait = "0.1.68" +chrono = { version = "0.4.24", features = ["serde"] } +dashmap = "5.4.0" +displaydoc = "0.2.3" +governor = "0.5.1" +rand = { version = "0.8.5", features = ["small_rng"] } +reqwest = { version = "0.11.0", features = ["json", "rustls-tls", "brotli"], default-features = false } +retry-block = "1.0.0" +serde = { version = "1.0.159", features = ["derive", "rc"] } +serde_json = "1.0.95" +thiserror = "1.0.40" +tokio = { version = "1.27.0", features = ["sync", "rt"] } +torrent-name-parser = "0.12.0" +tracing = "0.1.37" diff --git a/dim/src/external/filename.rs b/dim-extern-api/src/filename.rs similarity index 96% rename from dim/src/external/filename.rs rename to dim-extern-api/src/filename.rs index 7e1252ca1..a39f6e835 100644 --- a/dim/src/external/filename.rs +++ b/dim-extern-api/src/filename.rs @@ -1,6 +1,6 @@ -use anitomy::Anitomy; +pub use anitomy::Anitomy; use anitomy::ElementCategory; -use torrent_name_parser::Metadata as TorrentMetadata; +pub use torrent_name_parser::Metadata as TorrentMetadata; #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct Metadata { diff --git a/dim/src/external/mod.rs b/dim-extern-api/src/lib.rs similarity index 97% rename from dim/src/external/mod.rs rename to dim-extern-api/src/lib.rs index 941c8b99e..2ec5c90d8 100644 --- a/dim/src/external/mod.rs +++ b/dim-extern-api/src/lib.rs @@ -1,6 +1,9 @@ -/// Module contains a common interface for extracting and obtaining filename metadata. +//! Library contains a common interface for extracting and obtaining filename metadata as well as +//! the implementations for various external APIs, such as TMDB. + pub mod filename; pub mod mock; +pub mod tmdb; use async_trait::async_trait; @@ -13,8 +16,6 @@ use serde::Deserialize; use serde::Serialize; use thiserror::Error; -pub mod tmdb; - pub type Result = ::core::result::Result; #[derive(Clone, Display, Debug, Error, Serialize)] diff --git a/dim/src/external/mock.rs b/dim-extern-api/src/mock.rs similarity index 84% rename from dim/src/external/mock.rs rename to dim-extern-api/src/mock.rs index 7e25061f1..bda5757b5 100644 --- a/dim/src/external/mock.rs +++ b/dim-extern-api/src/mock.rs @@ -1,7 +1,7 @@ -use super::ExternalActor; -use super::ExternalMedia; -use super::ExternalQuery; -use super::Result; +use crate::ExternalActor; +use crate::ExternalMedia; +use crate::ExternalQuery; +use crate::Result; #[derive(Debug, Clone, Copy)] pub struct MockProvider; diff --git a/dim/src/external/tmdb/cache_control.rs b/dim-extern-api/src/tmdb/cache_control.rs similarity index 99% rename from dim/src/external/tmdb/cache_control.rs rename to dim-extern-api/src/tmdb/cache_control.rs index 2ea36785e..3672ce750 100644 --- a/dim/src/external/tmdb/cache_control.rs +++ b/dim-extern-api/src/tmdb/cache_control.rs @@ -1,4 +1,4 @@ -use crate::external::MediaSearchType; +use crate::MediaSearchType; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; diff --git a/dim/src/external/tmdb/metadata_provider.rs b/dim-extern-api/src/tmdb/metadata_provider.rs similarity index 97% rename from dim/src/external/tmdb/metadata_provider.rs rename to dim-extern-api/src/tmdb/metadata_provider.rs index d0d1a131b..0e96d00d5 100644 --- a/dim/src/external/tmdb/metadata_provider.rs +++ b/dim-extern-api/src/tmdb/metadata_provider.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use std::future::Future; use std::marker::PhantomData; use std::num::NonZeroU32; +use std::result::Result; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; use std::time::Duration; @@ -12,8 +13,8 @@ use async_trait::async_trait; use tokio::sync::broadcast; use tracing::instrument; -use crate::external::{Result as QueryResult, *}; -use core::result::Result; +use crate::Result as QueryResult; +use crate::*; use governor::clock::DefaultClock; use governor::middleware::NoOpMiddleware; @@ -246,7 +247,7 @@ impl TMDBMetadataProvider { .await?; let mut search = serde_json::from_str::(&st).map_err(|error| { - crate::external::Error::DeserializationError { + Error::DeserializationError { body: st, error: format!("{error}"), } @@ -264,7 +265,7 @@ impl TMDBMetadataProvider { .await?; let genre_list = serde_json::from_str::(&st).map_err(|error| { - crate::external::Error::DeserializationError { + Error::DeserializationError { body: st, error: format!("{error}"), } @@ -335,7 +336,7 @@ impl TMDBMetadataProvider { .await?; let details = serde_json::from_str::(&response_body).map_err(|err| { - crate::external::Error::DeserializationError { + Error::DeserializationError { body: response_body, error: format!("{err}"), } @@ -367,12 +368,11 @@ impl TMDBMetadataProvider { ) .await?; - let actor = serde_json::from_str::(&resp).map_err(|error| { - crate::external::Error::DeserializationError { + let actor = + serde_json::from_str::(&resp).map_err(|error| Error::DeserializationError { body: resp, error: format!("{error}"), - } - })?; + })?; Ok(actor.cast.into_iter().map(|x| x.into()).collect()) } @@ -400,7 +400,7 @@ impl TMDBMetadataProvider { .await?; let tv_details = serde_json::from_str::(&response_body).map_err(|err| { - crate::external::Error::DeserializationError { + Error::DeserializationError { body: response_body, error: format!("{err}"), } @@ -434,7 +434,7 @@ impl TMDBMetadataProvider { .await?; let tv_details = serde_json::from_str::(&response_body).map_err(|err| { - crate::external::Error::DeserializationError { + Error::DeserializationError { body: response_body, error: format!("{err}"), } diff --git a/dim/src/external/tmdb/mod.rs b/dim-extern-api/src/tmdb/mod.rs similarity index 98% rename from dim/src/external/tmdb/mod.rs rename to dim-extern-api/src/tmdb/mod.rs index 4f90cc7f8..5a5c64d3d 100644 --- a/dim/src/external/tmdb/mod.rs +++ b/dim-extern-api/src/tmdb/mod.rs @@ -69,9 +69,7 @@ mod tests { use chrono::{Datelike, Timelike}; use super::*; - use crate::external::{ - ExternalEpisode, ExternalMedia, ExternalQuery, ExternalQueryShow, ExternalSeason, - }; + use crate::{ExternalEpisode, ExternalMedia, ExternalQuery, ExternalQueryShow, ExternalSeason}; fn make_letterkenny() -> ExternalMedia { let dt = chrono::Utc::now() diff --git a/dim/src/external/tmdb/raw_client.rs b/dim-extern-api/src/tmdb/raw_client.rs similarity index 98% rename from dim/src/external/tmdb/raw_client.rs rename to dim-extern-api/src/tmdb/raw_client.rs index 81bef961d..a936e388e 100644 --- a/dim/src/external/tmdb/raw_client.rs +++ b/dim-extern-api/src/tmdb/raw_client.rs @@ -6,9 +6,7 @@ use serde::Deserialize; use std::future::Future; use std::time::Duration; -use crate::external::{ - ExternalActor, ExternalEpisode, ExternalMedia, ExternalSeason, MediaSearchType, -}; +use crate::{ExternalActor, ExternalEpisode, ExternalMedia, ExternalSeason, MediaSearchType}; use super::{TMDBClientRequestError, TMDBMetadataProvider, TMDB_BASE_URL}; diff --git a/dim/Cargo.toml b/dim/Cargo.toml index 471c3e354..ba0a4ab46 100644 --- a/dim/Cargo.toml +++ b/dim/Cargo.toml @@ -21,24 +21,21 @@ nightfall = { git = "https://github.com/Dusk-Labs/nightfall", tag = "0.3.12-rc4" dim-auth = { path = "../dim-auth" } dim-database = { path = "../dim-database" } dim-events = { path = "../dim-events" } +dim-extern-api = { path = "../dim-extern-api" } serde = { version = "^1.0.125", default-features = false, features = ["derive", "std", "rc"] } serde_derive = "^1.0.125" serde_json = "^1.0.64" -anitomy = "0.1.2" -async-recursion = "0.3.2" async-trait = "0.1.50" bytes = "1.0.1" cfg-if = "1.0.0" chrono = { version = "0.4.19", features = ["serde"] } -dashmap = "5.3.3" dia-i18n = "0.10.0" displaydoc = "0.2.3" dominant_color = "0.3.0" futures = "0.3.14" fuzzy-matcher = "0.3.7" -governor = "0.5.0" http = "^0.2.3" image = "0.24.3" itertools = "0.10.3" @@ -47,7 +44,6 @@ notify = "5.0.0" once_cell = "1.8.0" parking_lot = "0.12.0" percent-encoding = "2.1.0" -priority-queue = "1.2.0" rand = { version = "0.8.5", features = ["small_rng"] } reqwest = { version = "0.11.0", features = ["json", "rustls-tls", "brotli"], default-features = false } rust-embed = "^5.9.0" @@ -56,7 +52,6 @@ structopt = "0.3.21" thiserror = "1.0.30" tokio = { version = "1", features = ["rt", "signal", "full", "tracing"] } toml = "0.5.8" -torrent-name-parser = "0.6.3" tracing = "0.1.32" tracing-appender = "0.2.0" tracing-subscriber = { version = "^0.3.10", features = ["fmt", "env-filter", "json"] } @@ -70,7 +65,6 @@ xtra = { version = "0.5.1", features = ["with-tokio-1"] } # FIXME: Remove when we get rid of xtra_proc new_xtra = { package = "xtra", git = "https://github.com/Restioson/xtra", features = ["with-tokio-1"] } url = "2.2.2" -retry-block = "1.0.0" hyper = "0.14.20" rusqlite = { version = "0.27.0", features = ["hooks"] } libsqlite3-sys = { version = "^0.24.0" } diff --git a/dim/src/core.rs b/dim/src/core.rs index e4c120f5e..c09b61153 100644 --- a/dim/src/core.rs +++ b/dim/src/core.rs @@ -1,5 +1,4 @@ use crate::balanced_or_tree; -use crate::external::tmdb::TMDBMetadataProvider; use crate::logger::RequestLogger; use crate::routes; use crate::routes::*; @@ -8,6 +7,7 @@ use crate::stream_tracking::StreamTracking; use crate::websocket; use dim_database::library::MediaType; +use dim_extern_api::tmdb::TMDBMetadataProvider; use once_cell::sync::OnceCell; diff --git a/dim/src/errors.rs b/dim/src/errors.rs index 18675956f..5eccbdbe9 100644 --- a/dim/src/errors.rs +++ b/dim/src/errors.rs @@ -63,7 +63,7 @@ pub enum DimError { /// User does not exist UserNotFound, /// Couldn't find the tmdb id provided. - ExternalSearchError(crate::external::Error), + ExternalSearchError(dim_extern_api::Error), } impl From for DimError { diff --git a/dim/src/lib.rs b/dim/src/lib.rs index 94700a3dc..dc463250f 100644 --- a/dim/src/lib.rs +++ b/dim/src/lib.rs @@ -29,8 +29,6 @@ use tracing_subscriber::EnvFilter; pub mod core; /// Module contains all the error definitions used in dim, and returned by the web-service. pub mod errors; -/// Module contains our external api interfaces -pub mod external; /// Contains the code for fetching assets like posters and stills. pub mod fetcher; /// Inspect api for Result type diff --git a/dim/src/routes/library.rs b/dim/src/routes/library.rs index ac2c6b104..b5f336215 100644 --- a/dim/src/routes/library.rs +++ b/dim/src/routes/library.rs @@ -1,7 +1,6 @@ use crate::core::DbConnection; use crate::core::EventTx; use crate::errors; -use crate::external::tmdb::TMDBMetadataProvider; use crate::json; use crate::scanner; use crate::scanner::daemon::FsWatcher; @@ -13,9 +12,10 @@ use dim_database::library::Library; use dim_database::library::MediaType; use dim_database::media::Media; use dim_database::mediafile::MediaFile; - use dim_database::user::User; +use dim_extern_api::tmdb::TMDBMetadataProvider; + use std::collections::HashMap; use std::sync::Arc; diff --git a/dim/src/routes/media.rs b/dim/src/routes/media.rs index 6121b42ec..f6f3f011c 100644 --- a/dim/src/routes/media.rs +++ b/dim/src/routes/media.rs @@ -1,13 +1,10 @@ use crate::core::DbConnection; use crate::errors; -use crate::external::tmdb::TMDBMetadataProvider; -use crate::external::ExternalQueryIntoShow; use crate::json; use crate::tree; use crate::utils::secs_to_pretty; use chrono::Datelike; -use dim_database::user::User; use dim_database::compact_mediafile::CompactMediafile; use dim_database::episode::Episode; @@ -17,6 +14,10 @@ use dim_database::media::Media; use dim_database::media::UpdateMedia; use dim_database::mediafile::MediaFile; use dim_database::progress::Progress; +use dim_database::user::User; + +use dim_extern_api::tmdb::TMDBMetadataProvider; +use dim_extern_api::ExternalQueryIntoShow; use warp::http::status::StatusCode; use warp::reply; diff --git a/dim/src/routes/mediafile.rs b/dim/src/routes/mediafile.rs index bc625b1c1..993015f76 100644 --- a/dim/src/routes/mediafile.rs +++ b/dim/src/routes/mediafile.rs @@ -1,7 +1,6 @@ use crate::core::DbConnection; use crate::errors; use crate::errors::ErrorStatusCode; -use crate::external::ExternalQueryIntoShow; use crate::scanner::movie; use crate::scanner::parse_filenames; use crate::scanner::tv_show; @@ -15,6 +14,8 @@ use dim_database::library::MediaType; use dim_database::mediafile::MediaFile; use dim_database::user::User; +use dim_extern_api::ExternalQueryIntoShow; + use serde::Serialize; use serde_json::json; use std::sync::Arc; diff --git a/dim/src/routes/rematch_media.rs b/dim/src/routes/rematch_media.rs index 15baafdaa..fe5152fd3 100644 --- a/dim/src/routes/rematch_media.rs +++ b/dim/src/routes/rematch_media.rs @@ -1,7 +1,6 @@ use crate::core::DbConnection; use crate::core::EventTx; use crate::errors::*; -use crate::external::ExternalQueryIntoShow; use crate::scanner::movie; use crate::scanner::parse_filenames; use crate::scanner::tv_show; @@ -16,6 +15,8 @@ use std::sync::Arc; use dim_database::library::MediaType; use dim_database::mediafile::MediaFile; +use dim_extern_api::ExternalQueryIntoShow; + use tracing::error; use tracing::info; diff --git a/dim/src/scanner/daemon.rs b/dim/src/scanner/daemon.rs index 369abc39f..3b702362c 100644 --- a/dim/src/scanner/daemon.rs +++ b/dim/src/scanner/daemon.rs @@ -1,5 +1,5 @@ use crate::core::EventTx; -use crate::external::ExternalQueryIntoShow; +use dim_extern_api::ExternalQueryIntoShow; use super::movie; use super::tv_show; diff --git a/dim/src/scanner/mediafile.rs b/dim/src/scanner/mediafile.rs index 1c7e87533..2a40206ab 100644 --- a/dim/src/scanner/mediafile.rs +++ b/dim/src/scanner/mediafile.rs @@ -1,8 +1,8 @@ //! Module contains all the code that creates and inserts basic mediafiles into the database. -use crate::external::filename::Metadata; use crate::streaming::ffprobe::FFProbeCtx; use crate::streaming::FFPROBE_BIN; +use dim_extern_api::filename::Metadata; use async_trait::async_trait; diff --git a/dim/src/scanner/mod.rs b/dim/src/scanner/mod.rs index 0711b183a..f64bc9f3f 100644 --- a/dim/src/scanner/mod.rs +++ b/dim/src/scanner/mod.rs @@ -10,13 +10,8 @@ pub mod tv_show; use self::mediafile::Error as CreatorError; use self::mediafile::MediafileCreator; -use super::external::filename::CombinedExtractor; -use super::external::filename::FilenameMetadata; -use super::external::filename::Metadata; use crate::core::EventTx; -use crate::external::ExternalQueryIntoShow; -use anitomy::Anitomy; use async_trait::async_trait; use dim_database::library::Library; @@ -24,6 +19,13 @@ use dim_database::library::MediaType; use dim_database::mediafile::InsertableMediaFile; use dim_database::mediafile::MediaFile; +use dim_extern_api::filename::Anitomy; +use dim_extern_api::filename::CombinedExtractor; +use dim_extern_api::filename::FilenameMetadata; +use dim_extern_api::filename::Metadata; +use dim_extern_api::filename::TorrentMetadata; +use dim_extern_api::ExternalQueryIntoShow; + use futures::FutureExt; use itertools::Itertools; @@ -35,7 +37,6 @@ use std::pin::Pin; use std::sync::Arc; use std::time::Instant; -use torrent_name_parser::Metadata as TorrentMetadata; use tracing::error; use tracing::info; use tracing::instrument; diff --git a/dim/src/scanner/movie.rs b/dim/src/scanner/movie.rs index 0be5595ac..0fba55a4f 100644 --- a/dim/src/scanner/movie.rs +++ b/dim/src/scanner/movie.rs @@ -1,9 +1,9 @@ #![allow(unstable_name_collisions)] -use crate::external::ExternalMedia; -use crate::external::ExternalQueryIntoShow; use crate::inspect::ResultExt; use crate::scanner::format_path; +use dim_extern_api::ExternalMedia; +use dim_extern_api::ExternalQueryIntoShow; use super::MediaMatcher; use super::WorkUnit; @@ -285,7 +285,7 @@ mod tests { use super::super::tests::mediafile::create_library; use super::MovieMatcher; - use crate::external::ExternalMedia; + use dim_extern_api::ExternalMedia; use chrono::TimeZone; use dim_database::genre::Genre; diff --git a/dim/src/scanner/tv_show.rs b/dim/src/scanner/tv_show.rs index 1fddd6baf..93393e5b6 100644 --- a/dim/src/scanner/tv_show.rs +++ b/dim/src/scanner/tv_show.rs @@ -4,13 +4,13 @@ use super::movie::asset_from_url; use super::MediaMatcher; use super::Metadata; use super::WorkUnit; -use crate::external::ExternalEpisode; -use crate::external::ExternalMedia; +use dim_extern_api::ExternalEpisode; +use dim_extern_api::ExternalMedia; -use crate::external::ExternalQueryIntoShow; -use crate::external::ExternalQueryShow; -use crate::external::ExternalSeason; use crate::inspect::ResultExt; +use dim_extern_api::ExternalQueryIntoShow; +use dim_extern_api::ExternalQueryShow; +use dim_extern_api::ExternalSeason; use async_trait::async_trait; @@ -518,9 +518,9 @@ mod tests { use super::super::tests::mediafile::create_library; use super::TvMatcher; - use crate::external::ExternalEpisode; - use crate::external::ExternalMedia; - use crate::external::ExternalSeason; + use dim_extern_api::ExternalEpisode; + use dim_extern_api::ExternalMedia; + use dim_extern_api::ExternalSeason; use dim_database::episode::Episode; use dim_database::media::Media; diff --git a/dim/src/websocket.rs b/dim/src/websocket.rs index 05685d12f..b131e5524 100644 --- a/dim/src/websocket.rs +++ b/dim/src/websocket.rs @@ -174,7 +174,8 @@ pub fn event_socket( addr, message: dim_events::Message { id: -1, - event_type: dim_events::PushEventType::EventAuthOk, + event_type: + dim_events::PushEventType::EventAuthOk, } .to_string(), });