diff --git a/Dockerfile b/Dockerfile index d1dc609..52b5a19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,11 +19,6 @@ RUN apt-get install -y \ curl \ wget \ pkg-config \ - libavutil-dev \ - libavformat-dev \ - libavcodec-dev \ - libavfilter-dev \ - libavdevice-dev \ clang \ nodejs \ npm \ @@ -39,4 +34,4 @@ ENV PATH="/root/.cargo/bin:${PATH}" RUN python3 scripts/clean.py RUN python3 scripts/check.py --install -RUN python3 scripts/build.py all --verbose --ffmpeg +RUN python3 scripts/build.py all --verbose diff --git a/README.md b/README.md index a837fd3..405530e 100644 --- a/README.md +++ b/README.md @@ -77,16 +77,14 @@ $ ./scripts/check.py --install All Componens: ```sh -$ ./scripts/build.py all --ffmpeg +$ ./scripts/build.py all ``` Daemon only: ```sh -$ ./scripts/build.py daemon --ffmpeg +$ ./scripts/build.py daemon ``` -If you don't want to build with ffmpeg support omit the `--ffmpeg` flag. - UI only: ```sh $ ./scripts/build.py ui diff --git a/mediarepo-daemon/Cargo.lock b/mediarepo-daemon/Cargo.lock index a9e5bc4..f18bf7e 100644 --- a/mediarepo-daemon/Cargo.lock +++ b/mediarepo-daemon/Cargo.lock @@ -20,6 +20,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + [[package]] name = "ahash" version = "0.7.6" @@ -67,12 +73,6 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.2" @@ -128,7 +128,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -179,27 +179,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde 1.0.136", -] - -[[package]] -name = "bindgen" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" -dependencies = [ - "bitflags", - "cexpr", - "cfg-if 0.1.10", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2 1.0.36", - "quote 1.0.15", - "regex", - "rustc-hash", - "shlex", + "serde", ] [[package]] @@ -221,7 +201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec", "constant_time_eq", ] @@ -232,7 +212,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec", "constant_time_eq", ] @@ -243,19 +223,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec", "cc", "cfg-if 1.0.0", "constant_time_eq", ] +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -264,7 +256,16 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03588e54c62ae6d763e2a80090d50353b785795361b4ff5b3bf0a5097fc31c0b" dependencies = [ - "generic-array", + "generic-array 0.14.5", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", ] [[package]] @@ -279,7 +280,7 @@ dependencies = [ "futures-core", "lazy_static", "num_enum", - "serde 1.0.136", + "serde", "thiserror", "tokio", "tracing", @@ -292,6 +293,12 @@ version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + [[package]] name = "bytemuck" version = "1.7.3" @@ -319,15 +326,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom 5.1.2", -] - [[package]] name = "cfg-if" version = "0.1.10" @@ -348,23 +346,12 @@ checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ "libc", "num-integer", - "num-traits 0.2.14", - "serde 1.0.136", + "num-traits", + "serde", "time 0.1.44", "winapi", ] -[[package]] -name = "clang-sys" -version = "0.29.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "2.34.0" @@ -394,15 +381,18 @@ checksum = "120133d4db2ec47efe2e26502ee984747630c67f51974fca0b6c1340cf2368d3" [[package]] name = "config" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +checksum = "54ad70579325f1a38ea4c13412b82241c5900700a69785d73e2736bd65a33f86" dependencies = [ + "async-trait", + "json5", "lazy_static", - "nom 5.1.2", + "nom", + "pathdiff", + "ron", "rust-ini", - "serde 1.0.136", - "serde-hjson", + "serde", "serde_json", "toml", "yaml-rust", @@ -423,16 +413,18 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829835c211a0247cd11e65e13cec8696b879374879c35ce162ce8098b23c90d4" +checksum = "565a7dfea2d10dd0e5c57cc394d5d441b1910960d8c9211ed14135e0e6ec3a20" dependencies = [ "console-api", "crossbeam-channel", + "crossbeam-utils 0.8.7", "futures 0.3.21", "hdrhistogram", "humantime", - "serde 1.0.136", + "prost-types", + "serde", "serde_json", "thread_local", "tokio", @@ -578,7 +570,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -625,13 +617,22 @@ dependencies = [ "adler32", ] +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.5", ] [[package]] @@ -642,7 +643,16 @@ checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" dependencies = [ "block-buffer 0.10.1", "crypto-common", - "generic-array", + "generic-array 0.14.5", +] + +[[package]] +name = "dlv-list" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" +dependencies = [ + "rand", ] [[package]] @@ -737,6 +747,12 @@ dependencies = [ "threadpool", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + [[package]] name = "fastrand" version = "1.7.0" @@ -746,31 +762,6 @@ dependencies = [ "instant", ] -[[package]] -name = "ffmpeg-next" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676cda947a87a1e8a42e154059c567e75de64860252cce52c684acd8c074fa0" -dependencies = [ - "bitflags", - "ffmpeg-sys-next", - "libc", -] - -[[package]] -name = "ffmpeg-sys-next" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de57234f2c49c6e093fe67bbbaa9142c228f6e2d5533ef27980993d5b6adef2a" -dependencies = [ - "bindgen", - "cc", - "libc", - "num_cpus", - "pkg-config", - "vcpkg", -] - [[package]] name = "fixedbitset" version = "0.4.1" @@ -939,6 +930,15 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.5" @@ -1003,13 +1003,22 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash 0.4.7", +] + [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1018,7 +1027,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -1030,8 +1039,8 @@ dependencies = [ "base64", "byteorder", "flate2", - "nom 7.1.0", - "num-traits 0.2.14", + "nom", + "num-traits", ] [[package]] @@ -1159,7 +1168,7 @@ dependencies = [ "jpeg-decoder 0.2.1", "num-iter", "num-rational", - "num-traits 0.2.14", + "num-traits", "png", "scoped_threadpool", "tiff", @@ -1172,7 +1181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -1247,6 +1256,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + [[package]] name = "keccak" version = "0.1.0" @@ -1259,47 +1279,18 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "lebe" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7efd1d698db0759e6ef11a7cd44407407399a910c774dd804c64c032da7826ff" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec 0.5.2", - "bitflags", - "cfg-if 1.0.0", - "ryu", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libsqlite3-sys" version = "0.23.2" @@ -1344,6 +1335,12 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "matchers" version = "0.1.0" @@ -1365,7 +1362,7 @@ version = "0.31.0" dependencies = [ "bromine", "chrono", - "serde 1.0.136", + "serde", "serde_piecewise_default", "thiserror", "tracing", @@ -1385,7 +1382,7 @@ dependencies = [ "multibase", "multihash", "sea-orm", - "serde 1.0.136", + "serde", "sqlx", "thiserror", "thumbnailer", @@ -1398,7 +1395,7 @@ dependencies = [ [[package]] name = "mediarepo-daemon" -version = "1.0.0-rc.3" +version = "1.0.0-rc.4" dependencies = [ "console-subscriber", "glob", @@ -1440,7 +1437,7 @@ dependencies = [ "mime", "mime_guess", "sea-orm", - "serde 1.0.136", + "serde", "tokio", "tracing", "typemap_rev", @@ -1457,7 +1454,7 @@ dependencies = [ "mediarepo-logic", "port_check", "rayon", - "serde 1.0.136", + "serde", "tokio", "tracing", "tracing-futures", @@ -1486,9 +1483,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -1512,9 +1509,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" dependencies = [ "libc", "log", @@ -1607,17 +1604,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.0" @@ -1646,7 +1632,7 @@ checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -1656,7 +1642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -1667,7 +1653,7 @@ checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -1678,16 +1664,7 @@ checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", -] - -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -1745,6 +1722,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -1784,6 +1767,16 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "ordered-multimap" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +dependencies = [ + "dlv-list", + "hashbrown 0.9.1", +] + [[package]] name = "ouroboros" version = "0.14.0" @@ -1834,10 +1827,16 @@ dependencies = [ ] [[package]] -name = "peeking_take_while" -version = "0.1.2" +name = "paste" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "percent-encoding" @@ -1845,6 +1844,49 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2 1.0.36", + "quote 1.0.15", + "syn 1.0.86", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +dependencies = [ + "maplit", + "pest", + "sha-1", +] + [[package]] name = "petgraph" version = "0.6.0" @@ -2159,11 +2201,26 @@ dependencies = [ "chrono", ] +[[package]] +name = "ron" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b861ecaade43ac97886a512b360d01d66be9f41f3c61088b42cedf92e03d678" +dependencies = [ + "base64", + "bitflags", + "serde", +] + [[package]] name = "rust-ini" -version = "0.13.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" +checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] [[package]] name = "rust_decimal" @@ -2171,17 +2228,11 @@ version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4214023b1223d02a4aad9f0bb9828317634a56530870a2eaf7200a99c0c10f68" dependencies = [ - "arrayvec 0.7.2", - "num-traits 0.2.14", - "serde 1.0.136", + "arrayvec", + "num-traits", + "serde", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustversion" version = "1.0.6" @@ -2233,7 +2284,7 @@ dependencies = [ "sea-orm-macros", "sea-query", "sea-strum", - "serde 1.0.136", + "serde", "serde_json", "sqlx", "tracing", @@ -2325,12 +2376,6 @@ dependencies = [ "libc", ] -[[package]] -name = "serde" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" - [[package]] name = "serde" version = "1.0.136" @@ -2340,18 +2385,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hjson" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" -dependencies = [ - "lazy_static", - "num-traits 0.1.43", - "regex", - "serde 0.8.23", -] - [[package]] name = "serde_derive" version = "1.0.136" @@ -2369,10 +2402,9 @@ version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" dependencies = [ - "indexmap", "itoa 1.0.1", "ryu", - "serde 1.0.136", + "serde", ] [[package]] @@ -2381,7 +2413,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91a44b0f51aedd237f8f25c831e1f629982a187a5045c08ce4bccccce17b4b0" dependencies = [ - "serde 1.0.136", + "serde", "serde_piecewise_default_derive", ] @@ -2393,10 +2425,22 @@ checksum = "19446953e7b22342c23c79ede938c04b1c12f4eb7513db30cda94193ce30ff2a" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", - "serde 1.0.136", + "serde", "syn 0.15.44", ] +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + [[package]] name = "sha2" version = "0.9.9" @@ -2407,7 +2451,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug", + "opaque-debug 0.3.0", ] [[package]] @@ -2440,12 +2484,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -2493,15 +2531,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ "itertools", - "nom 7.1.0", + "nom", "unicode_categories", ] [[package]] name = "sqlx" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692749de69603d81e016212199d73a2e14ee20e2def7d7914919e8db5d4d48b9" +checksum = "fc15591eb44ffb5816a4a70a7efd5dd87bfd3aa84c4c200401c4396140525826" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2509,20 +2547,18 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518be6f6fff5ca76f985d434f9c37f3662af279642acf730388f271dff7b9016" +checksum = "195183bf6ff8328bb82c0511a83faf60aacf75840103388851db61d7a9854ae3" dependencies = [ - "ahash", + "ahash 0.7.6", "atoi", "bitflags", "byteorder", "bytes", "chrono", "crc", - "crossbeam-channel", "crossbeam-queue", - "crossbeam-utils 0.8.7", "either", "flume", "futures-channel", @@ -2540,10 +2576,10 @@ dependencies = [ "memchr", "num-bigint", "once_cell", - "parking_lot", + "paste", "percent-encoding", "rust_decimal", - "serde 1.0.136", + "serde", "serde_json", "sha2 0.9.9", "smallvec", @@ -2558,9 +2594,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e45140529cf1f90a5e1c2e561500ca345821a1c513652c8f486bbf07407cc8" +checksum = "eee35713129561f5e55c554bba1c378e2a7e67f81257b7311183de98c50e6f94" dependencies = [ "dotenv", "either", @@ -2578,9 +2614,9 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8061cbaa91ee75041514f67a09398c65a64efed72c90151ecd47593bad53da99" +checksum = "b555e70fbbf84e269ec3858b7a6515bcfe7a166a7cc9c636dd6efd20431678b6" dependencies = [ "native-tls", "once_cell", @@ -2594,12 +2630,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "stringprep" version = "0.1.2" @@ -2737,12 +2767,12 @@ dependencies = [ [[package]] name = "thumbnailer" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2c8e83220af2d58ff05f00dd28ceeef896e831d263014fd1229099f2d954be" +checksum = "16c652b0061a3f3500284063fab527dc5e2dbd015905fcd08c5bd471c52a338b" dependencies = [ - "ffmpeg-next", "image", + "lazy_static", "mime", "rayon", "tempfile", @@ -2799,9 +2829,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.16.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" dependencies = [ "bytes", "libc", @@ -2811,6 +2841,7 @@ dependencies = [ "once_cell", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", "tracing", "winapi", @@ -2902,7 +2933,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "serde 1.0.136", + "serde", ] [[package]] @@ -2983,9 +3014,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" +checksum = "f6c650a8ef0cd2dd93736f033d21cbd1224c5a967aa0c258d00fcf7dafef9b9f" dependencies = [ "cfg-if 1.0.0", "log", @@ -3065,21 +3096,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "serde 1.0.136", + "serde", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74786ce43333fcf51efe947aed9718fbe46d5c7328ec3f1029e818083966d9aa" +checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" dependencies = [ "ansi_term", "lazy_static", "matchers", "regex", - "serde 1.0.136", + "serde", "serde_json", "sharded-slab", "smallvec", @@ -3108,6 +3139,12 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + [[package]] name = "unicase" version = "2.6.0" @@ -3187,7 +3224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ "getrandom", - "serde 1.0.136", + "serde", ] [[package]] diff --git a/mediarepo-daemon/Cargo.toml b/mediarepo-daemon/Cargo.toml index 5268dfc..7700298 100644 --- a/mediarepo-daemon/Cargo.toml +++ b/mediarepo-daemon/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["mediarepo-core", "mediarepo-database", "mediarepo-logic", "m [package] name = "mediarepo-daemon" -version = "1.0.0-rc.3" +version = "1.0.0-rc.4" edition = "2018" license = "gpl-3" repository = "https://github.com/Trivernis/mediarepo-daemon" @@ -16,7 +16,7 @@ name = "mediarepo-daemon" path = "src/main.rs" [dependencies] -tracing = "0.1.30" +tracing = "0.1.31" toml = "0.5.8" structopt = "0.3.26" glob = "0.3.0" @@ -25,7 +25,7 @@ tracing-appender = "0.2.0" tracing-log = "0.1.2" rolling-file = "0.1.0" num-integer = "0.1.44" -console-subscriber = "0.1.1" +console-subscriber = "0.1.3" log = "0.4.14" [dependencies.mediarepo-core] @@ -38,13 +38,9 @@ path = "mediarepo-logic" path = "./mediarepo-socket" [dependencies.tokio] -version = "1.16.1" +version = "1.17.0" features = ["macros", "rt-multi-thread", "io-std", "io-util"] [dependencies.tracing-subscriber] -version= "0.3.8" +version= "0.3.9" features = ["env-filter", "ansi", "json"] - -[features] -default = ["ffmpeg"] -ffmpeg = ["mediarepo-core/ffmpeg", "mediarepo-logic/ffmpeg"] diff --git a/mediarepo-daemon/mediarepo-core/Cargo.toml b/mediarepo-daemon/mediarepo-core/Cargo.toml index 3ff010b..34a801f 100644 --- a/mediarepo-daemon/mediarepo-core/Cargo.toml +++ b/mediarepo-daemon/mediarepo-core/Cargo.toml @@ -17,35 +17,28 @@ typemap_rev = "0.1.5" futures = "0.3.21" itertools = "0.10.3" glob = "0.3.0" -tracing = "0.1.30" +tracing = "0.1.31" data-encoding = "2.3.2" tokio-graceful-shutdown = "0.4.3" - -[dependencies.thumbnailer] -version = "0.3.0" -default-features = false +thumbnailer = "0.4.0" [dependencies.sea-orm] version = "0.6.0" default-features = false [dependencies.sqlx] -version = "0.5.10" +version = "0.5.11" default-features = false features = ["migrate"] [dependencies.tokio] -version = "1.16.1" +version = "1.17.0" features = ["fs", "io-util", "io-std"] [dependencies.config] -version = "0.11.0" +version = "0.12.0" features = ["toml"] [dependencies.mediarepo-api] path = "../../mediarepo-api" -features = ["bromine"] - -[features] -default = [] -ffmpeg = ["thumbnailer/ffmpeg"] +features = ["bromine"] \ No newline at end of file diff --git a/mediarepo-daemon/mediarepo-core/src/settings/mod.rs b/mediarepo-daemon/mediarepo-core/src/settings/mod.rs index 66a8960..3ce242b 100644 --- a/mediarepo-daemon/mediarepo-core/src/settings/mod.rs +++ b/mediarepo-daemon/mediarepo-core/src/settings/mod.rs @@ -25,17 +25,17 @@ pub struct Settings { impl Settings { pub fn read(root: &PathBuf) -> RepoResult { - let mut settings = Config::default(); - settings - .merge(config::File::from_str( + let settings = Config::builder() + .add_source(config::File::from_str( &*Settings::default().to_toml_string()?, FileFormat::Toml, - ))? - .merge(config::File::from(root.join("repo")))? - .merge(config::Environment::with_prefix("MEDIAREPO").separator("."))?; + )) + .add_source(config::File::from(root.join("repo"))) + .add_source(config::Environment::with_prefix("MEDIAREPO").separator(".")) + .build()?; tracing::debug!("Settings are: {:#?}", settings); - Ok(settings.try_into::()?) + Ok(settings.try_deserialize()?) } /// Parses settings from a string @@ -50,16 +50,16 @@ impl Settings { .map(|p| p.to_string_lossy().to_string()) .unwrap_or_else(|| String::from("./")); - let mut settings = Config::default(); - settings - .merge(config::File::from_str( + let settings = Config::builder() + .add_source(config::File::from_str( &*settings_main.to_toml_string()?, FileFormat::Toml, - ))? - .merge(config::Environment::with_prefix("MEDIAREPO"))?; + )) + .add_source(config::Environment::with_prefix("MEDIAREPO")) + .build()?; tracing::debug!("Settings are: {:#?}", settings); - Ok(settings.try_into::()?) + Ok(settings.try_deserialize()?) } /// Converts the settings into a toml string diff --git a/mediarepo-daemon/mediarepo-database/Cargo.toml b/mediarepo-daemon/mediarepo-database/Cargo.toml index 52c3dfc..b37e501 100644 --- a/mediarepo-daemon/mediarepo-database/Cargo.toml +++ b/mediarepo-daemon/mediarepo-database/Cargo.toml @@ -8,13 +8,13 @@ workspace = ".." [dependencies] chrono = "0.4.19" -tracing = "0.1.30" +tracing = "0.1.31" [dependencies.mediarepo-core] path = "../mediarepo-core" [dependencies.sqlx] -version = "0.5.10" +version = "0.5.11" features = ["migrate"] [dependencies.sea-orm] diff --git a/mediarepo-daemon/mediarepo-logic/Cargo.toml b/mediarepo-daemon/mediarepo-logic/Cargo.toml index 3c2292c..018bcd4 100644 --- a/mediarepo-daemon/mediarepo-logic/Cargo.toml +++ b/mediarepo-daemon/mediarepo-logic/Cargo.toml @@ -10,9 +10,9 @@ workspace = ".." chrono = "0.4.19" typemap_rev = "0.1.5" serde = "1.0.136" -mime_guess = "2.0.3" +mime_guess = "2.0.4" mime = "0.3.16" -tracing = "0.1.30" +tracing = "0.1.31" async-trait = "0.1.52" [dependencies.mediarepo-core] @@ -27,9 +27,6 @@ features = ["runtime-tokio-native-tls", "macros"] default-features = false [dependencies.tokio] -version = "1.16.1" +version = "1.17.0" features = ["fs", "io-std", "io-util"] - -[features] -ffmpeg = ["mediarepo-core/ffmpeg"] diff --git a/mediarepo-daemon/mediarepo-socket/Cargo.toml b/mediarepo-daemon/mediarepo-socket/Cargo.toml index 9f38030..3911bc4 100644 --- a/mediarepo-daemon/mediarepo-socket/Cargo.toml +++ b/mediarepo-daemon/mediarepo-socket/Cargo.toml @@ -8,7 +8,7 @@ workspace = ".." [dependencies] serde = "1.0.136" -tracing = "0.1.30" +tracing = "0.1.31" compare = "0.1.0" port_check = "0.1.5" rayon = "1.5.1" @@ -23,7 +23,7 @@ path = "../mediarepo-database" path = "../mediarepo-logic" [dependencies.tokio] -version = "1.16.1" +version = "1.17.0" features = ["net"] [dependencies.chrono] diff --git a/mediarepo-ui/angular.json b/mediarepo-ui/angular.json index ce505ab..81c10ba 100644 --- a/mediarepo-ui/angular.json +++ b/mediarepo-ui/angular.json @@ -40,7 +40,9 @@ "src/styles.scss", "src/material-theme-correction.scss" ], - "scripts": [] + "scripts": [ + "./node_modules/chart.js/dist/chart.js" + ] }, "configurations": { "production": { @@ -114,7 +116,9 @@ "src/styles.scss", "src/material-theme-correction.scss" ], - "scripts": [] + "scripts": [ + "./node_modules/chart.js/dist/chart.js" + ] } }, "lint": { diff --git a/mediarepo-ui/package.json b/mediarepo-ui/package.json index 4bec025..c32a8c9 100644 --- a/mediarepo-ui/package.json +++ b/mediarepo-ui/package.json @@ -1,6 +1,6 @@ { "name": "mediarepo-ui", - "version": "1.0.0-rc.3", + "version": "1.0.0-rc.4", "scripts": { "ng": "ng", "start": "ng serve", @@ -28,6 +28,7 @@ "@ng-icons/feather-icons": "^13.2.1", "@ng-icons/material-icons": "^13.2.1", "@tauri-apps/api": "^1.0.0-beta.8", + "chart.js": "^3.7.1", "primeicons": "^5.0.0", "primeng": "^13.0.4", "rxjs": "~7.5.2", @@ -59,4 +60,4 @@ "karma-jasmine-html-reporter": "~1.7.0", "typescript": "~4.5.4" } -} \ No newline at end of file +} diff --git a/mediarepo-ui/src-tauri/Cargo.lock b/mediarepo-ui/src-tauri/Cargo.lock index 939030c..25b9158 100644 --- a/mediarepo-ui/src-tauri/Cargo.lock +++ b/mediarepo-ui/src-tauri/Cargo.lock @@ -40,7 +40,7 @@ checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "app" -version = "1.0.0-rc.3" +version = "1.0.0-rc.4" dependencies = [ "mediarepo-api", "serde", diff --git a/mediarepo-ui/src-tauri/Cargo.toml b/mediarepo-ui/src-tauri/Cargo.toml index 950b214..d5827af 100644 --- a/mediarepo-ui/src-tauri/Cargo.toml +++ b/mediarepo-ui/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "1.0.0-rc.3" +version = "1.0.0-rc.4" description = "The UI for the mediarepo media management tool" authors = ["you"] license = "" diff --git a/mediarepo-ui/src/app/components/core/core.module.ts b/mediarepo-ui/src/app/components/core/core.module.ts index bec4607..3cd15ba 100644 --- a/mediarepo-ui/src/app/components/core/core.module.ts +++ b/mediarepo-ui/src/app/components/core/core.module.ts @@ -89,7 +89,7 @@ import {AboutDialogComponent} from "./repositories-tab/repository-overview/about MatInputModule, TagModule, RepositoryModule, - MatToolbarModule, + MatToolbarModule ] }) export class CoreModule { diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repositories-tab.component.html b/mediarepo-ui/src/app/components/core/repositories-tab/repositories-tab.component.html index 4093b2a..e53e733 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repositories-tab.component.html +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repositories-tab.component.html @@ -1,6 +1,4 @@ -
- -
-
- -
+ + + diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.html b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.html index 2371237..66b350e 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.html +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.html @@ -4,45 +4,56 @@
- diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.scss b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.scss index ef89741..573a3be 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.scss +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.scss @@ -1,3 +1,10 @@ +@import "src/colors"; + +:host { + height: 100%; + width: 100%; +} + .repository-name { text-align: center; align-self: center; @@ -12,16 +19,38 @@ padding: 1em 1em 1em 3em; overflow-y: auto; user-select: none; - margin-left: 20%; - margin-right: 20%; + margin-top: 4em; + margin-left: 2em; + display: flex; app-metadata-entry { margin-bottom: 0.5em; display: block; } + + .stats-container { + margin-left: auto; + margin-right: auto; + } +} + +.repository-charts { + margin-top: 4em; + margin-right: 2em; + height: 100%; + display: block; } .details-content { height: calc(100% - 64px); overflow: hidden; + width: 75%; + margin: auto; + background: $background-lighter-05; +} + +.size-chart { + min-height: 50%; + max-width: 500px; + margin: auto; } diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.ts b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.ts index ad45bf0..1c8b220 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.ts +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repository-details-view/repository-details-view.component.ts @@ -5,6 +5,7 @@ import {RepositoryMetadata} from "../../../../models/RepositoryMetadata"; import {BehaviorSubject} from "rxjs"; import {MatDialog} from "@angular/material/dialog"; import {BusyDialogComponent} from "../../../shared/app-common/busy-dialog/busy-dialog.component"; +import {Dataset} from "../../../shared/app-common/chart/chart.component"; @Component({ selector: "app-repository-details-view", @@ -19,9 +20,14 @@ export class RepositoryDetailsViewComponent implements OnInit, OnChanges, OnDest public fileFolderSize = new BehaviorSubject(undefined); public thumbFolderSize = new BehaviorSubject(undefined); public databaseFileSize = new BehaviorSubject(undefined); + public chartData?: Dataset[]; + public chartLabels = ["Files", "Thumbnails", "Database"]; private refreshMetadataInterval?: number; - constructor(private repoService: RepositoryService, public dialog: MatDialog) { + constructor( + private repoService: RepositoryService, + public dialog: MatDialog + ) { } public async ngOnInit() { @@ -63,6 +69,11 @@ export class RepositoryDetailsViewComponent implements OnInit, OnChanges, OnDest this.thumbFolderSize.next(this.formatByteSize(thumbSize.size)); const databaseSize = await this.repoService.getSize("DatabaseFile"); this.databaseFileSize.next(this.formatByteSize(databaseSize.size)); + this.chartData = [ + { + data: [fileSize.size, thumbSize.size, databaseSize.size], + }, + ]; } public formatByteSize(size: number): string { diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repository-overview/repository-overview.component.scss b/mediarepo-ui/src/app/components/core/repositories-tab/repository-overview/repository-overview.component.scss index e16282d..ff3913e 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repository-overview/repository-overview.component.scss +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repository-overview/repository-overview.component.scss @@ -1,10 +1,17 @@ +:host { + height: 100%; + width: 100%; + display: block; + overflow: hidden; +} + .repository-container { padding: 1em; margin: auto; display: block; width: calc(600px - 2em); float: left; - + app-repository-card { display: block; position: relative; @@ -31,7 +38,8 @@ flex-wrap: wrap; overflow-y: auto; overflow-x: hidden; - height: calc(100% - 5em); + max-height: calc(100% - 2em); + padding-bottom: 2em; } diff --git a/mediarepo-ui/src/app/components/shared/app-common/app-common.module.ts b/mediarepo-ui/src/app/components/shared/app-common/app-common.module.ts index 0a25e48..cc18e49 100644 --- a/mediarepo-ui/src/app/components/shared/app-common/app-common.module.ts +++ b/mediarepo-ui/src/app/components/shared/app-common/app-common.module.ts @@ -26,6 +26,8 @@ import {FlapButtonComponent} from "./flap-button/flap-button.component"; import {MiddleCenteredComponent} from "./middle-centered/middle-centered.component"; import {FormatBytesPipe} from "./pipes/format-bytes.pipe"; import {ExternalUrlComponent} from "./external-url/external-url.component"; +import {ChartComponent} from "./chart/chart.component"; +import {ChartModule} from "primeng/chart"; @NgModule({ @@ -46,6 +48,7 @@ import {ExternalUrlComponent} from "./external-url/external-url.component"; MiddleCenteredComponent, FormatBytesPipe, ExternalUrlComponent, + ChartComponent, ], exports: [ ConfirmDialogComponent, @@ -63,6 +66,7 @@ import {ExternalUrlComponent} from "./external-url/external-url.component"; MiddleCenteredComponent, FormatBytesPipe, ExternalUrlComponent, + ChartComponent, ], imports: [ CommonModule, @@ -74,7 +78,8 @@ import {ExternalUrlComponent} from "./external-url/external-url.component"; MatProgressBarModule, MatSidenavModule, FlexLayoutModule, - MatRippleModule + MatRippleModule, + ChartModule ] }) export class AppCommonModule { diff --git a/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.html b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.html new file mode 100644 index 0000000..93ca8b0 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.html @@ -0,0 +1,2 @@ +

{{this.title}}

+ diff --git a/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.scss b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.scss new file mode 100644 index 0000000..cb7a0c3 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.scss @@ -0,0 +1,15 @@ +:host { + height: 100%; + width: 100%; + display: block; +} + +.title { + width: 100%; + text-align: center; +} + +p-chart { + height: 100%; + width: 100%; +} diff --git a/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.spec.ts b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.spec.ts new file mode 100644 index 0000000..540e5f6 --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.spec.ts @@ -0,0 +1,25 @@ +import {ComponentFixture, TestBed} from "@angular/core/testing"; + +import {ChartComponent} from "./chart.component"; + +describe("ChartComponent", () => { + let component: ChartComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ChartComponent] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ChartComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it("should create", () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.ts b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.ts new file mode 100644 index 0000000..13ac06d --- /dev/null +++ b/mediarepo-ui/src/app/components/shared/app-common/chart/chart.component.ts @@ -0,0 +1,86 @@ +import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, SimpleChanges} from "@angular/core"; +import {ChartOptions} from "chart.js"; + +export type ChartType = "doughnut"; +export type Dataset = { + label?: string, + data: number[], +}; + +@Component({ + selector: "app-chart", + templateUrl: "./chart.component.html", + styleUrls: ["./chart.component.scss"], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ChartComponent implements OnChanges { + + @Input() chartType?: ChartType; + @Input() title?: string; + @Input() labels: string[] = []; + @Input() datasets: Dataset[] = []; + + public data: any = {}; + public options: ChartOptions = { + responsive: true, + elements: { + arc: { + borderWidth: 0 + } + }, + plugins: { + legend: { + labels: { + color: "#FFF", + boxHeight: 20, + font: { + size: 16, + } + }, + }, + tooltip: { + titleFont: { + size: 16 + }, + bodyFont: { + size: 14 + } + } + } + }; + private readonly colors = [ + "#771e86", + "#4650b5", + "#0073d0", + "#0091d6", + "#00aacb", + "#00c0b7" + ]; + + constructor(private changeDetector: ChangeDetectorRef) { + } + + public ngOnChanges(changes: SimpleChanges): void { + if (changes["labels"] || changes["dataset"]) { + this.generateData(); + this.changeDetector.markForCheck(); + } + if (changes["chartType"]) { + this.changeDetector.markForCheck(); + } + } + + private generateData() { + this.data = { + labels: this.labels, + datasets: this.datasets.map(set => { + return { + label: set.label, + data: set.data, + backgroundColor: this.colors, + hoverBackgroundColor: this.colors, + }; + }) + }; + } +} diff --git a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.html b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.html index bf3f256..19a4afd 100644 --- a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.html +++ b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.html @@ -8,12 +8,15 @@ minBufferPx="500">
- + + +
+
diff --git a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.scss b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.scss index d53d41a..333074f 100644 --- a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.scss +++ b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.scss @@ -6,6 +6,13 @@ app-file-card { margin: 5px; } +.empty-grid-entry { + width: 100%; + height: 250px; + margin: 5px; + display: block; +} + .file-scroll { height: 100%; width: 100%; diff --git a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.ts b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.ts index e7569d0..d9e1f30 100644 --- a/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.ts +++ b/mediarepo-ui/src/app/components/shared/file/file-multiview/file-grid/file-grid.component.ts @@ -43,7 +43,7 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte public fileChanged = new BehaviorSubject(undefined); public selectedEntries: Selectable[] = []; - public partitionedGridEntries: Selectable[][] = []; + public partitionedGridEntries: (Selectable | undefined)[][] = []; private columns = 6; private entrySizePx = 260; @@ -187,12 +187,12 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte this.ctrlClicked = event.ctrlKey ? false : this.ctrlClicked; } - public trackByFileRowId(index: number, item: Selectable[]) { - return item.map(e => e.data.id).join("-"); + public trackByFileRowId(index: number, item: (Selectable | undefined)[]) { + return item.map(e => e?.data.id).join("-"); } - public trackByFileId(index: number, item: Selectable) { - return item.data.id; + public trackByFileId(index: number, item: Selectable | undefined) { + return item?.data.id; } public onFileStatusChange(): void { @@ -224,14 +224,18 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte for (let i = 0; i < (Math.ceil( this.gridEntries.length / this.columns)); i++) { - const entries = this.gridEntries.slice( + const entries: (Selectable | undefined)[] = this.gridEntries.slice( i * this.columns, Math.min(this.gridEntries.length, (i + 1) * this.columns) ); + const length = entries.length; + for (let i = 0; i < (this.columns - length); i++) { + entries.push(undefined); + } this.partitionedGridEntries.push(entries); const preselectedEntry = entries.find( - e => e.data.id == this.preselectedFile?.id); + e => e?.data.id == this.preselectedFile?.id); if (preselectedEntry) { scrollToIndex = i; @@ -256,7 +260,8 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte private scrollToSelection() { const selected = this.selectedEntries[0]; if (this.virtualScroll && selected) { - const index = Math.floor(this.gridEntries.indexOf(selected) / this.columns); + const index = Math.floor( + this.gridEntries.indexOf(selected) / this.columns); setTimeout(() => { this.virtualScroll.scrollToIndex(index); this.changeDetector.markForCheck(); @@ -345,14 +350,17 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte if (this.virtualScroll) { const viewportSize = this.virtualScroll.getViewportSize(); let offsetTop = this.virtualScroll.measureScrollOffset("top"); - const contentOffset = Math.floor(selectedIndex / this.columns) * 260; + const contentOffset = Math.floor( + selectedIndex / this.columns) * 260; if (contentOffset > offsetTop + viewportSize - 300 || contentOffset < offsetTop) { - this.virtualScroll.scrollToIndex(Math.floor(selectedIndex / this.columns)); + this.virtualScroll.scrollToIndex( + Math.floor(selectedIndex / this.columns)); offsetTop = this.virtualScroll.measureScrollOffset("top"); if (contentOffset < offsetTop + (viewportSize / 2)) { - this.virtualScroll.scrollToOffset((offsetTop + 130) - viewportSize / 2); + this.virtualScroll.scrollToOffset( + (offsetTop + 130) - viewportSize / 2); } } } @@ -361,14 +369,16 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit, Afte private pageDown() { if (this.virtualScroll) { const offsetTop = this.virtualScroll.measureScrollOffset("top"); - this.virtualScroll.scrollToOffset(offsetTop + this.virtualScroll.getViewportSize()); + this.virtualScroll.scrollToOffset( + offsetTop + this.virtualScroll.getViewportSize()); } } private pageUp() { if (this.virtualScroll) { const offsetTop = this.virtualScroll.measureScrollOffset("top"); - this.virtualScroll.scrollToOffset(offsetTop - this.virtualScroll.getViewportSize()); + this.virtualScroll.scrollToOffset( + offsetTop - this.virtualScroll.getViewportSize()); } } } diff --git a/mediarepo-ui/src/app/components/shared/file/file-thumbnail/file-thumbnail.component.scss b/mediarepo-ui/src/app/components/shared/file/file-thumbnail/file-thumbnail.component.scss index 3406b74..58a431f 100644 --- a/mediarepo-ui/src/app/components/shared/file/file-thumbnail/file-thumbnail.component.scss +++ b/mediarepo-ui/src/app/components/shared/file/file-thumbnail/file-thumbnail.component.scss @@ -34,8 +34,8 @@ app-content-aware-image { position: absolute; top: 0; right: 0; - height: 18%; - width: 18%; + height: 2.5em; + width: 2.5em; display: flex; border-bottom-left-radius: 50%; background-color: transparentize($background, .5); diff --git a/mediarepo-ui/src/material-theme-correction.scss b/mediarepo-ui/src/material-theme-correction.scss index 0de1762..26ebd60 100644 --- a/mediarepo-ui/src/material-theme-correction.scss +++ b/mediarepo-ui/src/material-theme-correction.scss @@ -52,7 +52,7 @@ mat-option { } mat-toolbar.mat-toolbar { - background: $background-darker-05; + background: $background-darker-05 !important; } .mat-card { diff --git a/mediarepo-ui/yarn.lock b/mediarepo-ui/yarn.lock index 6b7e364..f33ea43 100644 --- a/mediarepo-ui/yarn.lock +++ b/mediarepo-ui/yarn.lock @@ -2776,6 +2776,11 @@ chardet@^0.7.0: resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +chart.js@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.7.1.tgz#0516f690c6a8680c6c707e31a4c1807a6f400ada" + integrity sha512-8knRegQLFnPQAheZV8MjxIXc5gQEfDFD897BJgv/klO/vtIyFFmgMXrNfgrXpbTr/XbTturxRgxIXx/Y+ASJBA== + "chokidar@>=3.0.0 <4.0.0", chokidar@^3.0.0, chokidar@^3.5.1, chokidar@^3.5.2: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" diff --git a/scripts/build.py b/scripts/build.py index d5fe6c0..6b4c71d 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -9,7 +9,6 @@ from typing import List build_output = 'out' verbose = False -ffmpeg = False install_tooling = False windows = os.name == 'nt' @@ -21,12 +20,10 @@ def main(): global install_tooling global build_output global verbose - global ffmpeg global install_tooling build_output = opts.output if opts.output else build_output verbose = opts.verbose - ffmpeg = opts.ffmpeg install_tooling = opts.install_tooling build(opts.component, opts.bundles) @@ -41,8 +38,6 @@ def parse_args(): '--verbose', action='store_true', help='Verbose build') parser.add_argument( '--output', action='store', help='Build output directory') - parser.add_argument( - '--ffmpeg', action='store_true', help='Build with ffmpeg') parser.add_argument('--install-tooling', action='store_true', help='Install tooling') parser.add_argument('--bundles', nargs='+', @@ -74,11 +69,7 @@ def build(component: str, bundles: List[str] = None): def build_daemon(): '''Builds daemon''' cargo('fetch', 'mediarepo-daemon') - - if not ffmpeg: - cargo('build --release --frozen --no-default-features', 'mediarepo-daemon') - else: - cargo('build --release --frozen', 'mediarepo-daemon') + cargo('build --release --frozen', 'mediarepo-daemon') if windows: store_artifact('mediarepo-daemon/target/release/mediarepo-daemon.exe')