Commit 1006d44655
Unsigned
Layout: unified · split
Cargo.lock +184 −103
| @@ -46,9 +46,9 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" | ||
| 46 | 46 | |
| 47 | 47 | [[package]] |
| 48 | 48 | name = "bit_field" |
| 49 | version = "0.10.1" | |
| 49 | version = "0.10.2" | |
| 50 | 50 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 51 | checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" | |
| 51 | checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" | |
| 52 | 52 | |
| 53 | 53 | [[package]] |
| 54 | 54 | name = "bitflags" |
| @@ -82,9 +82,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" | ||
| 82 | 82 | |
| 83 | 83 | [[package]] |
| 84 | 84 | name = "bytes" |
| 85 | version = "1.3.0" | |
| 85 | version = "1.4.0" | |
| 86 | 86 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 87 | checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" | |
| 87 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" | |
| 88 | 88 | |
| 89 | 89 | [[package]] |
| 90 | 90 | name = "cassowary" |
| @@ -163,7 +163,7 @@ dependencies = [ | ||
| 163 | 163 | "encode_unicode", |
| 164 | 164 | "lazy_static", |
| 165 | 165 | "libc", |
| 166 | "windows-sys", | |
| 166 | "windows-sys 0.42.0", | |
| 167 | 167 | ] |
| 168 | 168 | |
| 169 | 169 | [[package]] |
| @@ -284,9 +284,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" | ||
| 284 | 284 | |
| 285 | 285 | [[package]] |
| 286 | 286 | name = "cxx" |
| 287 | version = "1.0.88" | |
| 287 | version = "1.0.91" | |
| 288 | 288 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 289 | checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" | |
| 289 | checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" | |
| 290 | 290 | dependencies = [ |
| 291 | 291 | "cc", |
| 292 | 292 | "cxxbridge-flags", |
| @@ -296,9 +296,9 @@ dependencies = [ | ||
| 296 | 296 | |
| 297 | 297 | [[package]] |
| 298 | 298 | name = "cxx-build" |
| 299 | version = "1.0.88" | |
| 299 | version = "1.0.91" | |
| 300 | 300 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 301 | checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" | |
| 301 | checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" | |
| 302 | 302 | dependencies = [ |
| 303 | 303 | "cc", |
| 304 | 304 | "codespan-reporting", |
| @@ -311,15 +311,15 @@ dependencies = [ | ||
| 311 | 311 | |
| 312 | 312 | [[package]] |
| 313 | 313 | name = "cxxbridge-flags" |
| 314 | version = "1.0.88" | |
| 314 | version = "1.0.91" | |
| 315 | 315 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 316 | checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" | |
| 316 | checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" | |
| 317 | 317 | |
| 318 | 318 | [[package]] |
| 319 | 319 | name = "cxxbridge-macro" |
| 320 | version = "1.0.88" | |
| 320 | version = "1.0.91" | |
| 321 | 321 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 322 | checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" | |
| 322 | checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" | |
| 323 | 323 | dependencies = [ |
| 324 | 324 | "proc-macro2", |
| 325 | 325 | "quote", |
| @@ -352,18 +352,39 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" | ||
| 352 | 352 | |
| 353 | 353 | [[package]] |
| 354 | 354 | name = "encoding_rs" |
| 355 | version = "0.8.31" | |
| 355 | version = "0.8.32" | |
| 356 | 356 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 357 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" | |
| 357 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" | |
| 358 | 358 | dependencies = [ |
| 359 | 359 | "cfg-if", |
| 360 | 360 | ] |
| 361 | 361 | |
| 362 | [[package]] | |
| 363 | name = "errno" | |
| 364 | version = "0.2.8" | |
| 365 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 366 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" | |
| 367 | dependencies = [ | |
| 368 | "errno-dragonfly", | |
| 369 | "libc", | |
| 370 | "winapi", | |
| 371 | ] | |
| 372 | ||
| 373 | [[package]] | |
| 374 | name = "errno-dragonfly" | |
| 375 | version = "0.1.2" | |
| 376 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 377 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" | |
| 378 | dependencies = [ | |
| 379 | "cc", | |
| 380 | "libc", | |
| 381 | ] | |
| 382 | ||
| 362 | 383 | [[package]] |
| 363 | 384 | name = "exr" |
| 364 | version = "1.5.2" | |
| 385 | version = "1.5.3" | |
| 365 | 386 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 366 | checksum = "8eb5f255b5980bb0c8cf676b675d1a99be40f316881444f44e0462eaf5df5ded" | |
| 387 | checksum = "e8af5ef47e2ed89d23d0ecbc1b681b30390069de70260937877514377fc24feb" | |
| 367 | 388 | dependencies = [ |
| 368 | 389 | "bit_field", |
| 369 | 390 | "flume", |
| @@ -372,13 +393,14 @@ dependencies = [ | ||
| 372 | 393 | "miniz_oxide", |
| 373 | 394 | "smallvec", |
| 374 | 395 | "threadpool", |
| 396 | "zune-inflate", | |
| 375 | 397 | ] |
| 376 | 398 | |
| 377 | 399 | [[package]] |
| 378 | 400 | name = "fastrand" |
| 379 | version = "1.8.0" | |
| 401 | version = "1.9.0" | |
| 380 | 402 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 381 | checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" | |
| 403 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" | |
| 382 | 404 | dependencies = [ |
| 383 | 405 | "instant", |
| 384 | 406 | ] |
| @@ -448,9 +470,9 @@ dependencies = [ | ||
| 448 | 470 | |
| 449 | 471 | [[package]] |
| 450 | 472 | name = "futures" |
| 451 | version = "0.3.25" | |
| 473 | version = "0.3.26" | |
| 452 | 474 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 453 | checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" | |
| 475 | checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" | |
| 454 | 476 | dependencies = [ |
| 455 | 477 | "futures-channel", |
| 456 | 478 | "futures-core", |
| @@ -462,9 +484,9 @@ dependencies = [ | ||
| 462 | 484 | |
| 463 | 485 | [[package]] |
| 464 | 486 | name = "futures-channel" |
| 465 | version = "0.3.25" | |
| 487 | version = "0.3.26" | |
| 466 | 488 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 467 | checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" | |
| 489 | checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" | |
| 468 | 490 | dependencies = [ |
| 469 | 491 | "futures-core", |
| 470 | 492 | "futures-sink", |
| @@ -472,33 +494,33 @@ dependencies = [ | ||
| 472 | 494 | |
| 473 | 495 | [[package]] |
| 474 | 496 | name = "futures-core" |
| 475 | version = "0.3.25" | |
| 497 | version = "0.3.26" | |
| 476 | 498 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 477 | checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" | |
| 499 | checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" | |
| 478 | 500 | |
| 479 | 501 | [[package]] |
| 480 | 502 | name = "futures-io" |
| 481 | version = "0.3.25" | |
| 503 | version = "0.3.26" | |
| 482 | 504 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 483 | checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" | |
| 505 | checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" | |
| 484 | 506 | |
| 485 | 507 | [[package]] |
| 486 | 508 | name = "futures-sink" |
| 487 | version = "0.3.25" | |
| 509 | version = "0.3.26" | |
| 488 | 510 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 489 | checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" | |
| 511 | checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" | |
| 490 | 512 | |
| 491 | 513 | [[package]] |
| 492 | 514 | name = "futures-task" |
| 493 | version = "0.3.25" | |
| 515 | version = "0.3.26" | |
| 494 | 516 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 495 | checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" | |
| 517 | checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" | |
| 496 | 518 | |
| 497 | 519 | [[package]] |
| 498 | 520 | name = "futures-util" |
| 499 | version = "0.3.25" | |
| 521 | version = "0.3.26" | |
| 500 | 522 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 501 | checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" | |
| 523 | checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" | |
| 502 | 524 | dependencies = [ |
| 503 | 525 | "futures-core", |
| 504 | 526 | "futures-io", |
| @@ -587,9 +609,9 @@ dependencies = [ | ||
| 587 | 609 | |
| 588 | 610 | [[package]] |
| 589 | 611 | name = "http" |
| 590 | version = "0.2.8" | |
| 612 | version = "0.2.9" | |
| 591 | 613 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 592 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" | |
| 614 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" | |
| 593 | 615 | dependencies = [ |
| 594 | 616 | "bytes", |
| 595 | 617 | "fnv", |
| @@ -621,9 +643,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" | ||
| 621 | 643 | |
| 622 | 644 | [[package]] |
| 623 | 645 | name = "hyper" |
| 624 | version = "0.14.23" | |
| 646 | version = "0.14.24" | |
| 625 | 647 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 626 | checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" | |
| 648 | checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" | |
| 627 | 649 | dependencies = [ |
| 628 | 650 | "bytes", |
| 629 | 651 | "futures-channel", |
| @@ -739,6 +761,16 @@ dependencies = [ | ||
| 739 | 761 | "serde_json", |
| 740 | 762 | ] |
| 741 | 763 | |
| 764 | [[package]] | |
| 765 | name = "io-lifetimes" | |
| 766 | version = "1.0.5" | |
| 767 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 768 | checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" | |
| 769 | dependencies = [ | |
| 770 | "libc", | |
| 771 | "windows-sys 0.45.0", | |
| 772 | ] | |
| 773 | ||
| 742 | 774 | [[package]] |
| 743 | 775 | name = "ipnet" |
| 744 | 776 | version = "2.7.1" |
| @@ -762,9 +794,9 @@ dependencies = [ | ||
| 762 | 794 | |
| 763 | 795 | [[package]] |
| 764 | 796 | name = "js-sys" |
| 765 | version = "0.3.60" | |
| 797 | version = "0.3.61" | |
| 766 | 798 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 767 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" | |
| 799 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" | |
| 768 | 800 | dependencies = [ |
| 769 | 801 | "wasm-bindgen", |
| 770 | 802 | ] |
| @@ -796,6 +828,12 @@ dependencies = [ | ||
| 796 | 828 | "cc", |
| 797 | 829 | ] |
| 798 | 830 | |
| 831 | [[package]] | |
| 832 | name = "linux-raw-sys" | |
| 833 | version = "0.1.4" | |
| 834 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 835 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" | |
| 836 | ||
| 799 | 837 | [[package]] |
| 800 | 838 | name = "lock_api" |
| 801 | 839 | version = "0.4.9" |
| @@ -862,14 +900,14 @@ dependencies = [ | ||
| 862 | 900 | |
| 863 | 901 | [[package]] |
| 864 | 902 | name = "mio" |
| 865 | version = "0.8.5" | |
| 903 | version = "0.8.6" | |
| 866 | 904 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 867 | checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" | |
| 905 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" | |
| 868 | 906 | dependencies = [ |
| 869 | 907 | "libc", |
| 870 | 908 | "log", |
| 871 | 909 | "wasi", |
| 872 | "windows-sys", | |
| 910 | "windows-sys 0.45.0", | |
| 873 | 911 | ] |
| 874 | 912 | |
| 875 | 913 | [[package]] |
| @@ -970,9 +1008,9 @@ dependencies = [ | ||
| 970 | 1008 | |
| 971 | 1009 | [[package]] |
| 972 | 1010 | name = "once_cell" |
| 973 | version = "1.17.0" | |
| 1011 | version = "1.17.1" | |
| 974 | 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 975 | checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" | |
| 1013 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" | |
| 976 | 1014 | |
| 977 | 1015 | [[package]] |
| 978 | 1016 | name = "openssl" |
| @@ -1031,15 +1069,15 @@ dependencies = [ | ||
| 1031 | 1069 | |
| 1032 | 1070 | [[package]] |
| 1033 | 1071 | name = "parking_lot_core" |
| 1034 | version = "0.9.6" | |
| 1072 | version = "0.9.7" | |
| 1035 | 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1036 | checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" | |
| 1074 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" | |
| 1037 | 1075 | dependencies = [ |
| 1038 | 1076 | "cfg-if", |
| 1039 | 1077 | "libc", |
| 1040 | 1078 | "redox_syscall", |
| 1041 | 1079 | "smallvec", |
| 1042 | "windows-sys", | |
| 1080 | "windows-sys 0.45.0", | |
| 1043 | 1081 | ] |
| 1044 | 1082 | |
| 1045 | 1083 | [[package]] |
| @@ -1106,9 +1144,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" | ||
| 1106 | 1144 | |
| 1107 | 1145 | [[package]] |
| 1108 | 1146 | name = "proc-macro2" |
| 1109 | version = "1.0.50" | |
| 1147 | version = "1.0.51" | |
| 1110 | 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1111 | checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" | |
| 1149 | checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" | |
| 1112 | 1150 | dependencies = [ |
| 1113 | 1151 | "unicode-ident", |
| 1114 | 1152 | ] |
| @@ -1183,15 +1221,6 @@ dependencies = [ | ||
| 1183 | 1221 | "bitflags", |
| 1184 | 1222 | ] |
| 1185 | 1223 | |
| 1186 | [[package]] | |
| 1187 | name = "remove_dir_all" | |
| 1188 | version = "0.5.3" | |
| 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1190 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" | |
| 1191 | dependencies = [ | |
| 1192 | "winapi", | |
| 1193 | ] | |
| 1194 | ||
| 1195 | 1224 | [[package]] |
| 1196 | 1225 | name = "reqwest" |
| 1197 | 1226 | version = "0.11.14" |
| @@ -1231,9 +1260,9 @@ dependencies = [ | ||
| 1231 | 1260 | |
| 1232 | 1261 | [[package]] |
| 1233 | 1262 | name = "rgb" |
| 1234 | version = "0.8.34" | |
| 1263 | version = "0.8.36" | |
| 1235 | 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1236 | checksum = "3603b7d71ca82644f79b5a06d1220e9a58ede60bd32255f698cb1af8838b8db3" | |
| 1265 | checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" | |
| 1237 | 1266 | dependencies = [ |
| 1238 | 1267 | "bytemuck", |
| 1239 | 1268 | ] |
| @@ -1247,6 +1276,20 @@ dependencies = [ | ||
| 1247 | 1276 | "fsio", |
| 1248 | 1277 | ] |
| 1249 | 1278 | |
| 1279 | [[package]] | |
| 1280 | name = "rustix" | |
| 1281 | version = "0.36.8" | |
| 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1283 | checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" | |
| 1284 | dependencies = [ | |
| 1285 | "bitflags", | |
| 1286 | "errno", | |
| 1287 | "io-lifetimes", | |
| 1288 | "libc", | |
| 1289 | "linux-raw-sys", | |
| 1290 | "windows-sys 0.45.0", | |
| 1291 | ] | |
| 1292 | ||
| 1250 | 1293 | [[package]] |
| 1251 | 1294 | name = "ryu" |
| 1252 | 1295 | version = "1.0.12" |
| @@ -1259,7 +1302,7 @@ version = "0.1.21" | ||
| 1259 | 1302 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1260 | 1303 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" |
| 1261 | 1304 | dependencies = [ |
| 1262 | "windows-sys", | |
| 1305 | "windows-sys 0.42.0", | |
| 1263 | 1306 | ] |
| 1264 | 1307 | |
| 1265 | 1308 | [[package]] |
| @@ -1325,9 +1368,9 @@ dependencies = [ | ||
| 1325 | 1368 | |
| 1326 | 1369 | [[package]] |
| 1327 | 1370 | name = "serde_json" |
| 1328 | version = "1.0.91" | |
| 1371 | version = "1.0.93" | |
| 1329 | 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1330 | checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" | |
| 1373 | checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" | |
| 1331 | 1374 | dependencies = [ |
| 1332 | 1375 | "itoa", |
| 1333 | 1376 | "ryu", |
| @@ -1361,9 +1404,9 @@ dependencies = [ | ||
| 1361 | 1404 | |
| 1362 | 1405 | [[package]] |
| 1363 | 1406 | name = "signal-hook" |
| 1364 | version = "0.3.14" | |
| 1407 | version = "0.3.15" | |
| 1365 | 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1366 | checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" | |
| 1409 | checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" | |
| 1367 | 1410 | dependencies = [ |
| 1368 | 1411 | "libc", |
| 1369 | 1412 | "signal-hook-registry", |
| @@ -1382,13 +1425,19 @@ dependencies = [ | ||
| 1382 | 1425 | |
| 1383 | 1426 | [[package]] |
| 1384 | 1427 | name = "signal-hook-registry" |
| 1385 | version = "1.4.0" | |
| 1428 | version = "1.4.1" | |
| 1386 | 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1387 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" | |
| 1430 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" | |
| 1388 | 1431 | dependencies = [ |
| 1389 | 1432 | "libc", |
| 1390 | 1433 | ] |
| 1391 | 1434 | |
| 1435 | [[package]] | |
| 1436 | name = "simd-adler32" | |
| 1437 | version = "0.3.4" | |
| 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1439 | checksum = "14a5df39617d7c8558154693a1bb8157a4aab8179209540cc0b10e5dc24e0b18" | |
| 1440 | ||
| 1392 | 1441 | [[package]] |
| 1393 | 1442 | name = "sixel-rs" |
| 1394 | 1443 | version = "0.3.3" |
| @@ -1409,9 +1458,9 @@ dependencies = [ | ||
| 1409 | 1458 | |
| 1410 | 1459 | [[package]] |
| 1411 | 1460 | name = "slab" |
| 1412 | version = "0.4.7" | |
| 1461 | version = "0.4.8" | |
| 1413 | 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1414 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" | |
| 1463 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" | |
| 1415 | 1464 | dependencies = [ |
| 1416 | 1465 | "autocfg", |
| 1417 | 1466 | ] |
| @@ -1434,18 +1483,18 @@ dependencies = [ | ||
| 1434 | 1483 | |
| 1435 | 1484 | [[package]] |
| 1436 | 1485 | name = "spin" |
| 1437 | version = "0.9.4" | |
| 1486 | version = "0.9.5" | |
| 1438 | 1487 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1439 | checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" | |
| 1488 | checksum = "7dccf47db1b41fa1573ed27ccf5e08e3ca771cb994f776668c5ebda893b248fc" | |
| 1440 | 1489 | dependencies = [ |
| 1441 | 1490 | "lock_api", |
| 1442 | 1491 | ] |
| 1443 | 1492 | |
| 1444 | 1493 | [[package]] |
| 1445 | 1494 | name = "syn" |
| 1446 | version = "1.0.107" | |
| 1495 | version = "1.0.109" | |
| 1447 | 1496 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1448 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" | |
| 1497 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" | |
| 1449 | 1498 | dependencies = [ |
| 1450 | 1499 | "proc-macro2", |
| 1451 | 1500 | "quote", |
| @@ -1454,16 +1503,15 @@ dependencies = [ | ||
| 1454 | 1503 | |
| 1455 | 1504 | [[package]] |
| 1456 | 1505 | name = "tempfile" |
| 1457 | version = "3.3.0" | |
| 1506 | version = "3.4.0" | |
| 1458 | 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1459 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" | |
| 1508 | checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" | |
| 1460 | 1509 | dependencies = [ |
| 1461 | 1510 | "cfg-if", |
| 1462 | 1511 | "fastrand", |
| 1463 | "libc", | |
| 1464 | 1512 | "redox_syscall", |
| 1465 | "remove_dir_all", | |
| 1466 | "winapi", | |
| 1513 | "rustix", | |
| 1514 | "windows-sys 0.42.0", | |
| 1467 | 1515 | ] |
| 1468 | 1516 | |
| 1469 | 1517 | [[package]] |
| @@ -1506,15 +1554,15 @@ dependencies = [ | ||
| 1506 | 1554 | |
| 1507 | 1555 | [[package]] |
| 1508 | 1556 | name = "tinyvec_macros" |
| 1509 | version = "0.1.0" | |
| 1557 | version = "0.1.1" | |
| 1510 | 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1511 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" | |
| 1559 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" | |
| 1512 | 1560 | |
| 1513 | 1561 | [[package]] |
| 1514 | 1562 | name = "tokio" |
| 1515 | version = "1.24.2" | |
| 1563 | version = "1.25.0" | |
| 1516 | 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1517 | checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" | |
| 1565 | checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" | |
| 1518 | 1566 | dependencies = [ |
| 1519 | 1567 | "autocfg", |
| 1520 | 1568 | "bytes", |
| @@ -1524,14 +1572,14 @@ dependencies = [ | ||
| 1524 | 1572 | "num_cpus", |
| 1525 | 1573 | "pin-project-lite", |
| 1526 | 1574 | "socket2", |
| 1527 | "windows-sys", | |
| 1575 | "windows-sys 0.42.0", | |
| 1528 | 1576 | ] |
| 1529 | 1577 | |
| 1530 | 1578 | [[package]] |
| 1531 | 1579 | name = "tokio-native-tls" |
| 1532 | version = "0.3.0" | |
| 1580 | version = "0.3.1" | |
| 1533 | 1581 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1534 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" | |
| 1582 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" | |
| 1535 | 1583 | dependencies = [ |
| 1536 | 1584 | "native-tls", |
| 1537 | 1585 | "tokio", |
| @@ -1539,9 +1587,9 @@ dependencies = [ | ||
| 1539 | 1587 | |
| 1540 | 1588 | [[package]] |
| 1541 | 1589 | name = "tokio-util" |
| 1542 | version = "0.7.4" | |
| 1590 | version = "0.7.7" | |
| 1543 | 1591 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1544 | checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" | |
| 1592 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" | |
| 1545 | 1593 | dependencies = [ |
| 1546 | 1594 | "bytes", |
| 1547 | 1595 | "futures-core", |
| @@ -1648,9 +1696,9 @@ dependencies = [ | ||
| 1648 | 1696 | |
| 1649 | 1697 | [[package]] |
| 1650 | 1698 | name = "unicode-segmentation" |
| 1651 | version = "1.10.0" | |
| 1699 | version = "1.10.1" | |
| 1652 | 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1653 | checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" | |
| 1701 | checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" | |
| 1654 | 1702 | |
| 1655 | 1703 | [[package]] |
| 1656 | 1704 | name = "unicode-width" |
| @@ -1725,9 +1773,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" | ||
| 1725 | 1773 | |
| 1726 | 1774 | [[package]] |
| 1727 | 1775 | name = "wasm-bindgen" |
| 1728 | version = "0.2.83" | |
| 1776 | version = "0.2.84" | |
| 1729 | 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1730 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" | |
| 1778 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" | |
| 1731 | 1779 | dependencies = [ |
| 1732 | 1780 | "cfg-if", |
| 1733 | 1781 | "wasm-bindgen-macro", |
| @@ -1735,9 +1783,9 @@ dependencies = [ | ||
| 1735 | 1783 | |
| 1736 | 1784 | [[package]] |
| 1737 | 1785 | name = "wasm-bindgen-backend" |
| 1738 | version = "0.2.83" | |
| 1786 | version = "0.2.84" | |
| 1739 | 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1740 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" | |
| 1788 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" | |
| 1741 | 1789 | dependencies = [ |
| 1742 | 1790 | "bumpalo", |
| 1743 | 1791 | "log", |
| @@ -1750,9 +1798,9 @@ dependencies = [ | ||
| 1750 | 1798 | |
| 1751 | 1799 | [[package]] |
| 1752 | 1800 | name = "wasm-bindgen-futures" |
| 1753 | version = "0.4.33" | |
| 1801 | version = "0.4.34" | |
| 1754 | 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1755 | checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" | |
| 1803 | checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" | |
| 1756 | 1804 | dependencies = [ |
| 1757 | 1805 | "cfg-if", |
| 1758 | 1806 | "js-sys", |
| @@ -1762,9 +1810,9 @@ dependencies = [ | ||
| 1762 | 1810 | |
| 1763 | 1811 | [[package]] |
| 1764 | 1812 | name = "wasm-bindgen-macro" |
| 1765 | version = "0.2.83" | |
| 1813 | version = "0.2.84" | |
| 1766 | 1814 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1767 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" | |
| 1815 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" | |
| 1768 | 1816 | dependencies = [ |
| 1769 | 1817 | "quote", |
| 1770 | 1818 | "wasm-bindgen-macro-support", |
| @@ -1772,9 +1820,9 @@ dependencies = [ | ||
| 1772 | 1820 | |
| 1773 | 1821 | [[package]] |
| 1774 | 1822 | name = "wasm-bindgen-macro-support" |
| 1775 | version = "0.2.83" | |
| 1823 | version = "0.2.84" | |
| 1776 | 1824 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1777 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" | |
| 1825 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" | |
| 1778 | 1826 | dependencies = [ |
| 1779 | 1827 | "proc-macro2", |
| 1780 | 1828 | "quote", |
| @@ -1785,15 +1833,15 @@ dependencies = [ | ||
| 1785 | 1833 | |
| 1786 | 1834 | [[package]] |
| 1787 | 1835 | name = "wasm-bindgen-shared" |
| 1788 | version = "0.2.83" | |
| 1836 | version = "0.2.84" | |
| 1789 | 1837 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1790 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" | |
| 1838 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" | |
| 1791 | 1839 | |
| 1792 | 1840 | [[package]] |
| 1793 | 1841 | name = "web-sys" |
| 1794 | version = "0.3.60" | |
| 1842 | version = "0.3.61" | |
| 1795 | 1843 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1796 | checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" | |
| 1844 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" | |
| 1797 | 1845 | dependencies = [ |
| 1798 | 1846 | "js-sys", |
| 1799 | 1847 | "wasm-bindgen", |
| @@ -1851,6 +1899,30 @@ dependencies = [ | ||
| 1851 | 1899 | "windows_x86_64_msvc", |
| 1852 | 1900 | ] |
| 1853 | 1901 | |
| 1902 | [[package]] | |
| 1903 | name = "windows-sys" | |
| 1904 | version = "0.45.0" | |
| 1905 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1906 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" | |
| 1907 | dependencies = [ | |
| 1908 | "windows-targets", | |
| 1909 | ] | |
| 1910 | ||
| 1911 | [[package]] | |
| 1912 | name = "windows-targets" | |
| 1913 | version = "0.42.1" | |
| 1914 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1915 | checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" | |
| 1916 | dependencies = [ | |
| 1917 | "windows_aarch64_gnullvm", | |
| 1918 | "windows_aarch64_msvc", | |
| 1919 | "windows_i686_gnu", | |
| 1920 | "windows_i686_msvc", | |
| 1921 | "windows_x86_64_gnu", | |
| 1922 | "windows_x86_64_gnullvm", | |
| 1923 | "windows_x86_64_msvc", | |
| 1924 | ] | |
| 1925 | ||
| 1854 | 1926 | [[package]] |
| 1855 | 1927 | name = "windows_aarch64_gnullvm" |
| 1856 | 1928 | version = "0.42.1" |
| @@ -1943,3 +2015,12 @@ dependencies = [ | ||
| 1943 | 2015 | "typemap", |
| 1944 | 2016 | "viuer", |
| 1945 | 2017 | ] |
| 2018 | ||
| 2019 | [[package]] | |
| 2020 | name = "zune-inflate" | |
| 2021 | version = "0.2.50" | |
| 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2023 | checksum = "589245df6230839c305984dcc0a8385cc72af1fd223f360ffd5d65efa4216d40" | |
| 2024 | dependencies = [ | |
| 2025 | "simd-adler32", | |
| 2026 | ] | |
README.md +10 −15
| @@ -1,20 +1,13 @@ | ||
| 1 |  | |
| 2 |  | |
| 3 | [](https://crates.io/crates/youtube-tui) | |
| 4 | [](https://crates.io/crates/youtube-tui) | |
| 5 | [](https://aur.archlinux.org/packages/youtube-tui) | |
| 6 |  | |
| 7 | ||
| 8 | ***Read more in the [user manual](https://siriusmart.github.io/youtube-tui) (including installation guide and documentation).*** | |
| 9 | ||
| 10 | 1 | # Overview |
| 11 | 2 | |
| 12 | 3 | Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for browsing YouTube content from the terminal. |
| 13 | 4 | |
| 14 |  | |
| 5 |  | |
| 15 | 6 | |
| 16 | 7 | It is like an _app launcher_, it launches other programs to do the heavy lifting (for example, `mpv` for playing videos). |
| 17 | 8 | |
| 9 | > Consider regenerating config files on updates to allow new features. | |
| 10 | ||
| 18 | 11 | ## Customisable |
| 19 | 12 | |
| 20 | 13 | The YouTube TUI can be customised through config files, they are located in `~/.config/youtube-tui` and are in the YAML format. |
| @@ -38,17 +31,19 @@ env: | ||
| 38 | 31 | |
| 39 | 32 | Anything from layouts to colours and keybindings can be customised, more on that later. |
| 40 | 33 | |
| 41 | ## Dependency-free | |
| 34 | ## ~~Dependency-free~~ | |
| 35 | ||
| 36 | > Clipboard need to be put as an optional feature before before calling dependency-free, for now `libxcb` is a required dependency. | |
| 42 | 37 | |
| 43 | 38 | The YouTube TUI does not work on its own, it is instead like a _TUI frontend_ for programs like `mpv` or `yt-dlp`/`youtube-dl`. |
| 44 | 39 | |
| 45 | However, the programs to launch can be changed, and therefore the YouTube TUI <u>does not rely on any specific dependencies</u> to run. | |
| 40 | However, the programs to launch can be changed, and therefore ~~the YouTube TUI <u>does not rely on any specific dependencies</u> to run~~. | |
| 46 | 41 | |
| 47 |  | |
| 42 |  | |
| 48 | 43 | |
| 49 | 44 | ## Powerful |
| 50 | 45 | |
| 51 | The YouTube TUI allows you to browse YouTube with (almost) all of its features, functions including: | |
| 46 | The YouTube TUI allows you to browse YouTube with (almost) all of it's features, functions including: | |
| 52 | 47 | |
| 53 | 48 | - View popular/trending videos |
| 54 | 49 | - View information about channels, playlists and videos |
| @@ -60,11 +55,11 @@ It also includes features like: | ||
| 60 | 55 | - Vim-like commands |
| 61 | 56 | - Mouse support |
| 62 | 57 | - Extensible keybindings system |
| 58 | - Offline library | |
| 63 | 59 | |
| 64 | 60 | ### What it doesn't have |
| 65 | 61 | |
| 66 | 62 | - Subscriptions (first priority) |
| 67 | - Download library (will implement) | |
| 68 | 63 | |
| 69 | 64 | ## How to contribute |
| 70 | 65 | |
docs/src/README.md +8 −4
| @@ -6,6 +6,8 @@ Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for | ||
| 6 | 6 | |
| 7 | 7 | It is like an _app launcher_, it launches other programs to do the heavy lifting (for example, `mpv` for playing videos). |
| 8 | 8 | |
| 9 | > Consider regenerating config files on updates to allow new features. | |
| 10 | ||
| 9 | 11 | ## Customisable |
| 10 | 12 | |
| 11 | 13 | The YouTube TUI can be customised through config files, they are located in `~/.config/youtube-tui` and are in the YAML format. |
| @@ -29,11 +31,13 @@ env: | ||
| 29 | 31 | |
| 30 | 32 | Anything from layouts to colours and keybindings can be customised, more on that later. |
| 31 | 33 | |
| 32 | ## Dependency-free | |
| 34 | ## ~~Dependency-free~~ | |
| 35 | ||
| 36 | > Clipboard need to be put as an optional feature before before calling dependency-free, for now `libxcb` is a required dependency. | |
| 33 | 37 | |
| 34 | 38 | The YouTube TUI does not work on its own, it is instead like a _TUI frontend_ for programs like `mpv` or `yt-dlp`/`youtube-dl`. |
| 35 | 39 | |
| 36 | However, the programs to launch can be changed, and therefore the YouTube TUI <u>does not rely on any specific dependencies</u> to run. | |
| 40 | However, the programs to launch can be changed, and therefore ~~the YouTube TUI <u>does not rely on any specific dependencies</u> to run~~. | |
| 37 | 41 | |
| 38 | 42 |  |
| 39 | 43 | |
| @@ -50,12 +54,12 @@ It also includes features like: | ||
| 50 | 54 | |
| 51 | 55 | - Vim-like commands |
| 52 | 56 | - Mouse support |
| 53 | - Entensible keybindings system | |
| 57 | - Extensible keybindings system | |
| 58 | - Offline library | |
| 54 | 59 | |
| 55 | 60 | ### What it doesn't have |
| 56 | 61 | |
| 57 | 62 | - Subscriptions (first priority) |
| 58 | - Download library (will implement) | |
| 59 | 63 | |
| 60 | 64 | ## How to contribute |
| 61 | 65 | |
docs/src/SUMMARY.md +5 −6
| @@ -18,12 +18,11 @@ | ||
| 18 | 18 | |
| 19 | 19 | # Contributing |
| 20 | 20 | |
| 21 | - [How it works](how_it_works.md) | |
| 22 | - [Framework](framework.md) | |
| 23 | - [Invidious API]() | |
| 24 | - [Individual items]() | |
| 25 | ||
| 26 | - [Contribution guide]() | |
| 21 | - [How it works](explaination/how_it_works.md) | |
| 22 | - [Framework](explaination/framework.md) | |
| 23 | - [Event loop]() | |
| 24 | - [Invidious and loading videos]() | |
| 25 | - [Caching and library]() | |
| 27 | 26 | |
| 28 | 27 | - [Changelogs](changelogs.md) |
| 29 | 28 | - [Contributors](contributors.md) |
docs/src/basic_usage.md +8 −8
| @@ -49,12 +49,6 @@ To apply search filters, select the button with 3 dots (`...`) to the right of t | ||
| 49 | 49 | |
| 50 | 50 | Press `Enter` to select a video or playlist from any lists, then move the cursor to the *bottom item* where you can play, download and open the webpage in browser. |
| 51 | 51 | |
| 52 | ### Playlist views | |
| 53 | ||
| 54 | The playlist page allows two different view modes, the first of which is *commands view* - similar to what the video page offers. | |
| 55 | ||
| 56 | The other one is *videos view*, which allows you to look at each videos in the playlist individually. | |
| 57 | ||
| 58 | 52 | ## Command mode |
| 59 | 53 | |
| 60 | 54 | Command mode is like that of Vim, it can be started by pressing `:` when nothing is selected. |
| @@ -63,11 +57,13 @@ More about commands in the [next chapter](commands.md). | ||
| 63 | 57 | |
| 64 | 58 | ## Command bindings |
| 65 | 59 | |
| 66 | Keys can be binded to a command, more about it in the next chapter. | |
| 60 | Keys can be bind to a command, more about it in the next chapter. | |
| 61 | ||
| 62 | For example `Ctrl + F` launches your web browser. | |
| 67 | 63 | |
| 68 | 64 | ## Buttons |
| 69 | 65 | |
| 70 | Buttons have no use on their own, but allows you to navigate between pages. | |
| 66 | Buttons are similar to hyperlinks, it allows you to navigate between pages. | |
| 71 | 67 | |
| 72 | 68 | ## Mouse click control |
| 73 | 69 | |
| @@ -83,3 +79,7 @@ However, there are some downsides to not using your keyboard. | ||
| 83 | 79 | |
| 84 | 80 | 1. Cannot move up or down to items not on screen in a list (you can do that with `Up` or `Down arrow`) |
| 85 | 81 | 2. Cannot access function keys like `Backspace` or `Q` |
| 82 | ||
| 83 | ## Library | |
| 84 | ||
| 85 | Items can be bookmarked and saved to library, they can also be saved to be viewed offline. | |
docs/src/changelogs.md +19 −5
| @@ -1,12 +1,26 @@ | ||
| 1 | 1 | # Changelogs |
| 2 | 2 | |
| 3 | ## v0.7.0 | |
| 4 | ||
| 5 | ### Added | |
| 6 | ||
| 7 | - File system based caching | |
| 8 | - Bookmark library | |
| 9 | - Save video/playlists for offline viewing | |
| 10 | ||
| 11 | ### Fixed | |
| 12 | ||
| 13 | - Empty ItemList crash (<a href="https://github.com/Siriusmart/youtube-tui/issues/26" target=_blank>issue 26</a>) | |
| 14 | ||
| 15 | <hr> | |
| 16 | ||
| 3 | 17 | ## v0.6.2 |
| 4 | 18 | |
| 5 | #### Added | |
| 19 | ### Added | |
| 6 | 20 | |
| 7 | 21 | - Command bindings |
| 8 | 22 | |
| 9 | #### Fixed | |
| 23 | ### Fixed | |
| 10 | 24 | |
| 11 | 25 | - Image not cleared when going back to "switch view" |
| 12 | 26 | |
| @@ -34,7 +48,7 @@ | ||
| 34 | 48 | |
| 35 | 49 | ## v0.5.3 |
| 36 | 50 | |
| 37 | #### Fixed | |
| 51 | ### Fixed | |
| 38 | 52 | |
| 39 | 53 | - Search bar could not handle non English characters (e.g. <a href="https://github.com/Siriusmart/youtube-tui/issues/14" target=_blank>Russian</a>) |
| 40 | 54 | |
| @@ -68,11 +82,11 @@ | ||
| 68 | 82 | |
| 69 | 83 | ## v0.4.4 |
| 70 | 84 | |
| 71 | #### Added | |
| 85 | ### Added | |
| 72 | 86 | |
| 73 | 87 | - Added default select item for each page (can be changed in `layouts.yml`) |
| 74 | 88 | |
| 75 | #### Fixes | |
| 89 | ### Fixes | |
| 76 | 90 | |
| 77 | 91 | - Video list view in playlists not working |
| 78 | 92 | - Channel view scroll causes panic |
docs/src/contributors.md +6 −2
| @@ -4,10 +4,14 @@ | ||
| 4 | 4 | |
| 5 | 5 | Creator and main developer of YouTube TUI. |
| 6 | 6 | |
| 7 | ## <a href="https://github.com/LuckyTurtleDev" target=_blank>LuckyTurtleDev</a> | |
| 8 | ||
| 9 | Maintainer of the <a href="https://aur.archlinux.org/packages/youtube-tui" target=_blank>`youtube-tui`</a> package on AUR. | |
| 10 | ||
| 7 | 11 | ## <a href="https://github.com/zaedus" target=_blank>Zaedus</a> |
| 8 | 12 | |
| 9 | Made the PKGBUILD and maintainer of the `youtube-tui-full-bin`, `youtube-tui-nodefaults-bin` and `youtube-tui-git` package on <a href="https://aur.archlinux.org/packages/youtube-tui-git" target=_blank>the AUR</a>. | |
| 13 | Maintainer of the <a href="https://aur.archlinux.org/packages/youtube-tui-full-bin" target=_blank>`youtube-tui-full-bin`</a>, <a href="https://aur.archlinux.org/packages/youtube-tui-nodefaults-bin" target=_blank>`youtube-tui-nodefaults-bin`</a> and <a href="https://aur.archlinux.org/packages/youtube-tui-git" target=_blank>`youtube-tui-git`</a> package on AUR. | |
| 10 | 14 | |
| 11 | ## <a href="https://github.com/fractal-tess" target=_blank>Fractal Tess</a> | |
| 15 | ## <a href="https://github.com/fractal-tess" target=_blank>Fractal Tess</a>, <a href="https://github.com/msrd0" target=_blank>msrd0</a> | |
| 12 | 16 | |
| 13 | 17 | Fixed typos in README. |
docs/src/explaination/framework.md added +126
| @@ -0,0 +1,126 @@ | ||
| 1 | # Framework | |
| 2 | ||
| 3 | At the core of this TUI, is the framework from the <a href="https://crates.io/crates/tui-additions" target=_blank>`tui-additions`</a> crate, it allows the program to *render* onto the screen, *take inputs* (mouse and keyboard) in an orderly fashion. | |
| 4 | ||
| 5 | A <a href="https://docs.rs/tui-additions/latest/tui_additions/framework/struct.Framework.html" target=_blank>Framework</a> holds a bunch of other structs, a simplified version would looks something like this. | |
| 6 | ||
| 7 | ```rs | |
| 8 | struct Framework { | |
| 9 | state: Vec<Vec<Item>>, | |
| 10 | cursor: CursorState, | |
| 11 | selectables: Vec<Vec<(usize, usize)>>, | |
| 12 | data: FrameworkData, | |
| 13 | history: FrameworkHistory, | |
| 14 | } | |
| 15 | ``` | |
| 16 | ||
| 17 | ## State | |
| 18 | ||
| 19 | Holds a 2D array of items, but that is just the simplified version. | |
| 20 | ||
| 21 | The `State` struct also holds the width of the items, heigh of the rows, and other details such as *if the row should be centered or not*. | |
| 22 | ||
| 23 | ## Cursor | |
| 24 | ||
| 25 | The cursor can be in one of these states. | |
| 26 | ||
| 27 | - Selected - where an item is selected. | |
| 28 | - Hover - when its being moved around. | |
| 29 | - None - when the page first loads, the cursor does not have a state. | |
| 30 | ||
| 31 | ## Selectables | |
| 32 | ||
| 33 | This is an interesting one. As [mentioned below](#selectableself---bool), some items can be hovered when other cannot. Each `selectables[x][y]` maps to a selectable (hoverable) coordinate. | |
| 34 | ||
| 35 | Instead of using a `HashMap<(usize, usize)>`, using a 2D array ensures that all *x: 0..range* and *y: 0..range* are mapped to a selectable item. And moving the cursor left is as easy as increasing x by 1, without having to worry about selectability check and stuff. | |
| 36 | ||
| 37 | ## Data | |
| 38 | ||
| 39 | There are 2 sets of data available - *global* and *state*. | |
| 40 | ||
| 41 | **Global data** are global across all pages, this is mainly used to store config structs, as they are meant to be applied globally. | |
| 42 | ||
| 43 | **State data** are exclusive to each page, this is done to ensure that each page will get the correct data. | |
| 44 | ||
| 45 | > For example, if state data is not used, the next page will overwrite data in the previous page, making going back in history impossible. | |
| 46 | ||
| 47 | ## History | |
| 48 | ||
| 49 | This stores the past states and data of the struct, pretty self explanatory. | |
| 50 | ||
| 51 | <hr> | |
| 52 | ||
| 53 | ## Items | |
| 54 | ||
| 55 | Items are placed across the screen *in rows*, each item is <u>individual</u> and changing of one should not affect others in anyway. | |
| 56 | ||
| 57 |  | |
| 58 | ||
| 59 | > Diagram showing that individual items arranged in rows on screen. | |
| 60 | ||
| 61 | Each item has a set of functions from the trait <a href="https://docs.rs/tui-additions/latest/tui_additions/framework/trait.FrameworkItem.html" target=_blank>FrameworkItem</a>: | |
| 62 | ||
| 63 | ### .selectable(&self) -> bool | |
| 64 | ||
| 65 | The function is ran on page load, it determines whether *the item can be hovered by cursor or not*. | |
| 66 | ||
| 67 | Most item returns true, as they can be selected and hovered. | |
| 68 | ||
| 69 | However there are some exceptions, including MessageBar and the big info display in channel home page. | |
| 70 | ||
| 71 | > PageButtons returns true in this function, as they can be hovered by cursor. Instead, `.select()` is responsible for their special behaviour. | |
| 72 | ||
| 73 | ### .select(&mut self, &mut Framework) -> bool | |
| 74 | ||
| 75 | This function is ran when an item is selected (pressed enter on), it allows the item to modify its own state and the framework state. The returned boolean also determines if the selecting item will *stay selected* and capture key input. | |
| 76 | ||
| 77 | Most items returns true in this function, for example SearchBar stays selected and captures key input after being selected, until deselect. | |
| 78 | ||
| 79 | PageButtons returns false, as they don't want to say selected. This does not mean the function does nothing, they are still able to modify their own states and <u>push a LoadPage task to queue</u>. | |
| 80 | ||
| 81 | ### .deselect(&mut self, &mut Framework) -> bool | |
| 82 | ||
| 83 | This function is the exact opposite of the .select() function, it is called when the *deselect keybinding* (Esc) is pressed, or the mouse clicks somewhere outside the item. | |
| 84 | ||
| 85 | All items returns true on this function. | |
| 86 | ||
| 87 | > A fun fact is that items can actually return false, and refuse to get deselected. This can be useful when waiting for a condition to be met. | |
| 88 | ||
| 89 | ### .load_item(&mut self, &mut Framework, ...) -> Result | |
| 90 | ||
| 91 | This is the function responsible for the loading of items. The YouTube TUI adds an empty item to the screen, then calls this function for the item to load itself. | |
| 92 | ||
| 93 | An item that heavily rely on this function is ItemList, it loads video according to the current page, whether it's Library, History or Search. | |
| 94 | ||
| 95 | > Currently, this function can be very inefficient as items are loaded one after another (sync). This will improve once Rust implements async traits. | |
| 96 | ||
| 97 | Errors will be displayed in MessageBar in the next frame. | |
| 98 | ||
| 99 | ### .render(&mut self, &mut Framework, &mut Frame, area) | |
| 100 | ||
| 101 | Items should be able to render itself within `area` of `Frame`, the area is different for each item, and should not overlap. | |
| 102 | ||
| 103 | Each frame is rendered 2 times. | |
| 104 | ||
| 105 | 1. Render all normal items. | |
| 106 | 2. Render all popups, as they need to be above normal items. | |
| 107 | ||
| 108 | Normal items should not render in the popup render, for example: | |
| 109 | ||
| 110 | ```rs | |
| 111 | if popup_render { | |
| 112 | return; | |
| 113 | } | |
| 114 | ``` | |
| 115 | ||
| 116 | ### .key_event(&mut self, &mut Framework, KeyEvent) -> Result | |
| 117 | ||
| 118 | Pretty self explanatory, selected item takes in a key event and do some modification to itself and/or the Framework state. | |
| 119 | ||
| 120 | Errors will be displayed in MessageBar in the next frame. | |
| 121 | ||
| 122 | ### .mouse_event(&mut self, &mut Framework, x, y) -> bool | |
| 123 | ||
| 124 | Similar to key\_event, this function takes in the relative `x` and `y` of the mouse click on the item. | |
| 125 | ||
| 126 | The return boolean indicates if the item has been modified by the mouse click, if true then the screen will rerender. | |
docs/src/explaination/how_it_works.md added +7
| @@ -0,0 +1,7 @@ | ||
| 1 | # How it works | |
| 2 | ||
| 3 | This sections talks about roughly how this TUI works, *crates*, *important structs* and their location, and the *main event loop* will be mentioned. | |
| 4 | ||
| 5 | ## Table of contents | |
| 6 | ||
| 7 | - [Framework](./framework.md) talks about how a *single frame* is rendered, and how a *single input* is handled. | |
docs/src/framework.md deleted −20
| @@ -1,20 +0,0 @@ | ||
| 1 | # Framework | |
| 2 | ||
| 3 | At the core of this TUI, is the framework from the <a href="https://crates.io/crates/tui-additions" target=_blank>`tui-additions`</a> crate, it allows the program to *render* onto the screen, *take inputs* (mouse and keyboard) in an orderly fashion. | |
| 4 | ||
| 5 | ## Items | |
| 6 | ||
| 7 | Items are placed across the screen *in rows*, each item is <u>individual</u> and changing of one should not affect others in anyway. | |
| 8 | ||
| 9 | Each item has a set of funcitons (from the trait `FrameworkItem`), or handlers. | |
| 10 | ||
| 11 | |Function|Return type|Purpose| | |
| 12 | |---|---|---| | |
| 13 | |`selectable`|Boolean|Check if the item can be selected, and should the user be able to hover the cursor over the item.<br><br>(E.g. Message bar is not selectable)| | |
| 14 | |`render`|None|The item renders itself within a given area of the screen.| | |
| 15 | |`key_event`|Result|The item handles the keyboard input when it is selected, if an `Err(_)` is returned then the error will be displayed in the message bar.| | |
| 16 | |`mouse_event`|Boolean|The selected item handles the mouse click event when being clicked on.| | |
| 17 | ||
| 18 | Todo... | |
| 19 | ||
| 20 |  | |
docs/src/how_it_works.md deleted −10
| @@ -1,10 +0,0 @@ | ||
| 1 | # How it works | |
| 2 | ||
| 3 | This sections talks about roughly how this TUI works, *crates*, *important structs* and their location, and the *main event loop* will be mentioned. | |
| 4 | ||
| 5 | ## Table of contents | |
| 6 | ||
| 7 | - [Framework](framework.md) talks about how a *single frame* is rendered, and how a *single input* is handled. | |
| 8 | - [Invidious]() talks about how information from YouTube is retrieved. | |
| 9 | - [Important struct]() talks about how variables are stored across the program. | |
| 10 | - [The main event loop]() talks about how different parts of the program are chained together to function as is. | |
docs/src/installation.md +8 −9
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | # Installation |
| 2 | 2 | |
| 3 | It's about download (or building) the binary and putting them in an easily accessible location (like `/bin/`). | |
| 3 | > Currently YouTube TUI requires `libxcb`, which should come preinstalled in most Linux system. | |
| 4 | 4 | |
| 5 | The YouTube TUI is not tested for Windows. | |
| 5 | The YouTube TUI is *not* tested for Windows. | |
| 6 | 6 | |
| 7 | 7 | ## Install from Crates.io (recommended) |
| 8 | 8 | |
| 9 | Crates.io is a repository for programs written in Rust, and the YouTube TUI is avaliable <a href="https://crates.io/crates/youtube-tui" target=_blank>*there*</a>. | |
| 9 | Crates.io is a repository for programs written in Rust, and the YouTube TUI is available <a href="https://crates.io/crates/youtube-tui" target=_blank>*there*</a>. | |
| 10 | 10 | |
| 11 | 11 | To install using this method, you will need `rustc` and `cargo` present. <a href="https://www.rust-lang.org/tools/install" target=_blank>*Here*</a>'s a tutorial on how to get them. |
| 12 | 12 | |
| @@ -20,14 +20,15 @@ cargo install youtube-tui | ||
| 20 | 20 | |
| 21 | 21 | ## AUR for Arch Linux (recommended) |
| 22 | 22 | |
| 23 | The YouTube TUI is avaliable in the AUR <a href="https://aur.archlinux.org/packages/youtube-tui-git" target=_blank>*here*</a>. | |
| 23 | The YouTube TUI is available in the AUR <a href="https://aur.archlinux.org/packages/youtube-tui-git" target=_blank>*here*</a>. | |
| 24 | 24 | |
| 25 | 25 | Use an <a href="https://aur.archlinux.org" target=_blank>AUR</a> helper like <a href="https://aur.archlinux.org/packages/yay" target=_blank>`yay`</a> to install. |
| 26 | 26 | |
| 27 | 27 | ```sh |
| 28 | yay -S youtube-tui-git # replace `yay` with your AUR helper | |
| 29 | yay -S youtube-tui-full-bin # requires libsixel | |
| 30 | yay -S youtube-tui-nodefaults-bin | |
| 28 | yay -S youtube-tui # lastest crates.io release, recommended | |
| 29 | yay -S youtube-tui-git # latest git version, potentially untested | |
| 30 | yay -S youtube-tui-full-bin # default binary (out of date) | |
| 31 | yay -S youtube-tui-nodefaults-bin # minimal binary (out of date) | |
| 31 | 32 | ``` |
| 32 | 33 | |
| 33 | 34 | ## Build from source |
| @@ -71,5 +72,3 @@ Display images with Sixels, allows the display of images at full definition. Not | ||
| 71 | 72 | Enabling this will also enable `halfblock`. |
| 72 | 73 | |
| 73 | 74 | Requires <a href="https://github.com/saitoha/libsixel" target=_blank>`libsixel`</a>. |
| 74 | ||
| 75 | > `sixel` and `halfblock` does not compile on Windows. | |
src/config/commandbindings.rs +7 −7
| @@ -45,12 +45,8 @@ impl CommandBindings { | ||
| 45 | 45 | Page::MainMenu(MainMenuPage::History) => get_command(key, &self.watchhistory), |
| 46 | 46 | Page::MainMenu(MainMenuPage::Subscriptions) => get_command(key, &self.subscriptions), |
| 47 | 47 | Page::MainMenu(MainMenuPage::Library) => get_command(key, &self.libray), |
| 48 | Page::SingleItem(SingleItemPage::Video(_)) | |
| 49 | | Page::SingleItem(SingleItemPage::LocalVideo(_)) => get_command(key, &self.video), | |
| 50 | Page::SingleItem(SingleItemPage::Playlist(_)) | |
| 51 | | Page::SingleItem(SingleItemPage::LocalPlaylist(_)) => { | |
| 52 | get_command(key, &self.playlist) | |
| 53 | } | |
| 48 | Page::SingleItem(SingleItemPage::Video(_)) => get_command(key, &self.video), | |
| 49 | Page::SingleItem(SingleItemPage::Playlist(_)) => get_command(key, &self.playlist), | |
| 54 | 50 | Page::ChannelDisplay(ChannelDisplayPage { |
| 55 | 51 | r#type: ChannelDisplayPageType::Main, |
| 56 | 52 | .. |
| @@ -250,5 +246,9 @@ fn subscriptions_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> { | ||
| 250 | 246 | } |
| 251 | 247 | |
| 252 | 248 | fn library_default() -> HashMap<KeyCodeSerde, HashMap<u8, String>> { |
| 253 | HashMap::default() | |
| 249 | HashMap::from([ | |
| 250 | (KeyCodeSerde::Char('a'), HashMap::from([(2, String::from("run ${terminal-emulator} mpv '${hover-url}' --no-video"))])), | |
| 251 | (KeyCodeSerde::Char('A'), HashMap::from([(1, String::from("run ${terminal-emulator} mpv '${hover-url}' --no-video --loop-playlist=inf --shuffle"))])), | |
| 252 | (KeyCodeSerde::Char('p'), HashMap::from([(2, String::from("run mpv '${hover-url}'"))])) | |
| 253 | ]) | |
| 254 | 254 | } |
src/config/commands.rs +71 −61
| @@ -10,9 +10,9 @@ use crate::global::traits::ConfigTrait; | ||
| 10 | 10 | pub struct CommandsConfig { |
| 11 | 11 | pub launch_command: String, |
| 12 | 12 | pub video: Vec<(String, String)>, |
| 13 | pub saved_video: Vec<(String, String)>, | |
| 13 | 14 | pub playlist: Vec<(String, String)>, |
| 14 | pub local_video: Vec<(String, String)>, | |
| 15 | pub local_playlist: Vec<(String, String)>, | |
| 15 | pub saved_playlist: Vec<(String, String)>, | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | impl Key for CommandsConfig { |
| @@ -28,18 +28,18 @@ impl From<CommandsConfigSerde> for CommandsConfig { | ||
| 28 | 28 | .into_iter() |
| 29 | 29 | .map(|hashmap| hashmap.into_iter().last().unwrap()) |
| 30 | 30 | .collect(), |
| 31 | playlist: original | |
| 32 | .playlist | |
| 31 | saved_video: original | |
| 32 | .saved_video | |
| 33 | 33 | .into_iter() |
| 34 | 34 | .map(|hashmap| hashmap.into_iter().last().unwrap()) |
| 35 | 35 | .collect(), |
| 36 | local_video: original | |
| 37 | .local_video | |
| 36 | playlist: original | |
| 37 | .playlist | |
| 38 | 38 | .into_iter() |
| 39 | 39 | .map(|hashmap| hashmap.into_iter().last().unwrap()) |
| 40 | 40 | .collect(), |
| 41 | local_playlist: original | |
| 42 | .local_playlist | |
| 41 | saved_playlist: original | |
| 42 | .saved_playlist | |
| 43 | 43 | .into_iter() |
| 44 | 44 | .map(|hashmap| hashmap.into_iter().last().unwrap()) |
| 45 | 45 | .collect(), |
| @@ -55,12 +55,12 @@ pub struct CommandsConfigSerde { | ||
| 55 | 55 | pub launch_command: String, |
| 56 | 56 | #[serde(default = "video_default")] |
| 57 | 57 | pub video: Vec<HashMap<String, String>>, |
| 58 | #[serde(default = "saved_video_default")] | |
| 59 | pub saved_video: Vec<HashMap<String, String>>, | |
| 58 | 60 | #[serde(default = "playlist_default")] |
| 59 | 61 | pub playlist: Vec<HashMap<String, String>>, |
| 60 | #[serde(default = "local_video_default")] | |
| 61 | pub local_video: Vec<HashMap<String, String>>, | |
| 62 | #[serde(default = "local_playlist_default")] | |
| 63 | pub local_playlist: Vec<HashMap<String, String>>, | |
| 62 | #[serde(default = "saved_playlist_default")] | |
| 63 | pub saved_playlist: Vec<HashMap<String, String>>, | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | impl ConfigTrait for CommandsConfigSerde { |
| @@ -72,9 +72,9 @@ impl Default for CommandsConfigSerde { | ||
| 72 | 72 | Self { |
| 73 | 73 | launch_command: launch_command_default(), |
| 74 | 74 | video: video_default(), |
| 75 | saved_video: saved_video_default(), | |
| 75 | 76 | playlist: playlist_default(), |
| 76 | local_video: local_video_default(), | |
| 77 | local_playlist: local_playlist_default(), | |
| 77 | saved_playlist: saved_playlist_default(), | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
| @@ -83,11 +83,15 @@ impl Default for CommandsConfigSerde { | ||
| 83 | 83 | // Different pages may contain different `env`s (for example `url` is different in each page) |
| 84 | 84 | |
| 85 | 85 | fn launch_command_default() -> String { |
| 86 | String::from("loadpage watchhistory ;; flush ;; history clear") | |
| 86 | String::from("loadpage library ;; flush ;; history clear") | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | fn video_default() -> Vec<HashMap<String, String>> { |
| 90 | 90 | vec![ |
| 91 | HashMap::from([( | |
| 92 | String::from("Reload updated video"), | |
| 93 | String::from("run rm '~/.cache/youtube-tui/info/${id}.json' ;; video ${id}"), | |
| 94 | )]), | |
| 91 | 95 | HashMap::from([( |
| 92 | 96 | String::from("Play video"), |
| 93 | 97 | String::from("run ${video-player} '${embed-url}'"), |
| @@ -115,12 +119,12 @@ fn video_default() -> Vec<HashMap<String, String>> { | ||
| 115 | 119 | String::from("togglemark ${id}") |
| 116 | 120 | )]), |
| 117 | 121 | HashMap::from([( |
| 118 | String::from("Save video"), | |
| 119 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -o '${save-path}${id}/%(id)s'") | |
| 122 | String::from("Save video to library"), | |
| 123 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}.*' ;; run ${terminal-emulator} ${youtube-downloader} '${embed-url}' -o '${save-path}%(title)s[%(id)s].%(ext)s'") | |
| 120 | 124 | )]), |
| 121 | 125 | HashMap::from([( |
| 122 | String::from("Save audio"), | |
| 123 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -x -o '${save-path}${id}/%(id)s'") | |
| 126 | String::from("Save audio to library"), | |
| 127 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}.*' ;; run ${terminal-emulator} ${youtube-downloader} '${embed-url}' -x -o '${save-path}%(title)s[%(id)s].%(ext)s'") | |
| 124 | 128 | )]), |
| 125 | 129 | HashMap::from([( |
| 126 | 130 | String::from("Mode: ${provider}"), |
| @@ -129,24 +133,23 @@ fn video_default() -> Vec<HashMap<String, String>> { | ||
| 129 | 133 | ] |
| 130 | 134 | } |
| 131 | 135 | |
| 132 | fn playlist_default() -> Vec<HashMap<String, String>> { | |
| 136 | fn saved_video_default() -> Vec<HashMap<String, String>> { | |
| 133 | 137 | vec![ |
| 134 | HashMap::from([(String::from("Switch view"), String::from("%switch-view%"))]), | |
| 135 | 138 | HashMap::from([( |
| 136 | String::from("Reload as online mode"), | |
| 137 | String::from("playlist ${id}"), | |
| 139 | String::from("Reload updated video"), | |
| 140 | String::from("run rm '~/.cache/youtube-tui/info/${id}.json' ;; video ${id}"), | |
| 138 | 141 | )]), |
| 139 | 142 | HashMap::from([( |
| 140 | String::from("Play all videos"), | |
| 141 | String::from("run ${video-player} ${all-videos}"), | |
| 143 | String::from("[Offline] Play saved file"), | |
| 144 | String::from("run find ${save-path} | grep ${id} | ${video-player} --playlist=- --force-window"), | |
| 142 | 145 | )]), |
| 143 | 146 | HashMap::from([( |
| 144 | String::from("Play all audio"), | |
| 145 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video"), | |
| 147 | String::from("[Offline] Play saved file (audio)"), | |
| 148 | String::from("run ${terminal-emulator} bash -c 'find ${save-path} | grep ${id} | ${video-player} --playlist=- --no-video'"), | |
| 146 | 149 | )]), |
| 147 | 150 | HashMap::from([( |
| 148 | String::from("Shuffle play all audio (loop)"), | |
| 149 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video --shuffle --loop-playlist=inf"), | |
| 151 | String::from("[Offline] Play saved file (audio loop)"), | |
| 152 | String::from("run ${terminal-emulator} bash -c 'find ${save-path} | grep ${id} | ${video-player} --playlist=- --no-video --loop'"), | |
| 150 | 153 | )]), |
| 151 | 154 | HashMap::from([( |
| 152 | 155 | String::from("View channel"), |
| @@ -161,35 +164,38 @@ fn playlist_default() -> Vec<HashMap<String, String>> { | ||
| 161 | 164 | String::from("togglemark ${id}") |
| 162 | 165 | )]), |
| 163 | 166 | HashMap::from([( |
| 164 | String::from("Save all audio"), | |
| 165 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run mkdir '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -x -o '${save-path}${id}/%(id)s'") | |
| 167 | String::from("Redownload video to library"), | |
| 168 | String::from("bookmark ${id} ;; run rm ${save-path}*${id}*.* ;; run ${terminal-emulator} ${youtube-downloader} ${embed-url} -o '${save-path}%(title)s[%(id)s].%(ext)s'"), | |
| 166 | 169 | )]), |
| 167 | 170 | HashMap::from([( |
| 168 | String::from("Mode: ${provider}"), | |
| 169 | String::from("switchprovider"), | |
| 171 | String::from("Redownload audio to library"), | |
| 172 | String::from("bookmark ${id} ;; run rm ${save-path}*${id}*.* ;; run ${terminal-emulator} ${youtube-downloader} ${embed-url} -x -o '${save-path}%(title)s[%(id)s].%(ext)s'") | |
| 173 | )]), | |
| 174 | HashMap::from([( | |
| 175 | String::from("Delete saved file"), | |
| 176 | String::from("run rm ${save-path}*${id}*.*") | |
| 170 | 177 | )]), |
| 171 | 178 | ] |
| 172 | 179 | } |
| 173 | 180 | |
| 174 | fn local_video_default() -> Vec<HashMap<String, String>> { | |
| 181 | fn playlist_default() -> Vec<HashMap<String, String>> { | |
| 175 | 182 | vec![ |
| 183 | HashMap::from([(String::from("Switch view"), String::from("%switch-view%"))]), | |
| 176 | 184 | HashMap::from([( |
| 177 | String::from("Reload as online mode"), | |
| 178 | String::from("video ${id}"), | |
| 185 | String::from("Reload updated playlist"), | |
| 186 | String::from("run rm ~/.cache/youtube-tui/info/${id}.json ;; reload"), | |
| 179 | 187 | )]), |
| 180 | 188 | HashMap::from([( |
| 181 | String::from("Play video"), | |
| 182 | String::from("run ${video-player} '${embed-url}'"), | |
| 189 | String::from("Play all (videos)"), | |
| 190 | String::from("run ${video-player} ${all-videos}"), | |
| 183 | 191 | )]), |
| 184 | 192 | HashMap::from([( |
| 185 | String::from("Play audio"), | |
| 186 | String::from("run ${terminal-emulator} ${video-player} '${embed-url}' --no-video"), | |
| 193 | String::from("Play all (audio)"), | |
| 194 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video"), | |
| 187 | 195 | )]), |
| 188 | 196 | HashMap::from([( |
| 189 | String::from("Play audio (loop)"), | |
| 190 | String::from( | |
| 191 | "run ${terminal-emulator} ${video-player} '${embed-url}' --no-video --loop-file=inf", | |
| 192 | ), | |
| 197 | String::from("Shuffle play all (audio loop)"), | |
| 198 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video --shuffle --loop-playlist=inf"), | |
| 193 | 199 | )]), |
| 194 | 200 | HashMap::from([( |
| 195 | 201 | String::from("View channel"), |
| @@ -204,12 +210,12 @@ fn local_video_default() -> Vec<HashMap<String, String>> { | ||
| 204 | 210 | String::from("togglemark ${id}") |
| 205 | 211 | )]), |
| 206 | 212 | HashMap::from([( |
| 207 | String::from("Save video"), | |
| 208 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -o '${save-path}${id}/%(id)s'") | |
| 213 | String::from("Save playlist videos to library"), | |
| 214 | String::from("bookmark ${id} ;; run rm -rf '${save-path}*${id}*' ;; run ${terminal-emulator} bash -c \"${youtube-downloader} ${all-videos} -o '\"'${save-path}${title}[${id}]/%(title)s[%(id)s].%(ext)s'\"'\"") | |
| 209 | 215 | )]), |
| 210 | 216 | HashMap::from([( |
| 211 | String::from("Save audio"), | |
| 212 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -x -o '${save-path}${id}/%(id)s'") | |
| 217 | String::from("Save playlist audio to library"), | |
| 218 | String::from("bookmark ${id} ;; run rm -rf '${save-path}*${id}*' ;; run ${terminal-emulator} bash -c \"${youtube-downloader} ${all-videos} -x -o '\"'${save-path}${title}[${id}]/%(title)s[%(id)s].%(ext)s'\"'\"") | |
| 213 | 219 | )]), |
| 214 | 220 | HashMap::from([( |
| 215 | 221 | String::from("Mode: ${provider}"), |
| @@ -218,24 +224,24 @@ fn local_video_default() -> Vec<HashMap<String, String>> { | ||
| 218 | 224 | ] |
| 219 | 225 | } |
| 220 | 226 | |
| 221 | fn local_playlist_default() -> Vec<HashMap<String, String>> { | |
| 227 | fn saved_playlist_default() -> Vec<HashMap<String, String>> { | |
| 222 | 228 | vec![ |
| 223 | 229 | HashMap::from([(String::from("Switch view"), String::from("%switch-view%"))]), |
| 224 | 230 | HashMap::from([( |
| 225 | String::from("Reload as online mode"), | |
| 226 | String::from("playlist ${id}"), | |
| 231 | String::from("Reload updated playlist"), | |
| 232 | String::from("run rm ~/.cache/youtube-tui/info/${id}.json ;; reload"), | |
| 227 | 233 | )]), |
| 228 | 234 | HashMap::from([( |
| 229 | String::from("Play all videos"), | |
| 230 | String::from("run ${video-player} ${all-videos}"), | |
| 235 | String::from("[Offline] Play all (videos)"), | |
| 236 | String::from("run find ${save-path} | grep ${id} | ${video-player} --playlist=- --force-window"), | |
| 231 | 237 | )]), |
| 232 | 238 | HashMap::from([( |
| 233 | String::from("Play all audio"), | |
| 234 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video"), | |
| 239 | String::from("[Offline] Play all (audio)"), | |
| 240 | String::from("run ${terminal-emulator} bash -c 'find ${save-path} | grep ${id} | ${video-player} --playlist=- --no-video'"), | |
| 235 | 241 | )]), |
| 236 | 242 | HashMap::from([( |
| 237 | String::from("Shuffle play all audio (loop)"), | |
| 238 | String::from("run ${terminal-emulator} ${video-player} ${all-videos} --no-video --shuffle --loop-playlist=inf"), | |
| 243 | String::from("[Offline] Shuffle play all (audio loop)"), | |
| 244 | String::from("run ${terminal-emulator} bash -c 'find ${save-path} | grep ${id} | ${video-player} --playlist=- --no-video --loop-playlist=inf'"), | |
| 239 | 245 | )]), |
| 240 | 246 | HashMap::from([( |
| 241 | 247 | String::from("View channel"), |
| @@ -250,12 +256,16 @@ fn local_playlist_default() -> Vec<HashMap<String, String>> { | ||
| 250 | 256 | String::from("togglemark ${id}") |
| 251 | 257 | )]), |
| 252 | 258 | HashMap::from([( |
| 253 | String::from("Save all audio"), | |
| 254 | String::from("bookmark ${id} ;; run rm -rf '${save-path}${id}' ;; run mkdir '${save-path}${id}' ;; run ${terminal-emulator} ${youtube-downloader} ${all-videos} -x -o '${save-path}${id}/%(id)s'") | |
| 259 | String::from("Redownload playlist videos to library"), | |
| 260 | String::from("bookmark ${id} ;; run rm -rf ${save-path}*${id}* ;; run ${terminal-emulator} bash -c \"${youtube-downloader} ${all-videos} -o '\"'${save-path}${title}[${id}]/%(title)s[%(id)s].%(ext)s'\"'\"") | |
| 255 | 261 | )]), |
| 256 | 262 | HashMap::from([( |
| 257 | String::from("Mode: ${provider}"), | |
| 258 | String::from("switchprovider"), | |
| 263 | String::from("Redownload playlist audio to library"), | |
| 264 | String::from("bookmark ${id} ;; run rm -rf ${save-path}*${id}* ;; run ${terminal-emulator} bash -c \"${youtube-downloader} ${all-videos} -x -o '\"'${save-path}${title}[${id}]/%(title)s[%(id)s].%(ext)s'\"'\"") | |
| 265 | )]), | |
| 266 | HashMap::from([( | |
| 267 | String::from("Delete saved files"), | |
| 268 | String::from("run rm -rf ${save-path}*${id}*") | |
| 259 | 269 | )]), |
| 260 | 270 | ] |
| 261 | 271 | } |
src/global/functions/mod.rs +2
| @@ -25,3 +25,5 @@ mod update_provider; | ||
| 25 | 25 | pub use update_provider::*; |
| 26 | 26 | mod init_move; |
| 27 | 27 | pub use init_move::*; |
| 28 | mod singleitem_load; | |
| 29 | pub use singleitem_load::*; | |
src/global/functions/run_command.rs +1 −1
| @@ -76,7 +76,7 @@ pub fn run_single_command( | ||
| 76 | 76 | let _ = library.push(item, None); |
| 77 | 77 | let _ = library.save(); |
| 78 | 78 | *framework.data.global.get_mut::<Message>().unwrap() = |
| 79 | Message::Success(String::from("Item bookmarked")) | |
| 79 | Message::Success(String::from("Bookmark added")) | |
| 80 | 80 | } |
| 81 | 81 | Err(e) => { |
| 82 | 82 | *framework.data.global.get_mut::<Message>().unwrap() = |
src/global/functions/singleitem_load.rs added +39
| @@ -0,0 +1,39 @@ | ||
| 1 | use std::error::Error; | |
| 2 | ||
| 3 | use invidious::reqwest::blocking::Client; | |
| 4 | ||
| 5 | use crate::{config::MainConfig, global::structs::Item}; | |
| 6 | ||
| 7 | use super::download_all_images; | |
| 8 | ||
| 9 | pub fn load_playlist( | |
| 10 | client: &Client, | |
| 11 | id: &str, | |
| 12 | mainconfig: &MainConfig, | |
| 13 | ) -> Result<Item, Box<dyn Error>> { | |
| 14 | let playlist = Item::from_full_playlist(client.playlist(id, None)?, mainconfig.image_index); | |
| 15 | let videos = &playlist.fullplaylist()?.videos; | |
| 16 | ||
| 17 | if mainconfig.images.display() { | |
| 18 | download_all_images({ | |
| 19 | let mut items = videos.iter().map(|item| item.into()).collect::<Vec<_>>(); | |
| 20 | items.extend([(&playlist).into()].into_iter()); | |
| 21 | items | |
| 22 | }); | |
| 23 | } | |
| 24 | ||
| 25 | Ok(playlist) | |
| 26 | } | |
| 27 | ||
| 28 | pub fn load_video( | |
| 29 | client: &Client, | |
| 30 | id: &str, | |
| 31 | mainconfig: &MainConfig, | |
| 32 | ) -> Result<Item, Box<dyn Error>> { | |
| 33 | let video = Item::from_full_video(client.video(id, None)?, mainconfig.image_index); | |
| 34 | if mainconfig.images.display() { | |
| 35 | download_all_images(vec![(&video).into()]); | |
| 36 | } | |
| 37 | ||
| 38 | Ok(video) | |
| 39 | } | |
src/global/functions/update_provider.rs +2 −4
| @@ -90,8 +90,7 @@ pub fn update_provider(data: &mut FrameworkData) { | ||
| 90 | 90 | } |
| 91 | 91 | }, |
| 92 | 92 | )], |
| 93 | Page::SingleItem(SingleItemPage::Video(id)) | |
| 94 | | Page::SingleItem(SingleItemPage::LocalVideo(id)) => vec![ | |
| 93 | Page::SingleItem(SingleItemPage::Video(id)) => vec![ | |
| 95 | 94 | ( |
| 96 | 95 | String::from("url"), |
| 97 | 96 | match status.provider { |
| @@ -127,8 +126,7 @@ pub fn update_provider(data: &mut FrameworkData) { | ||
| 127 | 126 | }, |
| 128 | 127 | ), |
| 129 | 128 | ], |
| 130 | Page::SingleItem(SingleItemPage::Playlist(id)) | |
| 131 | | Page::SingleItem(SingleItemPage::LocalPlaylist(id)) => vec![ | |
| 129 | Page::SingleItem(SingleItemPage::Playlist(id)) => vec![ | |
| 132 | 130 | ( |
| 133 | 131 | String::from("url"), |
| 134 | 132 | match status.provider { |
src/global/structs/message.rs +5 −1
| @@ -2,7 +2,7 @@ use typemap::Key; | ||
| 2 | 2 | |
| 3 | 3 | /// Messages in the message bar |
| 4 | 4 | // is stored in `data.global` |
| 5 | #[derive(Clone)] | |
| 5 | #[derive(Clone, PartialEq, Eq)] | |
| 6 | 6 | pub enum Message { |
| 7 | 7 | Message(String), |
| 8 | 8 | Error(String), |
| @@ -22,4 +22,8 @@ impl Message { | ||
| 22 | 22 | Self::None => default.to_string(), |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | ||
| 26 | pub fn is_none(&self) -> bool { | |
| 27 | self == &Self::None | |
| 28 | } | |
| 25 | 29 | } |
src/global/structs/page.rs −2
| @@ -81,8 +81,6 @@ pub enum ChannelDisplayPageType { | ||
| 81 | 81 | /// Different items to be displayed on a single item page |
| 82 | 82 | #[derive(Clone, PartialEq, Eq)] |
| 83 | 83 | pub enum SingleItemPage { |
| 84 | LocalVideo(String), | |
| 85 | LocalPlaylist(String), | |
| 86 | 84 | Video(String), |
| 87 | 85 | Playlist(String), |
| 88 | 86 | } |
src/global/structs/tasks.rs +13 −5
| @@ -76,7 +76,7 @@ impl TaskQueue { | ||
| 76 | 76 | |
| 77 | 77 | /// runs all tasks in a task queue |
| 78 | 78 | pub fn run( |
| 79 | self, | |
| 79 | mut self, | |
| 80 | 80 | framework: &mut Framework, |
| 81 | 81 | terminal: &mut Terminal<CrosstermBackend<Stdout>>, |
| 82 | 82 | ) -> Result<(), Box<dyn Error>> { |
| @@ -139,8 +139,10 @@ impl TaskQueue { | ||
| 139 | 139 | } else { |
| 140 | 140 | Message::None |
| 141 | 141 | }; |
| 142 | update_provider(&mut framework.data); | |
| 143 | Self::render(framework, terminal)?; | |
| 142 | let status = framework.data.global.get_mut::<Status>().unwrap(); | |
| 143 | status.provider_updated = true; | |
| 144 | status.render_image = true; | |
| 145 | self.render = RenderTask::All; | |
| 144 | 146 | } |
| 145 | 147 | |
| 146 | 148 | if self.reload { |
| @@ -168,8 +170,10 @@ impl TaskQueue { | ||
| 168 | 170 | } else { |
| 169 | 171 | Message::None |
| 170 | 172 | }; |
| 171 | update_provider(&mut framework.data); | |
| 172 | Self::render(framework, terminal)?; | |
| 173 | let status = framework.data.global.get_mut::<Status>().unwrap(); | |
| 174 | status.provider_updated = true; | |
| 175 | status.render_image = true; | |
| 176 | self.render = RenderTask::All; | |
| 173 | 177 | } |
| 174 | 178 | |
| 175 | 179 | match self.render { |
| @@ -183,6 +187,10 @@ impl TaskQueue { | ||
| 183 | 187 | RenderTask::None => {} |
| 184 | 188 | } |
| 185 | 189 | |
| 190 | if framework.data.global.get::<Status>().unwrap().provider_updated { | |
| 191 | update_provider(&mut framework.data); | |
| 192 | } | |
| 193 | ||
| 186 | 194 | Ok(()) |
| 187 | 195 | } |
| 188 | 196 | |
src/items/itemlist.rs +2 −2
| @@ -137,11 +137,11 @@ impl ItemList { | ||
| 137 | 137 | match &self.items[self.textlist.selected] { |
| 138 | 138 | Item::MiniVideo(MiniVideoItem { id, .. }) |
| 139 | 139 | | Item::FullVideo(FullVideoItem { id, .. }) => { |
| 140 | Some(Page::SingleItem(SingleItemPage::LocalVideo(id.clone()))) | |
| 140 | Some(Page::SingleItem(SingleItemPage::Video(id.clone()))) | |
| 141 | 141 | } |
| 142 | 142 | Item::MiniPlaylist(MiniPlaylistItem { id, .. }) |
| 143 | 143 | | Item::FullPlaylist(FullPlaylistItem { id, .. }) => { |
| 144 | Some(Page::SingleItem(SingleItemPage::LocalPlaylist(id.clone()))) | |
| 144 | Some(Page::SingleItem(SingleItemPage::Playlist(id.clone()))) | |
| 145 | 145 | } |
| 146 | 146 | Item::MiniChannel(MiniChannelItem { id: _id, .. }) |
| 147 | 147 | | Item::FullChannel(FullChannelItem { id: _id, .. }) => todo!(), |
src/items/pagebutton.rs +7 −7
| @@ -55,11 +55,11 @@ impl PageButton { | ||
| 55 | 55 | _ => {} |
| 56 | 56 | } |
| 57 | 57 | } else if *self == Self::Subscriptions || *self == Self::Library { |
| 58 | match page { | |
| 59 | Page::MainMenu(MainMenuPage::Subscriptions) => *self = Self::Subscriptions, | |
| 60 | Page::MainMenu(MainMenuPage::Library) => *self = Self::Library, | |
| 61 | _ => {} | |
| 62 | } | |
| 58 | // match page { | |
| 59 | // Page::MainMenu(MainMenuPage::Subscriptions) => *self = Self::Subscriptions, | |
| 60 | // Page::MainMenu(MainMenuPage::Library) => *self = Self::Library, | |
| 61 | // _ => {} | |
| 62 | // } | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | } |
| @@ -131,8 +131,8 @@ impl FrameworkItem for PageButton { | ||
| 131 | 131 | match self { |
| 132 | 132 | Self::Trending => *self = Self::Popular, |
| 133 | 133 | Self::Popular => *self = Self::Trending, |
| 134 | Self::Subscriptions => *self = Self::Library, | |
| 135 | Self::Library => *self = Self::Subscriptions, | |
| 134 | // Self::Subscriptions => *self = Self::Library, | |
| 135 | // Self::Library => *self = Self::Subscriptions, | |
| 136 | 136 | _ => { |
| 137 | 137 | *framework.data.global.get_mut::<Message>().unwrap() = |
| 138 | 138 | Message::Message(String::from("You are already on this page")); |
src/items/singleitem.rs +116 −106
| @@ -4,7 +4,7 @@ use super::ItemInfo; | ||
| 4 | 4 | use crate::{ |
| 5 | 5 | config::{AppearanceConfig, CommandsConfig, KeyBindingsConfig, MainConfig, Provider}, |
| 6 | 6 | global::{ |
| 7 | functions::{apply_envs, download_all_images, set_envs}, | |
| 7 | functions::{apply_envs, load_playlist, load_video, set_envs}, | |
| 8 | 8 | structs::{ |
| 9 | 9 | InvidiousClient, Item, KeyAction, Message, Page, SingleItemPage, StateEnvs, Status, |
| 10 | 10 | Task, Tasks, WatchHistory, |
| @@ -16,6 +16,7 @@ use home::home_dir; | ||
| 16 | 16 | use tui::{ |
| 17 | 17 | layout::{Constraint, Rect}, |
| 18 | 18 | style::Style, |
| 19 | widgets::{Block, Borders}, | |
| 19 | 20 | }; |
| 20 | 21 | use tui_additions::{ |
| 21 | 22 | framework::{FrameworkClean, FrameworkItem}, |
| @@ -70,26 +71,34 @@ pub struct SinglePlaylistItem { | ||
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 73 | impl SingleVideoItem { |
| 73 | pub fn new(commands: &CommandsConfig) -> Self { | |
| 74 | Self::new_with_map( | |
| 75 | commands | |
| 76 | .video | |
| 77 | .clone() | |
| 78 | .into_iter() | |
| 79 | .map(|(display, command)| (display, command)) | |
| 80 | .collect(), | |
| 81 | ) | |
| 82 | } | |
| 83 | ||
| 84 | pub fn new_local(commands: &CommandsConfig) -> Self { | |
| 85 | Self::new_with_map( | |
| 86 | commands | |
| 87 | .local_video | |
| 88 | .clone() | |
| 89 | .into_iter() | |
| 90 | .map(|(display, command)| (display, command)) | |
| 91 | .collect(), | |
| 92 | ) | |
| 74 | pub fn new(commands: &CommandsConfig, mainconfig: &MainConfig, id: &str) -> Self { | |
| 75 | let saved = (|| -> Option<()> { | |
| 76 | fs::read_dir(home_dir().unwrap().join(mainconfig.env.get("save-path")?.replacen("~/", "", 1))) | |
| 77 | .ok()? | |
| 78 | .filter_map(|entry| Some(entry.ok()?.path().file_stem()?.to_os_string())) | |
| 79 | .find(|stem| stem.as_os_str().to_str().unwrap_or_default().contains(id))?; | |
| 80 | Some(()) | |
| 81 | })() | |
| 82 | .is_some(); | |
| 83 | if saved { | |
| 84 | Self::new_with_map( | |
| 85 | commands | |
| 86 | .saved_video | |
| 87 | .clone() | |
| 88 | .into_iter() | |
| 89 | .map(|(display, command)| (display, command)) | |
| 90 | .collect(), | |
| 91 | ) | |
| 92 | } else { | |
| 93 | Self::new_with_map( | |
| 94 | commands | |
| 95 | .video | |
| 96 | .clone() | |
| 97 | .into_iter() | |
| 98 | .map(|(display, command)| (display, command)) | |
| 99 | .collect(), | |
| 100 | ) | |
| 101 | } | |
| 93 | 102 | } |
| 94 | 103 | |
| 95 | 104 | pub fn new_with_map(commands: Vec<(String, String)>) -> Self { |
| @@ -169,6 +178,7 @@ impl SingleVideoItem { | ||
| 169 | 178 | }, |
| 170 | 179 | ), |
| 171 | 180 | (String::from("channel-id"), video_item.channel_id.clone()), |
| 181 | (String::from("title"), video_item.title.clone()), | |
| 172 | 182 | ( |
| 173 | 183 | String::from("channel-url"), |
| 174 | 184 | match status.provider { |
| @@ -186,28 +196,36 @@ impl SingleVideoItem { | ||
| 186 | 196 | } |
| 187 | 197 | |
| 188 | 198 | impl SinglePlaylistItem { |
| 189 | pub fn new(commands: &CommandsConfig, playlist_items: &[Item]) -> Self { | |
| 190 | Self::new_with_map( | |
| 191 | commands | |
| 192 | .playlist | |
| 193 | .clone() | |
| 194 | .into_iter() | |
| 195 | .map(|(display, command)| (display, command)) | |
| 196 | .collect(), | |
| 197 | playlist_items, | |
| 198 | ) | |
| 199 | } | |
| 200 | ||
| 201 | pub fn new_local(commands: &CommandsConfig, playlist_items: &[Item]) -> Self { | |
| 202 | Self::new_with_map( | |
| 203 | commands | |
| 204 | .local_playlist | |
| 205 | .clone() | |
| 206 | .into_iter() | |
| 207 | .map(|(display, command)| (display, command)) | |
| 208 | .collect(), | |
| 209 | playlist_items, | |
| 210 | ) | |
| 199 | pub fn new(commands: &CommandsConfig, mainconfig: &MainConfig ,id: &str, playlist_items: &[Item]) -> Self { | |
| 200 | let saved = (|| -> Option<()> { | |
| 201 | fs::read_dir(home_dir().unwrap().join(mainconfig.env.get("save-path")?.replacen("~/", "", 1))) | |
| 202 | .ok()? | |
| 203 | .filter_map(|entry| Some(entry.ok()?.path().file_stem()?.to_os_string())) | |
| 204 | .find(|stem| stem.as_os_str().to_str().unwrap_or_default().contains(id))?; | |
| 205 | Some(()) | |
| 206 | })() | |
| 207 | .is_some(); | |
| 208 | if saved { | |
| 209 | Self::new_with_map( | |
| 210 | commands | |
| 211 | .saved_playlist | |
| 212 | .clone() | |
| 213 | .into_iter() | |
| 214 | .map(|(display, command)| (display, command)) | |
| 215 | .collect(), | |
| 216 | playlist_items, | |
| 217 | ) | |
| 218 | } else { | |
| 219 | Self::new_with_map( | |
| 220 | commands | |
| 221 | .playlist | |
| 222 | .clone() | |
| 223 | .into_iter() | |
| 224 | .map(|(display, command)| (display, command)) | |
| 225 | .collect(), | |
| 226 | playlist_items, | |
| 227 | ) | |
| 228 | } | |
| 211 | 229 | } |
| 212 | 230 | |
| 213 | 231 | pub fn new_with_map(commands: Vec<(String, String)>, playlist_items: &[Item]) -> Self { |
| @@ -311,6 +329,7 @@ impl SinglePlaylistItem { | ||
| 311 | 329 | vec![ |
| 312 | 330 | (String::from("id"), playlist_item.id.clone()), |
| 313 | 331 | (String::from("channel-id"), playlist_item.channel_id.clone()), |
| 332 | (String::from("title"), playlist_item.title.clone()), | |
| 314 | 333 | ( |
| 315 | 334 | String::from("all-ids"), |
| 316 | 335 | playlist_item |
| @@ -526,6 +545,18 @@ impl FrameworkItem for SingleItem { | ||
| 526 | 545 | return; |
| 527 | 546 | } |
| 528 | 547 | |
| 548 | let appearance = framework.data.global.get::<AppearanceConfig>().unwrap(); | |
| 549 | ||
| 550 | if self.item.is_none() { | |
| 551 | frame.render_widget( | |
| 552 | Block::default() | |
| 553 | .borders(Borders::ALL) | |
| 554 | .border_type(appearance.borders), | |
| 555 | area, | |
| 556 | ); | |
| 557 | return; | |
| 558 | } | |
| 559 | ||
| 529 | 560 | if status.provider_updated { |
| 530 | 561 | set_envs( |
| 531 | 562 | self.infalte_item_update( |
| @@ -537,18 +568,12 @@ impl FrameworkItem for SingleItem { | ||
| 537 | 568 | ); |
| 538 | 569 | } |
| 539 | 570 | |
| 540 | let appearance = framework.data.global.get::<AppearanceConfig>().unwrap(); | |
| 541 | 571 | self.update_appearance(appearance, &info); |
| 542 | 572 | |
| 543 | 573 | let chunks = self.grid.chunks(area).unwrap()[0].clone(); |
| 544 | 574 | |
| 545 | 575 | frame.render_widget(self.grid.clone(), area); |
| 546 | 576 | |
| 547 | // only continue if `self.item` is Some | |
| 548 | if self.item.is_none() { | |
| 549 | return; | |
| 550 | } | |
| 551 | ||
| 552 | 577 | match &mut self.r#type { |
| 553 | 578 | SingleItemType::Video(typeinfo) => { |
| 554 | 579 | // 2 by 1 grid, item info in the first cell and textlist at the second |
| @@ -634,74 +659,59 @@ impl FrameworkItem for SingleItem { | ||
| 634 | 659 | let mainconfig = framework.data.global.get::<MainConfig>().unwrap(); |
| 635 | 660 | // load items using the invidious api |
| 636 | 661 | // gets the item that it needs to load from `data.state.Page` |
| 637 | self.item = match r#type { | |
| 662 | let (item, r#type) = match r#type { | |
| 638 | 663 | SingleItemPage::Video(id) => { |
| 639 | let client = &framework.data.global.get::<InvidiousClient>().unwrap().0; | |
| 640 | self.r#type = SingleItemType::Video(SingleVideoItem::new( | |
| 641 | framework.data.global.get::<CommandsConfig>().unwrap(), | |
| 642 | )); | |
| 643 | let video = Item::from_full_video(client.video(id, None)?, mainconfig.image_index); | |
| 644 | if mainconfig.images.display() { | |
| 645 | download_all_images(vec![(&video).into()]); | |
| 646 | } | |
| 647 | Some(video) | |
| 648 | } | |
| 649 | SingleItemPage::Playlist(id) => { | |
| 650 | let client = &framework.data.global.get::<InvidiousClient>().unwrap().0; | |
| 651 | let playlist = | |
| 652 | Item::from_full_playlist(client.playlist(id, None)?, mainconfig.image_index); | |
| 653 | let videos = &playlist.fullplaylist()?.videos; | |
| 654 | self.r#type = SingleItemType::Playlist( | |
| 655 | SinglePlaylistItem::new( | |
| 656 | framework.data.global.get::<CommandsConfig>().unwrap(), | |
| 657 | videos, | |
| 658 | ) | |
| 659 | .into(), | |
| 660 | ); | |
| 661 | ||
| 662 | if mainconfig.images.display() { | |
| 663 | download_all_images({ | |
| 664 | let mut items = videos.iter().map(|item| item.into()).collect::<Vec<_>>(); | |
| 665 | items.extend([(&playlist).into()].into_iter()); | |
| 666 | items | |
| 667 | }); | |
| 668 | } | |
| 664 | let home_dir = home_dir().unwrap(); | |
| 665 | let path = home_dir.join(format!(".cache/youtube-tui/info/{id}.json")); | |
| 669 | 666 | |
| 670 | Some(playlist) | |
| 671 | } | |
| 672 | SingleItemPage::LocalVideo(id) => { | |
| 673 | let s = fs::read_to_string( | |
| 674 | home_dir() | |
| 675 | .unwrap() | |
| 676 | .join(format!(".cache/youtube-tui/info/{id}.json")), | |
| 677 | )?; | |
| 678 | self.r#type = SingleItemType::Video(SingleVideoItem::new_local( | |
| 679 | framework.data.global.get::<CommandsConfig>().unwrap(), | |
| 680 | )); | |
| 681 | ||
| 682 | Some(serde_json::from_str(&s)?) | |
| 667 | let video = if path.exists() { | |
| 668 | serde_json::from_str(&fs::read_to_string(path)?)? | |
| 669 | } else { | |
| 670 | load_video( | |
| 671 | &framework.data.global.get::<InvidiousClient>().unwrap().0, | |
| 672 | id, | |
| 673 | mainconfig, | |
| 674 | )? | |
| 675 | }; | |
| 676 | ( | |
| 677 | video, | |
| 678 | SingleItemType::Video(SingleVideoItem::new( | |
| 679 | framework.data.global.get::<CommandsConfig>().unwrap(), | |
| 680 | mainconfig, | |
| 681 | id, | |
| 682 | )), | |
| 683 | ) | |
| 683 | 684 | } |
| 685 | SingleItemPage::Playlist(id) => { | |
| 686 | let path = home_dir() | |
| 687 | .unwrap() | |
| 688 | .join(format!(".cache/youtube-tui/info/{id}.json")); | |
| 684 | 689 | |
| 685 | SingleItemPage::LocalPlaylist(id) => { | |
| 686 | let s = fs::read_to_string( | |
| 687 | home_dir() | |
| 688 | .unwrap() | |
| 689 | .join(format!(".cache/youtube-tui/info/{id}.json")), | |
| 690 | )?; | |
| 691 | ||
| 692 | let playlist: Item = serde_json::from_str(&s)?; | |
| 693 | let videos = &playlist.fullplaylist()?.videos; | |
| 694 | self.r#type = SingleItemType::Playlist( | |
| 695 | SinglePlaylistItem::new_local( | |
| 690 | let playlist = if path.exists() { | |
| 691 | serde_json::from_str(&fs::read_to_string(path)?)? | |
| 692 | } else { | |
| 693 | load_playlist( | |
| 694 | &framework.data.global.get::<InvidiousClient>().unwrap().0, | |
| 695 | id, | |
| 696 | mainconfig, | |
| 697 | )? | |
| 698 | }; | |
| 699 | let r#type = SingleItemType::Playlist( | |
| 700 | SinglePlaylistItem::new( | |
| 696 | 701 | framework.data.global.get::<CommandsConfig>().unwrap(), |
| 697 | videos, | |
| 702 | mainconfig, | |
| 703 | id, | |
| 704 | &playlist.fullplaylist().unwrap().videos, | |
| 698 | 705 | ) |
| 699 | 706 | .into(), |
| 700 | 707 | ); |
| 701 | 708 | |
| 702 | Some(playlist) | |
| 709 | (playlist, r#type) | |
| 703 | 710 | } |
| 704 | 711 | }; |
| 712 | ||
| 713 | self.item = Some(item); | |
| 714 | self.r#type = r#type; | |
| 705 | 715 | self.iteminfo.item = self.item.clone(); |
| 706 | 716 | |
| 707 | 717 | if let Some(item) = &self.item { |