Commit 1006d44655

1006d44655e414f45910e4ec26c3030fddc96fa9

parent: 6b52ccce6c

Unsigned

Siriusmart <71584876+Siriusmart@users.noreply.github.com> · 2023-02-26 13:13 UTC

offline library

Layout: unified · split

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