diff options
56 files changed, 404 insertions, 393 deletions
@@ -117,47 +117,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -165,9 +166,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" @@ -212,9 +213,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-recursion" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", @@ -271,9 +272,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "av1-grain" @@ -315,9 +316,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -379,9 +380,9 @@ dependencies = [ [[package]] name = "bitstream-io" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c9989a51171e2e81038ab168b6ae22886fe9ded214430dbb4f41c28cf176da" +checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e" [[package]] name = "blake2" @@ -403,9 +404,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41bfbdb21256b87a8b5e80fab81a8eed158178e812fd7ba451907518b2742f16" +checksum = "c6a6c0b39c38fd754ac338b00a88066436389c0f029da5d37d1e01091d9b7c17" [[package]] name = "bumpalo" @@ -415,9 +416,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -426,6 +427,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -433,12 +440,13 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.94" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -500,9 +508,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "a9689a29b593160de5bc4aacab7b5d54fb52231de70122626c178e6a368994c7" dependencies = [ "clap_builder", "clap_derive", @@ -510,9 +518,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "2e5387378c84f6faa26890ebf9f0a92989f8873d4d380467bcd0d8d8620424df" dependencies = [ "anstream", "anstyle", @@ -522,18 +530,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.2" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" +checksum = "d2020fa13af48afc65a9a87335bda648309ab3d154cd03c7ff95b378c7ed39c4" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck", "proc-macro2", @@ -564,9 +572,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "console" @@ -615,9 +623,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -652,9 +660,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -772,9 +780,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "encode_unicode" @@ -883,9 +891,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1054,9 +1062,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1126,9 +1134,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1279,9 +1287,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f24ce812868d86d19daa79bf3bf9175bc44ea323391147a5e3abde2a283871b" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -1304,7 +1312,7 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.0", + "hyper 1.3.1", "hyper-util", "rustls", "rustls-pki-types", @@ -1315,16 +1323,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.0", + "hyper 1.3.1", "pin-project-lite", "socket2", "tokio", @@ -1368,20 +1376,35 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", "color_quant", "exr", "gif", - "jpeg-decoder", + "image-webp", "num-traits", "png", "qoi", + "ravif", + "rayon", + "rgb", "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" +dependencies = [ + "byteorder-lite", + "thiserror", ] [[package]] @@ -1470,6 +1493,12 @@ dependencies = [ ] [[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] name = "itertools" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1670,9 +1699,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -1682,9 +1711,6 @@ name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" @@ -1724,9 +1750,9 @@ dependencies = [ [[package]] name = "libavif-image" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d77d358bef9ea07eeced62c3c4209b62bc68fb19b811b3598daf26daa82b2e7" +checksum = "56c640fa0f324e93e55a6bc8ee62cc63cb0a77376c021676236771d7ee4aa82a" dependencies = [ "image", "libavif", @@ -1745,9 +1771,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libdav1d-sys" @@ -1783,9 +1809,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1921,9 +1947,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", "simd-adler32", @@ -2009,11 +2035,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -2046,11 +2071,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -2058,9 +2082,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -2148,12 +2172,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -2170,15 +2194,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec 1.13.2", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -2194,9 +2218,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pear" @@ -2310,9 +2334,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.80" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -2524,20 +2548,20 @@ dependencies = [ [[package]] name = "redb" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1100a056c5dcdd4e5513d5333385223b26ef1bf92f31eb38f407e8c20549256" +checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" dependencies = [ "libc", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] @@ -2562,9 +2586,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -2606,9 +2630,9 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64", "bytes", @@ -2618,7 +2642,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.0", + "hyper 1.3.1", "hyper-rustls", "hyper-util", "ipnet", @@ -2689,7 +2713,7 @@ dependencies = [ "memchr", "multer", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project-lite", "rand 0.8.5", "ref-cast", @@ -2774,9 +2798,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2799,9 +2823,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", @@ -2823,15 +2847,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -2846,9 +2870,9 @@ checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scoped-tls" @@ -2864,18 +2888,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -2884,9 +2908,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -2895,9 +2919,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -2966,9 +2990,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3023,9 +3047,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3078,9 +3102,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.59" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3267,18 +3291,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", @@ -3354,16 +3378,16 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2", @@ -3373,9 +3397,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -3418,23 +3442,22 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", @@ -3444,18 +3467,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap", "serde", @@ -3477,7 +3500,6 @@ dependencies = [ "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -3498,7 +3520,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4047,9 +4068,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "f217b6745021054125ef5741032a021a9c65f82bee2a8017cca928f1e3179991" dependencies = [ "memchr", ] @@ -4075,18 +4096,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", @@ -4095,9 +4116,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zstd" @@ -4128,6 +4149,12 @@ dependencies = [ ] [[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4135,3 +4162,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" +dependencies = [ + "zune-core", +] @@ -19,10 +19,10 @@ rocket = "0.5" rocket_ws = "0.1" log = "0.4.21" -anyhow = "1.0.82" -tokio = { version = "1.37.0", features = ["full"] } +anyhow = "1.0.86" +tokio = { version = "1.38.0", features = ["full"] } -reqwest = { version = "0.12.3", default-features = false, features = [ +reqwest = { version = "0.12.4", default-features = false, features = [ "rustls-tls", "json", "blocking", diff --git a/base/Cargo.toml b/base/Cargo.toml index de8ab17..67600ed 100644 --- a/base/Cargo.toml +++ b/base/Cargo.toml @@ -6,18 +6,18 @@ edition = "2021" [dependencies] jellycommon = { path = "../common" } jellyclient = { path = "../client" } -serde = { version = "1.0.197", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } serde_yaml = "0.9.34" log = { workspace = true } sha2 = "0.10.8" -base64 = "0.22.0" +base64 = "0.22.1" tokio = { workspace = true } -anyhow = "1.0.82" +anyhow = "1.0.86" bincode = "2.0.0-rc.3" rand = "0.8.5" -redb = "2.0.0" +redb = "2.1.1" tantivy = "0.22.0" -serde_json = "1.0.115" +serde_json = "1.0.117" aes-gcm-siv = "0.11.1" [features] diff --git a/base/src/assetfed.rs b/base/src/assetfed.rs index 4ca587b..bb39bbd 100644 --- a/base/src/assetfed.rs +++ b/base/src/assetfed.rs @@ -38,7 +38,7 @@ impl AssetInner { pub fn ser(&self) -> Asset { let mut plaintext = Vec::new(); plaintext.extend(u32::to_le_bytes(VERSION)); - plaintext.extend(bincode::encode_to_vec(&self, bincode::config::standard()).unwrap()); + plaintext.extend(bincode::encode_to_vec(self, bincode::config::standard()).unwrap()); while plaintext.len() % 16 == 0 { plaintext.push(0); @@ -53,7 +53,7 @@ impl AssetInner { Asset(base64::engine::general_purpose::URL_SAFE.encode(&ciphertext)) } pub fn deser(s: &str) -> anyhow::Result<Self> { - let ciphertext = base64::engine::general_purpose::URL_SAFE.decode(&s)?; + let ciphertext = base64::engine::general_purpose::URL_SAFE.decode(s)?; let (ciphertext, nonce) = ciphertext.split_at(ciphertext.len() - 12); let plaintext = ASSET_KEY .decrypt(nonce.into(), ciphertext) diff --git a/base/src/cache.rs b/base/src/cache.rs index 68f191e..5ded6f8 100644 --- a/base/src/cache.rs +++ b/base/src/cache.rs @@ -110,7 +110,7 @@ where return Err(e); } } - rename(temp_path, &location.abs()).context("rename cache")?; + rename(temp_path, location.abs()).context("rename cache")?; } drop(_guard); Ok(location) @@ -150,7 +150,7 @@ where .context("encoding cache object")?; Ok(()) })?; - let mut file = std::fs::File::open(&location.abs())?; + let mut file = std::fs::File::open(location.abs())?; let object = bincode::decode_from_std_read::<T, _, _>(&mut file, bincode::config::standard()) .context("decoding cache object")?; let object = Arc::new(object); diff --git a/base/src/database.rs b/base/src/database.rs index d890956..e57ea3e 100644 --- a/base/src/database.rs +++ b/base/src/database.rs @@ -35,6 +35,7 @@ pub const T_INVITE: TableDefinition<&str, Ser<()>> = TableDefinition::new("invit pub const T_NODE: TableDefinition<&str, Ser<Node>> = TableDefinition::new("node"); pub const T_NODE_EXTENDED: TableDefinition<&str, Ser<ExtendedNode>> = TableDefinition::new("node-ext"); +#[allow(clippy::type_complexity)] pub const T_NODE_IMPORT: TableDefinition<&str, Ser<Vec<(Vec<usize>, Node)>>> = TableDefinition::new("node-import"); diff --git a/base/src/federation.rs b/base/src/federation.rs index 75c16e7..662a7ac 100644 --- a/base/src/federation.rs +++ b/base/src/federation.rs @@ -32,10 +32,7 @@ impl Federation { } pub fn get_instance(&self, host: &String) -> anyhow::Result<&Instance> { - Ok(self - .instances - .get(host) - .ok_or(anyhow!("unknown instance"))?) + self.instances.get(host).ok_or(anyhow!("unknown instance")) } pub async fn get_session(&self, host: &String) -> anyhow::Result<Arc<Session>> { diff --git a/base/src/lib.rs b/base/src/lib.rs index 385ad7a..1ffaa10 100644 --- a/base/src/lib.rs +++ b/base/src/lib.rs @@ -3,7 +3,6 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -#![feature(lazy_cell)] pub mod assetfed; pub mod cache; pub mod database; @@ -31,7 +30,7 @@ pub fn load_config() -> GlobalConfig { serde_yaml::from_reader( std::fs::File::open(std::env::var("JELLYTHING_CONFIG").unwrap_or_else(|_| { if std::env::args() - .nth(0) + .next() .unwrap_or_default() .ends_with("jellything") { diff --git a/base/src/permission.rs b/base/src/permission.rs index 15b24a9..358202f 100644 --- a/base/src/permission.rs +++ b/base/src/permission.rs @@ -21,9 +21,9 @@ pub trait PermissionSetExt { impl PermissionSetExt for PermissionSet { fn check_explicit(&self, perm: &UserPermission) -> Option<bool> { self.0 - .get(&perm) - .or(CONF.default_permission_set.0.get(&perm)) - .map(|v| *v) + .get(perm) + .or(CONF.default_permission_set.0.get(perm)) + .copied() } fn assert(&self, perm: &UserPermission) -> Result<(), anyhow::Error> { if self.check(perm) { @@ -61,6 +61,6 @@ fn check_node_permission(perms: &PermissionSet, node: &Node) -> bool { return v; } } - return true; + true } } diff --git a/client/Cargo.toml b/client/Cargo.toml index 3aeb3dc..4d3fc6b 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" jellycommon = { path = "../common" } log = { workspace = true } reqwest = { workspace = true } -anyhow = "1.0.82" -serde_json = "1.0.115" -serde = { version = "1.0.197", features = ["derive"] } +anyhow = "1.0.86" +serde_json = "1.0.117" +serde = { version = "1.0.203", features = ["derive"] } tokio = { workspace = true } diff --git a/common/Cargo.toml b/common/Cargo.toml index 3c8d90a..913be45 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -serde = { version = "1.0.197", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } bincode = { version = "2.0.0-rc.3", features = ["derive"] } rocket = { workspace = true, optional = true } chrono = { version = "0.4.38", features = ["serde"] } diff --git a/common/src/helpers.rs b/common/src/helpers.rs index 92595e0..54f5479 100644 --- a/common/src/helpers.rs +++ b/common/src/helpers.rs @@ -5,15 +5,21 @@ */ use std::ops::Deref; -#[derive(PartialEq, PartialOrd)] +#[derive(PartialEq)] pub struct SortAnyway<T>(pub T); impl<T: PartialEq> Eq for SortAnyway<T> { fn assert_receiver_is_total_eq(&self) {} } +#[allow(clippy::non_canonical_partial_ord_impl)] +impl<T: PartialOrd> PartialOrd for SortAnyway<T> { + fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { + self.0.partial_cmp(&other.0) + } +} impl<T: PartialOrd> Ord for SortAnyway<T> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(&other).unwrap() + self.partial_cmp(other).unwrap() } } diff --git a/common/src/lib.rs b/common/src/lib.rs index d06c40c..7403347 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -3,6 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ +#![allow(clippy::needless_borrows_for_generic_args)] pub mod config; pub mod helpers; pub mod r#impl; @@ -282,17 +283,16 @@ impl TraktKind { } } } -impl ToString for TraktKind { - fn to_string(&self) -> String { - match self { +impl Display for TraktKind { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { TraktKind::Movie => "Movie", TraktKind::Show => "Show", TraktKind::Season => "Season", TraktKind::Episode => "Episode", TraktKind::Person => "Person", TraktKind::User => "User", - } - .to_string() + }) } } impl Display for ObjectIds { diff --git a/common/src/user.rs b/common/src/user.rs index 5f2b0e4..1a527b9 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -129,19 +129,19 @@ impl UserPermission { impl Display for UserPermission { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(&match self { - UserPermission::ManageSelf => format!("manage self (password, display name, etc.)"), - UserPermission::FederatedContent => format!("access to federated content"), - UserPermission::Admin => format!("administrative rights"), + UserPermission::ManageSelf => "manage self (password, display name, etc.)".to_string(), + UserPermission::FederatedContent => "access to federated content".to_string(), + UserPermission::Admin => "administrative rights".to_string(), UserPermission::StreamFormat(StreamFormat::Original) => { - format!("downloading the original media") + "downloading the original media".to_string() } UserPermission::StreamFormat(StreamFormat::Matroska) => { - format!("downloading a remuxed WebM/Matroska version of the media ") + "downloading a remuxed WebM/Matroska version of the media ".to_string() } UserPermission::StreamFormat(x) => { format!("downloading media via {x:?}") } - UserPermission::Transcode => format!("transcoding"), + UserPermission::Transcode => "transcoding".to_string(), // UserPermission::ManageUsers => format!("management of all users"), // UserPermission::GenerateInvite => format!("inviting new users"), UserPermission::AccessNode(s) => format!("access to library node {s:?}"), diff --git a/ebml_derive/Cargo.toml b/ebml_derive/Cargo.toml index 4ece809..a90b2a5 100644 --- a/ebml_derive/Cargo.toml +++ b/ebml_derive/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" proc-macro = true [dependencies] -syn = "2.0.59" +syn = "2.0.66" quote = "1.0.36" diff --git a/import/Cargo.toml b/import/Cargo.toml index 8844812..06aac98 100644 --- a/import/Cargo.toml +++ b/import/Cargo.toml @@ -11,18 +11,18 @@ jellymatroska = { path = "../matroska" } jellyremuxer = { path = "../remuxer" } log = { workspace = true } -anyhow = "1.0.82" +anyhow = "1.0.86" reqwest = { workspace = true } urlencoding = "2.1.3" bincode = { version = "2.0.0-rc.3", features = ["derive"] } -serde = { version = "1.0.197", features = ["derive"] } -serde_json = "1.0.115" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.117" serde_yaml = "0.9.34" -async-recursion = "1.1.0" +async-recursion = "1.1.1" futures = "0.3.30" tokio = { workspace = true } -regex = "1.10.4" -base64 = "0.22.0" +regex = "1.10.5" +base64 = "0.22.1" diff --git a/import/src/db.rs b/import/src/db.rs index 87350ac..7a3636c 100644 --- a/import/src/db.rs +++ b/import/src/db.rs @@ -62,7 +62,7 @@ impl ImportStorage for DatabaseStorage<'_> { Ok(value.value().0) } fn insert_complete_node(&self, id: &str, node: Node) -> anyhow::Result<()> { - insert_complete_node(&self.db, id, node) + insert_complete_node(self.db, id, node) } fn add_partial_node(&self, id: &str, index_path: &[usize], node: Node) -> anyhow::Result<()> { @@ -106,9 +106,10 @@ impl ImportStorage for DatabaseStorage<'_> { } } +pub type Parts = RwLock<HashMap<String, Vec<(Vec<usize>, Node)>>>; pub(crate) struct MemoryStorage<'a> { pub db: &'a DataAcid, - pub parts: RwLock<HashMap<String, Vec<(Vec<usize>, Node)>>>, + pub parts: Parts, } impl<'a> MemoryStorage<'a> { pub fn new(db: &'a DataAcid) -> Self { @@ -148,7 +149,7 @@ impl ImportStorage for MemoryStorage<'_> { .to_owned()) } fn insert_complete_node(&self, id: &str, node: Node) -> anyhow::Result<()> { - insert_complete_node(&self.db, id, node) + insert_complete_node(self.db, id, node) } fn add_partial_node(&self, id: &str, index_path: &[usize], node: Node) -> anyhow::Result<()> { diff --git a/import/src/lib.rs b/import/src/lib.rs index 49f709a..544937c 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -3,7 +3,6 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -#![feature(lazy_cell)] pub mod db; pub mod infojson; pub mod tmdb; @@ -60,7 +59,7 @@ struct Apis { } pub fn is_importing() -> bool { - IMPORT_SEM.available_permits() <= 0 + IMPORT_SEM.available_permits() == 0 } pub async fn import(db: &DataAcid, fed: &Federation) -> anyhow::Result<()> { @@ -214,8 +213,8 @@ async fn import_path( .read_dir()? .map(Result::unwrap) .filter_map(|e| { - if e.path().extension() == Some(&OsStr::new("yaml")) - || e.path().extension() == Some(&OsStr::new("jelly")) + if e.path().extension() == Some(OsStr::new("yaml")) + || e.path().extension() == Some(OsStr::new("jelly")) || e.metadata().unwrap().is_dir() { Some(e.path()) @@ -345,12 +344,12 @@ async fn process_source( } } // TODO lazy assets - for (_, ps) in &mut node_ext.people { + for ps in node_ext.people.values_mut() { for p in ps { if let Some(id) = p.person.ids.tmdb { if let Some(tmdb) = &ap.tmdb { let k = tmdb.person_image(id).await?; - if let Some(prof) = k.profiles.get(0) { + if let Some(prof) = k.profiles.first() { p.person.headshot = Some( AssetInner::Cache(tmdb.image(&prof.file_path).await?).ser(), ); @@ -402,10 +401,10 @@ async fn process_source( // TODO lazy assets if let Some(poster) = &details.poster_path { - node.public.poster = Some(AssetInner::Cache(tmdb.image(&poster).await?).ser()); + node.public.poster = Some(AssetInner::Cache(tmdb.image(poster).await?).ser()); } if let Some(backdrop) = &details.backdrop_path { - node.public.backdrop = Some(AssetInner::Cache(tmdb.image(&backdrop).await?).ser()); + node.public.backdrop = Some(AssetInner::Cache(tmdb.image(backdrop).await?).ser()); } node.public.tagline = details.tagline.clone(); @@ -584,7 +583,7 @@ async fn process_source( .map(|e| e.path()) .filter(|e| { e.extension() == Some(OsStr::new("yaml")) - || e.extension() == Some(&OsStr::new("jelly")) + || e.extension() == Some(OsStr::new("jelly")) }); let mut children = Vec::new(); @@ -614,7 +613,7 @@ async fn process_source( Ok(errors) } -const RE_YOUTUBE_ID: LazyLock<Regex> = +static RE_YOUTUBE_ID: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"\[([A-Za-z0-9_-]{11})\]"#).unwrap()); pub fn infer_id_from_path(path: &Path) -> anyhow::Result<String> { @@ -792,7 +791,7 @@ async fn import_remote( }; make_opt_asset_federated(host, &mut node.public.backdrop)?; make_opt_asset_federated(host, &mut node.public.poster)?; - for (_, g) in &mut node_ext.people { + for g in node_ext.people.values_mut() { for a in g { make_opt_asset_federated(host, &mut a.person.headshot)?; } diff --git a/import/src/trakt.rs b/import/src/trakt.rs index 2bcf45f..19c50bc 100644 --- a/import/src/trakt.rs +++ b/import/src/trakt.rs @@ -269,7 +269,7 @@ impl Display for TraktSearchResult { "{} ({}) \x1b[2m{} [{}]\x1b[0m", self.inner.inner().title, self.inner.inner().year.unwrap_or(0), - self.r#type.to_string(), + self.r#type, self.inner.inner().ids )) } diff --git a/matroska/Cargo.toml b/matroska/Cargo.toml index f21a779..f4f7b7f 100644 --- a/matroska/Cargo.toml +++ b/matroska/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" ebml_derive = { path = "../ebml_derive" } log = "0.4.21" env_logger = "0.11.3" -thiserror = "1.0.58" +thiserror = "1.0.61" diff --git a/matroska/src/bin/mkvdump.rs b/matroska/src/bin/mkvdump.rs index b58adcc..c40e325 100644 --- a/matroska/src/bin/mkvdump.rs +++ b/matroska/src/bin/mkvdump.rs @@ -9,9 +9,9 @@ use std::{fs::File, io::BufReader}; fn main() { env_logger::init_from_env("LOG"); let path = std::env::args().nth(1).unwrap(); - let mut r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); + let r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); - while let Some(tag) = r.next() { + for tag in r { let (position, tag) = tag.unwrap(); match tag { MatroskaTag::SimpleBlock(b) | MatroskaTag::Block(b) => { diff --git a/matroska/src/read.rs b/matroska/src/read.rs index 536f2f8..42fbd73 100644 --- a/matroska/src/read.rs +++ b/matroska/src/read.rs @@ -83,7 +83,7 @@ impl EbmlReader { #[inline] pub fn read_utf8(&mut self, size: impl Into<usize>) -> Result<String> { let b = self.read_buf(size)?; - Ok(String::from_utf8(b).map_err(|_| Error::InvalidUTF8)?) + String::from_utf8(b).map_err(|_| Error::InvalidUTF8) } #[inline] @@ -160,7 +160,7 @@ impl EbmlReader { ); self.queue.clear(); self.position = position; - self.inner.seek(SeekFrom::Start(position as u64))?; + self.inner.seek(SeekFrom::Start(position))?; self.stack = path .iter() .map(|id| StackTag { id: *id, end: None }) @@ -257,7 +257,7 @@ impl ReadValue for Vec<u8> { } impl ReadValue for String { fn from_buf(buf: &[u8]) -> Result<Self> { - Ok(String::from_utf8(Vec::from(buf)).map_err(|_| Error::InvalidUTF8)?) + String::from_utf8(Vec::from(buf)).map_err(|_| Error::InvalidUTF8) } } impl ReadValue for Master { diff --git a/remuxer/Cargo.toml b/remuxer/Cargo.toml index 34a0d83..a1e9501 100644 --- a/remuxer/Cargo.toml +++ b/remuxer/Cargo.toml @@ -8,9 +8,9 @@ jellycommon = { path = "../common" } jellymatroska = { path = "../matroska" } jellybase = { path = "../base" } -tokio = { version = "1.37.0", features = ["io-util"] } -anyhow = "1.0.82" +tokio = { version = "1.38.0", features = ["io-util"] } +anyhow = "1.0.86" log = { workspace = true } -serde = { version = "1.0.197", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } bincode = { version = "2.0.0-rc.3", features = ["serde"] } diff --git a/remuxer/src/extract.rs b/remuxer/src/extract.rs index e70adf4..a9b4835 100644 --- a/remuxer/src/extract.rs +++ b/remuxer/src/extract.rs @@ -10,10 +10,8 @@ use jellymatroska::{block::Block, read::EbmlReader, Master, MatroskaTag}; use log::debug; use std::{fs::File, io::BufReader, path::PathBuf}; -pub fn extract_track( - path_base: PathBuf, - track_info: LocalTrack, -) -> anyhow::Result<Vec<(u64, Option<u64>, Vec<u8>)>> { +pub type TrackExtract = Vec<(u64, Option<u64>, Vec<u8>)>; +pub fn extract_track(path_base: PathBuf, track_info: LocalTrack) -> anyhow::Result<TrackExtract> { let source_path = path_base.join(track_info.path); let file = File::open(&source_path)?; let mut reader = EbmlReader::new(BufReader::new(file)); diff --git a/remuxer/src/fragment.rs b/remuxer/src/fragment.rs index cd395f9..872b1e0 100644 --- a/remuxer/src/fragment.rs +++ b/remuxer/src/fragment.rs @@ -186,7 +186,7 @@ pub fn write_fragment_into( let mut blocks = vec![MatroskaTag::Timestamp(start_block.pts)]; for i in start_block_index..end_block_index { let index_block = &index.blocks[i]; - let (mut block, duration) = reader.next()?; + let (mut block, duration) = reader.next_block()?; assert_eq!(index_block.size, block.data.len(), "seek index is wrong"); diff --git a/remuxer/src/remux.rs b/remuxer/src/remux.rs index 733dc49..9419847 100644 --- a/remuxer/src/remux.rs +++ b/remuxer/src/remux.rs @@ -305,7 +305,7 @@ pub fn remux_stream_into( for (block_track, index_block) in cluster.blocks { let track_reader = &mut track_readers[block_track]; // TODO handle duration - let mut block = track_reader.stream.next()?.0; + let mut block = track_reader.stream.next_block()?.0; assert_eq!(index_block.size, block.data.len(), "seek index is wrong"); @@ -326,8 +326,8 @@ fn find_first_cluster_with_off( skip: usize, track: usize, ) -> Option<u64> { - for skip in skip..segment_layout.len() { - if let Some(off) = segment_layout[skip].source_offsets[track] { + for cluster in segment_layout.iter().skip(skip) { + if let Some(off) = cluster.source_offsets[track] { return Some(off); } } diff --git a/remuxer/src/seek_index.rs b/remuxer/src/seek_index.rs index 5bec6e6..7008696 100644 --- a/remuxer/src/seek_index.rs +++ b/remuxer/src/seek_index.rs @@ -18,7 +18,7 @@ use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path, sync::Arc} pub fn get_seek_index(path: &Path) -> anyhow::Result<Arc<BTreeMap<u64, Arc<SeekIndex>>>> { cache_memory(&["seekindex", path.to_str().unwrap()], move || { info!("generating seek index for {path:?}"); - let input = File::open(&path).context("opening source file")?; + let input = File::open(path).context("opening source file")?; let mut input = EbmlReader::new(BufReader::new(input)); let index = import_seek_index(&mut input)?; info!("done"); @@ -67,52 +67,43 @@ fn import_seek_index_segment( MatroskaTag::Cluster(_) => { let mut children = children.unwrap(); let mut pts = 0; - loop { - if let Some(Ok(Unflat { - children, - item, - position, - })) = children.n() - { - match item { - MatroskaTag::Timestamp(ts) => pts = ts, - MatroskaTag::BlockGroup(_) => { - trace!("group"); - let mut children = children.unwrap(); - while let Some(Ok(Unflat { - children: _, item, .. - })) = children.n() - { - match item { - MatroskaTag::Block(ref block) => { - debug!( - "block: track={} tso={}", - block.track, block.timestamp_off - ); - seek_index_add( - seek_index, - &block, - position.unwrap(), - pts, - ); - } - _ => trace!("{item:?}"), + while let Some(Ok(Unflat { + children, + item, + position, + })) = children.n() + { + match item { + MatroskaTag::Timestamp(ts) => pts = ts, + MatroskaTag::BlockGroup(_) => { + trace!("group"); + let mut children = children.unwrap(); + while let Some(Ok(Unflat { + children: _, item, .. + })) = children.n() + { + match item { + MatroskaTag::Block(ref block) => { + debug!( + "block: track={} tso={}", + block.track, block.timestamp_off + ); + seek_index_add(seek_index, block, position.unwrap(), pts); } + _ => trace!("{item:?}"), } } - MatroskaTag::SimpleBlock(block) => { - trace!( - "simple block: track={} tso={}", - block.track, - block.timestamp_off - ); - trace!("{pts} {}", block.timestamp_off); - seek_index_add(seek_index, &block, position.unwrap(), pts); - } - _ => trace!("(rsc) tag ignored: {item:?}"), } - } else { - break; + MatroskaTag::SimpleBlock(block) => { + trace!( + "simple block: track={} tso={}", + block.track, + block.timestamp_off + ); + trace!("{pts} {}", block.timestamp_off); + seek_index_add(seek_index, &block, position.unwrap(), pts); + } + _ => trace!("(rsc) tag ignored: {item:?}"), } } } @@ -142,9 +133,7 @@ fn seek_index_add( // } // } - let trs = seek_index - .entry(block.track) - .or_insert(SeekIndex::default()); + let trs = seek_index.entry(block.track).or_default(); if block.keyframe { trs.keyframes.push(trs.blocks.len()); diff --git a/remuxer/src/segment_extractor.rs b/remuxer/src/segment_extractor.rs index 2a12802..ca9e90f 100644 --- a/remuxer/src/segment_extractor.rs +++ b/remuxer/src/segment_extractor.rs @@ -18,7 +18,7 @@ impl<'a> SegmentExtractIter<'a> { } /// Returns the next block and sometimes its duration too. - pub fn next(&mut self) -> Result<(Block, Option<u64>)> { + pub fn next_block(&mut self) -> Result<(Block, Option<u64>)> { let mut duration = None; let mut group = false; let mut saved_block = None; diff --git a/server/Cargo.toml b/server/Cargo.toml index 6d5ece3..5029408 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -10,15 +10,15 @@ jellystream = { path = "../stream" } jellytranscoder = { path = "../transcoder" } jellyimport = { path = "../import" } -serde = { version = "1.0.197", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } bincode = { version = "2.0.0-rc.3", features = ["serde", "derive"] } -serde_json = "1.0.115" +serde_json = "1.0.117" log = { workspace = true } anyhow = { workspace = true } env_logger = "0.11.3" rand = "0.8.5" -base64 = "0.22.0" +base64 = "0.22.1" chrono = { version = "0.4.38", features = ["serde"] } vte = "0.13.0" chashmap = "2.2.2" @@ -27,10 +27,10 @@ humansize = "2.1.3" argon2 = "0.5.3" aes-gcm-siv = "0.11.1" -async-recursion = "1.1.0" +async-recursion = "1.1.1" futures = "0.3.30" tokio = { workspace = true } -tokio-util = { version = "0.7.10", features = ["io", "io-util"] } +tokio-util = { version = "0.7.11", features = ["io", "io-util"] } markup = "0.15.0" rocket = { workspace = true, features = ["secrets", "json"] } diff --git a/server/src/main.rs b/server/src/main.rs index 2cc8b98..dae2da4 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -3,9 +3,8 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -#![feature(lazy_cell)] -#![feature(int_roundings)] -#![feature(let_chains)] +#![feature(int_roundings, let_chains)] +#![allow(clippy::needless_borrows_for_generic_args)] use crate::routes::ui::{account::hash_password, admin::log::enable_logging}; use anyhow::Context; @@ -48,7 +47,7 @@ async fn main() { Ser(User { admin: true, name: username.clone(), - password: hash_password(&username, &password), + password: hash_password(username, password), ..admin.unwrap_or_else(|| User { display_name: "Admin".to_string(), ..Default::default() diff --git a/server/src/routes/stream.rs b/server/src/routes/stream.rs index ecfa3e7..756c502 100644 --- a/server/src/routes/stream.rs +++ b/server/src/routes/stream.rs @@ -54,7 +54,7 @@ pub async fn r_stream( spec: StreamSpec, ) -> Result<Either<StreamResponse, RedirectResponse>, MyError> { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; let source = node @@ -86,7 +86,7 @@ pub async fn r_stream( .ok_or(anyhow!("no credentials on the server-side"))?; info!("creating session on {host}"); - let instance = federation.get_instance(&host)?.to_owned(); + let instance = federation.get_instance(host)?.to_owned(); let session = instance .login(CreateSessionParams { username: username.to_owned(), @@ -116,12 +116,12 @@ pub async fn r_stream( range .as_ref() .map(|r| r.to_cr_hv()) - .unwrap_or(format!("none")) + .unwrap_or("none".to_string()) ); let urange = match &range { Some(r) => { - let r = r.0.get(0).unwrap_or(&(None..None)); + let r = r.0.first().unwrap_or(&(None..None)); r.start.unwrap_or(0)..r.end.unwrap_or(isize::MAX as usize) } None => 0..(isize::MAX as usize), @@ -192,14 +192,8 @@ impl RequestRange { assert_eq!(self.0.len(), 1); format!( "bytes {}-{}/*", - self.0[0] - .start - .map(|e| format!("{e}")) - .unwrap_or(String::new()), - self.0[0] - .end - .map(|e| format!("{e}")) - .unwrap_or(String::new()) + self.0[0].start.map(|e| e.to_string()).unwrap_or_default(), + self.0[0].end.map(|e| e.to_string()).unwrap_or_default() ) } pub fn from_hv(s: &str) -> Result<Self> { diff --git a/server/src/routes/ui/account/settings.rs b/server/src/routes/ui/account/settings.rs index 492e8ca..7d54d75 100644 --- a/server/src/routes/ui/account/settings.rs +++ b/server/src/routes/ui/account/settings.rs @@ -98,7 +98,6 @@ fn settings_page(session: Session, flash: Option<MyResult<String>>) -> DynLayout p { "The secret can be found in " code{"$XDG_CONFIG_HOME/jellynative_secret"} " or by clicking " a.button[href="jellynative://show-secret-v1"] { "Show Secret" } "." } } }, - ..Default::default() } } diff --git a/server/src/routes/ui/admin/log.rs b/server/src/routes/ui/admin/log.rs index 5b81a52..884ad7a 100644 --- a/server/src/routes/ui/admin/log.rs +++ b/server/src/routes/ui/admin/log.rs @@ -22,7 +22,7 @@ use std::{ const MAX_LOG_LEN: usize = 4096; -static LOGGER: LazyLock<Log> = LazyLock::new(Log::new); +static LOGGER: LazyLock<Log> = LazyLock::new(Log::default); pub fn enable_logging() { log::set_logger(&*LOGGER).unwrap(); @@ -63,9 +63,8 @@ pub fn r_admin_log<'a>(_session: AdminSession, warnonly: bool) -> MyResult<DynLa ..Default::default() }) } - -impl Log { - pub fn new() -> Self { +impl Default for Log { + fn default() -> Self { Self { inner: env_logger::builder() .filter_level(log::LevelFilter::Warn) @@ -74,6 +73,8 @@ impl Log { log: Default::default(), } } +} +impl Log { fn should_log(&self, metadata: &log::Metadata) -> bool { let level = metadata.level(); level @@ -152,18 +153,11 @@ fn format_level(level: Level) -> impl markup::Render { markup::new! { span[style=format!("color:{c}")] {@s} } } +#[derive(Default)] pub struct HtmlOut { s: String, color: bool, } -impl Default for HtmlOut { - fn default() -> Self { - Self { - color: false, - s: String::new(), - } - } -} impl HtmlOut { pub fn set_color(&mut self, [r, g, b]: [u8; 3]) { self.reset_color(); @@ -184,16 +178,12 @@ impl vte::Perform for HtmlOut { x => write!(self.s, "&#{};", x as u32).unwrap(), } } - fn execute(&mut self, _byte: u8) {} fn hook(&mut self, _params: &vte::Params, _i: &[u8], _ignore: bool, _a: char) {} fn put(&mut self, _byte: u8) {} fn unhook(&mut self) {} fn osc_dispatch(&mut self, _params: &[&[u8]], _bell_terminated: bool) {} - fn esc_dispatch(&mut self, _intermediates: &[u8], _ignore: bool, _byte: u8) { - // self.s += &format!(" {:?} ", (_intermediates, _byte)) - } - + fn esc_dispatch(&mut self, _intermediates: &[u8], _ignore: bool, _byte: u8) {} fn csi_dispatch( &mut self, params: &vte::Params, @@ -202,9 +192,9 @@ impl vte::Perform for HtmlOut { action: char, ) { let mut k = params.iter(); - // self.s += &format!(" {:?} ", (params, action)); + #[allow(clippy::single_match)] match action { - 'm' => match k.next().unwrap_or(&[0]).get(0).unwrap_or(&0) { + 'm' => match k.next().unwrap_or(&[0]).first().unwrap_or(&0) { c @ (30..=37 | 40..=47) => { let c = if *c >= 40 { *c - 10 } else { *c }; self.set_color(match c { diff --git a/server/src/routes/ui/admin/mod.rs b/server/src/routes/ui/admin/mod.rs index 540ac72..25f1f42 100644 --- a/server/src/routes/ui/admin/mod.rs +++ b/server/src/routes/ui/admin/mod.rs @@ -134,7 +134,7 @@ pub async fn r_admin_invite( database: &State<DataAcid>, ) -> MyResult<DynLayoutPage<'static>> { let i = format!("{}", rand::thread_rng().gen::<u128>()); - T_INVITE.insert(&database, &*i, ())?; + T_INVITE.insert(database, &*i, ())?; admin_dashboard(database, Some(Ok(format!("Invite: {}", i)))).await } @@ -152,7 +152,7 @@ pub async fn r_admin_remove_invite( ) -> MyResult<DynLayoutPage<'static>> { drop(session); T_INVITE - .remove(&database, form.invite.as_str())? + .remove(database, form.invite.as_str())? .ok_or(anyhow!("invite did not exist"))?; admin_dashboard(database, Some(Ok("Invite invalidated".into()))).await @@ -166,9 +166,9 @@ pub async fn r_admin_import( ) -> MyResult<DynLayoutPage<'static>> { drop(session); let t = Instant::now(); - let r = import(&database, &federation).await; + let r = import(database, federation).await; admin_dashboard( - &database, + database, Some( r.map_err(|e| e.into()) .map(|_| format!("Import successful; took {:?}", t.elapsed())), @@ -187,7 +187,7 @@ pub async fn r_admin_delete_cache( let r = tokio::fs::remove_dir_all(&CONF.cache_path).await; tokio::fs::create_dir(&CONF.cache_path).await?; admin_dashboard( - &database, + database, Some( r.map_err(|e| e.into()) .map(|_| format!("Cache deleted; took {:?}", t.elapsed())), @@ -233,7 +233,7 @@ pub async fn r_admin_transcode_posters( drop(_permit); admin_dashboard( - &database, + database, Some(Ok(format!( "All posters pre-transcoded; took {:?}", t.elapsed() diff --git a/server/src/routes/ui/admin/user.rs b/server/src/routes/ui/admin/user.rs index 4d77191..26c1837 100644 --- a/server/src/routes/ui/admin/user.rs +++ b/server/src/routes/ui/admin/user.rs @@ -76,7 +76,7 @@ fn manage_single_user<'a>( name: String, ) -> MyResult<DynLayoutPage<'a>> { let user = T_USER - .get(&database, &*name)? + .get(database, &*name)? .ok_or(anyhow!("user does not exist"))?; let flash = flash.map(|f| f.map_err(|e| format!("{e:?}"))); @@ -193,7 +193,7 @@ pub fn r_admin_remove_user( ) -> MyResult<DynLayoutPage<'static>> { drop(session); T_USER - .remove(&database, form.name.as_str())? + .remove(database, form.name.as_str())? .ok_or(anyhow!("user did not exist"))?; user_management(database, Some(Ok("User removed".into()))) } diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs index c278a31..ad31240 100644 --- a/server/src/routes/ui/assets.rs +++ b/server/src/routes/ui/assets.rs @@ -75,7 +75,7 @@ pub async fn r_item_assets( width: Option<usize>, ) -> MyResult<Redirect> { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -83,10 +83,10 @@ pub async fn r_item_assets( AssetRole::Backdrop => node.public.backdrop, AssetRole::Poster => node.public.poster, }; - if let None = asset { + if asset.is_none() { if let Some(parent) = &node.public.path.last() { let parent = T_NODE - .get(&db, parent.as_str())? + .get(db, parent.as_str())? .ok_or(anyhow!("node does not exist"))?; asset = match role { AssetRole::Backdrop => parent.public.backdrop, @@ -113,7 +113,7 @@ pub async fn r_person_asset( width: Option<usize>, ) -> MyResult<Redirect> { T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -129,7 +129,7 @@ pub async fn r_person_asset( .person .headshot .to_owned() - .unwrap_or(AssetInner::Assets(format!("fallback-Person.avif").into()).ser()); + .unwrap_or(AssetInner::Assets("fallback-Person.avif".into()).ser()); Ok(Redirect::temporary(rocket::uri!(r_asset(asset.0, width)))) } @@ -146,7 +146,7 @@ pub async fn r_node_thumbnail( width: Option<usize>, ) -> MyResult<Redirect> { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; diff --git a/server/src/routes/ui/error.rs b/server/src/routes/ui/error.rs index b8a132d..ba1dc88 100644 --- a/server/src/routes/ui/error.rs +++ b/server/src/routes/ui/error.rs @@ -41,7 +41,7 @@ pub fn r_catch<'a>(status: Status, _request: &Request) -> DynLayoutPage<'a> { } #[catch(default)] -pub fn r_api_catch<'a>(status: Status, _request: &Request) -> Value { +pub fn r_api_catch(status: Status, _request: &Request) -> Value { json!({ "error": format!("{status}") }) } diff --git a/server/src/routes/ui/home.rs b/server/src/routes/ui/home.rs index 2fa9212..0a1089a 100644 --- a/server/src/routes/ui/home.rs +++ b/server/src/routes/ui/home.rs @@ -50,7 +50,7 @@ pub fn r_home(sess: Session, db: &State<DataAcid>) -> MyResult<DynLayoutPage> { .collect::<Vec<_>>(); let toplevel = T_NODE - .get(&db, "library")? + .get(db, "library")? .context("root node missing")? .public .children diff --git a/server/src/routes/ui/layout.rs b/server/src/routes/ui/layout.rs index 1696ac4..9f9038c 100644 --- a/server/src/routes/ui/layout.rs +++ b/server/src/routes/ui/layout.rs @@ -74,7 +74,7 @@ markup::define! { @if let Some(flash) = &flash { @match flash { Ok(mesg) => { section.message { p.success { @mesg } } } - Err(err) => { section.message { p.error { @format!("{err}") } } } + Err(err) => { section.message { p.error { @err } } } } } } @@ -110,7 +110,7 @@ impl<'r, Main: Render> Responder<'r, 'static> for LayoutPage<Main> { title: self.title, class: &format!( "{} theme-{:?}", - self.class.as_deref().unwrap_or(""), + self.class.unwrap_or(""), session .as_ref() .map(|s| s.user.theme) diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs index bd839fb..d99ddb7 100644 --- a/server/src/routes/ui/node.rs +++ b/server/src/routes/ui/node.rs @@ -47,7 +47,7 @@ pub async fn r_library_node_ext<'a>( db: &'a State<DataAcid>, ) -> MyResult<Json<ExtendedNode>> { T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))?; @@ -63,14 +63,14 @@ pub async fn r_library_node_filter<'a>( filter: NodeFilterSort, ) -> MyResult<Either<DynLayoutPage<'a>, Json<NodePublic>>> { let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))? .public; let node_ext = T_NODE_EXTENDED.get(db, id)?.unwrap_or_default(); let udata = T_USER_NODE - .get(&db, &(session.user.name.as_str(), id))? + .get(db, &(session.user.name.as_str(), id))? .unwrap_or_default(); if *aj { @@ -80,7 +80,7 @@ pub async fn r_library_node_filter<'a>( let mut children = node .children .iter() - .map(|c| Ok(db.get_node_with_userdata(c, &session)?)) + .map(|c| db.get_node_with_userdata(c, &session)) .collect::<anyhow::Result<Vec<_>>>()? .into_iter() .collect(); @@ -113,7 +113,7 @@ pub async fn r_library_node_filter<'a>( Ok(Either::Left(LayoutPage { title: node.title.clone().unwrap_or_default(), content: markup::new! { - @NodePage { node: &node, id: &id, udata: &udata, children: &children, path: &path, filter: &filter, node_ext: &node_ext } + @NodePage { node: &node, id, udata: &udata, children: &children, path: &path, filter: &filter, node_ext: &node_ext } }, ..Default::default() })) @@ -220,10 +220,10 @@ markup::define! { } .title { @pe.person.name br; - @if let Some(c) = pe.characters.get(0) { + @if let Some(c) = pe.characters.first() { .subtitle { @c } } - @if let Some(c) = pe.jobs.get(0) { + @if let Some(c) = pe.jobs.first() { .subtitle { @c } } } @@ -359,11 +359,8 @@ impl MediaInfoExt for MediaInfo { fn resolution_name(&self) -> &'static str { let mut maxdim = 0; for t in &self.tracks { - match &t.kind { - SourceTrackKind::Video { width, height, .. } => { - maxdim = maxdim.max(*width.max(height)) - } - _ => (), + if let SourceTrackKind::Video { width, height, .. } = &t.kind { + maxdim = maxdim.max(*width.max(height)) } } diff --git a/server/src/routes/ui/player.rs b/server/src/routes/ui/player.rs index 69445ed..55e1303 100644 --- a/server/src/routes/ui/player.rs +++ b/server/src/routes/ui/player.rs @@ -108,9 +108,9 @@ pub fn r_player<'a>( let spec = StreamSpec { track: None .into_iter() - .chain(conf.v.into_iter()) - .chain(conf.a.into_iter()) - .chain(conf.s.into_iter()) + .chain(conf.v) + .chain(conf.a) + .chain(conf.s) .collect::<Vec<_>>(), format: StreamFormat::Matroska, webm: Some(true), @@ -131,7 +131,6 @@ pub fn r_player<'a>( } @conf }, - ..Default::default() })) } diff --git a/server/src/routes/ui/search.rs b/server/src/routes/ui/search.rs index 4ea5716..5ca4b51 100644 --- a/server/src/routes/ui/search.rs +++ b/server/src/routes/ui/search.rs @@ -49,12 +49,12 @@ pub async fn r_search<'a>( let id = doc.get_first(db.node_index.id).unwrap().as_str().unwrap(); let node = T_NODE - .get(&db, id)? + .get(db, id)? .only_if_permitted(&session.user.permissions) .ok_or(anyhow!("node does not exist"))? .public; let udata = T_USER_NODE - .get(&db, &(session.user.name.as_str(), id))? + .get(db, &(session.user.name.as_str(), id))? .unwrap_or_default(); results.push((id.to_owned(), node, udata)); diff --git a/server/src/routes/ui/sort.rs b/server/src/routes/ui/sort.rs index a779b15..88f262b 100644 --- a/server/src/routes/ui/sort.rs +++ b/server/src/routes/ui/sort.rs @@ -220,7 +220,7 @@ markup::define! { .category { h3 { @cname } @for (value, label) in *cat { - label { input[type="checkbox", name="filter_kind", value=value, checked=f.filter_kind.as_ref().map(|k|k.contains(&value)).unwrap_or(true)]; @label } br; + label { input[type="checkbox", name="filter_kind", value=value, checked=f.filter_kind.as_ref().map(|k|k.contains(value)).unwrap_or(true)]; @label } br; } } } diff --git a/stream/Cargo.toml b/stream/Cargo.toml index 2bd9f6a..c63b8d2 100644 --- a/stream/Cargo.toml +++ b/stream/Cargo.toml @@ -11,6 +11,6 @@ jellyremuxer = { path = "../remuxer" } log = { workspace = true } anyhow = { workspace = true } -tokio = { version = "1.37.0", features = ["io-util"] } -tokio-util = { version = "0.7.10", features = ["io", "io-util"] } -serde_json = "1.0.115" +tokio = { version = "1.38.0", features = ["io-util"] } +tokio-util = { version = "0.7.11", features = ["io", "io-util"] } +serde_json = "1.0.117" diff --git a/stream/src/fragment.rs b/stream/src/fragment.rs index 16bb703..1082e1c 100644 --- a/stream/src/fragment.rs +++ b/stream/src/fragment.rs @@ -29,7 +29,7 @@ pub async fn fragment_stream( let n = spec.index.ok_or(anyhow!("segment index missing"))?; let local_track = local_tracks - .get(0) + .first() .ok_or(anyhow!("track missing"))? .to_owned(); diff --git a/stream/src/hls.rs b/stream/src/hls.rs index b5a78ef..342cbde 100644 --- a/stream/src/hls.rs +++ b/stream/src/hls.rs @@ -55,7 +55,7 @@ pub async fn hls_variant_stream( mut spec: StreamSpec, mut b: DuplexStream, ) -> Result<()> { - let local_track = local_tracks.get(0).ok_or(anyhow!("no track"))?.to_owned(); + let local_track = local_tracks.first().ok_or(anyhow!("no track"))?.to_owned(); let track_index = spec.track[0]; let media_info = node.public.media.to_owned().ok_or(anyhow!("no media?"))?; let frags = spawn_blocking(move || { diff --git a/stream/src/jhls.rs b/stream/src/jhls.rs index ac1a3e5..2e45378 100644 --- a/stream/src/jhls.rs +++ b/stream/src/jhls.rs @@ -21,7 +21,7 @@ pub async fn jhls_index( perms: &PermissionSet, ) -> Result<()> { let local_track = local_tracks - .get(0) + .first() .ok_or(anyhow!("track missing"))? .to_owned(); diff --git a/stream/src/webvtt.rs b/stream/src/webvtt.rs index b29c7c5..316e224 100644 --- a/stream/src/webvtt.rs +++ b/stream/src/webvtt.rs @@ -21,8 +21,8 @@ pub async fn vtt_stream( // TODO should use fragments too? big films take too long... - let tracki = *spec.track.get(0).ok_or(anyhow!("no track selected"))?; - let local_track = local_tracks.get(0).ok_or(anyhow!("no tracks"))?.clone(); + let tracki = *spec.track.first().ok_or(anyhow!("no track selected"))?; + let local_track = local_tracks.first().ok_or(anyhow!("no tracks"))?.clone(); let track = &node.public.media.unwrap().tracks[tracki]; let cp = local_track.codec_private.clone(); diff --git a/tool/Cargo.toml b/tool/Cargo.toml index ba74ee9..12b6895 100644 --- a/tool/Cargo.toml +++ b/tool/Cargo.toml @@ -11,18 +11,18 @@ jellyclient = { path = "../client" } log = { workspace = true } env_logger = "0.11.3" -anyhow = "1.0.82" +anyhow = "1.0.86" reqwest = { workspace = true } indicatif = "0.17.8" tokio = { workspace = true } -clap = { version = "4.5.4", features = ["derive"] } -clap_complete = "4.5.2" +clap = { version = "4.5.6", features = ["derive"] } +clap_complete = "4.5.5" -serde = { version = "1.0.197", features = ["derive"] } -serde_json = "1.0.115" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.117" serde_yaml = "0.9.34" bincode = { version = "2.0.0-rc.3", features = ["serde"] } -base64 = "0.22.0" +base64 = "0.22.1" rand = "0.8.5" dialoguer = { version = "0.11.0", features = ["fuzzy-select"] } diff --git a/tool/src/add.rs b/tool/src/add.rs index dfec40d..7b3861e 100644 --- a/tool/src/add.rs +++ b/tool/src/add.rs @@ -55,6 +55,14 @@ pub async fn add(action: Action) -> anyhow::Result<()> { default = i }; } + TraktKind::Show => { + if let Some(i) = directories + .iter() + .position(|d| d.0.to_str().unwrap().contains("shows")) + { + default = i + }; + } _ => (), } } @@ -71,7 +79,7 @@ pub async fn add(action: Action) -> anyhow::Result<()> { let (last_search, trakt_object, trakt_kind) = loop { let name: String = Input::with_theme(&theme) .with_prompt("Search by title") - .default(media.as_ref().map(path_to_query).unwrap_or_default()) + .default(media.as_ref().map(|p| path_to_query(p)).unwrap_or_default()) .interact_text() .unwrap(); @@ -155,7 +163,7 @@ pub async fn add(action: Action) -> anyhow::Result<()> { } fn validate_id(s: &String) -> anyhow::Result<()> { - if &make_id(&s) == s { + if &make_id(s) == s { Ok(()) } else { bail!("invalid id") @@ -174,7 +182,7 @@ fn make_id(s: &str) -> String { out } -fn path_to_query(path: &PathBuf) -> String { +fn path_to_query(path: &Path) -> String { path.file_stem() .unwrap() .to_str() diff --git a/tool/src/migrate.rs b/tool/src/migrate.rs index 0412430..fe369d4 100644 --- a/tool/src/migrate.rs +++ b/tool/src/migrate.rs @@ -112,7 +112,7 @@ pub fn migrate(action: Action) -> anyhow::Result<()> { let table = txn.open_table(T_USER)?; let len = table.len()?; - for r in table.iter()?.progress_count(len.try_into().unwrap()) { + for r in table.iter()?.progress_count(len) { let (k, v) = r?; serde_json::to_writer(&mut o, &(k.value(), v.value().0))?; writeln!(&mut o)?; @@ -161,7 +161,7 @@ pub fn migrate(action: Action) -> anyhow::Result<()> { let table = txn.open_table(T_USER_NODE)?; let len = table.len()?; - for r in table.iter()?.progress_count(len.try_into().unwrap()) { + for r in table.iter()?.progress_count(len) { let (k, v) = r?; serde_json::to_writer(&mut o, &(k.value(), v.value().0))?; writeln!(&mut o)?; @@ -213,7 +213,7 @@ pub fn migrate(action: Action) -> anyhow::Result<()> { let table = txn.open_table(T_INVITE)?; let len = table.len()?; - for r in table.iter()?.progress_count(len.try_into().unwrap()) { + for r in table.iter()?.progress_count(len) { let (k, v) = r?; serde_json::to_writer(&mut o, &(k.value(), v.value().0))?; writeln!(&mut o)?; diff --git a/transcoder/Cargo.toml b/transcoder/Cargo.toml index 2343ec6..e49bd2a 100644 --- a/transcoder/Cargo.toml +++ b/transcoder/Cargo.toml @@ -9,14 +9,14 @@ jellybase = { path = "../base" } jellyremuxer = { path = "../remuxer" } log = { workspace = true } # TODO: change this back to crates.io when pr is merged -image = "0.24.9" +image = "0.25.1" # image = { git = "https://github.com/metamuffin/image-rs", features = [ # "avif-decoder", # ] } -libavif-image = { version = "0.12.0", default-features = false, features = [ +libavif-image = { version = "0.13.0", default-features = false, features = [ "codec-dav1d", ] } -anyhow = "1.0.82" +anyhow = "1.0.86" rgb = "0.8.37" rav1e = { version = "0.7.1", default-features = false, features = [ "threading", diff --git a/transcoder/src/fragment.rs b/transcoder/src/fragment.rs index 7695a48..ecb73d5 100644 --- a/transcoder/src/fragment.rs +++ b/transcoder/src/fragment.rs @@ -22,7 +22,7 @@ pub async fn transcode( enc: &EncodingProfile, input: impl FnOnce(ChildStdin), ) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &["frag-tc", key, &format!("{enc:?}")], move |mut output| async move { let _permit = LOCAL_VIDEO_TRANSCODING_TASKS.acquire().await?; @@ -78,9 +78,9 @@ pub async fn transcode( let mut proc = Command::new("ffmpeg") .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .args(&["-f", "matroska", "-i", "pipe:0"]) + .args(["-f", "matroska", "-i", "pipe:0"]) .args(args) - .args(&["-f", "webm", "pipe:1"]) + .args(["-f", "webm", "pipe:1"]) .spawn()?; // let mut proc = Command::new("cat") // .stdin(Stdio::piped()) @@ -98,5 +98,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/image.rs b/transcoder/src/image.rs index 3589ab9..3d7cb2d 100644 --- a/transcoder/src/image.rs +++ b/transcoder/src/image.rs @@ -22,7 +22,7 @@ pub async fn transcode( speed: u8, width: usize, ) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &[ "image-tc", path.clone().as_os_str().to_str().unwrap(), @@ -96,5 +96,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/lib.rs b/transcoder/src/lib.rs index 7bf2c12..fe44a1c 100644 --- a/transcoder/src/lib.rs +++ b/transcoder/src/lib.rs @@ -3,8 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -#![feature(async_closure)] -#![feature(exit_status_error)] +#![feature(async_closure, exit_status_error)] use tokio::sync::Semaphore; pub mod fragment; diff --git a/transcoder/src/thumbnail.rs b/transcoder/src/thumbnail.rs index 9661fd0..c8bfb1c 100644 --- a/transcoder/src/thumbnail.rs +++ b/transcoder/src/thumbnail.rs @@ -5,7 +5,7 @@ use std::{path::Path, process::Stdio}; use tokio::{io::copy, process::Command}; pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &["thumb", path.to_str().unwrap(), &format!("{time}")], move |mut output| async move { let _permit = LOCAL_IMAGE_TRANSCODING_TASKS.acquire().await?; @@ -13,12 +13,12 @@ pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePat let mut proc = Command::new("ffmpeg") .stdout(Stdio::piped()) - .args(&["-ss", &format!("{time}")]) - .args(&["-f", "matroska", "-i", path.to_str().unwrap()]) - .args(&["-frames:v", "1"]) - .args(&["-c:v", "qoi"]) - .args(&["-f", "image2"]) - .args(&["-update", "1"]) + .args(["-ss", &format!("{time}")]) + .args(["-f", "matroska", "-i", path.to_str().unwrap()]) + .args(["-frames:v", "1"]) + .args(["-c:v", "qoi"]) + .args(["-f", "image2"]) + .args(["-update", "1"]) .arg("pipe:1") .spawn()?; @@ -30,5 +30,5 @@ pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePat Ok(()) }, ) - .await?) + .await } |