Commit 3c8e0c8185

3c8e0c81856a564902f72dabcc01d9bb591a5dbc

parent: 57e6337180

Unsigned

Siriusmart <71584876+Siriusmart@users.noreply.github.com> · 2023-05-18 10:17 UTC

reduced compile time by replacing reqwest with a lighter, blocking http client - http-req

Layout: unified · split

Cargo.lock +70 −576
@@ -38,12 +38,6 @@ version = "0.13.1"
3838source = "registry+https://github.com/rust-lang/crates.io-index"
3939checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
4040
41[[package]]
42name = "base64"
43version = "0.21.0"
44source = "registry+https://github.com/rust-lang/crates.io-index"
45checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
46
4741[[package]]
4842name = "bit_field"
4943version = "0.10.2"
@@ -64,9 +58,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
6458
6559[[package]]
6660name = "bumpalo"
67version = "3.12.1"
61version = "3.12.2"
6862source = "registry+https://github.com/rust-lang/crates.io-index"
69checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8"
63checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
7064
7165[[package]]
7266name = "bytemuck"
@@ -80,12 +74,6 @@ version = "1.4.3"
8074source = "registry+https://github.com/rust-lang/crates.io-index"
8175checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
8276
83[[package]]
84name = "bytes"
85version = "1.4.0"
86source = "registry+https://github.com/rust-lang/crates.io-index"
87checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
88
8977[[package]]
9078name = "cassowary"
9179version = "0.3.0"
@@ -138,16 +126,6 @@ dependencies = [
138126 "winapi",
139127]
140128
141[[package]]
142name = "codespan-reporting"
143version = "0.11.1"
144source = "registry+https://github.com/rust-lang/crates.io-index"
145checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
146dependencies = [
147 "termcolor",
148 "unicode-width",
149]
150
151129[[package]]
152130name = "color_quant"
153131version = "1.1.0"
@@ -282,50 +260,6 @@ version = "0.2.2"
282260source = "registry+https://github.com/rust-lang/crates.io-index"
283261checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
284262
285[[package]]
286name = "cxx"
287version = "1.0.94"
288source = "registry+https://github.com/rust-lang/crates.io-index"
289checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
290dependencies = [
291 "cc",
292 "cxxbridge-flags",
293 "cxxbridge-macro",
294 "link-cplusplus",
295]
296
297[[package]]
298name = "cxx-build"
299version = "1.0.94"
300source = "registry+https://github.com/rust-lang/crates.io-index"
301checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
302dependencies = [
303 "cc",
304 "codespan-reporting",
305 "once_cell",
306 "proc-macro2",
307 "quote",
308 "scratch",
309 "syn 2.0.15",
310]
311
312[[package]]
313name = "cxxbridge-flags"
314version = "1.0.94"
315source = "registry+https://github.com/rust-lang/crates.io-index"
316checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
317
318[[package]]
319name = "cxxbridge-macro"
320version = "1.0.94"
321source = "registry+https://github.com/rust-lang/crates.io-index"
322checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
323dependencies = [
324 "proc-macro2",
325 "quote",
326 "syn 2.0.15",
327]
328
329263[[package]]
330264name = "dyn-clone"
331265version = "1.0.11"
@@ -344,15 +278,6 @@ version = "0.3.6"
344278source = "registry+https://github.com/rust-lang/crates.io-index"
345279checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
346280
347[[package]]
348name = "encoding_rs"
349version = "0.8.32"
350source = "registry+https://github.com/rust-lang/crates.io-index"
351checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
352dependencies = [
353 "cfg-if",
354]
355
356281[[package]]
357282name = "errno"
358283version = "0.3.1"
@@ -431,12 +356,6 @@ dependencies = [
431356 "spin",
432357]
433358
434[[package]]
435name = "fnv"
436version = "1.0.7"
437source = "registry+https://github.com/rust-lang/crates.io-index"
438checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
439
440359[[package]]
441360name = "foreign-types"
442361version = "0.3.2"
@@ -452,79 +371,18 @@ version = "0.1.1"
452371source = "registry+https://github.com/rust-lang/crates.io-index"
453372checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
454373
455[[package]]
456name = "form_urlencoded"
457version = "1.1.0"
458source = "registry+https://github.com/rust-lang/crates.io-index"
459checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
460dependencies = [
461 "percent-encoding",
462]
463
464[[package]]
465name = "futures"
466version = "0.3.28"
467source = "registry+https://github.com/rust-lang/crates.io-index"
468checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40"
469dependencies = [
470 "futures-channel",
471 "futures-core",
472 "futures-io",
473 "futures-sink",
474 "futures-task",
475 "futures-util",
476]
477
478[[package]]
479name = "futures-channel"
480version = "0.3.28"
481source = "registry+https://github.com/rust-lang/crates.io-index"
482checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
483dependencies = [
484 "futures-core",
485 "futures-sink",
486]
487
488374[[package]]
489375name = "futures-core"
490376version = "0.3.28"
491377source = "registry+https://github.com/rust-lang/crates.io-index"
492378checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
493379
494[[package]]
495name = "futures-io"
496version = "0.3.28"
497source = "registry+https://github.com/rust-lang/crates.io-index"
498checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
499
500380[[package]]
501381name = "futures-sink"
502382version = "0.3.28"
503383source = "registry+https://github.com/rust-lang/crates.io-index"
504384checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
505385
506[[package]]
507name = "futures-task"
508version = "0.3.28"
509source = "registry+https://github.com/rust-lang/crates.io-index"
510checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
511
512[[package]]
513name = "futures-util"
514version = "0.3.28"
515source = "registry+https://github.com/rust-lang/crates.io-index"
516checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
517dependencies = [
518 "futures-core",
519 "futures-io",
520 "futures-sink",
521 "futures-task",
522 "memchr",
523 "pin-project-lite",
524 "pin-utils",
525 "slab",
526]
527
528386[[package]]
529387name = "getrandom"
530388version = "0.2.9"
@@ -548,25 +406,6 @@ dependencies = [
548406 "weezl",
549407]
550408
551[[package]]
552name = "h2"
553version = "0.3.18"
554source = "registry+https://github.com/rust-lang/crates.io-index"
555checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21"
556dependencies = [
557 "bytes",
558 "fnv",
559 "futures-core",
560 "futures-sink",
561 "futures-util",
562 "http",
563 "indexmap",
564 "slab",
565 "tokio",
566 "tokio-util",
567 "tracing",
568]
569
570409[[package]]
571410name = "half"
572411version = "2.2.1"
@@ -607,74 +446,13 @@ dependencies = [
607446]
608447
609448[[package]]
610name = "http"
611version = "0.2.9"
449name = "http_req"
450version = "0.9.1"
612451source = "registry+https://github.com/rust-lang/crates.io-index"
613checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
452checksum = "5825a38a94c3aff23ea7f60572726829ef055ca02fc64899c3e2e7db2ce4f03f"
614453dependencies = [
615 "bytes",
616 "fnv",
617 "itoa",
618]
619
620[[package]]
621name = "http-body"
622version = "0.4.5"
623source = "registry+https://github.com/rust-lang/crates.io-index"
624checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
625dependencies = [
626 "bytes",
627 "http",
628 "pin-project-lite",
629]
630
631[[package]]
632name = "httparse"
633version = "1.8.0"
634source = "registry+https://github.com/rust-lang/crates.io-index"
635checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
636
637[[package]]
638name = "httpdate"
639version = "1.0.2"
640source = "registry+https://github.com/rust-lang/crates.io-index"
641checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
642
643[[package]]
644name = "hyper"
645version = "0.14.26"
646source = "registry+https://github.com/rust-lang/crates.io-index"
647checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
648dependencies = [
649 "bytes",
650 "futures-channel",
651 "futures-core",
652 "futures-util",
653 "h2",
654 "http",
655 "http-body",
656 "httparse",
657 "httpdate",
658 "itoa",
659 "pin-project-lite",
660 "socket2",
661 "tokio",
662 "tower-service",
663 "tracing",
664 "want",
665]
666
667[[package]]
668name = "hyper-tls"
669version = "0.5.0"
670source = "registry+https://github.com/rust-lang/crates.io-index"
671checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
672dependencies = [
673 "bytes",
674 "hyper",
675454 "native-tls",
676 "tokio",
677 "tokio-native-tls",
455 "unicase",
678456]
679457
680458[[package]]
@@ -693,22 +471,11 @@ dependencies = [
693471
694472[[package]]
695473name = "iana-time-zone-haiku"
696version = "0.1.1"
697source = "registry+https://github.com/rust-lang/crates.io-index"
698checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca"
699dependencies = [
700 "cxx",
701 "cxx-build",
702]
703
704[[package]]
705name = "idna"
706version = "0.3.0"
474version = "0.1.2"
707475source = "registry+https://github.com/rust-lang/crates.io-index"
708checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
476checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
709477dependencies = [
710 "unicode-bidi",
711 "unicode-normalization",
478 "cc",
712479]
713480
714481[[package]]
@@ -751,11 +518,11 @@ dependencies = [
751518
752519[[package]]
753520name = "invidious"
754version = "0.4.1"
521version = "0.5.0"
755522source = "registry+https://github.com/rust-lang/crates.io-index"
756checksum = "d8a4bb13ce198d68343e135c30ccfaee05fc23f3931b29ce0c83e653a275ab9c"
523checksum = "dcf06ca3149bc691b638f1eed94bc5ea5d7eae85ddc01c23249f0af0bd16d62e"
757524dependencies = [
758 "reqwest",
525 "http_req",
759526 "serde",
760527 "serde_json",
761528]
@@ -771,12 +538,6 @@ dependencies = [
771538 "windows-sys 0.48.0",
772539]
773540
774[[package]]
775name = "ipnet"
776version = "2.7.2"
777source = "registry+https://github.com/rust-lang/crates.io-index"
778checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"
779
780541[[package]]
781542name = "itoa"
782543version = "1.0.6"
@@ -794,9 +555,9 @@ dependencies = [
794555
795556[[package]]
796557name = "js-sys"
797version = "0.3.61"
558version = "0.3.63"
798559source = "registry+https://github.com/rust-lang/crates.io-index"
799checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
560checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
800561dependencies = [
801562 "wasm-bindgen",
802563]
@@ -815,24 +576,15 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
815576
816577[[package]]
817578name = "libc"
818version = "0.2.142"
579version = "0.2.144"
819580source = "registry+https://github.com/rust-lang/crates.io-index"
820checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317"
821
822[[package]]
823name = "link-cplusplus"
824version = "1.0.8"
825source = "registry+https://github.com/rust-lang/crates.io-index"
826checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5"
827dependencies = [
828 "cc",
829]
581checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
830582
831583[[package]]
832584name = "linux-raw-sys"
833version = "0.3.6"
585version = "0.3.7"
834586source = "registry+https://github.com/rust-lang/crates.io-index"
835checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c"
587checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f"
836588
837589[[package]]
838590name = "lock_api"
@@ -868,12 +620,6 @@ dependencies = [
868620 "libc",
869621]
870622
871[[package]]
872name = "memchr"
873version = "2.5.0"
874source = "registry+https://github.com/rust-lang/crates.io-index"
875checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
876
877623[[package]]
878624name = "memoffset"
879625version = "0.8.0"
@@ -883,12 +629,6 @@ dependencies = [
883629 "autocfg",
884630]
885631
886[[package]]
887name = "mime"
888version = "0.3.17"
889source = "registry+https://github.com/rust-lang/crates.io-index"
890checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
891
892632[[package]]
893633name = "miniz_oxide"
894634version = "0.6.2"
@@ -1045,7 +785,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
1045785dependencies = [
1046786 "proc-macro2",
1047787 "quote",
1048 "syn 2.0.15",
788 "syn",
1049789]
1050790
1051791[[package]]
@@ -1089,49 +829,31 @@ dependencies = [
1089829 "windows-sys 0.45.0",
1090830]
1091831
1092[[package]]
1093name = "percent-encoding"
1094version = "2.2.0"
1095source = "registry+https://github.com/rust-lang/crates.io-index"
1096checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
1097
1098832[[package]]
1099833name = "pin-project"
1100version = "1.0.12"
834version = "1.1.0"
1101835source = "registry+https://github.com/rust-lang/crates.io-index"
1102checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc"
836checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead"
1103837dependencies = [
1104838 "pin-project-internal",
1105839]
1106840
1107841[[package]]
1108842name = "pin-project-internal"
1109version = "1.0.12"
843version = "1.1.0"
1110844source = "registry+https://github.com/rust-lang/crates.io-index"
1111checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
845checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07"
1112846dependencies = [
1113847 "proc-macro2",
1114848 "quote",
1115 "syn 1.0.109",
849 "syn",
1116850]
1117851
1118[[package]]
1119name = "pin-project-lite"
1120version = "0.2.9"
1121source = "registry+https://github.com/rust-lang/crates.io-index"
1122checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
1123
1124[[package]]
1125name = "pin-utils"
1126version = "0.1.0"
1127source = "registry+https://github.com/rust-lang/crates.io-index"
1128checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1129
1130852[[package]]
1131853name = "pkg-config"
1132version = "0.3.26"
854version = "0.3.27"
1133855source = "registry+https://github.com/rust-lang/crates.io-index"
1134checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
856checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
1135857
1136858[[package]]
1137859name = "png"
@@ -1148,9 +870,9 @@ dependencies = [
1148870
1149871[[package]]
1150872name = "proc-macro2"
1151version = "1.0.56"
873version = "1.0.58"
1152874source = "registry+https://github.com/rust-lang/crates.io-index"
1153checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
875checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8"
1154876dependencies = [
1155877 "unicode-ident",
1156878]
@@ -1166,9 +888,9 @@ dependencies = [
1166888
1167889[[package]]
1168890name = "quote"
1169version = "1.0.26"
891version = "1.0.27"
1170892source = "registry+https://github.com/rust-lang/crates.io-index"
1171checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
893checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
1172894dependencies = [
1173895 "proc-macro2",
1174896]
@@ -1213,43 +935,6 @@ dependencies = [
1213935 "bitflags",
1214936]
1215937
1216[[package]]
1217name = "reqwest"
1218version = "0.11.17"
1219source = "registry+https://github.com/rust-lang/crates.io-index"
1220checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91"
1221dependencies = [
1222 "base64 0.21.0",
1223 "bytes",
1224 "encoding_rs",
1225 "futures-core",
1226 "futures-util",
1227 "h2",
1228 "http",
1229 "http-body",
1230 "hyper",
1231 "hyper-tls",
1232 "ipnet",
1233 "js-sys",
1234 "log",
1235 "mime",
1236 "native-tls",
1237 "once_cell",
1238 "percent-encoding",
1239 "pin-project-lite",
1240 "serde",
1241 "serde_json",
1242 "serde_urlencoded",
1243 "tokio",
1244 "tokio-native-tls",
1245 "tower-service",
1246 "url",
1247 "wasm-bindgen",
1248 "wasm-bindgen-futures",
1249 "web-sys",
1250 "winreg",
1251]
1252
1253938[[package]]
1254939name = "rgb"
1255940version = "0.8.36"
@@ -1261,9 +946,9 @@ dependencies = [
1261946
1262947[[package]]
1263948name = "rustix"
1264version = "0.37.17"
949version = "0.37.19"
1265950source = "registry+https://github.com/rust-lang/crates.io-index"
1266checksum = "bc809f704c03a812ac71f22456c857be34185cac691a4316f27ab0f633bb9009"
951checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
1267952dependencies = [
1268953 "bitflags",
1269954 "errno",
@@ -1294,17 +979,11 @@ version = "1.1.0"
1294979source = "registry+https://github.com/rust-lang/crates.io-index"
1295980checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
1296981
1297[[package]]
1298name = "scratch"
1299version = "1.0.5"
1300source = "registry+https://github.com/rust-lang/crates.io-index"
1301checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
1302
1303982[[package]]
1304983name = "security-framework"
1305version = "2.8.2"
984version = "2.9.0"
1306985source = "registry+https://github.com/rust-lang/crates.io-index"
1307checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254"
986checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1"
1308987dependencies = [
1309988 "bitflags",
1310989 "core-foundation",
@@ -1315,9 +994,9 @@ dependencies = [
1315994
1316995[[package]]
1317996name = "security-framework-sys"
1318version = "2.8.0"
997version = "2.9.0"
1319998source = "registry+https://github.com/rust-lang/crates.io-index"
1320checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
999checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7"
13211000dependencies = [
13221001 "core-foundation-sys",
13231002 "libc",
@@ -1325,22 +1004,22 @@ dependencies = [
13251004
13261005[[package]]
13271006name = "serde"
1328version = "1.0.160"
1007version = "1.0.163"
13291008source = "registry+https://github.com/rust-lang/crates.io-index"
1330checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c"
1009checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
13311010dependencies = [
13321011 "serde_derive",
13331012]
13341013
13351014[[package]]
13361015name = "serde_derive"
1337version = "1.0.160"
1016version = "1.0.163"
13381017source = "registry+https://github.com/rust-lang/crates.io-index"
1339checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df"
1018checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
13401019dependencies = [
13411020 "proc-macro2",
13421021 "quote",
1343 "syn 2.0.15",
1022 "syn",
13441023]
13451024
13461025[[package]]
@@ -1354,18 +1033,6 @@ dependencies = [
13541033 "serde",
13551034]
13561035
1357[[package]]
1358name = "serde_urlencoded"
1359version = "0.7.1"
1360source = "registry+https://github.com/rust-lang/crates.io-index"
1361checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
1362dependencies = [
1363 "form_urlencoded",
1364 "itoa",
1365 "ryu",
1366 "serde",
1367]
1368
13691036[[package]]
13701037name = "serde_yaml"
13711038version = "0.9.21"
@@ -1433,31 +1100,12 @@ dependencies = [
14331100 "make-cmd",
14341101]
14351102
1436[[package]]
1437name = "slab"
1438version = "0.4.8"
1439source = "registry+https://github.com/rust-lang/crates.io-index"
1440checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
1441dependencies = [
1442 "autocfg",
1443]
1444
14451103[[package]]
14461104name = "smallvec"
14471105version = "1.10.0"
14481106source = "registry+https://github.com/rust-lang/crates.io-index"
14491107checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
14501108
1451[[package]]
1452name = "socket2"
1453version = "0.4.9"
1454source = "registry+https://github.com/rust-lang/crates.io-index"
1455checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
1456dependencies = [
1457 "libc",
1458 "winapi",
1459]
1460
14611109[[package]]
14621110name = "spin"
14631111version = "0.9.8"
@@ -1469,20 +1117,9 @@ dependencies = [
14691117
14701118[[package]]
14711119name = "syn"
1472version = "1.0.109"
1473source = "registry+https://github.com/rust-lang/crates.io-index"
1474checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
1475dependencies = [
1476 "proc-macro2",
1477 "quote",
1478 "unicode-ident",
1479]
1480
1481[[package]]
1482name = "syn"
1483version = "2.0.15"
1120version = "2.0.16"
14841121source = "registry+https://github.com/rust-lang/crates.io-index"
1485checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
1122checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01"
14861123dependencies = [
14871124 "proc-macro2",
14881125 "quote",
@@ -1522,99 +1159,12 @@ dependencies = [
15221159 "weezl",
15231160]
15241161
1525[[package]]
1526name = "tinyvec"
1527version = "1.6.0"
1528source = "registry+https://github.com/rust-lang/crates.io-index"
1529checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
1530dependencies = [
1531 "tinyvec_macros",
1532]
1533
1534[[package]]
1535name = "tinyvec_macros"
1536version = "0.1.1"
1537source = "registry+https://github.com/rust-lang/crates.io-index"
1538checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1539
1540[[package]]
1541name = "tokio"
1542version = "1.28.0"
1543source = "registry+https://github.com/rust-lang/crates.io-index"
1544checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f"
1545dependencies = [
1546 "autocfg",
1547 "bytes",
1548 "libc",
1549 "mio",
1550 "num_cpus",
1551 "pin-project-lite",
1552 "socket2",
1553 "windows-sys 0.48.0",
1554]
1555
1556[[package]]
1557name = "tokio-native-tls"
1558version = "0.3.1"
1559source = "registry+https://github.com/rust-lang/crates.io-index"
1560checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
1561dependencies = [
1562 "native-tls",
1563 "tokio",
1564]
1565
1566[[package]]
1567name = "tokio-util"
1568version = "0.7.8"
1569source = "registry+https://github.com/rust-lang/crates.io-index"
1570checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d"
1571dependencies = [
1572 "bytes",
1573 "futures-core",
1574 "futures-sink",
1575 "pin-project-lite",
1576 "tokio",
1577 "tracing",
1578]
1579
1580[[package]]
1581name = "tower-service"
1582version = "0.3.2"
1583source = "registry+https://github.com/rust-lang/crates.io-index"
1584checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
1585
1586[[package]]
1587name = "tracing"
1588version = "0.1.37"
1589source = "registry+https://github.com/rust-lang/crates.io-index"
1590checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
1591dependencies = [
1592 "cfg-if",
1593 "pin-project-lite",
1594 "tracing-core",
1595]
1596
1597[[package]]
1598name = "tracing-core"
1599version = "0.1.30"
1600source = "registry+https://github.com/rust-lang/crates.io-index"
1601checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
1602dependencies = [
1603 "once_cell",
1604]
1605
16061162[[package]]
16071163name = "traitobject"
16081164version = "0.1.0"
16091165source = "registry+https://github.com/rust-lang/crates.io-index"
16101166checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
16111167
1612[[package]]
1613name = "try-lock"
1614version = "0.2.4"
1615source = "registry+https://github.com/rust-lang/crates.io-index"
1616checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
1617
16181168[[package]]
16191169name = "tui"
16201170version = "0.19.0"
@@ -1652,10 +1202,13 @@ dependencies = [
16521202]
16531203
16541204[[package]]
1655name = "unicode-bidi"
1656version = "0.3.13"
1205name = "unicase"
1206version = "2.6.0"
16571207source = "registry+https://github.com/rust-lang/crates.io-index"
1658checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
1208checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
1209dependencies = [
1210 "version_check",
1211]
16591212
16601213[[package]]
16611214name = "unicode-ident"
@@ -1663,15 +1216,6 @@ version = "1.0.8"
16631216source = "registry+https://github.com/rust-lang/crates.io-index"
16641217checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
16651218
1666[[package]]
1667name = "unicode-normalization"
1668version = "0.1.22"
1669source = "registry+https://github.com/rust-lang/crates.io-index"
1670checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
1671dependencies = [
1672 "tinyvec",
1673]
1674
16751219[[package]]
16761220name = "unicode-segmentation"
16771221version = "1.10.1"
@@ -1699,23 +1243,18 @@ version = "0.2.8"
16991243source = "registry+https://github.com/rust-lang/crates.io-index"
17001244checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6"
17011245
1702[[package]]
1703name = "url"
1704version = "2.3.1"
1705source = "registry+https://github.com/rust-lang/crates.io-index"
1706checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
1707dependencies = [
1708 "form_urlencoded",
1709 "idna",
1710 "percent-encoding",
1711]
1712
17131246[[package]]
17141247name = "vcpkg"
17151248version = "0.2.15"
17161249source = "registry+https://github.com/rust-lang/crates.io-index"
17171250checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
17181251
1252[[package]]
1253name = "version_check"
1254version = "0.9.4"
1255source = "registry+https://github.com/rust-lang/crates.io-index"
1256checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1257
17191258[[package]]
17201259name = "viuer"
17211260version = "0.6.2"
@@ -1723,7 +1262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
17231262checksum = "b511f7e9ae27b5750f12ca50c353a1179bd4cc964a47294eb0d2cdad40cb41c0"
17241263dependencies = [
17251264 "ansi_colours",
1726 "base64 0.13.1",
1265 "base64",
17271266 "console",
17281267 "crossterm 0.25.0",
17291268 "image",
@@ -1733,16 +1272,6 @@ dependencies = [
17331272 "termcolor",
17341273]
17351274
1736[[package]]
1737name = "want"
1738version = "0.3.0"
1739source = "registry+https://github.com/rust-lang/crates.io-index"
1740checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
1741dependencies = [
1742 "log",
1743 "try-lock",
1744]
1745
17461275[[package]]
17471276name = "wasi"
17481277version = "0.11.0+wasi-snapshot-preview1"
@@ -1751,9 +1280,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
17511280
17521281[[package]]
17531282name = "wasm-bindgen"
1754version = "0.2.84"
1283version = "0.2.86"
17551284source = "registry+https://github.com/rust-lang/crates.io-index"
1756checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
1285checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
17571286dependencies = [
17581287 "cfg-if",
17591288 "wasm-bindgen-macro",
@@ -1761,36 +1290,24 @@ dependencies = [
17611290
17621291[[package]]
17631292name = "wasm-bindgen-backend"
1764version = "0.2.84"
1293version = "0.2.86"
17651294source = "registry+https://github.com/rust-lang/crates.io-index"
1766checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
1295checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
17671296dependencies = [
17681297 "bumpalo",
17691298 "log",
17701299 "once_cell",
17711300 "proc-macro2",
17721301 "quote",
1773 "syn 1.0.109",
1302 "syn",
17741303 "wasm-bindgen-shared",
17751304]
17761305
1777[[package]]
1778name = "wasm-bindgen-futures"
1779version = "0.4.34"
1780source = "registry+https://github.com/rust-lang/crates.io-index"
1781checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454"
1782dependencies = [
1783 "cfg-if",
1784 "js-sys",
1785 "wasm-bindgen",
1786 "web-sys",
1787]
1788
17891306[[package]]
17901307name = "wasm-bindgen-macro"
1791version = "0.2.84"
1308version = "0.2.86"
17921309source = "registry+https://github.com/rust-lang/crates.io-index"
1793checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
1310checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
17941311dependencies = [
17951312 "quote",
17961313 "wasm-bindgen-macro-support",
@@ -1798,32 +1315,22 @@ dependencies = [
17981315
17991316[[package]]
18001317name = "wasm-bindgen-macro-support"
1801version = "0.2.84"
1318version = "0.2.86"
18021319source = "registry+https://github.com/rust-lang/crates.io-index"
1803checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
1320checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
18041321dependencies = [
18051322 "proc-macro2",
18061323 "quote",
1807 "syn 1.0.109",
1324 "syn",
18081325 "wasm-bindgen-backend",
18091326 "wasm-bindgen-shared",
18101327]
18111328
18121329[[package]]
18131330name = "wasm-bindgen-shared"
1814version = "0.2.84"
1331version = "0.2.86"
18151332source = "registry+https://github.com/rust-lang/crates.io-index"
1816checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
1817
1818[[package]]
1819name = "web-sys"
1820version = "0.3.61"
1821source = "registry+https://github.com/rust-lang/crates.io-index"
1822checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
1823dependencies = [
1824 "js-sys",
1825 "wasm-bindgen",
1826]
1333checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
18271334
18281335[[package]]
18291336name = "weezl"
@@ -2018,15 +1525,6 @@ version = "0.48.0"
20181525source = "registry+https://github.com/rust-lang/crates.io-index"
20191526checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
20201527
2021[[package]]
2022name = "winreg"
2023version = "0.10.1"
2024source = "registry+https://github.com/rust-lang/crates.io-index"
2025checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
2026dependencies = [
2027 "winapi",
2028]
2029
20301528[[package]]
20311529name = "x11-clipboard"
20321530version = "0.3.3"
@@ -2054,15 +1552,11 @@ dependencies = [
20541552 "clipboard",
20551553 "crossterm 0.26.1",
20561554 "dyn-clone",
2057 "futures",
20581555 "home",
20591556 "invidious",
2060 "rayon",
2061 "reqwest",
20621557 "serde",
20631558 "serde_json",
20641559 "serde_yaml",
2065 "tokio",
20661560 "tui",
20671561 "tui-additions",
20681562 "typemap",
@@ -2071,9 +1565,9 @@ dependencies = [
20711565
20721566[[package]]
20731567name = "zune-inflate"
2074version = "0.2.53"
1568version = "0.2.54"
20751569source = "registry+https://github.com/rust-lang/crates.io-index"
2076checksum = "440a08fd59c6442e4b846ea9b10386c38307eae728b216e1ab2c305d1c9daaf8"
1570checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"
20771571dependencies = [
20781572 "simd-adler32",
20791573]
Cargo.toml +3 −6
@@ -11,7 +11,7 @@ repository = "https://github.com/siriusmart/youtube-tui"
1111license = "GPL-3.0-or-later"
1212keywords = ["cli", "terminal", "youtube", "tui"]
1313categories =["command-line-interface", "command-line-utilities"]
14exclude = ["/docs", "/LICENSE"]
14exclude = ["/docs", "/LICENSE", "/threadcounter.sh"]
1515
1616# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717
@@ -30,14 +30,11 @@ home = "0.5"
3030chrono = {version = "0.4", default-features = false, features = ["clock"]}
3131typemap = {version = "0.3", default-features = false}
3232tui-additions = {version = "0.1.13", default-features = false, features = ["framework", "widgets"]}
33invidious = {version = "0.4", default-features = false, features = ["reqwest"]}
33invidious = {version = "0.5"}
3434serde_yaml = {version = "0.9", default-features = false}
3535dyn-clone = {version = "1.0", default-features = false}
36tokio = {version = "1.21", default-features = false}
37futures = {version = "0.3", default-features = false}
38reqwest = {version = "0.11", default-features = false}
3936serde_json = {version = "1.0", default-features = false}
4037clipboard = {version = "0.5", optional = true}
4138
4239# tui-additions = {path = "../../Rust/Packages/tui-additions", default-features = false, features = ["framework", "widgets"]}
43# invidious = {path = "../../Rust/Packages/invidious", default-features = false, features = ["reqwest"]}
40# invidious = {path = "../../Rust/Packages/invidious"}
docs/src/installation.md +1 −1
@@ -1,6 +1,6 @@
11# Installation
22
3The YouTube TUI is *not* tested for Windows.
3The YouTube TUI is *not* intended for Windows, pull requests to make it work are welcome.
44
55## Install from Crates.io (recommended)
66
src/global/functions/download_all_images.rs +16 −38
@@ -1,7 +1,5 @@
11use crate::global::structs::Item;
2use futures::future::join_all;
3use std::{error::Error, io::Cursor, thread};
4use tokio::runtime::Runtime;
2use std::{error::Error, fs, io::Cursor, path::PathBuf, thread};
53
64pub struct DownloadRequest {
75 pub url: String,
@@ -48,45 +46,25 @@ pub fn download_all_images(downloads: Vec<Option<DownloadRequest>>) {
4846 return;
4947 }
5048
51 thread::spawn(move || {
52 let rt: Runtime = tokio::runtime::Runtime::new().unwrap();
49 let path = home::home_dir()
50 .expect("Cannot get your home directory")
51 .join(".cache/youtube-tui/thumbnails/");
5352
54 rt.block_on(download_all_images_async(
55 downloads.into_iter().flatten().collect(),
56 ));
57 });
58}
59
60// Create a `download_single()`s and join them into 1 future
61// So all downloads will happen at the same time without waiting
62async fn download_all_images_async(downloads: Vec<DownloadRequest>) {
63 let mut actions = Vec::new();
64 let mut path = home::home_dir().expect("Cannot get your home directory");
65 path.push(".cache/youtube-tui/thumbnails/");
66
67 for download in downloads.into_iter() {
68 let path = path.clone().join(download.id);
69
70 if !path.exists() {
71 actions.push(download_single(
72 download.url,
73 path.clone().into_os_string().into_string().unwrap(),
74 ));
53 downloads.into_iter().flatten().for_each(|req| {
54 let path = path.clone().join(req.id);
55 if path.exists() {
56 return;
7557 }
76 }
77
78 join_all(actions).await;
58 thread::spawn(move || {
59 let _ = download_single(&req.url, path);
60 });
61 })
7962}
8063
81// Download a single file
82async fn download_single(url: String, path: String) -> Result<(), Box<dyn Error>> {
83 let response = reqwest::get(url).await?;
84 if !response.status().is_success() {
85 return Ok(());
86 }
87
88 let mut file = std::fs::File::create(path)?;
89 let mut content = Cursor::new(response.bytes().await?);
64fn download_single(url: &str, path: PathBuf) -> Result<(), Box<dyn Error>> {
65 let res = invidious::functions::httpreq_get(url)?;
66 let mut file = fs::File::create(path)?;
67 let mut content = Cursor::new(res);
9068 std::io::copy(&mut content, &mut file)?;
9169 Ok(())
9270}
src/global/functions/run_command.rs +1 −1
@@ -36,7 +36,7 @@ pub fn run_command(
3636 framework: &mut Framework,
3737 terminal: &mut Terminal<CrosstermBackend<Stdout>>,
3838) {
39 command.split(";;").into_iter().for_each(|single_command| {
39 command.split(";;").for_each(|single_command| {
4040 run_single_command(
4141 &single_command
4242 .trim()
src/global/functions/singleitem_load.rs +3 −3
@@ -1,9 +1,9 @@
11use crate::{config::MainConfig, global::functions::download_all_images, global::structs::Item};
2use invidious::reqwest::blocking::Client;
2use invidious::ClientSync;
33use std::error::Error;
44
55pub fn load_playlist(
6 client: &Client,
6 client: &ClientSync,
77 id: &str,
88 mainconfig: &MainConfig,
99) -> Result<Item, Box<dyn Error>> {
@@ -22,7 +22,7 @@ pub fn load_playlist(
2222}
2323
2424pub fn load_video(
25 client: &Client,
25 client: &ClientSync,
2626 id: &str,
2727 mainconfig: &MainConfig,
2828) -> Result<Item, Box<dyn Error>> {
src/global/structs/invidiousclient.rs +3 −3
@@ -1,14 +1,14 @@
1use invidious::reqwest::blocking::Client;
1use invidious::ClientSync;
22use typemap::Key;
33
44// used in `data.global`
55/// Holds the invidious client
66#[derive(Clone)]
7pub struct InvidiousClient(pub Client);
7pub struct InvidiousClient(pub ClientSync);
88
99impl InvidiousClient {
1010 pub fn new(instance: String) -> Self {
11 Self(Client::new(instance))
11 Self(ClientSync::default().instance(instance))
1212 }
1313}
1414
src/global/structs/item.rs +1 −4
@@ -1,7 +1,5 @@
11use crate::global::functions::*;
2use invidious::structs::{
3 channel::Channel, hidden::*, universal::Playlist as FullPlaylist, video::Video,
4};
2use invidious::{channel::Channel, hidden::*, universal::Playlist as FullPlaylist, video::Video};
53use serde::{Deserialize, Serialize};
64use std::fmt::Display;
75
@@ -198,7 +196,6 @@ impl Item {
198196 }
199197}
200198
201
202199impl Item {
203200 /// stript self into a FullVideoItem
204201 pub fn into_fullvideo(self) -> Result<FullVideoItem, Errors> {
src/global/structs/mod.rs +2 −2
@@ -8,9 +8,9 @@ mod message;
88mod page;
99mod state_env;
1010mod status;
11mod subscriptions;
1112mod tasks;
1213mod watchhistory;
13mod subscriptions;
1414
1515pub use errors::*;
1616pub use invidiousclient::*;
@@ -21,6 +21,6 @@ pub use message::*;
2121pub use page::*;
2222pub use state_env::*;
2323pub use status::*;
24pub use subscriptions::*;
2425pub use tasks::*;
2526pub use watchhistory::*;
26pub use subscriptions::*;
src/global/structs/subscriptions.rs +19 −5
@@ -1,8 +1,8 @@
1use std::{collections::HashMap, error::Error, sync::mpsc, thread};
21use serde::*;
2use std::{collections::HashMap, error::Error, sync::mpsc, thread};
33// use rayon::prelude::*;
4use super::{InvidiousClient, Item, MiniVideoItem};
45use crate::config::MainConfig;
5use super::{MiniVideoItem, InvidiousClient, Item};
66
77#[derive(Serialize, Deserialize)]
88/// id, videos
@@ -32,7 +32,7 @@ impl Subscriptions {
3232 (id, Some(videos)) => {
3333 self.0.insert(id, videos);
3434 success += 1;
35 },
35 }
3636 (id, None) => {
3737 self.0.get_mut(&id).unwrap().clear();
3838 failed += 1;
@@ -44,6 +44,20 @@ impl Subscriptions {
4444 }
4545}
4646
47fn sync_one(id: &str, client: &InvidiousClient, image_index: usize) -> Result<Vec<MiniVideoItem>, Box<dyn Error>> {
48 Ok(client.0.channel_videos(id, None)?.videos.into_iter().map(|video| Item::from_channel_video(video, image_index).into_minivideo().unwrap()).collect())
47fn sync_one(
48 id: &str,
49 client: &InvidiousClient,
50 image_index: usize,
51) -> Result<Vec<MiniVideoItem>, Box<dyn Error>> {
52 Ok(client
53 .0
54 .channel_videos(id, None)?
55 .videos
56 .into_iter()
57 .map(|video| {
58 Item::from_channel_video(video, image_index)
59 .into_minivideo()
60 .unwrap()
61 })
62 .collect())
4963}
src/items/channeldisplay.rs +9 −3
@@ -405,7 +405,9 @@ impl FrameworkItem for ChannelDisplay {
405405 .channel(&page.id, None)?,
406406 mainconfig.image_index,
407407 );
408 download_all_images(vec![(&channel).into()]);
408 if mainconfig.images.display() {
409 download_all_images(vec![(&channel).into()]);
410 }
409411 *self = Self::Main {
410412 iteminfo: ItemInfo::new(Some(channel.clone())),
411413 channel,
@@ -423,7 +425,9 @@ impl FrameworkItem for ChannelDisplay {
423425 .into_iter()
424426 .map(|video| Item::from_channel_video(video, mainconfig.image_index))
425427 .collect::<Vec<_>>();
426 download_all_images(videos.iter().map(|item| item.into()).collect());
428 if mainconfig.images.display() {
429 download_all_images(videos.iter().map(|item| item.into()).collect());
430 }
427431 *self = Self::Videos {
428432 textlist: TextList::default()
429433 .ascii_only(!mainconfig.allow_unicode)
@@ -451,7 +455,9 @@ impl FrameworkItem for ChannelDisplay {
451455 .into_iter()
452456 .map(Item::from_channel_playlist)
453457 .collect::<Vec<_>>();
454 download_all_images(playlists.iter().map(|item| item.into()).collect());
458 if mainconfig.images.display() {
459 download_all_images(playlists.iter().map(|item| item.into()).collect());
460 }
455461 *self = Self::Playlists {
456462 textlist: TextList::default()
457463 .ascii_only(!mainconfig.allow_unicode)
src/items/iteminfo.rs +1 −10
@@ -10,7 +10,7 @@ use viuer::{print_from_file, Config};
1010use crate::{config::*, global::structs::*};
1111
1212/// an item info displays info of any `Item`s
13#[derive(Clone)]
13#[derive(Clone, Default)]
1414pub struct ItemInfo {
1515 pub item: Option<Item>,
1616 pub lazy_scroll: u16,
@@ -381,15 +381,6 @@ impl FrameworkItem for ItemInfo {
381381 }
382382}
383383
384impl Default for ItemInfo {
385 fn default() -> Self {
386 Self {
387 item: None,
388 lazy_scroll: 0,
389 }
390 }
391}
392
393384impl ItemInfo {
394385 pub fn new(item: Option<Item>) -> Self {
395386 Self {
src/run.rs +12 −14
@@ -53,20 +53,18 @@ pub fn run(
5353 let (mut frameworkclean, state) = framework.split_clean();
5454 for row in state.0.iter_mut() {
5555 for item in row.items.iter_mut() {
56 match item.item.r#type() {
57 "youtube_tui::items::searchfilters::SearchFilter" => {
58 if item.item.mouse_event(
59 &mut frameworkclean,
60 0,
61 0,
62 mouse.column,
63 mouse.row,
64 ) {
65 searchfilter_clicked = true;
66 break;
67 }
68 }
69 _ => {}
56 if item.item.r#type()
57 == "youtube_tui::items::searchfilters::SearchFilter"
58 && item.item.mouse_event(
59 &mut frameworkclean,
60 0,
61 0,
62 mouse.column,
63 mouse.row,
64 )
65 {
66 searchfilter_clicked = true;
67 break;
7068 }
7169 }
7270
threadcounter.sh added +16
@@ -0,0 +1,16 @@
1# !/bin/bash
2# this scrips shows how many threads the tui is running, as it gets bumped up significantly when visiting a new page (it's downloading the immages)
3
4while true; do
5 PID=$(pgrep youtube-tui)
6
7 if [ -n "$PID" ]; then
8 THREADS=$(ps hH p $PID | wc -l)
9
10 echo "youtube-tui is running with $THREADS threads."
11 else
12 echo "youtube-tui is not currently running."
13 fi
14
15 sleep 0.05
16done