Commit 05e733814a
Unsigned
Layout: unified · split
Cargo.lock +272 −237
| @@ -8,15 +8,6 @@ version = "1.0.2" | ||
| 8 | 8 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 9 | 9 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" |
| 10 | 10 | |
| 11 | [[package]] | |
| 12 | name = "aho-corasick" | |
| 13 | version = "0.5.3" | |
| 14 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 15 | checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" | |
| 16 | dependencies = [ | |
| 17 | "memchr 0.1.11", | |
| 18 | ] | |
| 19 | ||
| 20 | 11 | [[package]] |
| 21 | 12 | name = "android_system_properties" |
| 22 | 13 | version = "0.1.5" |
| @@ -43,9 +34,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" | ||
| 43 | 34 | |
| 44 | 35 | [[package]] |
| 45 | 36 | name = "base64" |
| 46 | version = "0.13.0" | |
| 37 | version = "0.13.1" | |
| 47 | 38 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 48 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" | |
| 39 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" | |
| 49 | 40 | |
| 50 | 41 | [[package]] |
| 51 | 42 | name = "bit_field" |
| @@ -61,9 +52,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" | ||
| 61 | 52 | |
| 62 | 53 | [[package]] |
| 63 | 54 | name = "bumpalo" |
| 64 | version = "3.11.0" | |
| 55 | version = "3.11.1" | |
| 65 | 56 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 66 | checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" | |
| 57 | checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" | |
| 67 | 58 | |
| 68 | 59 | [[package]] |
| 69 | 60 | name = "bytemuck" |
| @@ -110,7 +101,17 @@ dependencies = [ | ||
| 110 | 101 | "iana-time-zone", |
| 111 | 102 | "num-integer", |
| 112 | 103 | "num-traits", |
| 113 | "winapi 0.3.9", | |
| 104 | "winapi", | |
| 105 | ] | |
| 106 | ||
| 107 | [[package]] | |
| 108 | name = "codespan-reporting" | |
| 109 | version = "0.11.1" | |
| 110 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 111 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" | |
| 112 | dependencies = [ | |
| 113 | "termcolor", | |
| 114 | "unicode-width", | |
| 114 | 115 | ] |
| 115 | 116 | |
| 116 | 117 | [[package]] |
| @@ -121,15 +122,15 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" | ||
| 121 | 122 | |
| 122 | 123 | [[package]] |
| 123 | 124 | name = "console" |
| 124 | version = "0.15.1" | |
| 125 | version = "0.15.2" | |
| 125 | 126 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 126 | checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" | |
| 127 | checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" | |
| 127 | 128 | dependencies = [ |
| 128 | 129 | "encode_unicode", |
| 130 | "lazy_static", | |
| 129 | 131 | "libc", |
| 130 | "once_cell", | |
| 131 | 132 | "terminal_size", |
| 132 | "winapi 0.3.9", | |
| 133 | "winapi", | |
| 133 | 134 | ] |
| 134 | 135 | |
| 135 | 136 | [[package]] |
| @@ -180,42 +181,24 @@ dependencies = [ | ||
| 180 | 181 | |
| 181 | 182 | [[package]] |
| 182 | 183 | name = "crossbeam-epoch" |
| 183 | version = "0.9.10" | |
| 184 | version = "0.9.11" | |
| 184 | 185 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 185 | checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" | |
| 186 | checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" | |
| 186 | 187 | dependencies = [ |
| 187 | 188 | "autocfg", |
| 188 | 189 | "cfg-if", |
| 189 | 190 | "crossbeam-utils", |
| 190 | 191 | "memoffset", |
| 191 | "once_cell", | |
| 192 | 192 | "scopeguard", |
| 193 | 193 | ] |
| 194 | 194 | |
| 195 | 195 | [[package]] |
| 196 | 196 | name = "crossbeam-utils" |
| 197 | version = "0.8.11" | |
| 197 | version = "0.8.12" | |
| 198 | 198 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 199 | checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" | |
| 199 | checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" | |
| 200 | 200 | dependencies = [ |
| 201 | 201 | "cfg-if", |
| 202 | "once_cell", | |
| 203 | ] | |
| 204 | ||
| 205 | [[package]] | |
| 206 | name = "crossterm" | |
| 207 | version = "0.23.2" | |
| 208 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 209 | checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" | |
| 210 | dependencies = [ | |
| 211 | "bitflags", | |
| 212 | "crossterm_winapi", | |
| 213 | "libc", | |
| 214 | "mio", | |
| 215 | "parking_lot", | |
| 216 | "signal-hook", | |
| 217 | "signal-hook-mio", | |
| 218 | "winapi 0.3.9", | |
| 219 | 202 | ] |
| 220 | 203 | |
| 221 | 204 | [[package]] |
| @@ -232,7 +215,7 @@ dependencies = [ | ||
| 232 | 215 | "serde", |
| 233 | 216 | "signal-hook", |
| 234 | 217 | "signal-hook-mio", |
| 235 | "winapi 0.3.9", | |
| 218 | "winapi", | |
| 236 | 219 | ] |
| 237 | 220 | |
| 238 | 221 | [[package]] |
| @@ -241,7 +224,57 @@ version = "0.9.0" | ||
| 241 | 224 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 242 | 225 | checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" |
| 243 | 226 | dependencies = [ |
| 244 | "winapi 0.3.9", | |
| 227 | "winapi", | |
| 228 | ] | |
| 229 | ||
| 230 | [[package]] | |
| 231 | name = "crunchy" | |
| 232 | version = "0.2.2" | |
| 233 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 234 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" | |
| 235 | ||
| 236 | [[package]] | |
| 237 | name = "cxx" | |
| 238 | version = "1.0.80" | |
| 239 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 240 | checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" | |
| 241 | dependencies = [ | |
| 242 | "cc", | |
| 243 | "cxxbridge-flags", | |
| 244 | "cxxbridge-macro", | |
| 245 | "link-cplusplus", | |
| 246 | ] | |
| 247 | ||
| 248 | [[package]] | |
| 249 | name = "cxx-build" | |
| 250 | version = "1.0.80" | |
| 251 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 252 | checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" | |
| 253 | dependencies = [ | |
| 254 | "cc", | |
| 255 | "codespan-reporting", | |
| 256 | "once_cell", | |
| 257 | "proc-macro2", | |
| 258 | "quote", | |
| 259 | "scratch", | |
| 260 | "syn", | |
| 261 | ] | |
| 262 | ||
| 263 | [[package]] | |
| 264 | name = "cxxbridge-flags" | |
| 265 | version = "1.0.80" | |
| 266 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 267 | checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" | |
| 268 | ||
| 269 | [[package]] | |
| 270 | name = "cxxbridge-macro" | |
| 271 | version = "1.0.80" | |
| 272 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 273 | checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" | |
| 274 | dependencies = [ | |
| 275 | "proc-macro2", | |
| 276 | "quote", | |
| 277 | "syn", | |
| 245 | 278 | ] |
| 246 | 279 | |
| 247 | 280 | [[package]] |
| @@ -273,15 +306,15 @@ dependencies = [ | ||
| 273 | 306 | |
| 274 | 307 | [[package]] |
| 275 | 308 | name = "exr" |
| 276 | version = "1.5.1" | |
| 309 | version = "1.5.2" | |
| 277 | 310 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 278 | checksum = "c9a7880199e74c6d3fe45579df2f436c5913a71405494cb89d59234d86b47dc5" | |
| 311 | checksum = "8eb5f255b5980bb0c8cf676b675d1a99be40f316881444f44e0462eaf5df5ded" | |
| 279 | 312 | dependencies = [ |
| 280 | 313 | "bit_field", |
| 281 | 314 | "flume", |
| 282 | 315 | "half", |
| 283 | 316 | "lebe", |
| 284 | "miniz_oxide", | |
| 317 | "miniz_oxide 0.6.2", | |
| 285 | 318 | "smallvec", |
| 286 | 319 | "threadpool", |
| 287 | 320 | ] |
| @@ -302,7 +335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 302 | 335 | checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" |
| 303 | 336 | dependencies = [ |
| 304 | 337 | "crc32fast", |
| 305 | "miniz_oxide", | |
| 338 | "miniz_oxide 0.5.4", | |
| 306 | 339 | ] |
| 307 | 340 | |
| 308 | 341 | [[package]] |
| @@ -350,9 +383,9 @@ dependencies = [ | ||
| 350 | 383 | |
| 351 | 384 | [[package]] |
| 352 | 385 | name = "futures" |
| 353 | version = "0.3.24" | |
| 386 | version = "0.3.25" | |
| 354 | 387 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 355 | checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" | |
| 388 | checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" | |
| 356 | 389 | dependencies = [ |
| 357 | 390 | "futures-channel", |
| 358 | 391 | "futures-core", |
| @@ -365,9 +398,9 @@ dependencies = [ | ||
| 365 | 398 | |
| 366 | 399 | [[package]] |
| 367 | 400 | name = "futures-channel" |
| 368 | version = "0.3.24" | |
| 401 | version = "0.3.25" | |
| 369 | 402 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 370 | checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" | |
| 403 | checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" | |
| 371 | 404 | dependencies = [ |
| 372 | 405 | "futures-core", |
| 373 | 406 | "futures-sink", |
| @@ -375,15 +408,15 @@ dependencies = [ | ||
| 375 | 408 | |
| 376 | 409 | [[package]] |
| 377 | 410 | name = "futures-core" |
| 378 | version = "0.3.24" | |
| 411 | version = "0.3.25" | |
| 379 | 412 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 380 | checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" | |
| 413 | checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" | |
| 381 | 414 | |
| 382 | 415 | [[package]] |
| 383 | 416 | name = "futures-executor" |
| 384 | version = "0.3.24" | |
| 417 | version = "0.3.25" | |
| 385 | 418 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 386 | checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" | |
| 419 | checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" | |
| 387 | 420 | dependencies = [ |
| 388 | 421 | "futures-core", |
| 389 | 422 | "futures-task", |
| @@ -392,15 +425,15 @@ dependencies = [ | ||
| 392 | 425 | |
| 393 | 426 | [[package]] |
| 394 | 427 | name = "futures-io" |
| 395 | version = "0.3.24" | |
| 428 | version = "0.3.25" | |
| 396 | 429 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 397 | checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" | |
| 430 | checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" | |
| 398 | 431 | |
| 399 | 432 | [[package]] |
| 400 | 433 | name = "futures-macro" |
| 401 | version = "0.3.24" | |
| 434 | version = "0.3.25" | |
| 402 | 435 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 403 | checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" | |
| 436 | checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" | |
| 404 | 437 | dependencies = [ |
| 405 | 438 | "proc-macro2", |
| 406 | 439 | "quote", |
| @@ -409,21 +442,21 @@ dependencies = [ | ||
| 409 | 442 | |
| 410 | 443 | [[package]] |
| 411 | 444 | name = "futures-sink" |
| 412 | version = "0.3.24" | |
| 445 | version = "0.3.25" | |
| 413 | 446 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 414 | checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" | |
| 447 | checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" | |
| 415 | 448 | |
| 416 | 449 | [[package]] |
| 417 | 450 | name = "futures-task" |
| 418 | version = "0.3.24" | |
| 451 | version = "0.3.25" | |
| 419 | 452 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 420 | checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" | |
| 453 | checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" | |
| 421 | 454 | |
| 422 | 455 | [[package]] |
| 423 | 456 | name = "futures-util" |
| 424 | version = "0.3.24" | |
| 457 | version = "0.3.25" | |
| 425 | 458 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 426 | checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" | |
| 459 | checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" | |
| 427 | 460 | dependencies = [ |
| 428 | 461 | "futures-channel", |
| 429 | 462 | "futures-core", |
| @@ -431,7 +464,7 @@ dependencies = [ | ||
| 431 | 464 | "futures-macro", |
| 432 | 465 | "futures-sink", |
| 433 | 466 | "futures-task", |
| 434 | "memchr 2.5.0", | |
| 467 | "memchr", | |
| 435 | 468 | "pin-project-lite", |
| 436 | 469 | "pin-utils", |
| 437 | 470 | "slab", |
| @@ -439,9 +472,9 @@ dependencies = [ | ||
| 439 | 472 | |
| 440 | 473 | [[package]] |
| 441 | 474 | name = "getrandom" |
| 442 | version = "0.2.7" | |
| 475 | version = "0.2.8" | |
| 443 | 476 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 444 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" | |
| 477 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" | |
| 445 | 478 | dependencies = [ |
| 446 | 479 | "cfg-if", |
| 447 | 480 | "js-sys", |
| @@ -481,9 +514,12 @@ dependencies = [ | ||
| 481 | 514 | |
| 482 | 515 | [[package]] |
| 483 | 516 | name = "half" |
| 484 | version = "1.8.2" | |
| 517 | version = "2.1.0" | |
| 485 | 518 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 486 | checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" | |
| 519 | checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554" | |
| 520 | dependencies = [ | |
| 521 | "crunchy", | |
| 522 | ] | |
| 487 | 523 | |
| 488 | 524 | [[package]] |
| 489 | 525 | name = "hashbrown" |
| @@ -502,11 +538,11 @@ dependencies = [ | ||
| 502 | 538 | |
| 503 | 539 | [[package]] |
| 504 | 540 | name = "home" |
| 505 | version = "0.5.3" | |
| 541 | version = "0.5.4" | |
| 506 | 542 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 507 | checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" | |
| 543 | checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" | |
| 508 | 544 | dependencies = [ |
| 509 | "winapi 0.3.9", | |
| 545 | "winapi", | |
| 510 | 546 | ] |
| 511 | 547 | |
| 512 | 548 | [[package]] |
| @@ -582,15 +618,26 @@ dependencies = [ | ||
| 582 | 618 | |
| 583 | 619 | [[package]] |
| 584 | 620 | name = "iana-time-zone" |
| 585 | version = "0.1.50" | |
| 621 | version = "0.1.51" | |
| 586 | 622 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 587 | checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" | |
| 623 | checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" | |
| 588 | 624 | dependencies = [ |
| 589 | 625 | "android_system_properties", |
| 590 | 626 | "core-foundation-sys", |
| 627 | "iana-time-zone-haiku", | |
| 591 | 628 | "js-sys", |
| 592 | 629 | "wasm-bindgen", |
| 593 | "winapi 0.3.9", | |
| 630 | "winapi", | |
| 631 | ] | |
| 632 | ||
| 633 | [[package]] | |
| 634 | name = "iana-time-zone-haiku" | |
| 635 | version = "0.1.1" | |
| 636 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 637 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" | |
| 638 | dependencies = [ | |
| 639 | "cxx", | |
| 640 | "cxx-build", | |
| 594 | 641 | ] |
| 595 | 642 | |
| 596 | 643 | [[package]] |
| @@ -605,9 +652,9 @@ dependencies = [ | ||
| 605 | 652 | |
| 606 | 653 | [[package]] |
| 607 | 654 | name = "image" |
| 608 | version = "0.24.3" | |
| 655 | version = "0.24.4" | |
| 609 | 656 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 610 | checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" | |
| 657 | checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" | |
| 611 | 658 | dependencies = [ |
| 612 | 659 | "bytemuck", |
| 613 | 660 | "byteorder", |
| @@ -643,9 +690,9 @@ dependencies = [ | ||
| 643 | 690 | |
| 644 | 691 | [[package]] |
| 645 | 692 | name = "invidious" |
| 646 | version = "0.3.2" | |
| 693 | version = "0.4.0" | |
| 647 | 694 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 648 | checksum = "c0768e9ab3b6d2f3ce235e6c85167d3e78cde11fb08c0811c5f320c6f5a4834e" | |
| 695 | checksum = "f6a0c87f44203986f9b402ef0409c1c776c5229d09be2a85cda5b53a23ba0757" | |
| 649 | 696 | dependencies = [ |
| 650 | 697 | "reqwest", |
| 651 | 698 | "serde", |
| @@ -660,9 +707,9 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" | ||
| 660 | 707 | |
| 661 | 708 | [[package]] |
| 662 | 709 | name = "itoa" |
| 663 | version = "1.0.3" | |
| 710 | version = "1.0.4" | |
| 664 | 711 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 665 | checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" | |
| 712 | checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" | |
| 666 | 713 | |
| 667 | 714 | [[package]] |
| 668 | 715 | name = "jpeg-decoder" |
| @@ -682,22 +729,6 @@ dependencies = [ | ||
| 682 | 729 | "wasm-bindgen", |
| 683 | 730 | ] |
| 684 | 731 | |
| 685 | [[package]] | |
| 686 | name = "kernel32-sys" | |
| 687 | version = "0.2.2" | |
| 688 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 689 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |
| 690 | dependencies = [ | |
| 691 | "winapi 0.2.8", | |
| 692 | "winapi-build", | |
| 693 | ] | |
| 694 | ||
| 695 | [[package]] | |
| 696 | name = "lazy_static" | |
| 697 | version = "0.2.11" | |
| 698 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 699 | checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" | |
| 700 | ||
| 701 | 732 | [[package]] |
| 702 | 733 | name = "lazy_static" |
| 703 | 734 | version = "1.4.0" |
| @@ -712,9 +743,18 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" | ||
| 712 | 743 | |
| 713 | 744 | [[package]] |
| 714 | 745 | name = "libc" |
| 715 | version = "0.2.133" | |
| 746 | version = "0.2.135" | |
| 747 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 748 | checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" | |
| 749 | ||
| 750 | [[package]] | |
| 751 | name = "link-cplusplus" | |
| 752 | version = "1.0.7" | |
| 716 | 753 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 717 | checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" | |
| 754 | checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" | |
| 755 | dependencies = [ | |
| 756 | "cc", | |
| 757 | ] | |
| 718 | 758 | |
| 719 | 759 | [[package]] |
| 720 | 760 | name = "lock_api" |
| @@ -741,15 +781,6 @@ version = "0.1.0" | ||
| 741 | 781 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 742 | 782 | checksum = "a8ca8afbe8af1785e09636acb5a41e08a765f5f0340568716c18a8700ba3c0d3" |
| 743 | 783 | |
| 744 | [[package]] | |
| 745 | name = "memchr" | |
| 746 | version = "0.1.11" | |
| 747 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 748 | checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" | |
| 749 | dependencies = [ | |
| 750 | "libc", | |
| 751 | ] | |
| 752 | ||
| 753 | 784 | [[package]] |
| 754 | 785 | name = "memchr" |
| 755 | 786 | version = "2.5.0" |
| @@ -780,6 +811,15 @@ dependencies = [ | ||
| 780 | 811 | "adler", |
| 781 | 812 | ] |
| 782 | 813 | |
| 814 | [[package]] | |
| 815 | name = "miniz_oxide" | |
| 816 | version = "0.6.2" | |
| 817 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 818 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" | |
| 819 | dependencies = [ | |
| 820 | "adler", | |
| 821 | ] | |
| 822 | ||
| 783 | 823 | [[package]] |
| 784 | 824 | name = "mio" |
| 785 | 825 | version = "0.8.4" |
| @@ -789,7 +829,7 @@ dependencies = [ | ||
| 789 | 829 | "libc", |
| 790 | 830 | "log", |
| 791 | 831 | "wasi", |
| 792 | "windows-sys", | |
| 832 | "windows-sys 0.36.1", | |
| 793 | 833 | ] |
| 794 | 834 | |
| 795 | 835 | [[package]] |
| @@ -807,7 +847,7 @@ version = "0.2.10" | ||
| 807 | 847 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 808 | 848 | checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" |
| 809 | 849 | dependencies = [ |
| 810 | "lazy_static 1.4.0", | |
| 850 | "lazy_static", | |
| 811 | 851 | "libc", |
| 812 | 852 | "log", |
| 813 | 853 | "openssl", |
| @@ -867,9 +907,9 @@ checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" | ||
| 867 | 907 | |
| 868 | 908 | [[package]] |
| 869 | 909 | name = "openssl" |
| 870 | version = "0.10.41" | |
| 910 | version = "0.10.42" | |
| 871 | 911 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 872 | checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" | |
| 912 | checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" | |
| 873 | 913 | dependencies = [ |
| 874 | 914 | "bitflags", |
| 875 | 915 | "cfg-if", |
| @@ -899,9 +939,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" | ||
| 899 | 939 | |
| 900 | 940 | [[package]] |
| 901 | 941 | name = "openssl-sys" |
| 902 | version = "0.9.75" | |
| 942 | version = "0.9.77" | |
| 903 | 943 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 904 | checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" | |
| 944 | checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" | |
| 905 | 945 | dependencies = [ |
| 906 | 946 | "autocfg", |
| 907 | 947 | "cc", |
| @@ -922,15 +962,15 @@ dependencies = [ | ||
| 922 | 962 | |
| 923 | 963 | [[package]] |
| 924 | 964 | name = "parking_lot_core" |
| 925 | version = "0.9.3" | |
| 965 | version = "0.9.4" | |
| 926 | 966 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 927 | checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" | |
| 967 | checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" | |
| 928 | 968 | dependencies = [ |
| 929 | 969 | "cfg-if", |
| 930 | 970 | "libc", |
| 931 | 971 | "redox_syscall", |
| 932 | 972 | "smallvec", |
| 933 | "windows-sys", | |
| 973 | "windows-sys 0.42.0", | |
| 934 | 974 | ] |
| 935 | 975 | |
| 936 | 976 | [[package]] |
| @@ -986,14 +1026,14 @@ dependencies = [ | ||
| 986 | 1026 | "bitflags", |
| 987 | 1027 | "crc32fast", |
| 988 | 1028 | "flate2", |
| 989 | "miniz_oxide", | |
| 1029 | "miniz_oxide 0.5.4", | |
| 990 | 1030 | ] |
| 991 | 1031 | |
| 992 | 1032 | [[package]] |
| 993 | 1033 | name = "proc-macro2" |
| 994 | version = "1.0.44" | |
| 1034 | version = "1.0.47" | |
| 995 | 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 996 | checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" | |
| 1036 | checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" | |
| 997 | 1037 | dependencies = [ |
| 998 | 1038 | "unicode-ident", |
| 999 | 1039 | ] |
| @@ -1040,32 +1080,13 @@ dependencies = [ | ||
| 1040 | 1080 | "bitflags", |
| 1041 | 1081 | ] |
| 1042 | 1082 | |
| 1043 | [[package]] | |
| 1044 | name = "regex" | |
| 1045 | version = "0.1.80" | |
| 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1047 | checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" | |
| 1048 | dependencies = [ | |
| 1049 | "aho-corasick", | |
| 1050 | "memchr 0.1.11", | |
| 1051 | "regex-syntax", | |
| 1052 | "thread_local", | |
| 1053 | "utf8-ranges", | |
| 1054 | ] | |
| 1055 | ||
| 1056 | [[package]] | |
| 1057 | name = "regex-syntax" | |
| 1058 | version = "0.3.9" | |
| 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1060 | checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" | |
| 1061 | ||
| 1062 | 1083 | [[package]] |
| 1063 | 1084 | name = "remove_dir_all" |
| 1064 | 1085 | version = "0.5.3" |
| 1065 | 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1066 | 1087 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" |
| 1067 | 1088 | dependencies = [ |
| 1068 | "winapi 0.3.9", | |
| 1089 | "winapi", | |
| 1069 | 1090 | ] |
| 1070 | 1091 | |
| 1071 | 1092 | [[package]] |
| @@ -1126,8 +1147,8 @@ version = "0.1.20" | ||
| 1126 | 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1127 | 1148 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" |
| 1128 | 1149 | dependencies = [ |
| 1129 | "lazy_static 1.4.0", | |
| 1130 | "windows-sys", | |
| 1150 | "lazy_static", | |
| 1151 | "windows-sys 0.36.1", | |
| 1131 | 1152 | ] |
| 1132 | 1153 | |
| 1133 | 1154 | [[package]] |
| @@ -1142,6 +1163,12 @@ version = "1.1.0" | ||
| 1142 | 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1143 | 1164 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" |
| 1144 | 1165 | |
| 1166 | [[package]] | |
| 1167 | name = "scratch" | |
| 1168 | version = "1.0.2" | |
| 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1170 | checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" | |
| 1171 | ||
| 1145 | 1172 | [[package]] |
| 1146 | 1173 | name = "security-framework" |
| 1147 | 1174 | version = "2.7.0" |
| @@ -1165,30 +1192,20 @@ dependencies = [ | ||
| 1165 | 1192 | "libc", |
| 1166 | 1193 | ] |
| 1167 | 1194 | |
| 1168 | [[package]] | |
| 1169 | name = "semver-parser" | |
| 1170 | version = "0.6.2" | |
| 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1172 | checksum = "d8fff3c9c5a54636ab95acd8c1349926e04cb1eb8cd70b5adced8a1d1f703a67" | |
| 1173 | dependencies = [ | |
| 1174 | "lazy_static 0.2.11", | |
| 1175 | "regex", | |
| 1176 | ] | |
| 1177 | ||
| 1178 | 1195 | [[package]] |
| 1179 | 1196 | name = "serde" |
| 1180 | version = "1.0.145" | |
| 1197 | version = "1.0.147" | |
| 1181 | 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1182 | checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" | |
| 1199 | checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" | |
| 1183 | 1200 | dependencies = [ |
| 1184 | 1201 | "serde_derive", |
| 1185 | 1202 | ] |
| 1186 | 1203 | |
| 1187 | 1204 | [[package]] |
| 1188 | 1205 | name = "serde_derive" |
| 1189 | version = "1.0.145" | |
| 1206 | version = "1.0.147" | |
| 1190 | 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1191 | checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" | |
| 1208 | checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" | |
| 1192 | 1209 | dependencies = [ |
| 1193 | 1210 | "proc-macro2", |
| 1194 | 1211 | "quote", |
| @@ -1197,9 +1214,9 @@ dependencies = [ | ||
| 1197 | 1214 | |
| 1198 | 1215 | [[package]] |
| 1199 | 1216 | name = "serde_json" |
| 1200 | version = "1.0.85" | |
| 1217 | version = "1.0.87" | |
| 1201 | 1218 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1202 | checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" | |
| 1219 | checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" | |
| 1203 | 1220 | dependencies = [ |
| 1204 | 1221 | "itoa", |
| 1205 | 1222 | "ryu", |
| @@ -1220,9 +1237,9 @@ dependencies = [ | ||
| 1220 | 1237 | |
| 1221 | 1238 | [[package]] |
| 1222 | 1239 | name = "serde_yaml" |
| 1223 | version = "0.9.13" | |
| 1240 | version = "0.9.14" | |
| 1224 | 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1225 | checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" | |
| 1242 | checksum = "6d232d893b10de3eb7258ff01974d6ee20663d8e833263c99409d4b13a0209da" | |
| 1226 | 1243 | dependencies = [ |
| 1227 | 1244 | "indexmap", |
| 1228 | 1245 | "itoa", |
| @@ -1262,13 +1279,11 @@ dependencies = [ | ||
| 1262 | 1279 | ] |
| 1263 | 1280 | |
| 1264 | 1281 | [[package]] |
| 1265 | name = "sixel" | |
| 1266 | version = "0.3.2" | |
| 1282 | name = "sixel-rs" | |
| 1283 | version = "0.3.3" | |
| 1267 | 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1268 | checksum = "51e4bcd2d65122138405b83d3f7777df6b04b0dd5222c85972ed1fb0119aeaaa" | |
| 1285 | checksum = "cfa95c014543113a192d906e5971d0c8d1e8b4cc1e61026539687a7016644ce5" | |
| 1269 | 1286 | dependencies = [ |
| 1270 | "lazy_static 0.2.11", | |
| 1271 | "semver-parser", | |
| 1272 | 1287 | "sixel-sys", |
| 1273 | 1288 | ] |
| 1274 | 1289 | |
| @@ -1292,9 +1307,9 @@ dependencies = [ | ||
| 1292 | 1307 | |
| 1293 | 1308 | [[package]] |
| 1294 | 1309 | name = "smallvec" |
| 1295 | version = "1.9.0" | |
| 1310 | version = "1.10.0" | |
| 1296 | 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1297 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" | |
| 1312 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" | |
| 1298 | 1313 | |
| 1299 | 1314 | [[package]] |
| 1300 | 1315 | name = "socket2" |
| @@ -1303,7 +1318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1303 | 1318 | checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" |
| 1304 | 1319 | dependencies = [ |
| 1305 | 1320 | "libc", |
| 1306 | "winapi 0.3.9", | |
| 1321 | "winapi", | |
| 1307 | 1322 | ] |
| 1308 | 1323 | |
| 1309 | 1324 | [[package]] |
| @@ -1317,9 +1332,9 @@ dependencies = [ | ||
| 1317 | 1332 | |
| 1318 | 1333 | [[package]] |
| 1319 | 1334 | name = "syn" |
| 1320 | version = "1.0.100" | |
| 1335 | version = "1.0.103" | |
| 1321 | 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1322 | checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" | |
| 1337 | checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" | |
| 1323 | 1338 | dependencies = [ |
| 1324 | 1339 | "proc-macro2", |
| 1325 | 1340 | "quote", |
| @@ -1337,7 +1352,7 @@ dependencies = [ | ||
| 1337 | 1352 | "libc", |
| 1338 | 1353 | "redox_syscall", |
| 1339 | 1354 | "remove_dir_all", |
| 1340 | "winapi 0.3.9", | |
| 1355 | "winapi", | |
| 1341 | 1356 | ] |
| 1342 | 1357 | |
| 1343 | 1358 | [[package]] |
| @@ -1356,26 +1371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1356 | 1371 | checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" |
| 1357 | 1372 | dependencies = [ |
| 1358 | 1373 | "libc", |
| 1359 | "winapi 0.3.9", | |
| 1360 | ] | |
| 1361 | ||
| 1362 | [[package]] | |
| 1363 | name = "thread-id" | |
| 1364 | version = "2.0.0" | |
| 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1366 | checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" | |
| 1367 | dependencies = [ | |
| 1368 | "kernel32-sys", | |
| 1369 | "libc", | |
| 1370 | ] | |
| 1371 | ||
| 1372 | [[package]] | |
| 1373 | name = "thread_local" | |
| 1374 | version = "0.2.7" | |
| 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1376 | checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" | |
| 1377 | dependencies = [ | |
| 1378 | "thread-id", | |
| 1374 | "winapi", | |
| 1379 | 1375 | ] |
| 1380 | 1376 | |
| 1381 | 1377 | [[package]] |
| @@ -1415,20 +1411,19 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" | ||
| 1415 | 1411 | |
| 1416 | 1412 | [[package]] |
| 1417 | 1413 | name = "tokio" |
| 1418 | version = "1.21.1" | |
| 1414 | version = "1.21.2" | |
| 1419 | 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1420 | checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" | |
| 1416 | checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" | |
| 1421 | 1417 | dependencies = [ |
| 1422 | 1418 | "autocfg", |
| 1423 | 1419 | "bytes", |
| 1424 | 1420 | "libc", |
| 1425 | "memchr 2.5.0", | |
| 1421 | "memchr", | |
| 1426 | 1422 | "mio", |
| 1427 | 1423 | "num_cpus", |
| 1428 | "once_cell", | |
| 1429 | 1424 | "pin-project-lite", |
| 1430 | 1425 | "socket2", |
| 1431 | "winapi 0.3.9", | |
| 1426 | "winapi", | |
| 1432 | 1427 | ] |
| 1433 | 1428 | |
| 1434 | 1429 | [[package]] |
| @@ -1463,9 +1458,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" | ||
| 1463 | 1458 | |
| 1464 | 1459 | [[package]] |
| 1465 | 1460 | name = "tracing" |
| 1466 | version = "0.1.36" | |
| 1461 | version = "0.1.37" | |
| 1467 | 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1468 | checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" | |
| 1463 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" | |
| 1469 | 1464 | dependencies = [ |
| 1470 | 1465 | "cfg-if", |
| 1471 | 1466 | "pin-project-lite", |
| @@ -1474,9 +1469,9 @@ dependencies = [ | ||
| 1474 | 1469 | |
| 1475 | 1470 | [[package]] |
| 1476 | 1471 | name = "tracing-core" |
| 1477 | version = "0.1.29" | |
| 1472 | version = "0.1.30" | |
| 1478 | 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1479 | checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" | |
| 1474 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" | |
| 1480 | 1475 | dependencies = [ |
| 1481 | 1476 | "once_cell", |
| 1482 | 1477 | ] |
| @@ -1501,7 +1496,7 @@ checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1" | ||
| 1501 | 1496 | dependencies = [ |
| 1502 | 1497 | "bitflags", |
| 1503 | 1498 | "cassowary", |
| 1504 | "crossterm 0.25.0", | |
| 1499 | "crossterm", | |
| 1505 | 1500 | "serde", |
| 1506 | 1501 | "unicode-segmentation", |
| 1507 | 1502 | "unicode-width", |
| @@ -1509,9 +1504,11 @@ dependencies = [ | ||
| 1509 | 1504 | |
| 1510 | 1505 | [[package]] |
| 1511 | 1506 | name = "tui-additions" |
| 1512 | version = "0.1.8" | |
| 1507 | version = "0.1.9" | |
| 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1509 | checksum = "19170ef3d86a5223daaa0bb449e71bdefe74676f5651ce8981e308915af64fa4" | |
| 1513 | 1510 | dependencies = [ |
| 1514 | "crossterm 0.25.0", | |
| 1511 | "crossterm", | |
| 1515 | 1512 | "dyn-clone", |
| 1516 | 1513 | "tui", |
| 1517 | 1514 | "typemap", |
| @@ -1535,9 +1532,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" | ||
| 1535 | 1532 | |
| 1536 | 1533 | [[package]] |
| 1537 | 1534 | name = "unicode-ident" |
| 1538 | version = "1.0.4" | |
| 1535 | version = "1.0.5" | |
| 1539 | 1536 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1540 | checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" | |
| 1537 | checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" | |
| 1541 | 1538 | |
| 1542 | 1539 | [[package]] |
| 1543 | 1540 | name = "unicode-normalization" |
| @@ -1586,12 +1583,6 @@ dependencies = [ | ||
| 1586 | 1583 | "percent-encoding", |
| 1587 | 1584 | ] |
| 1588 | 1585 | |
| 1589 | [[package]] | |
| 1590 | name = "utf8-ranges" | |
| 1591 | version = "0.1.3" | |
| 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1593 | checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" | |
| 1594 | ||
| 1595 | 1586 | [[package]] |
| 1596 | 1587 | name = "vcpkg" |
| 1597 | 1588 | version = "0.2.15" |
| @@ -1600,18 +1591,17 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" | ||
| 1600 | 1591 | |
| 1601 | 1592 | [[package]] |
| 1602 | 1593 | name = "viuer" |
| 1603 | version = "0.6.1" | |
| 1594 | version = "0.6.2" | |
| 1604 | 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1605 | checksum = "9db8b59a46844025fa705f65ba7d0a9ebf3369cb5fa2f10c532f1d41e0a56fa4" | |
| 1596 | checksum = "b511f7e9ae27b5750f12ca50c353a1179bd4cc964a47294eb0d2cdad40cb41c0" | |
| 1606 | 1597 | dependencies = [ |
| 1607 | 1598 | "ansi_colours", |
| 1608 | 1599 | "base64", |
| 1609 | 1600 | "console", |
| 1610 | "crossterm 0.23.2", | |
| 1601 | "crossterm", | |
| 1611 | 1602 | "image", |
| 1612 | "lazy_static 1.4.0", | |
| 1613 | "sixel", | |
| 1614 | "sixel-sys", | |
| 1603 | "lazy_static", | |
| 1604 | "sixel-rs", | |
| 1615 | 1605 | "tempfile", |
| 1616 | 1606 | "termcolor", |
| 1617 | 1607 | ] |
| @@ -1714,12 +1704,6 @@ version = "0.1.7" | ||
| 1714 | 1704 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1715 | 1705 | checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" |
| 1716 | 1706 | |
| 1717 | [[package]] | |
| 1718 | name = "winapi" | |
| 1719 | version = "0.2.8" | |
| 1720 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1721 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |
| 1722 | ||
| 1723 | 1707 | [[package]] |
| 1724 | 1708 | name = "winapi" |
| 1725 | 1709 | version = "0.3.9" |
| @@ -1730,12 +1714,6 @@ dependencies = [ | ||
| 1730 | 1714 | "winapi-x86_64-pc-windows-gnu", |
| 1731 | 1715 | ] |
| 1732 | 1716 | |
| 1733 | [[package]] | |
| 1734 | name = "winapi-build" | |
| 1735 | version = "0.1.1" | |
| 1736 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1737 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |
| 1738 | ||
| 1739 | 1717 | [[package]] |
| 1740 | 1718 | name = "winapi-i686-pc-windows-gnu" |
| 1741 | 1719 | version = "0.4.0" |
| @@ -1748,7 +1726,7 @@ version = "0.1.5" | ||
| 1748 | 1726 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1749 | 1727 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" |
| 1750 | 1728 | dependencies = [ |
| 1751 | "winapi 0.3.9", | |
| 1729 | "winapi", | |
| 1752 | 1730 | ] |
| 1753 | 1731 | |
| 1754 | 1732 | [[package]] |
| @@ -1763,50 +1741,107 @@ version = "0.36.1" | ||
| 1763 | 1741 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1764 | 1742 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" |
| 1765 | 1743 | dependencies = [ |
| 1766 | "windows_aarch64_msvc", | |
| 1767 | "windows_i686_gnu", | |
| 1768 | "windows_i686_msvc", | |
| 1769 | "windows_x86_64_gnu", | |
| 1770 | "windows_x86_64_msvc", | |
| 1744 | "windows_aarch64_msvc 0.36.1", | |
| 1745 | "windows_i686_gnu 0.36.1", | |
| 1746 | "windows_i686_msvc 0.36.1", | |
| 1747 | "windows_x86_64_gnu 0.36.1", | |
| 1748 | "windows_x86_64_msvc 0.36.1", | |
| 1749 | ] | |
| 1750 | ||
| 1751 | [[package]] | |
| 1752 | name = "windows-sys" | |
| 1753 | version = "0.42.0" | |
| 1754 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1755 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" | |
| 1756 | dependencies = [ | |
| 1757 | "windows_aarch64_gnullvm", | |
| 1758 | "windows_aarch64_msvc 0.42.0", | |
| 1759 | "windows_i686_gnu 0.42.0", | |
| 1760 | "windows_i686_msvc 0.42.0", | |
| 1761 | "windows_x86_64_gnu 0.42.0", | |
| 1762 | "windows_x86_64_gnullvm", | |
| 1763 | "windows_x86_64_msvc 0.42.0", | |
| 1771 | 1764 | ] |
| 1772 | 1765 | |
| 1766 | [[package]] | |
| 1767 | name = "windows_aarch64_gnullvm" | |
| 1768 | version = "0.42.0" | |
| 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1770 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" | |
| 1771 | ||
| 1773 | 1772 | [[package]] |
| 1774 | 1773 | name = "windows_aarch64_msvc" |
| 1775 | 1774 | version = "0.36.1" |
| 1776 | 1775 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1777 | 1776 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" |
| 1778 | 1777 | |
| 1778 | [[package]] | |
| 1779 | name = "windows_aarch64_msvc" | |
| 1780 | version = "0.42.0" | |
| 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1782 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" | |
| 1783 | ||
| 1779 | 1784 | [[package]] |
| 1780 | 1785 | name = "windows_i686_gnu" |
| 1781 | 1786 | version = "0.36.1" |
| 1782 | 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1783 | 1788 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" |
| 1784 | 1789 | |
| 1790 | [[package]] | |
| 1791 | name = "windows_i686_gnu" | |
| 1792 | version = "0.42.0" | |
| 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1794 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" | |
| 1795 | ||
| 1785 | 1796 | [[package]] |
| 1786 | 1797 | name = "windows_i686_msvc" |
| 1787 | 1798 | version = "0.36.1" |
| 1788 | 1799 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1789 | 1800 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" |
| 1790 | 1801 | |
| 1802 | [[package]] | |
| 1803 | name = "windows_i686_msvc" | |
| 1804 | version = "0.42.0" | |
| 1805 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1806 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" | |
| 1807 | ||
| 1791 | 1808 | [[package]] |
| 1792 | 1809 | name = "windows_x86_64_gnu" |
| 1793 | 1810 | version = "0.36.1" |
| 1794 | 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1795 | 1812 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" |
| 1796 | 1813 | |
| 1814 | [[package]] | |
| 1815 | name = "windows_x86_64_gnu" | |
| 1816 | version = "0.42.0" | |
| 1817 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1818 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" | |
| 1819 | ||
| 1820 | [[package]] | |
| 1821 | name = "windows_x86_64_gnullvm" | |
| 1822 | version = "0.42.0" | |
| 1823 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1824 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" | |
| 1825 | ||
| 1797 | 1826 | [[package]] |
| 1798 | 1827 | name = "windows_x86_64_msvc" |
| 1799 | 1828 | version = "0.36.1" |
| 1800 | 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1801 | 1830 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" |
| 1802 | 1831 | |
| 1832 | [[package]] | |
| 1833 | name = "windows_x86_64_msvc" | |
| 1834 | version = "0.42.0" | |
| 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1836 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" | |
| 1837 | ||
| 1803 | 1838 | [[package]] |
| 1804 | 1839 | name = "winreg" |
| 1805 | 1840 | version = "0.10.1" |
| 1806 | 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1807 | 1842 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" |
| 1808 | 1843 | dependencies = [ |
| 1809 | "winapi 0.3.9", | |
| 1844 | "winapi", | |
| 1810 | 1845 | ] |
| 1811 | 1846 | |
| 1812 | 1847 | [[package]] |
| @@ -1814,7 +1849,7 @@ name = "youtube-tui" | ||
| 1814 | 1849 | version = "0.5.0" |
| 1815 | 1850 | dependencies = [ |
| 1816 | 1851 | "chrono", |
| 1817 | "crossterm 0.25.0", | |
| 1852 | "crossterm", | |
| 1818 | 1853 | "dyn-clone", |
| 1819 | 1854 | "futures", |
| 1820 | 1855 | "home", |
Cargo.toml +5 −3
| @@ -19,13 +19,15 @@ crossterm = {version = "0.25", features = ["serde"]} | ||
| 19 | 19 | viuer = {version = "0.6", features = ["sixel"]} |
| 20 | 20 | home = "0.5" |
| 21 | 21 | chrono = {version = "0.4", default-features = false, features = ["clock"]} |
| 22 | # tui-additions = {version = "0.1", default-features = false, features = ["framework", "widgets"]} | |
| 22 | tui-additions = {version = "0.1", default-features = false, features = ["framework", "widgets"]} | |
| 23 | 23 | typemap = "0.3" |
| 24 | invidious = {version = "0.3", default-features = false, features = ["reqwest"]} | |
| 24 | invidious = {version = "0.4", default-features = false, features = ["reqwest"]} | |
| 25 | 25 | serde_yaml = "0.9" |
| 26 | 26 | dyn-clone = "1.0" |
| 27 | 27 | tokio = "1.21" |
| 28 | 28 | futures = "0.3" |
| 29 | 29 | reqwest = "0.11" |
| 30 | 30 | serde_json = "1.0" |
| 31 | tui-additions = {path = "../../Rust/Packages/tui-additions", default-features = false, features = ["framework", "widgets"]} | |
| 31 | ||
| 32 | # tui-additions = {path = "../../Rust/Packages/tui-additions", default-features = false, features = ["framework", "widgets"]} | |
| 33 | # invidious = {path = "../../Rust/Packages/invidious", default-features = false, features = ["reqwest"]} | |
README.md +2 −2
| @@ -39,13 +39,13 @@ An aesthetically pleasing YouTube TUI written in Rust. | ||
| 39 | 39 | > |
| 40 | 40 | > #### Done |
| 41 | 41 | > |
| 42 | > - Config files (mostly, more options will be added when I get to that part) | |
| 42 | > - Config files | |
| 43 | 43 | > - Home and search page |
| 44 | 44 | > - Search fully functional |
| 45 | 45 | > |
| 46 | 46 | > #### To do before release |
| 47 | 47 | > |
| 48 | > - Item info, channels page | |
| 48 | > - Item info (WIP), channels page | |
| 49 | 49 | > - Watch history |
| 50 | 50 | > - Basically back to where it is before the rewrite |
| 51 | 51 | |
src/config/appearance.rs +39 −4
| @@ -23,6 +23,14 @@ pub struct AppearanceConfig { | ||
| 23 | 23 | /// Includes all configurable colors |
| 24 | 24 | #[derive(Clone, Copy, Serialize, Deserialize)] |
| 25 | 25 | pub struct ColorsConfig { |
| 26 | #[serde(default = "text_default")] | |
| 27 | pub text: Color, | |
| 28 | #[serde(default = "text_special_default")] | |
| 29 | pub text_special: Color, | |
| 30 | #[serde(default = "text_secondary_default")] | |
| 31 | pub text_secondary: Color, | |
| 32 | #[serde(default = "text_error_default")] | |
| 33 | pub text_error: Color, | |
| 26 | 34 | #[serde(default = "outline_default")] |
| 27 | 35 | pub outline: Color, |
| 28 | 36 | #[serde(default = "outline_selected_default")] |
| @@ -37,8 +45,6 @@ pub struct ColorsConfig { | ||
| 37 | 45 | pub message_error_outline: Color, |
| 38 | 46 | #[serde(default = "message_success_outline_default")] |
| 39 | 47 | pub message_success_outline: Color, |
| 40 | #[serde(default = "error_text_default")] | |
| 41 | pub error_text: Color, | |
| 42 | 48 | #[serde(default)] |
| 43 | 49 | pub item_info: ItemInfoColors, |
| 44 | 50 | } |
| @@ -64,11 +70,18 @@ pub struct ItemInfoColors { | ||
| 64 | 70 | pub video_count: Color, |
| 65 | 71 | #[serde(default = "sub_count_default")] |
| 66 | 72 | pub sub_count: Color, |
| 73 | #[serde(default = "likes_default")] | |
| 74 | pub likes: Color, | |
| 75 | #[serde(default = "genre_default")] | |
| 76 | pub genre: Color, | |
| 67 | 77 | } |
| 68 | 78 | |
| 69 | 79 | impl Default for ColorsConfig { |
| 70 | 80 | fn default() -> Self { |
| 71 | 81 | Self { |
| 82 | text: text_default(), | |
| 83 | text_special: text_special_default(), | |
| 84 | text_secondary: text_secondary_default(), | |
| 72 | 85 | outline: outline_default(), |
| 73 | 86 | outline_selected: outline_selected_default(), |
| 74 | 87 | outline_hover: outline_hover_default(), |
| @@ -76,7 +89,7 @@ impl Default for ColorsConfig { | ||
| 76 | 89 | message_outline: message_outline_default(), |
| 77 | 90 | message_error_outline: message_error_outline_default(), |
| 78 | 91 | message_success_outline: message_success_outline_default(), |
| 79 | error_text: error_text_default(), | |
| 92 | text_error: text_error_default(), | |
| 80 | 93 | item_info: ItemInfoColors::default(), |
| 81 | 94 | } |
| 82 | 95 | } |
| @@ -94,6 +107,8 @@ impl Default for ItemInfoColors { | ||
| 94 | 107 | published: published_default(), |
| 95 | 108 | video_count: video_count_default(), |
| 96 | 109 | sub_count: sub_count_default(), |
| 110 | likes: likes_default(), | |
| 111 | genre: genre_default(), | |
| 97 | 112 | } |
| 98 | 113 | } |
| 99 | 114 | } |
| @@ -117,6 +132,18 @@ impl Key for AppearanceConfig { | ||
| 117 | 132 | |
| 118 | 133 | // defaults |
| 119 | 134 | |
| 135 | fn text_default() -> Color { | |
| 136 | Color::Reset | |
| 137 | } | |
| 138 | ||
| 139 | fn text_special_default() -> Color { | |
| 140 | Color::Reset | |
| 141 | } | |
| 142 | ||
| 143 | fn text_secondary_default() -> Color { | |
| 144 | Color::Reset | |
| 145 | } | |
| 146 | ||
| 120 | 147 | fn outline_default() -> Color { |
| 121 | 148 | Color::Reset |
| 122 | 149 | } |
| @@ -145,7 +172,7 @@ fn message_success_outline_default() -> Color { | ||
| 145 | 172 | Color::LightGreen |
| 146 | 173 | } |
| 147 | 174 | |
| 148 | fn error_text_default() -> Color { | |
| 175 | fn text_error_default() -> Color { | |
| 149 | 176 | Color::LightRed |
| 150 | 177 | } |
| 151 | 178 | |
| @@ -184,3 +211,11 @@ fn video_count_default() -> Color { | ||
| 184 | 211 | fn sub_count_default() -> Color { |
| 185 | 212 | Color::LightYellow |
| 186 | 213 | } |
| 214 | ||
| 215 | fn likes_default() -> Color { | |
| 216 | Color::Rgb(200, 255, 129) | |
| 217 | } | |
| 218 | ||
| 219 | fn genre_default() -> Color { | |
| 220 | Color::Rgb(255, 121, 215) | |
| 221 | } | |
src/config/commands.rs added +64
| @@ -0,0 +1,64 @@ | ||
| 1 | use std::collections::HashMap; | |
| 2 | ||
| 3 | use serde::{Deserialize, Serialize}; | |
| 4 | use typemap::Key; | |
| 5 | ||
| 6 | use crate::global::traits::ConfigTrait; | |
| 7 | ||
| 8 | #[derive(Clone)] | |
| 9 | pub struct CommandsConfig { | |
| 10 | pub video: HashMap<String, String>, | |
| 11 | pub playlist: HashMap<String, String>, | |
| 12 | } | |
| 13 | ||
| 14 | impl Key for CommandsConfig { | |
| 15 | type Value = Self; | |
| 16 | } | |
| 17 | ||
| 18 | impl From<CommandsConfigSerde> for CommandsConfig { | |
| 19 | fn from(original: CommandsConfigSerde) -> Self { | |
| 20 | Self { | |
| 21 | video: HashMap::from_iter(original.video.into_iter().map(|item| item.into_iter().last().unwrap())), | |
| 22 | playlist: HashMap::from_iter(original.playlist.into_iter().map(|item| item.into_iter().last().unwrap())), | |
| 23 | } | |
| 24 | } | |
| 25 | } | |
| 26 | ||
| 27 | #[derive(Serialize, Deserialize, Clone)] | |
| 28 | pub struct CommandsConfigSerde { | |
| 29 | #[serde(default = "video_default")] | |
| 30 | pub video: Vec<HashMap<String, String>>, | |
| 31 | #[serde(default = "playlist_default")] | |
| 32 | pub playlist: Vec<HashMap<String, String>>, | |
| 33 | } | |
| 34 | ||
| 35 | impl ConfigTrait for CommandsConfigSerde { | |
| 36 | const LABEL: &'static str = "commands"; | |
| 37 | } | |
| 38 | ||
| 39 | impl Default for CommandsConfigSerde { | |
| 40 | fn default() -> Self { | |
| 41 | Self { | |
| 42 | video: video_default(), | |
| 43 | playlist: playlist_default(), | |
| 44 | } | |
| 45 | } | |
| 46 | } | |
| 47 | ||
| 48 | fn video_default() -> Vec<HashMap<String, String>> { | |
| 49 | vec![HashMap::from( | |
| 50 | [( | |
| 51 | String::from("Play video"), | |
| 52 | String::from("${video-player} ${embed-url}"), | |
| 53 | )])] | |
| 54 | } | |
| 55 | ||
| 56 | fn playlist_default() -> Vec<HashMap<String, String>> { | |
| 57 | vec![ | |
| 58 | HashMap::from([(String::from("Switch view"), String::from("%switch-view%"))]), | |
| 59 | HashMap::from([( | |
| 60 | String::from("Play entire playlist"), | |
| 61 | String::from("${video-player} ${embed-url}"), | |
| 62 | )]), | |
| 63 | ] | |
| 64 | } | |
src/config/main.rs +8
| @@ -14,6 +14,8 @@ pub struct MainConfig { | ||
| 14 | 14 | pub message_bar_default: String, |
| 15 | 15 | #[serde(default = "images_default")] |
| 16 | 16 | pub images: Images, |
| 17 | #[serde(default = "refresh_after_modifying_search_filters_default")] | |
| 18 | pub refresh_after_modifying_search_filters: bool, | |
| 17 | 19 | #[serde(default = "image_index_default")] |
| 18 | 20 | // The image to download from the array of images provided by the invidious api |
| 19 | 21 | // 0 is usually `maxres` and 3 (default) is good enough for normal uses without having huge files sizes |
| @@ -35,6 +37,8 @@ impl Default for MainConfig { | ||
| 35 | 37 | message_bar_default: message_bar_default_default(), |
| 36 | 38 | images: images_default(), |
| 37 | 39 | image_index: image_index_default(), |
| 40 | refresh_after_modifying_search_filters: refresh_after_modifying_search_filters_default( | |
| 41 | ), | |
| 38 | 42 | |
| 39 | 43 | env: HashMap::default(), |
| 40 | 44 | } |
| @@ -83,3 +87,7 @@ const fn image_index_default() -> usize { | ||
| 83 | 87 | const fn allow_unicode_default() -> bool { |
| 84 | 88 | false |
| 85 | 89 | } |
| 90 | ||
| 91 | const fn refresh_after_modifying_search_filters_default() -> bool { | |
| 92 | true | |
| 93 | } | |
src/config/mod.rs +2
| @@ -9,5 +9,7 @@ mod pages; | ||
| 9 | 9 | pub use pages::*; |
| 10 | 10 | mod keybindings; |
| 11 | 11 | pub use keybindings::*; |
| 12 | mod commands; | |
| 13 | pub use commands::*; | |
| 12 | 14 | |
| 13 | 15 | pub mod serde; |
src/config/pages.rs +21 −14
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | use crate::{ |
| 2 | 2 | global::traits::ConfigTrait, |
| 3 | items::{ItemList, MessageBar, PageButton, SearchBar, SearchFilter}, | |
| 3 | items::{ItemList, MessageBar, PageButton, SearchBar, SearchFilter, SingleItem}, | |
| 4 | 4 | }; |
| 5 | 5 | use serde::{Deserialize, Serialize}; |
| 6 | 6 | use std::slice; |
| @@ -10,7 +10,7 @@ use typemap::Key; | ||
| 10 | 10 | |
| 11 | 11 | /// Minimum screen dimention for the tui to display without panicking, stored in `data.state` |
| 12 | 12 | // is automatically generated from PageConfig |
| 13 | #[derive(Clone, Copy)] | |
| 13 | #[derive(Clone, Copy, Default)] | |
| 14 | 14 | pub struct MinDimentions { |
| 15 | 15 | pub width: u16, |
| 16 | 16 | pub height: u16, |
| @@ -22,15 +22,6 @@ impl MinDimentions { | ||
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | impl Default for MinDimentions { | |
| 26 | fn default() -> Self { | |
| 27 | Self { | |
| 28 | width: 0, | |
| 29 | height: 0, | |
| 30 | } | |
| 31 | } | |
| 32 | } | |
| 33 | ||
| 34 | 25 | impl Key for MinDimentions { |
| 35 | 26 | type Value = Self; |
| 36 | 27 | } |
| @@ -42,6 +33,8 @@ pub struct PagesConfig { | ||
| 42 | 33 | pub main_menu: PageConfig, |
| 43 | 34 | #[serde(default = "search_default")] |
| 44 | 35 | pub search: PageConfig, |
| 36 | #[serde(default = "singleitem_default")] | |
| 37 | pub singleitem: PageConfig, | |
| 45 | 38 | } |
| 46 | 39 | |
| 47 | 40 | impl Key for PagesConfig { |
| @@ -57,6 +50,7 @@ impl Default for PagesConfig { | ||
| 57 | 50 | Self { |
| 58 | 51 | main_menu: main_menu_default(), |
| 59 | 52 | search: search_default(), |
| 53 | singleitem: singleitem_default(), | |
| 60 | 54 | } |
| 61 | 55 | } |
| 62 | 56 | } |
| @@ -163,6 +157,7 @@ pub enum PageItems { | ||
| 163 | 157 | Trending, |
| 164 | 158 | Popular, |
| 165 | 159 | SearchFilters, |
| 160 | SingleItemInfo, | |
| 166 | 161 | } |
| 167 | 162 | |
| 168 | 163 | impl PageItems { |
| @@ -175,6 +170,7 @@ impl PageItems { | ||
| 175 | 170 | Self::MessageBar => Box::new(MessageBar::default()), |
| 176 | 171 | Self::ItemList => Box::new(ItemList::default()), |
| 177 | 172 | Self::SearchFilters => Box::new(SearchFilter::default()), |
| 173 | Self::SingleItemInfo => Box::new(SingleItem::default()), | |
| 178 | 174 | } |
| 179 | 175 | } |
| 180 | 176 | |
| @@ -183,7 +179,7 @@ impl PageItems { | ||
| 183 | 179 | Self::Popular | Self::Trending => Constraint::Length(15), |
| 184 | 180 | Self::SearchBar => Constraint::Min(16), |
| 185 | 181 | Self::MessageBar => Constraint::Min(3), |
| 186 | Self::ItemList => Constraint::Min(9), | |
| 182 | Self::ItemList | Self::SingleItemInfo => Constraint::Min(9), | |
| 187 | 183 | Self::SearchFilters => Constraint::Length(5), |
| 188 | 184 | } |
| 189 | 185 | } |
| @@ -195,7 +191,7 @@ impl PageItems { | ||
| 195 | 191 | | Self::MessageBar |
| 196 | 192 | | Self::SearchBar |
| 197 | 193 | | Self::SearchFilters => Constraint::Length(3), |
| 198 | Self::ItemList => Constraint::Min(6), | |
| 194 | Self::ItemList | Self::SingleItemInfo => Constraint::Min(6), | |
| 199 | 195 | } |
| 200 | 196 | } |
| 201 | 197 | } |
| @@ -203,7 +199,7 @@ impl PageItems { | ||
| 203 | 199 | fn constraint_to_u16(constraint: &Constraint) -> u16 { |
| 204 | 200 | match constraint { |
| 205 | 201 | Constraint::Max(length) | Constraint::Min(length) | Constraint::Length(length) => *length, |
| 206 | _ => unreachable!(), | |
| 202 | _ => unreachable!("only `Max`, `Min`, `Length` can be used as item length"), | |
| 207 | 203 | } |
| 208 | 204 | } |
| 209 | 205 | |
| @@ -246,3 +242,14 @@ fn search_default() -> PageConfig { | ||
| 246 | 242 | message: String::from("Loading search results..."), |
| 247 | 243 | } |
| 248 | 244 | } |
| 245 | ||
| 246 | fn singleitem_default() -> PageConfig { | |
| 247 | PageConfig { | |
| 248 | layout: vec![ | |
| 249 | PageRow::from_vec(vec![PageItems::SearchBar, PageItems::SearchFilters], false), | |
| 250 | PageRow::from_vec(vec![PageItems::SingleItemInfo], false), | |
| 251 | PageRow::from_vec(vec![PageItems::MessageBar], false), | |
| 252 | ], | |
| 253 | message: String::from("Loading item details..."), | |
| 254 | } | |
| 255 | } | |
src/config/search.rs +9 −9
| @@ -7,7 +7,7 @@ use typemap::Key; | ||
| 7 | 7 | |
| 8 | 8 | // can be turned into URL Params for the search term with filters |
| 9 | 9 | /// Search query & filters |
| 10 | #[derive(Clone, Default, Serialize, Deserialize, PartialEq, Eq)] | |
| 10 | #[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 11 | 11 | pub struct Search { |
| 12 | 12 | pub query: String, |
| 13 | 13 | pub filters: SearchFilters, |
| @@ -35,7 +35,7 @@ impl ToString for Search { | ||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /// Search filters, read comments for function docs |
| 38 | #[derive(Default, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | |
| 38 | #[derive(Default, Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 39 | 39 | pub struct SearchFilters { |
| 40 | 40 | pub sort: SearchFilterSort, |
| 41 | 41 | pub date: SearchFilterDate, |
| @@ -68,7 +68,7 @@ impl SearchFilters { | ||
| 68 | 68 | 2 => self.duration.selected_index(), |
| 69 | 69 | 3 => self.r#type.selected_index(), |
| 70 | 70 | 4 => 0, |
| 71 | _ => unreachable!(), | |
| 71 | _ => unreachable!("`{index}` is not a valid index"), | |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| @@ -84,10 +84,10 @@ impl SearchFilters { | ||
| 84 | 84 | if set_index == 0 { |
| 85 | 85 | self.reset(message) |
| 86 | 86 | } else { |
| 87 | unreachable!() | |
| 87 | unreachable!("index can only be `0` for option `4` (reset all)") | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | _ => unreachable!(), | |
| 90 | _ => unreachable!("`{index_at}` is not a valid index"), | |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| @@ -97,7 +97,7 @@ impl SearchFilters { | ||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | #[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | |
| 100 | #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 101 | 101 | pub enum SearchFilterSort { |
| 102 | 102 | Relevance, |
| 103 | 103 | Rating, |
| @@ -105,7 +105,7 @@ pub enum SearchFilterSort { | ||
| 105 | 105 | Views, |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | #[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | |
| 108 | #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 109 | 109 | pub enum SearchFilterDate { |
| 110 | 110 | None, |
| 111 | 111 | Hour, |
| @@ -115,7 +115,7 @@ pub enum SearchFilterDate { | ||
| 115 | 115 | Year, |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | #[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | |
| 118 | #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 119 | 119 | pub enum SearchFilterDuration { |
| 120 | 120 | None, |
| 121 | 121 | Short, |
| @@ -123,7 +123,7 @@ pub enum SearchFilterDuration { | ||
| 123 | 123 | Long, |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | #[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | |
| 126 | #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] | |
| 127 | 127 | pub enum SearchFilterType { |
| 128 | 128 | All, |
| 129 | 129 | Video, |
src/config/serde.rs +7 −7
| @@ -18,13 +18,13 @@ impl Default for BorderTypeSerde { | ||
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | impl Into<BorderType> for BorderTypeSerde { | |
| 22 | fn into(self) -> BorderType { | |
| 23 | match self { | |
| 24 | Self::Plain => BorderType::Plain, | |
| 25 | Self::Rounded => BorderType::Rounded, | |
| 26 | Self::Thick => BorderType::Thick, | |
| 27 | Self::Double => BorderType::Double, | |
| 21 | impl From<BorderTypeSerde> for BorderType { | |
| 22 | fn from(origianl: BorderTypeSerde) -> BorderType { | |
| 23 | match origianl { | |
| 24 | BorderTypeSerde::Plain => BorderType::Plain, | |
| 25 | BorderTypeSerde::Rounded => BorderType::Rounded, | |
| 26 | BorderTypeSerde::Thick => BorderType::Thick, | |
| 27 | BorderTypeSerde::Double => BorderType::Double, | |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | } |
src/global/functions/download_all_images.rs +13 −12
| @@ -15,17 +15,22 @@ impl From<&Item> for Option<DownloadRequest> { | ||
| 15 | 15 | url: minivideo.thumbnail_url.clone(), |
| 16 | 16 | id: minivideo.id.clone(), |
| 17 | 17 | }, |
| 18 | Item::MiniPlaylist(miniplaylist) => match &miniplaylist.thumbnail { | |
| 19 | Some((id, url)) => DownloadRequest { | |
| 20 | url: url.clone(), | |
| 21 | id: id.clone(), | |
| 22 | }, | |
| 23 | None => return None, | |
| 18 | Item::MiniPlaylist(miniplaylist) => DownloadRequest { | |
| 19 | url: miniplaylist.thumbnail_url.clone(), | |
| 20 | id: miniplaylist.id.clone(), | |
| 24 | 21 | }, |
| 25 | 22 | Item::MiniChannel(minichannel) => DownloadRequest { |
| 26 | 23 | url: minichannel.thumbnail_url.clone(), |
| 27 | 24 | id: minichannel.id.clone(), |
| 28 | 25 | }, |
| 26 | Item::FullVideo(fullvideo) => DownloadRequest { | |
| 27 | url: fullvideo.thumbnail_url.clone(), | |
| 28 | id: fullvideo.id.clone(), | |
| 29 | }, | |
| 30 | Item::FullPlaylist(fullplaylist) => DownloadRequest { | |
| 31 | url: fullplaylist.thumbnail_url.clone(), | |
| 32 | id: fullplaylist.id.clone(), | |
| 33 | }, | |
| 29 | 34 | Item::Unknown(_) => return None, |
| 30 | 35 | }) |
| 31 | 36 | } |
| @@ -37,11 +42,7 @@ pub fn download_all_images(downloads: Vec<Option<DownloadRequest>>) { | ||
| 37 | 42 | let rt: Runtime = tokio::runtime::Runtime::new().unwrap(); |
| 38 | 43 | |
| 39 | 44 | let _ = rt.block_on(download_all_images_async( |
| 40 | downloads | |
| 41 | .into_iter() | |
| 42 | .filter(|request| request.is_some()) | |
| 43 | .map(|request| request.unwrap()) | |
| 44 | .collect(), | |
| 45 | downloads.into_iter().flatten().collect(), | |
| 45 | 46 | )); |
| 46 | 47 | }); |
| 47 | 48 | } |
| @@ -61,7 +62,7 @@ async fn download_all_images_async(downloads: Vec<DownloadRequest>) { | ||
| 61 | 62 | if !path.exists() { |
| 62 | 63 | actions.push(download_single( |
| 63 | 64 | download.url, |
| 64 | path.clone().into_os_string().into_string().unwrap(), | |
| 65 | path.to_owned().into_os_string().into_string().unwrap(), | |
| 65 | 66 | )); |
| 66 | 67 | } |
| 67 | 68 | |
src/global/functions/secs_display_string.rs +2 −2
| @@ -15,11 +15,11 @@ pub fn secs_display_string(mut secs: u32) -> String { | ||
| 15 | 15 | let minutes = secs / SECS_IN_MINUTE; |
| 16 | 16 | secs -= minutes * SECS_IN_MINUTE; |
| 17 | 17 | out.push(two_digit_num(minutes)); |
| 18 | } else if out.len() != 0 { | |
| 18 | } else if !out.is_empty() { | |
| 19 | 19 | out.push(String::from("00")); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | if out.len() == 0 { | |
| 22 | if out.is_empty() { | |
| 23 | 23 | out.push(String::from("00")); |
| 24 | 24 | } |
| 25 | 25 | out.push(two_digit_num(secs)); |
src/global/functions/viewcount_text.rs +1 −1
| @@ -1,4 +1,4 @@ | ||
| 1 | const UNITS: &[(&'static str, f64)] = &[ | |
| 1 | const UNITS: &[(&str, f64)] = &[ | |
| 2 | 2 | ("B", 1_000_000_000_f64), |
| 3 | 3 | ("M", 1_000_000_f64), |
| 4 | 4 | ("K", 1_000_f64), |
src/global/structs/errors.rs +1 −1
| @@ -12,7 +12,7 @@ impl Display for Errors { | ||
| 12 | 12 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 13 | 13 | match self { |
| 14 | 14 | Self::BlankError => f.write_str("Is a blank error ¯\\_(ツ)_/¯"), |
| 15 | Self::StringError(e) => f.write_str(&e), | |
| 15 | Self::StringError(e) => f.write_str(e), | |
| 16 | 16 | Self::StrError(e) => f.write_str(e), |
| 17 | 17 | } |
| 18 | 18 | } |
src/global/structs/item.rs +108 −44
| @@ -1,6 +1,10 @@ | ||
| 1 | 1 | use crate::global::functions::{date_text, secs_display_string, viewcount_text}; |
| 2 | use invidious::structs::hidden::{ | |
| 3 | Playlist, PopularItem, SearchItem, SearchItemTransition, TrendingVideo, | |
| 2 | use invidious::structs::{ | |
| 3 | hidden::{ | |
| 4 | Playlist, PlaylistItem, PopularItem, SearchItem, SearchItemTransition, TrendingVideo, | |
| 5 | }, | |
| 6 | universal::Playlist as FullPlaylist, | |
| 7 | video::Video, | |
| 4 | 8 | }; |
| 5 | 9 | use std::fmt::Display; |
| 6 | 10 | |
| @@ -12,10 +16,11 @@ pub enum Item { | ||
| 12 | 16 | MiniVideo(MiniVideoItem), |
| 13 | 17 | MiniPlaylist(MiniPlaylistItem), |
| 14 | 18 | MiniChannel(MiniChannelItem), |
| 19 | FullVideo(FullVideoItem), | |
| 20 | FullPlaylist(FullPlaylistItem), | |
| 15 | 21 | Unknown(SearchItemTransition), |
| 16 | 22 | } |
| 17 | 23 | |
| 18 | /// info from a video from search, trending and popular page | |
| 19 | 24 | #[derive(Clone)] |
| 20 | 25 | pub struct MiniVideoItem { |
| 21 | 26 | pub title: String, |
| @@ -25,7 +30,7 @@ pub struct MiniVideoItem { | ||
| 25 | 30 | pub views: Option<String>, |
| 26 | 31 | pub channel: String, |
| 27 | 32 | pub channel_id: String, |
| 28 | pub published: String, | |
| 33 | pub published: Option<String>, | |
| 29 | 34 | pub description: Option<String>, |
| 30 | 35 | } |
| 31 | 36 | |
| @@ -36,8 +41,7 @@ pub struct MiniPlaylistItem { | ||
| 36 | 41 | pub channel: String, |
| 37 | 42 | pub channel_id: String, |
| 38 | 43 | pub video_count: u32, |
| 39 | // (id, url) | |
| 40 | pub thumbnail: Option<(String, String)>, | |
| 44 | pub thumbnail_url: String, | |
| 41 | 45 | } |
| 42 | 46 | |
| 43 | 47 | #[derive(Clone)] |
| @@ -51,12 +55,44 @@ pub struct MiniChannelItem { | ||
| 51 | 55 | pub description: String, |
| 52 | 56 | } |
| 53 | 57 | |
| 58 | #[derive(Clone)] | |
| 59 | pub struct FullVideoItem { | |
| 60 | pub title: String, | |
| 61 | pub id: String, | |
| 62 | pub thumbnail_url: String, | |
| 63 | pub length: String, | |
| 64 | pub views: String, | |
| 65 | pub channel: String, | |
| 66 | pub channel_id: String, | |
| 67 | pub sub_count: String, | |
| 68 | pub published: String, | |
| 69 | pub description: String, | |
| 70 | pub likes: String, | |
| 71 | // pub dislikes: Option<String>, TODO | |
| 72 | pub genre: String, | |
| 73 | } | |
| 74 | ||
| 75 | #[derive(Clone)] | |
| 76 | pub struct FullPlaylistItem { | |
| 77 | pub title: String, | |
| 78 | pub id: String, | |
| 79 | pub channel: String, | |
| 80 | pub channel_id: String, | |
| 81 | pub video_count: u32, | |
| 82 | pub description: String, | |
| 83 | pub views: String, | |
| 84 | pub thumbnail_url: String, | |
| 85 | pub videos: Vec<Item>, | |
| 86 | } | |
| 87 | ||
| 54 | 88 | impl Display for Item { |
| 55 | 89 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 56 | 90 | f.write_str(match self { |
| 57 | 91 | Self::MiniVideo(video) => &video.title, |
| 58 | 92 | Self::MiniPlaylist(playlist) => &playlist.title, |
| 59 | 93 | Self::MiniChannel(channel) => &channel.name, |
| 94 | Self::FullVideo(video) => &video.title, | |
| 95 | Self::FullPlaylist(playlist) => &playlist.title, | |
| 60 | 96 | Self::Unknown(_) => "Unknown item", |
| 61 | 97 | }) |
| 62 | 98 | } |
| @@ -67,11 +103,10 @@ impl Item { | ||
| 67 | 103 | pub fn thumbnail_id(&self) -> &str { |
| 68 | 104 | match self { |
| 69 | 105 | Self::MiniVideo(video) => &video.id, |
| 70 | Self::MiniPlaylist(playlist) => match &playlist.thumbnail { | |
| 71 | Some((id, _)) => &id, | |
| 72 | None => "invalid", | |
| 73 | }, | |
| 106 | Self::MiniPlaylist(playlist) => &playlist.id, | |
| 74 | 107 | Self::MiniChannel(channel) => &channel.id, |
| 108 | Self::FullVideo(video) => &video.id, | |
| 109 | Self::FullPlaylist(playlist) => &playlist.id, | |
| 75 | 110 | Self::Unknown(_) => "invalid", |
| 76 | 111 | } |
| 77 | 112 | } |
| @@ -86,11 +121,11 @@ impl Item { | ||
| 86 | 121 | views: Some(viewcount_text(original.views)), |
| 87 | 122 | channel: original.author, |
| 88 | 123 | channel_id: original.author_id, |
| 89 | published: format!( | |
| 124 | published: Some(format!( | |
| 90 | 125 | "{} [{}]", |
| 91 | 126 | original.published_text, |
| 92 | 127 | date_text(original.published) |
| 93 | ), | |
| 128 | )), | |
| 94 | 129 | description: Some(original.description), |
| 95 | 130 | }) |
| 96 | 131 | } |
| @@ -104,30 +139,23 @@ impl Item { | ||
| 104 | 139 | views: Some(viewcount_text(original.views)), |
| 105 | 140 | channel: original.author, |
| 106 | 141 | channel_id: original.author_id, |
| 107 | published: format!( | |
| 142 | published: Some(format!( | |
| 108 | 143 | "{} [{}]", |
| 109 | 144 | original.published_text, |
| 110 | 145 | date_text(original.published) |
| 111 | ), | |
| 146 | )), | |
| 112 | 147 | description: None, |
| 113 | 148 | }) |
| 114 | 149 | } |
| 115 | 150 | |
| 116 | pub fn from_mini_playlist(original: Playlist, image_index: usize) -> Self { | |
| 151 | pub fn from_mini_playlist(original: Playlist) -> Self { | |
| 117 | 152 | Self::MiniPlaylist(MiniPlaylistItem { |
| 118 | 153 | title: original.title, |
| 119 | 154 | id: original.id, |
| 120 | 155 | channel: original.author, |
| 121 | 156 | channel_id: original.author_id, |
| 122 | 157 | video_count: original.video_count, |
| 123 | thumbnail: if original.videos.len() == 0 { | |
| 124 | None | |
| 125 | } else { | |
| 126 | Some(( | |
| 127 | original.videos[0].id.clone(), | |
| 128 | original.videos[0].thumbnails[image_index].url.clone(), | |
| 129 | )) | |
| 130 | }, | |
| 158 | thumbnail_url: original.thumbnail, | |
| 131 | 159 | }) |
| 132 | 160 | } |
| 133 | 161 | |
| @@ -138,17 +166,13 @@ impl Item { | ||
| 138 | 166 | id, |
| 139 | 167 | author, |
| 140 | 168 | author_id, |
| 141 | author_url: _, | |
| 142 | 169 | length, |
| 143 | 170 | thumbnails, |
| 144 | 171 | description, |
| 145 | description_html: _, | |
| 146 | 172 | views, |
| 147 | 173 | published, |
| 148 | 174 | published_text, |
| 149 | live: _, | |
| 150 | paid: _, | |
| 151 | premium: _, | |
| 175 | .. | |
| 152 | 176 | } => Self::MiniVideo(MiniVideoItem { |
| 153 | 177 | title, |
| 154 | 178 | id, |
| @@ -157,7 +181,7 @@ impl Item { | ||
| 157 | 181 | views: Some(viewcount_text(views)), |
| 158 | 182 | channel: author, |
| 159 | 183 | channel_id: author_id, |
| 160 | published: format!("{} [{}]", published_text, date_text(published)), | |
| 184 | published: Some(format!("{} [{}]", published_text, date_text(published))), | |
| 161 | 185 | description: Some(description), |
| 162 | 186 | }), |
| 163 | 187 | SearchItem::Playlist { |
| @@ -165,35 +189,26 @@ impl Item { | ||
| 165 | 189 | id, |
| 166 | 190 | author, |
| 167 | 191 | author_id, |
| 168 | author_url: _, | |
| 169 | 192 | video_count, |
| 170 | videos, | |
| 193 | thumbnail, | |
| 194 | .. | |
| 171 | 195 | } => Self::MiniPlaylist(MiniPlaylistItem { |
| 172 | 196 | title, |
| 173 | 197 | id, |
| 174 | 198 | channel: author, |
| 175 | 199 | channel_id: author_id, |
| 176 | 200 | video_count, |
| 177 | thumbnail: if videos.len() == 0 { | |
| 178 | None | |
| 179 | } else { | |
| 180 | Some(( | |
| 181 | videos[0].id.clone(), | |
| 182 | videos[0].thumbnails[image_index].url.clone(), | |
| 183 | )) | |
| 184 | }, | |
| 201 | thumbnail_url: thumbnail, | |
| 185 | 202 | }), |
| 186 | 203 | SearchItem::Channel { |
| 187 | 204 | name, |
| 188 | 205 | id, |
| 189 | url: _, | |
| 190 | 206 | thumbnails, |
| 191 | 207 | subscribers, |
| 192 | 208 | video_count, |
| 193 | 209 | description, |
| 194 | description_html: _, | |
| 195 | } => { | |
| 196 | Self::MiniChannel(MiniChannelItem { | |
| 210 | .. | |
| 211 | } => Self::MiniChannel(MiniChannelItem { | |
| 197 | 212 | name, |
| 198 | 213 | id, |
| 199 | 214 | thumbnail_url: format!("https://{}", thumbnails[image_index].url), |
| @@ -201,8 +216,57 @@ impl Item { | ||
| 201 | 216 | sub_count: subscribers, |
| 202 | 217 | sub_count_text: viewcount_text(subscribers as u64), |
| 203 | 218 | description, |
| 204 | })}, | |
| 219 | }), | |
| 205 | 220 | SearchItem::Unknown(searchitem_transitional) => Self::Unknown(searchitem_transitional), |
| 206 | 221 | } |
| 207 | 222 | } |
| 223 | ||
| 224 | pub fn from_full_video(original: Video, image_index: usize) -> Self { | |
| 225 | Self::FullVideo(FullVideoItem { | |
| 226 | title: original.title, | |
| 227 | id: original.id, | |
| 228 | thumbnail_url: original.thumbnails[image_index].url.clone(), | |
| 229 | length: secs_display_string(original.length as u32), | |
| 230 | views: viewcount_text(original.views), | |
| 231 | channel: original.author, | |
| 232 | channel_id: original.author_id, | |
| 233 | sub_count: original.sub_count_text, | |
| 234 | published: original.published_text, | |
| 235 | description: original.description, | |
| 236 | likes: viewcount_text(original.likes as u64), | |
| 237 | genre: original.genre, | |
| 238 | }) | |
| 239 | } | |
| 240 | ||
| 241 | pub fn from_full_playlist(original: FullPlaylist, image_index: usize) -> Self { | |
| 242 | Self::FullPlaylist(FullPlaylistItem { | |
| 243 | title: original.title, | |
| 244 | id: original.id, | |
| 245 | channel: original.author, | |
| 246 | channel_id: original.author_id, | |
| 247 | video_count: original.video_count, | |
| 248 | description: original.description, | |
| 249 | views: viewcount_text(original.views), | |
| 250 | thumbnail_url: original.thumbnail, | |
| 251 | videos: original | |
| 252 | .videos | |
| 253 | .into_iter() | |
| 254 | .map(|video| Self::from_playlist_item(video, image_index)) | |
| 255 | .collect(), | |
| 256 | }) | |
| 257 | } | |
| 258 | ||
| 259 | pub fn from_playlist_item(original: PlaylistItem, image_index: usize) -> Self { | |
| 260 | Self::MiniVideo(MiniVideoItem { | |
| 261 | title: original.title, | |
| 262 | id: original.id, | |
| 263 | thumbnail_url: original.thumbnails[image_index].url.to_owned(), | |
| 264 | length: secs_display_string(original.length), | |
| 265 | views: None, | |
| 266 | channel: original.author, | |
| 267 | channel_id: original.author_id, | |
| 268 | published: None, | |
| 269 | description: None, | |
| 270 | }) | |
| 271 | } | |
| 208 | 272 | } |
src/global/structs/page.rs +26 −1
| @@ -1,3 +1,5 @@ | ||
| 1 | use std::fmt::Debug; | |
| 2 | ||
| 1 | 3 | use crate::config::{PageConfig, PagesConfig, Search}; |
| 2 | 4 | use tui_additions::framework::Framework; |
| 3 | 5 | use typemap::Key; |
| @@ -8,6 +10,20 @@ use typemap::Key; | ||
| 8 | 10 | pub enum Page { |
| 9 | 11 | MainMenu(MainMenuPage), |
| 10 | 12 | Search(Search), |
| 13 | SingleItem(SingleItemPage), | |
| 14 | } | |
| 15 | ||
| 16 | impl Debug for Page { | |
| 17 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | |
| 18 | f.write_fmt(format_args!( | |
| 19 | "{}(_)", | |
| 20 | match self { | |
| 21 | Self::MainMenu(_) => "MainMenu", | |
| 22 | Self::Search(_) => "Search", | |
| 23 | Self::SingleItem(_) => "SingleItem", | |
| 24 | } | |
| 25 | )) | |
| 26 | } | |
| 11 | 27 | } |
| 12 | 28 | |
| 13 | 29 | impl Default for Page { |
| @@ -33,12 +49,20 @@ impl Default for MainMenuPage { | ||
| 33 | 49 | } |
| 34 | 50 | } |
| 35 | 51 | |
| 52 | /// Different items to be displayed on a single item page | |
| 53 | #[derive(Clone, PartialEq, Eq)] | |
| 54 | pub enum SingleItemPage { | |
| 55 | Video(String), | |
| 56 | Playlist(String), | |
| 57 | } | |
| 58 | ||
| 36 | 59 | impl Page { |
| 37 | 60 | pub fn to_page_config(&self, framework: &Framework) -> PageConfig { |
| 38 | 61 | let pages_config = framework.data.global.get::<PagesConfig>().unwrap(); |
| 39 | 62 | match self { |
| 40 | 63 | Self::MainMenu(_) => pages_config.main_menu.clone(), |
| 41 | 64 | Self::Search(_) => pages_config.search.clone(), |
| 65 | Self::SingleItem(_) => pages_config.singleitem.clone(), | |
| 42 | 66 | } |
| 43 | 67 | } |
| 44 | 68 | |
| @@ -47,7 +71,8 @@ impl Page { | ||
| 47 | 71 | let pages_config = framework.data.global.get::<PagesConfig>().unwrap(); |
| 48 | 72 | match self { |
| 49 | 73 | Self::MainMenu(_) => pages_config.main_menu.message.clone(), |
| 50 | Self::Search(_) => pages_config.main_menu.message.clone(), | |
| 74 | Self::Search(_) => pages_config.search.message.clone(), | |
| 75 | Self::SingleItem(_) => pages_config.singleitem.message.clone(), | |
| 51 | 76 | } |
| 52 | 77 | } |
| 53 | 78 | } |
src/global/structs/tasks.rs +7 −7
| @@ -52,7 +52,7 @@ impl TaskQueue { | ||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | RenderTask::None => self.render = RenderTask::Only(vec![(x, y)]), |
| 55 | _ => return, | |
| 55 | _ => {} | |
| 56 | 56 | }, |
| 57 | 57 | Task::LoadPage(page) => self.load_page = Some(page), |
| 58 | 58 | Task::ClearPage => self.clear_all = true, |
| @@ -80,7 +80,7 @@ impl TaskQueue { | ||
| 80 | 80 | } |
| 81 | 81 | RenderTask::Only(_locations) => { |
| 82 | 82 | // need to file an issue to tui-rs suggesting this as a feature |
| 83 | unimplemented!(); | |
| 83 | unimplemented!("tui-rs does not support partial re-rendering"); | |
| 84 | 84 | } |
| 85 | 85 | RenderTask::None => {} |
| 86 | 86 | } |
| @@ -104,8 +104,9 @@ impl TaskQueue { | ||
| 104 | 104 | *framework.data.global.get_mut::<Message>().unwrap() = |
| 105 | 105 | Message::Message(page.load_msg(framework)); |
| 106 | 106 | framework.push_history(); |
| 107 | framework.cursor = CursorState::default(); | |
| 107 | 108 | |
| 108 | let page_config = page.to_page_config(&framework); | |
| 109 | let page_config = page.to_page_config(framework); | |
| 109 | 110 | *framework.data.state.get_mut::<MinDimentions>().unwrap() = |
| 110 | 111 | MinDimentions::new(page_config.min_width(), page_config.min_height()); |
| 111 | 112 | |
| @@ -116,7 +117,6 @@ impl TaskQueue { | ||
| 116 | 117 | Self::render_force_clear(framework, terminal)?; |
| 117 | 118 | *framework.data.global.get_mut::<Message>().unwrap() = Message::None; |
| 118 | 119 | |
| 119 | framework.cursor = CursorState::default(); | |
| 120 | 120 | *framework.data.global.get_mut::<Message>().unwrap() = if let Err(e) = framework.load() |
| 121 | 121 | { |
| 122 | 122 | Message::Error(format!("{}", e)) |
| @@ -179,7 +179,7 @@ impl TaskQueue { | ||
| 179 | 179 | .get::<AppearanceConfig>() |
| 180 | 180 | .unwrap() |
| 181 | 181 | .colors |
| 182 | .error_text), | |
| 182 | .text_error), | |
| 183 | 183 | ); |
| 184 | 184 | frame.render_widget(paragraph, area); |
| 185 | 185 | return; |
| @@ -207,11 +207,11 @@ impl Tasks { | ||
| 207 | 207 | // clears and returns the `priority` task queue, if it is already cleared then returns the `last` task queue |
| 208 | 208 | pub fn pop(&mut self) -> Option<TaskQueue> { |
| 209 | 209 | if !self.priority.is_empty() { |
| 210 | return Some(mem::replace(&mut self.priority, TaskQueue::default())); | |
| 210 | return Some(mem::take(&mut self.priority)); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | if !self.last.is_empty() { |
| 214 | return Some(mem::replace(&mut self.last, TaskQueue::default())); | |
| 214 | return Some(mem::take(&mut self.last)); | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | None |
src/global/traits/configtrait.rs +2 −2
| @@ -5,7 +5,7 @@ use std::{ | ||
| 5 | 5 | io::Write, |
| 6 | 6 | }; |
| 7 | 7 | |
| 8 | const EXTENSION: &'static str = "yml"; | |
| 8 | const EXTENSION: &str = "yml"; | |
| 9 | 9 | |
| 10 | 10 | /// Trait for loading, saving config files |
| 11 | 11 | pub trait ConfigTrait { |
| @@ -57,7 +57,7 @@ pub trait ConfigTrait { | ||
| 57 | 57 | .truncate(true) |
| 58 | 58 | .open(&config_path)?; |
| 59 | 59 | |
| 60 | file.write(serde_yaml::to_string(&config)?.as_bytes())?; | |
| 60 | file.write_all(serde_yaml::to_string(&config)?.as_bytes())?; | |
| 61 | 61 | |
| 62 | 62 | Ok(Box::new(config)) |
| 63 | 63 | } |
src/init.rs +6 −2
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | use crate::{ |
| 2 | 2 | config::{ |
| 3 | AppearanceConfig, AppearanceConfigSerde, KeyBindingsConfig, MainConfig, MinDimentions, | |
| 4 | PagesConfig, Search, | |
| 3 | AppearanceConfig, AppearanceConfigSerde, CommandsConfig, KeyBindingsConfig, MainConfig, | |
| 4 | MinDimentions, PagesConfig, Search, CommandsConfigSerde, | |
| 5 | 5 | }, |
| 6 | 6 | global::{ |
| 7 | 7 | structs::{InvidiousClient, Message, Page, Status, Tasks}, |
| @@ -52,6 +52,10 @@ pub fn init(framework: &mut Framework) -> Result<(), Box<dyn Error>> { | ||
| 52 | 52 | .global |
| 53 | 53 | .insert::<KeyBindingsConfig>(*KeyBindingsConfig::load()?); |
| 54 | 54 | framework.data.global.insert::<Message>(Message::None); |
| 55 | framework | |
| 56 | .data | |
| 57 | .global | |
| 58 | .insert::<CommandsConfig>(CommandsConfig::from(*CommandsConfigSerde::load()?)); | |
| 55 | 59 | |
| 56 | 60 | framework.data.state.insert::<Tasks>(Tasks::default()); |
| 57 | 61 | framework.data.state.insert::<Page>(Page::default()); |
src/items/iteminfo.rs +102 −35
| @@ -82,22 +82,16 @@ impl FrameworkItem for ItemInfo { | ||
| 82 | 82 | Style::default().fg(appearance.colors.item_info.tag), |
| 83 | 83 | ), |
| 84 | 84 | ( |
| 85 | minivideo.title.clone(), | |
| 85 | minivideo.title.to_owned(), | |
| 86 | 86 | Style::default().fg(appearance.colors.item_info.title), |
| 87 | 87 | ), |
| 88 | ], | |
| 89 | minivideo.description.as_ref().map(|description| { | |
| 88 | 90 | ( |
| 89 | format!("Uploaded by {}", minivideo.channel), | |
| 90 | Style::default().fg(appearance.colors.item_info.author), | |
| 91 | ), | |
| 92 | ], | |
| 93 | if let Some(description) = &minivideo.description { | |
| 94 | Some(( | |
| 95 | description.clone(), | |
| 91 | description.to_owned(), | |
| 96 | 92 | Style::default().fg(appearance.colors.item_info.description), |
| 97 | )) | |
| 98 | } else { | |
| 99 | None | |
| 100 | }, | |
| 93 | ) | |
| 94 | }), | |
| 101 | 95 | ); |
| 102 | 96 | if let Some(views) = &minivideo.views { |
| 103 | 97 | out.0.push(( |
| @@ -105,19 +99,21 @@ impl FrameworkItem for ItemInfo { | ||
| 105 | 99 | Style::default().fg(appearance.colors.item_info.viewcount), |
| 106 | 100 | )); |
| 107 | 101 | } |
| 108 | out.0.extend( | |
| 109 | vec![ | |
| 110 | ( | |
| 111 | format!("Length: {}", minivideo.length), | |
| 112 | Style::default().fg(appearance.colors.item_info.length), | |
| 113 | ), | |
| 114 | ( | |
| 115 | format!("Published {}", minivideo.published), | |
| 116 | Style::default().fg(appearance.colors.item_info.published), | |
| 117 | ), | |
| 118 | ] | |
| 119 | .into_iter(), | |
| 120 | ); | |
| 102 | out.0.push(( | |
| 103 | format!("Length: {}", minivideo.length), | |
| 104 | Style::default().fg(appearance.colors.item_info.length), | |
| 105 | )); | |
| 106 | out.0.push(( | |
| 107 | format!("Uploaded by {}", minivideo.channel), | |
| 108 | Style::default().fg(appearance.colors.item_info.author), | |
| 109 | )); | |
| 110 | if let Some(published) = &minivideo.published { | |
| 111 | out.0.push(( | |
| 112 | format!("Published {}", published), | |
| 113 | Style::default().fg(appearance.colors.item_info.published), | |
| 114 | )); | |
| 115 | } | |
| 116 | ||
| 121 | 117 | out |
| 122 | 118 | } |
| 123 | 119 | Item::MiniPlaylist(miniplaylist) => ( |
| @@ -127,7 +123,7 @@ impl FrameworkItem for ItemInfo { | ||
| 127 | 123 | Style::default().fg(appearance.colors.item_info.tag), |
| 128 | 124 | ), |
| 129 | 125 | ( |
| 130 | miniplaylist.title.clone(), | |
| 126 | miniplaylist.title.to_owned(), | |
| 131 | 127 | Style::default().fg(appearance.colors.item_info.title), |
| 132 | 128 | ), |
| 133 | 129 | ( |
| @@ -156,15 +152,15 @@ impl FrameworkItem for ItemInfo { | ||
| 156 | 152 | Style::default().fg(appearance.colors.item_info.tag), |
| 157 | 153 | ), |
| 158 | 154 | ( |
| 159 | minichannel.name.clone(), | |
| 155 | minichannel.name.to_owned(), | |
| 160 | 156 | Style::default().fg(appearance.colors.item_info.title), |
| 161 | 157 | ), |
| 162 | 158 | ( |
| 163 | format!("{} subscriber{}", minichannel.sub_count_text, if minichannel.sub_count <= 1 { | |
| 164 | "" | |
| 165 | } else { | |
| 166 | "s" | |
| 167 | }), | |
| 159 | format!( | |
| 160 | "{} subscriber{}", | |
| 161 | minichannel.sub_count_text, | |
| 162 | if minichannel.sub_count <= 1 { "" } else { "s" } | |
| 163 | ), | |
| 168 | 164 | Style::default().fg(appearance.colors.item_info.sub_count), |
| 169 | 165 | ), |
| 170 | 166 | ( |
| @@ -181,14 +177,85 @@ impl FrameworkItem for ItemInfo { | ||
| 181 | 177 | ), |
| 182 | 178 | ], |
| 183 | 179 | Some(( |
| 184 | minichannel.description.clone(), | |
| 180 | minichannel.description.to_owned(), | |
| 181 | Style::default().fg(appearance.colors.item_info.description), | |
| 182 | )), | |
| 183 | ), | |
| 184 | Item::FullVideo(fullvideo) => ( | |
| 185 | vec![ | |
| 186 | ( | |
| 187 | String::from("[Video]"), | |
| 188 | Style::default().fg(appearance.colors.item_info.tag), | |
| 189 | ), | |
| 190 | ( | |
| 191 | fullvideo.title.to_owned(), | |
| 192 | Style::default().fg(appearance.colors.item_info.title), | |
| 193 | ), | |
| 194 | ( | |
| 195 | format!("{} views", fullvideo.views), | |
| 196 | Style::default().fg(appearance.colors.item_info.viewcount), | |
| 197 | ), | |
| 198 | ( | |
| 199 | format!("{} likes", fullvideo.likes), | |
| 200 | Style::default().fg(appearance.colors.item_info.likes), | |
| 201 | ), | |
| 202 | ( | |
| 203 | format!("Length: {}", fullvideo.length), | |
| 204 | Style::default().fg(appearance.colors.item_info.length), | |
| 205 | ), | |
| 206 | ( | |
| 207 | format!( | |
| 208 | "Uploaded by {} ({} subscribers)", | |
| 209 | fullvideo.channel, fullvideo.sub_count | |
| 210 | ), | |
| 211 | Style::default().fg(appearance.colors.item_info.author), | |
| 212 | ), | |
| 213 | ( | |
| 214 | format!("Published {}", fullvideo.published), | |
| 215 | Style::default().fg(appearance.colors.item_info.published), | |
| 216 | ), | |
| 217 | ], | |
| 218 | Some(( | |
| 219 | fullvideo.description.to_owned(), | |
| 220 | Style::default().fg(appearance.colors.item_info.description), | |
| 221 | )), | |
| 222 | ), | |
| 223 | Item::FullPlaylist(fullplaylist) => ( | |
| 224 | vec![ | |
| 225 | ( | |
| 226 | String::from("[Playlist]"), | |
| 227 | Style::default().fg(appearance.colors.item_info.tag), | |
| 228 | ), | |
| 229 | ( | |
| 230 | fullplaylist.title.to_owned(), | |
| 231 | Style::default().fg(appearance.colors.item_info.title), | |
| 232 | ), | |
| 233 | ( | |
| 234 | format!("Created by by {}", fullplaylist.channel), | |
| 235 | Style::default().fg(appearance.colors.item_info.author), | |
| 236 | ), | |
| 237 | ( | |
| 238 | format!( | |
| 239 | "{} video{}", | |
| 240 | fullplaylist.video_count, | |
| 241 | if fullplaylist.video_count <= 1 { | |
| 242 | "" | |
| 243 | } else { | |
| 244 | "s" | |
| 245 | } | |
| 246 | ), | |
| 247 | Style::default().fg(appearance.colors.item_info.video_count), | |
| 248 | ), | |
| 249 | ], | |
| 250 | Some(( | |
| 251 | fullplaylist.description.to_owned(), | |
| 185 | 252 | Style::default().fg(appearance.colors.item_info.description), |
| 186 | 253 | )), |
| 187 | 254 | ), |
| 188 | 255 | Item::Unknown(searchitem_transitional) => ( |
| 189 | 256 | vec![( |
| 190 | 257 | format!("Unknown type `{}`", searchitem_transitional.r#type), |
| 191 | Style::default().fg(appearance.colors.error_text), | |
| 258 | Style::default().fg(appearance.colors.text_error), | |
| 192 | 259 | )], |
| 193 | 260 | Some(( |
| 194 | 261 | serde_json::to_string(&searchitem_transitional).unwrap(), |
| @@ -220,7 +287,7 @@ impl FrameworkItem for ItemInfo { | ||
| 220 | 287 | |
| 221 | 288 | // renders the "text" |
| 222 | 289 | let (text, style) = text.unwrap(); |
| 223 | if text.len() == 0 { | |
| 290 | if text.is_empty() { | |
| 224 | 291 | return; |
| 225 | 292 | } |
| 226 | 293 | let paragraph = Paragraph::new(format!("Description:\n{}", text)) |
src/items/itemlist.rs +63 −25
| @@ -11,7 +11,9 @@ use crate::{ | ||
| 11 | 11 | config::{AppearanceConfig, KeyBindingsConfig, MainConfig}, |
| 12 | 12 | global::{ |
| 13 | 13 | functions::download_all_images, |
| 14 | structs::{InvidiousClient, Item, KeyAction, MainMenuPage, Page, Task, Tasks}, | |
| 14 | structs::{ | |
| 15 | InvidiousClient, Item, KeyAction, MainMenuPage, Page, SingleItemPage, Task, Tasks, | |
| 16 | }, | |
| 15 | 17 | }, |
| 16 | 18 | }; |
| 17 | 19 | |
| @@ -25,6 +27,42 @@ pub struct ItemList { | ||
| 25 | 27 | pub grid: Grid, |
| 26 | 28 | } |
| 27 | 29 | |
| 30 | impl ItemList { | |
| 31 | fn update_appearance( | |
| 32 | &mut self, | |
| 33 | appearance: &AppearanceConfig, | |
| 34 | mainconfig: &MainConfig, | |
| 35 | iteminfo: &tui_additions::framework::ItemInfo, | |
| 36 | ) { | |
| 37 | self.textlist.set_ascii_only(!mainconfig.allow_unicode); | |
| 38 | self.grid.set_border_type(appearance.borders); | |
| 39 | self.textlist.set_border_type(appearance.borders); | |
| 40 | self.textlist | |
| 41 | .set_style(Style::default().fg(appearance.colors.text)); | |
| 42 | ||
| 43 | if iteminfo.selected { | |
| 44 | self.grid | |
| 45 | .set_border_style(Style::default().fg(appearance.colors.outline_selected)); | |
| 46 | self.textlist | |
| 47 | .set_cursor_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 48 | self.textlist | |
| 49 | .set_selected_style(Style::default().fg(appearance.colors.text_special)); | |
| 50 | } else { | |
| 51 | self.textlist | |
| 52 | .set_cursor_style(Style::default().fg(appearance.colors.outline_secondary)); | |
| 53 | self.textlist | |
| 54 | .set_selected_style(Style::default().fg(appearance.colors.text_secondary)); | |
| 55 | if iteminfo.hover { | |
| 56 | self.grid | |
| 57 | .set_border_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 58 | } else { | |
| 59 | self.grid | |
| 60 | .set_border_style(Style::default().fg(appearance.colors.outline)); | |
| 61 | } | |
| 62 | } | |
| 63 | } | |
| 64 | } | |
| 65 | ||
| 28 | 66 | impl Default for ItemList { |
| 29 | 67 | fn default() -> Self { |
| 30 | 68 | Self { |
| @@ -54,19 +92,12 @@ impl FrameworkItem for ItemList { | ||
| 54 | 92 | } |
| 55 | 93 | |
| 56 | 94 | let appearance = framework.data.global.get::<AppearanceConfig>().unwrap(); |
| 95 | let mainconfig = framework.data.global.get::<MainConfig>().unwrap(); | |
| 96 | self.update_appearance(appearance, mainconfig, &info); | |
| 57 | 97 | |
| 58 | 98 | // creates the grid |
| 59 | self.grid | |
| 60 | .set_border_style(Style::default().fg(if info.hover { | |
| 61 | appearance.colors.outline_hover | |
| 62 | } else if info.selected { | |
| 63 | appearance.colors.outline_selected | |
| 64 | } else { | |
| 65 | appearance.colors.outline | |
| 66 | })); | |
| 67 | ||
| 68 | 99 | let grid = self.grid.clone(); |
| 69 | let chunks = &grid.chunks(area).unwrap()[0]; | |
| 100 | let chunks = grid.chunks(area).unwrap()[0].to_owned(); | |
| 70 | 101 | |
| 71 | 102 | // creates the text list in cell (0, 1) |
| 72 | 103 | self.textlist.set_height(chunks[0].height); |
| @@ -96,19 +127,6 @@ impl FrameworkItem for ItemList { | ||
| 96 | 127 | framework: &mut tui_additions::framework::FrameworkClean, |
| 97 | 128 | _info: tui_additions::framework::ItemInfo, |
| 98 | 129 | ) -> Result<(), Box<dyn Error>> { |
| 99 | let appearance = framework.data.global.get::<AppearanceConfig>().unwrap(); | |
| 100 | ||
| 101 | self.grid.set_border_type(appearance.borders); | |
| 102 | self.textlist.set_border_type(appearance.borders); | |
| 103 | self.textlist.set_ascii_only( | |
| 104 | !framework | |
| 105 | .data | |
| 106 | .global | |
| 107 | .get::<MainConfig>() | |
| 108 | .unwrap() | |
| 109 | .allow_unicode, | |
| 110 | ); | |
| 111 | ||
| 112 | 130 | let page = framework.data.state.get::<Page>().unwrap(); |
| 113 | 131 | let image_index = framework |
| 114 | 132 | .data |
| @@ -144,6 +162,7 @@ impl FrameworkItem for ItemList { | ||
| 144 | 162 | .map(|item| Item::from_search_item(item, image_index)) |
| 145 | 163 | .collect(); |
| 146 | 164 | } |
| 165 | _ => unreachable!("item `ItemList` cannot be used in `{page:?}`"), | |
| 147 | 166 | } |
| 148 | 167 | |
| 149 | 168 | if framework |
| @@ -194,6 +213,25 @@ impl FrameworkItem for ItemList { | ||
| 194 | 213 | KeyAction::MoveDown => self.textlist.down().is_ok(), |
| 195 | 214 | KeyAction::MoveLeft => self.textlist.first().is_ok(), |
| 196 | 215 | KeyAction::MoveRight => self.textlist.last().is_ok(), |
| 216 | KeyAction::Select => { | |
| 217 | let page_to_load = match &self.items[self.textlist.selected] { | |
| 218 | Item::MiniVideo(video) => { | |
| 219 | Page::SingleItem(SingleItemPage::Video(video.id.clone())) | |
| 220 | } | |
| 221 | Item::MiniPlaylist(playlist) => { | |
| 222 | Page::SingleItem(SingleItemPage::Playlist(playlist.id.clone())) | |
| 223 | } | |
| 224 | _ => unimplemented!(), | |
| 225 | }; | |
| 226 | framework | |
| 227 | .data | |
| 228 | .state | |
| 229 | .get_mut::<Tasks>() | |
| 230 | .unwrap() | |
| 231 | .priority | |
| 232 | .push(Task::LoadPage(page_to_load)); | |
| 233 | false | |
| 234 | } | |
| 197 | 235 | _ => false, |
| 198 | 236 | }; |
| 199 | 237 | |
| @@ -216,7 +254,7 @@ impl FrameworkItem for ItemList { | ||
| 216 | 254 | impl ItemList { |
| 217 | 255 | // change `self.item` to the currently selected item |
| 218 | 256 | pub fn update(&mut self) { |
| 219 | if self.items.len() == 0 { | |
| 257 | if self.items.is_empty() { | |
| 220 | 258 | self.info.item = None; |
| 221 | 259 | return; |
| 222 | 260 | } |
src/items/mod.rs +2
| @@ -11,3 +11,5 @@ mod pagebutton; | ||
| 11 | 11 | pub use pagebutton::*; |
| 12 | 12 | mod searchfilters; |
| 13 | 13 | pub use searchfilters::*; |
| 14 | mod singleitem; | |
| 15 | pub use singleitem::*; | |
src/items/searchfilters.rs +48 −4
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | use crate::{ |
| 2 | config::{AppearanceConfig, KeyBindingsConfig, Search, SearchFilters}, | |
| 2 | config::{AppearanceConfig, KeyBindingsConfig, MainConfig, Search, SearchFilters}, | |
| 3 | 3 | global::{ |
| 4 | 4 | functions::popup_area, |
| 5 | structs::{KeyAction, Message, Status, Task, Tasks}, | |
| 5 | structs::{KeyAction, Message, Page, Status, Task, Tasks}, | |
| 6 | 6 | }, |
| 7 | 7 | }; |
| 8 | 8 | use tui::{ |
| @@ -29,6 +29,7 @@ pub struct SearchFilter { | ||
| 29 | 29 | pub left_options: Vec<&'static str>, |
| 30 | 30 | pub current_hover: bool, |
| 31 | 31 | pub grid: Grid, |
| 32 | pub previous_state: Option<SearchFilters>, | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | impl Default for SearchFilter { |
| @@ -45,6 +46,7 @@ impl Default for SearchFilter { | ||
| 45 | 46 | vec![Constraint::Percentage(100)], |
| 46 | 47 | ) |
| 47 | 48 | .unwrap(), |
| 49 | previous_state: None, | |
| 48 | 50 | } |
| 49 | 51 | } |
| 50 | 52 | } |
| @@ -116,7 +118,7 @@ impl FrameworkItem for SearchFilter { | ||
| 116 | 118 | POPUP_MIN_HEIGHT, |
| 117 | 119 | )) |
| 118 | 120 | .alignment(Alignment::Center) |
| 119 | .style(Style::default().fg(appearance.colors.error_text)) | |
| 121 | .style(Style::default().fg(appearance.colors.text_error)) | |
| 120 | 122 | .block(block); |
| 121 | 123 | |
| 122 | 124 | frame.render_widget(paragraph, area); |
| @@ -172,7 +174,7 @@ impl FrameworkItem for SearchFilter { | ||
| 172 | 174 | self.right_textlist.set_border_type(appearance.borders); |
| 173 | 175 | self.grid.set_border_type(appearance.borders); |
| 174 | 176 | |
| 175 | self.update(&framework); | |
| 177 | self.update(framework); | |
| 176 | 178 | |
| 177 | 179 | self.left_textlist.set_items(&self.left_options)?; |
| 178 | 180 | self.right_textlist |
| @@ -198,6 +200,22 @@ impl FrameworkItem for SearchFilter { | ||
| 198 | 200 | .priority |
| 199 | 201 | .push(Task::ClearPage); |
| 200 | 202 | self.update(framework); |
| 203 | ||
| 204 | // create a clone of search options only if `refresh_after_modifying_search_filters` is true | |
| 205 | // and is a search page | |
| 206 | if !framework | |
| 207 | .data | |
| 208 | .global | |
| 209 | .get::<MainConfig>() | |
| 210 | .unwrap() | |
| 211 | .refresh_after_modifying_search_filters | |
| 212 | { | |
| 213 | return true; | |
| 214 | } | |
| 215 | ||
| 216 | if let Page::Search(search_options) = framework.data.state.get::<Page>().unwrap() { | |
| 217 | self.previous_state = Some(search_options.filters); | |
| 218 | } | |
| 201 | 219 | true |
| 202 | 220 | } |
| 203 | 221 | |
| @@ -208,6 +226,32 @@ impl FrameworkItem for SearchFilter { | ||
| 208 | 226 | .get_mut::<Status>() |
| 209 | 227 | .unwrap() |
| 210 | 228 | .popup_opened = false; |
| 229 | ||
| 230 | // refresh page only if changed and enabled in options | |
| 231 | let search_options = framework.data.state.get::<Search>().unwrap().clone(); | |
| 232 | if self.previous_state.is_none() | |
| 233 | || !framework | |
| 234 | .data | |
| 235 | .global | |
| 236 | .get::<MainConfig>() | |
| 237 | .unwrap() | |
| 238 | .refresh_after_modifying_search_filters | |
| 239 | || self.previous_state.unwrap() == search_options.filters | |
| 240 | { | |
| 241 | return true; | |
| 242 | } | |
| 243 | ||
| 244 | let page = framework.data.state.get_mut::<Page>().unwrap(); | |
| 245 | if let Page::Search(search) = page { | |
| 246 | *search = search_options; | |
| 247 | framework | |
| 248 | .data | |
| 249 | .state | |
| 250 | .get_mut::<Tasks>() | |
| 251 | .unwrap() | |
| 252 | .priority | |
| 253 | .push(Task::Reload); | |
| 254 | } | |
| 211 | 255 | true |
| 212 | 256 | } |
| 213 | 257 | |
src/items/singleitem.rs added +283
| @@ -0,0 +1,283 @@ | ||
| 1 | use std::collections::HashMap; | |
| 2 | use tui::{layout::Constraint, style::Style}; | |
| 3 | use tui_additions::{ | |
| 4 | framework::FrameworkItem, | |
| 5 | widgets::{Grid, TextList}, | |
| 6 | }; | |
| 7 | use super::ItemInfo; | |
| 8 | use crate::{ | |
| 9 | config::{AppearanceConfig, MainConfig, CommandsConfig}, | |
| 10 | global::{structs::{InvidiousClient, Item, Message, Page, SingleItemPage}, functions::download_all_images} | |
| 11 | }; | |
| 12 | ||
| 13 | impl Default for SingleItem { | |
| 14 | fn default() -> Self { | |
| 15 | Self { | |
| 16 | item: None, | |
| 17 | iteminfo: ItemInfo::default(), | |
| 18 | grid: Grid::new( | |
| 19 | vec![Constraint::Percentage(30), Constraint::Percentage(70)], | |
| 20 | vec![Constraint::Percentage(100)], | |
| 21 | ) | |
| 22 | .unwrap(), | |
| 23 | r#type: SingleItemType::None, | |
| 24 | } | |
| 25 | } | |
| 26 | } | |
| 27 | ||
| 28 | /// main item in the `SingleItem(_)` page | |
| 29 | #[derive(Clone)] | |
| 30 | pub struct SingleItem { | |
| 31 | pub item: Option<Item>, | |
| 32 | pub iteminfo: ItemInfo, | |
| 33 | pub grid: Grid, | |
| 34 | pub r#type: SingleItemType, | |
| 35 | } | |
| 36 | ||
| 37 | #[derive(Clone)] | |
| 38 | pub enum SingleItemType { | |
| 39 | None, | |
| 40 | Video(SingleVideoItem), | |
| 41 | Playlist(SinglePlaylistItem), | |
| 42 | } | |
| 43 | ||
| 44 | #[derive(Clone)] | |
| 45 | pub struct SingleVideoItem { | |
| 46 | pub textlist: TextList, | |
| 47 | pub commands: HashMap<String, String>, | |
| 48 | } | |
| 49 | ||
| 50 | #[derive(Clone)] | |
| 51 | pub struct SinglePlaylistItem { | |
| 52 | pub commands_view: TextList, | |
| 53 | pub videos_view: TextList, | |
| 54 | pub commands: HashMap<String, String>, | |
| 55 | pub is_commands_view: bool, | |
| 56 | pub hovered_video: ItemInfo, | |
| 57 | } | |
| 58 | ||
| 59 | impl SingleVideoItem { | |
| 60 | pub fn new(commands: &CommandsConfig) -> Self { | |
| 61 | Self { | |
| 62 | textlist: TextList::default().items(&commands.video.keys().collect()).unwrap(), | |
| 63 | commands: commands.video.clone(), | |
| 64 | } | |
| 65 | } | |
| 66 | ||
| 67 | pub fn update_appearance(&mut self, appearance: &AppearanceConfig, iteminfo: &tui_additions::framework::ItemInfo) { | |
| 68 | self.textlist.set_border_type(appearance.borders); | |
| 69 | self.textlist | |
| 70 | .set_style(Style::default().fg(appearance.colors.text)); | |
| 71 | ||
| 72 | if iteminfo.selected { | |
| 73 | self.textlist | |
| 74 | .set_cursor_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 75 | self.textlist | |
| 76 | .set_selected_style(Style::default().fg(appearance.colors.text_special)); | |
| 77 | } else { | |
| 78 | self.textlist | |
| 79 | .set_cursor_style(Style::default().fg(appearance.colors.outline_secondary)); | |
| 80 | self.textlist | |
| 81 | .set_selected_style(Style::default().fg(appearance.colors.text_secondary)); | |
| 82 | } | |
| 83 | } | |
| 84 | } | |
| 85 | ||
| 86 | impl SinglePlaylistItem { | |
| 87 | pub fn new(commands: &CommandsConfig, playlist_items: &Vec<Item>) -> Self { | |
| 88 | let mut hovered_video = ItemInfo::default(); | |
| 89 | hovered_video.item = if playlist_items.is_empty() { | |
| 90 | None | |
| 91 | } else { | |
| 92 | Some(playlist_items[0].clone()) | |
| 93 | }; | |
| 94 | Self { | |
| 95 | commands_view: TextList::default().items(&commands.playlist.keys().collect()).unwrap(), | |
| 96 | videos_view: TextList::default().items(&playlist_items).unwrap(), | |
| 97 | commands: commands.playlist.clone(), | |
| 98 | hovered_video, | |
| 99 | is_commands_view: true, | |
| 100 | } | |
| 101 | } | |
| 102 | ||
| 103 | pub fn update_appearance(&mut self, appearance: &AppearanceConfig, iteminfo: &tui_additions::framework::ItemInfo, grid: &mut Grid) { | |
| 104 | if self.is_commands_view { | |
| 105 | grid.widths = vec![Constraint::Percentage(30), Constraint::Percentage(70)]; | |
| 106 | self.commands_view.set_border_type(appearance.borders); | |
| 107 | self.commands_view.set_style(Style::default().fg(appearance.colors.text)); | |
| 108 | ||
| 109 | if iteminfo.selected { | |
| 110 | self.commands_view | |
| 111 | .set_cursor_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 112 | self.commands_view | |
| 113 | .set_selected_style(Style::default().fg(appearance.colors.text_special)); | |
| 114 | } else { | |
| 115 | self.commands_view | |
| 116 | .set_cursor_style(Style::default().fg(appearance.colors.outline_secondary)); | |
| 117 | self.commands_view | |
| 118 | .set_selected_style(Style::default().fg(appearance.colors.text_secondary)); | |
| 119 | } | |
| 120 | } else { | |
| 121 | grid.widths = vec![Constraint::Percentage(30), Constraint::Percentage(40), Constraint::Percentage(30)]; | |
| 122 | self.videos_view.set_border_type(appearance.borders); | |
| 123 | self.videos_view.set_style(Style::default().fg(appearance.colors.text)); | |
| 124 | ||
| 125 | if iteminfo.selected { | |
| 126 | self.videos_view | |
| 127 | .set_cursor_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 128 | self.videos_view | |
| 129 | .set_selected_style(Style::default().fg(appearance.colors.text_special)); | |
| 130 | } else { | |
| 131 | self.videos_view | |
| 132 | .set_cursor_style(Style::default().fg(appearance.colors.outline_secondary)); | |
| 133 | self.videos_view | |
| 134 | .set_selected_style(Style::default().fg(appearance.colors.text_secondary)); | |
| 135 | } | |
| 136 | } | |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | impl SingleItemType { | |
| 141 | pub fn update_appearance(&mut self, appearance: &AppearanceConfig, iteminfo: &tui_additions::framework::ItemInfo, grid: &mut Grid) { | |
| 142 | match self { | |
| 143 | Self::None => {}, | |
| 144 | Self::Playlist(playlistitem) => playlistitem.update_appearance(appearance, iteminfo, grid), | |
| 145 | Self::Video(videoitem) => videoitem.update_appearance(appearance, iteminfo) | |
| 146 | } | |
| 147 | } | |
| 148 | } | |
| 149 | ||
| 150 | impl SingleItem { | |
| 151 | fn update_appearance( | |
| 152 | &mut self, | |
| 153 | appearance: &AppearanceConfig, | |
| 154 | iteminfo: &tui_additions::framework::ItemInfo, | |
| 155 | ) { | |
| 156 | self.grid.set_border_type(appearance.borders); | |
| 157 | ||
| 158 | if iteminfo.selected { | |
| 159 | self.grid | |
| 160 | .set_border_style(Style::default().fg(appearance.colors.outline_selected)); | |
| 161 | } else { | |
| 162 | if iteminfo.hover { | |
| 163 | self.grid | |
| 164 | .set_border_style(Style::default().fg(appearance.colors.outline_hover)); | |
| 165 | } else { | |
| 166 | self.grid | |
| 167 | .set_border_style(Style::default().fg(appearance.colors.outline)); | |
| 168 | } | |
| 169 | } | |
| 170 | ||
| 171 | self.r#type.update_appearance(appearance, iteminfo, &mut self.grid); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | impl FrameworkItem for SingleItem { | |
| 176 | fn render( | |
| 177 | &mut self, | |
| 178 | frame: &mut tui::Frame<tui::backend::CrosstermBackend<std::io::Stdout>>, | |
| 179 | framework: &mut tui_additions::framework::FrameworkClean, | |
| 180 | area: tui::layout::Rect, | |
| 181 | popup_render: bool, | |
| 182 | info: tui_additions::framework::ItemInfo, | |
| 183 | ) { | |
| 184 | if popup_render { | |
| 185 | return; | |
| 186 | } | |
| 187 | ||
| 188 | let appearance = framework.data.global.get::<AppearanceConfig>().unwrap(); | |
| 189 | self.update_appearance(appearance, &info); | |
| 190 | ||
| 191 | let chunks = self.grid.chunks(area).unwrap()[0].to_owned(); | |
| 192 | ||
| 193 | frame.render_widget(self.grid.clone(), area); | |
| 194 | ||
| 195 | // only continue if `self.item` is Some | |
| 196 | if self.item.is_none() { | |
| 197 | return; | |
| 198 | } | |
| 199 | ||
| 200 | match &mut self.r#type { | |
| 201 | SingleItemType::Video(typeinfo) => { | |
| 202 | self.iteminfo | |
| 203 | .render(frame, framework, chunks[0], popup_render, info); | |
| 204 | typeinfo.textlist.set_height(chunks[1].height); | |
| 205 | frame.render_widget(typeinfo.textlist.clone(), chunks[1]); | |
| 206 | } | |
| 207 | SingleItemType::Playlist(typeinfo) => { | |
| 208 | self.iteminfo | |
| 209 | .render(frame, framework, chunks[0], popup_render, info); | |
| 210 | if typeinfo.is_commands_view { | |
| 211 | typeinfo.commands_view.set_height(chunks[1].height); | |
| 212 | frame.render_widget(typeinfo.commands_view.clone(), chunks[1]); | |
| 213 | } else { | |
| 214 | typeinfo.videos_view.set_height(chunks[1].height); | |
| 215 | frame.render_widget(typeinfo.videos_view.clone(), chunks[1]); | |
| 216 | typeinfo.hovered_video.render(frame, framework, chunks[2], popup_render, info); | |
| 217 | } | |
| 218 | } | |
| 219 | SingleItemType::None => {} | |
| 220 | } | |
| 221 | } | |
| 222 | ||
| 223 | fn load_item( | |
| 224 | &mut self, | |
| 225 | framework: &mut tui_additions::framework::FrameworkClean, | |
| 226 | _info: tui_additions::framework::ItemInfo, | |
| 227 | ) -> Result<(), Box<dyn std::error::Error>> { | |
| 228 | let page = framework.data.state.get::<Page>().unwrap(); | |
| 229 | ||
| 230 | let r#type = if let Page::SingleItem(r#type) = page { | |
| 231 | r#type | |
| 232 | } else { | |
| 233 | unreachable!("item `SingleItem` cannot be used in {page:?}") | |
| 234 | }; | |
| 235 | ||
| 236 | let client = &framework.data.global.get::<InvidiousClient>().unwrap().0; | |
| 237 | let mainconfig = framework.data.global.get::<MainConfig>().unwrap(); | |
| 238 | ||
| 239 | self.item = match r#type { | |
| 240 | SingleItemPage::Video(id) => match client.video(id, None) { | |
| 241 | Ok(video) => { | |
| 242 | self.r#type = SingleItemType::Video(SingleVideoItem::new(framework.data.global.get::<CommandsConfig>().unwrap())); | |
| 243 | let video = Item::from_full_video(video, mainconfig.image_index); | |
| 244 | if mainconfig.images.display() { | |
| 245 | download_all_images(vec![(&video).into()]); | |
| 246 | } | |
| 247 | Some(video) | |
| 248 | }, | |
| 249 | Err(e) => { | |
| 250 | *self = Self::default(); | |
| 251 | *framework.data.global.get_mut::<Message>().unwrap() = | |
| 252 | Message::Error(e.to_string()); | |
| 253 | None | |
| 254 | } | |
| 255 | }, | |
| 256 | SingleItemPage::Playlist(id) => match client.playlist(id, None) { | |
| 257 | Ok(playlist) => { | |
| 258 | let playlist = Item::from_full_playlist(playlist, mainconfig.image_index); | |
| 259 | let videos = if let Item::FullPlaylist(playlist) = &playlist { | |
| 260 | &playlist.videos | |
| 261 | } else { | |
| 262 | unreachable!(); | |
| 263 | }; | |
| 264 | self.r#type = SingleItemType::Playlist(SinglePlaylistItem::new(framework.data.global.get::<CommandsConfig>().unwrap(), videos)); | |
| 265 | if mainconfig.images.display() { | |
| 266 | download_all_images(vec![(&playlist).into()]); | |
| 267 | } | |
| 268 | ||
| 269 | Some(playlist) | |
| 270 | }, | |
| 271 | Err(e) => { | |
| 272 | *self = Self::default(); | |
| 273 | *framework.data.global.get_mut::<Message>().unwrap() = | |
| 274 | Message::Error(e.to_string()); | |
| 275 | None | |
| 276 | } | |
| 277 | } | |
| 278 | }; | |
| 279 | self.iteminfo.item = self.item.clone(); | |
| 280 | ||
| 281 | Ok(()) | |
| 282 | } | |
| 283 | } | |
src/run.rs +13 −8
| @@ -14,13 +14,15 @@ pub fn run( | ||
| 14 | 14 | mut framework: Framework, |
| 15 | 15 | ) -> Result<(), Box<dyn Error>> { |
| 16 | 16 | // push the initial page load |
| 17 | framework | |
| 17 | let tasks = framework | |
| 18 | 18 | .data |
| 19 | 19 | .state |
| 20 | 20 | .get_mut::<Tasks>() |
| 21 | .unwrap() | |
| 22 | .priority | |
| 21 | .unwrap(); | |
| 22 | tasks.priority | |
| 23 | 23 | .push(Task::LoadPage(Page::MainMenu(MainMenuPage::Trending))); |
| 24 | tasks.pop().unwrap().run(&mut framework, terminal)?; | |
| 25 | framework.clear_history(); | |
| 24 | 26 | |
| 25 | 27 | loop { |
| 26 | 28 | // repeat forever until all tasks are ran (and Tasks is cleared) |
| @@ -44,11 +46,7 @@ pub fn run( | ||
| 44 | 46 | .0 |
| 45 | 47 | .get(&key.code) |
| 46 | 48 | { |
| 47 | if let Some(action) = keyactions.get(&key.modifiers.bits()) { | |
| 48 | Some(*action) | |
| 49 | } else { | |
| 50 | None | |
| 51 | } | |
| 49 | keyactions.get(&key.modifiers.bits()).copied() | |
| 52 | 50 | } else { |
| 53 | 51 | None |
| 54 | 52 | }; |
| @@ -77,6 +75,13 @@ pub fn run( | ||
| 77 | 75 | KeyAction::MoveDown => framework.r#move(FrameworkDirection::Down)?, |
| 78 | 76 | KeyAction::MoveLeft => framework.r#move(FrameworkDirection::Left)?, |
| 79 | 77 | KeyAction::MoveRight => framework.r#move(FrameworkDirection::Right)?, |
| 78 | KeyAction::Reload => framework | |
| 79 | .data | |
| 80 | .state | |
| 81 | .get_mut::<Tasks>() | |
| 82 | .unwrap() | |
| 83 | .priority | |
| 84 | .push(Task::Reload), | |
| 80 | 85 | KeyAction::Back => { |
| 81 | 86 | if framework.revert_last_history().is_err() { |
| 82 | 87 | *framework.data.global.get_mut::<Message>().unwrap() = |