Compare commits
660 Commits
v0.1.0
...
v1.2.0-alpha.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d37ebcdd3 | |||
| 616215c0a6 | |||
| 9cb5668b4c | |||
| 2e1c2d6bf2 | |||
| af0ec409a0 | |||
| bc2c716111 | |||
| b9359d6b9c | |||
| 474deaedcf | |||
| 9d230461de | |||
| bdc893d8a5 | |||
| 76bdde0fe8 | |||
| ace7657edb | |||
| db656259e1 | |||
| 645f18002a | |||
| b9750b0b26 | |||
| eb9775c89f | |||
| 86efb9293b | |||
| 1f4519b2a5 | |||
| 67e383ca47 | |||
| f10c7d76db | |||
| e38d0b081d | |||
| f818a758bd | |||
| 11819d0163 | |||
| 2c393cb294 | |||
| 24d2aa7fc6 | |||
| c056f84b66 | |||
| a366c07128 | |||
| d1dc7bbca0 | |||
| d7d3c980cb | |||
| 44074beb33 | |||
| ab798437d5 | |||
| bdbdcfb1b4 | |||
| abe2274d12 | |||
| f602547ca4 | |||
| b6c6518fd9 | |||
| 26049d0359 | |||
| ed39cba41b | |||
| f91f6756c3 | |||
| b52d471828 | |||
| b841d067c7 | |||
| 27e5d79bf7 | |||
| 28a5576ef9 | |||
| 3b6e908352 | |||
| 004d335eda | |||
| ef8662edca | |||
| f2153f3d0b | |||
| b7ac9901c4 | |||
| 962f1d8aae | |||
| 66b834bd31 | |||
| 0214a518ee | |||
| 40137b15fa | |||
| d30e203d29 | |||
| 7810b31d13 | |||
| 9720335adf | |||
| 1af3ef7565 | |||
| 7da09c117f | |||
| 9ff47b6895 | |||
| ed4137949d | |||
| f833f28930 | |||
| 97fa44cd5d | |||
| 6562f6c764 | |||
| 1177091cf0 | |||
| a785828a6b | |||
| 39b4a48fef | |||
| a62038450f | |||
| 070eb5b796 | |||
| bc1e809545 | |||
| dee49c964a | |||
| 4aa1521e88 | |||
| 4a53917f27 | |||
| 75c849d203 | |||
| 3e3cffc6bc | |||
| 2d211e3c05 | |||
| e5142fe131 | |||
| 89312f0bf9 | |||
| f2e6fa486a | |||
| 4f0f80bbc2 | |||
| 31e5c0ed10 | |||
| 9a2afe6820 | |||
| c93f9a7041 | |||
| 5401248286 | |||
| 0511540b98 | |||
| dcb233c957 | |||
| 804cb22f56 | |||
| 00e4059213 | |||
| 83fcbf6d04 | |||
| 420ecc9ae6 | |||
| 835e9a0678 | |||
| e1a6721f7d | |||
| 2e588ef4cb | |||
| d3e0099d14 | |||
| b9acdc9578 | |||
| fefd552f60 | |||
| 6eb2866eee | |||
| 01401c4691 | |||
| 37c2bfcd04 | |||
| e190217390 | |||
| 5fa7013106 | |||
| abf53489f5 | |||
| 0db13a8474 | |||
| e1229a45a0 | |||
| eafe26507a | |||
| 5c70a7d974 | |||
| da8bae8582 | |||
| 4cce24e275 | |||
| 18f2f18e41 | |||
| ec3c6ce26e | |||
| 9862dfa78d | |||
| e3f91ea593 | |||
| 509b2cd9b9 | |||
| 1b54d86324 | |||
| 425b2ecdb1 | |||
| 3b973e1597 | |||
| 86d2781e67 | |||
| 5d10f139a9 | |||
| 9b5a1711ce | |||
| 646ec820a5 | |||
| a144a308f6 | |||
| 07818cf8f2 | |||
| ccbcc8296d | |||
| bea435439e | |||
| d9ff78c21d | |||
| 14a4bf3408 | |||
| 172d7e4578 | |||
| 5986cf7a15 | |||
| a5e4b745ef | |||
| 4cd538fe21 | |||
| c406dfee79 | |||
| 8a168d20b3 | |||
| b16f7150e8 | |||
| c4319f1c6c | |||
| d9003fa07b | |||
| eb2235e017 | |||
| 1e784c243b | |||
| 23e9b52af2 | |||
| e42ac4eca3 | |||
| 622595a7a0 | |||
| 556ca1b1e6 | |||
| cef4f22305 | |||
| ee1dd7b21f | |||
| 487b73a859 | |||
| a56fdde0e7 | |||
| 99f91d25c3 | |||
| 8579b0697d | |||
| f0761c8359 | |||
| b1833721d0 | |||
| aba099e15a | |||
| d25c0cced5 | |||
| bc4f6304db | |||
| 4357454b14 | |||
| 528abbcaa3 | |||
| 9bcc605e00 | |||
| f7e3b9ae9d | |||
| 1b963a99c1 | |||
| 363cc3cc5e | |||
| 8307a975ea | |||
| f5ecdfca60 | |||
| 5bb92d804b | |||
| 5b4b962015 | |||
| b43cfdd70b | |||
| 77350a823e | |||
| 5844aea281 | |||
| 8af5d8c3e4 | |||
| f0f3721ec5 | |||
| 5641c25cc1 | |||
| c1b32c2fc3 | |||
| dc70d2889f | |||
| 6b2879d9dc | |||
| 19e842d721 | |||
| 8d28c3cfc8 | |||
| baec206bf3 | |||
| 3aacd7575b | |||
| d739245e70 | |||
| c88d93b0ab | |||
| 64280509b0 | |||
| a7e81cfa8a | |||
| 2620354888 | |||
| 61a8790448 | |||
| 5b4af58baa | |||
| 6cd3c65362 | |||
| 211a3b9a39 | |||
| a4fd92a014 | |||
| 295d0f90ba | |||
| 5592242963 | |||
| 0212f3ba26 | |||
| 36521a2b1b | |||
| 571a4f23ea | |||
| 2b9829d57a | |||
| 2f6ea39f79 | |||
| 8e33214fd0 | |||
| 310dfb94c2 | |||
| 39e2a54e1e | |||
| 829cace7b9 | |||
| e82afa7e22 | |||
| 5e64ce16f4 | |||
| 2154d90759 | |||
| d889c85b4a | |||
| cc4d033db2 | |||
| 1cfef9f607 | |||
| bbd26d1c12 | |||
| 72f0c22e88 | |||
| 72daaeee0e | |||
| 26765c45c7 | |||
| 2afcaa46f9 | |||
| 3c5b2a2eed | |||
| 0ff8e865aa | |||
| 2d60acce51 | |||
| 53fb197585 | |||
| 3c11f5a0a1 | |||
| bef27b4ac5 | |||
| 0d0cfa1b4e | |||
| 286f4aa68d | |||
| 58f563ed61 | |||
| 523575e43c | |||
| 414017930e | |||
| 01550557fb | |||
| cdfb957203 | |||
| c647099f60 | |||
| 8899017a37 | |||
| c8b983fd76 | |||
| 24ad6b6a1d | |||
| ee9e23ef2c | |||
| 3125009e80 | |||
| b23e211e11 | |||
| 2cc9b342b7 | |||
| 085a74a6b3 | |||
| f6159a863c | |||
| 4430138e77 | |||
| 04eca2cbc0 | |||
| c8d47f8e67 | |||
| f7da6fdb63 | |||
| 2466bb6d4c | |||
| 5f293e38b6 | |||
| 08ce0b1da3 | |||
| e12aa7e695 | |||
| c92a32a503 | |||
| 56fdfdca49 | |||
| b2510645e5 | |||
| b5a08584a0 | |||
| 78568cd235 | |||
| 8e86d4a7c5 | |||
| 6322ff2dd5 | |||
| 89c3b93ba6 | |||
| 580dea6b44 | |||
| b203adc66f | |||
| 7a2639f772 | |||
| 535430d0c5 | |||
| a0c9c88e0e | |||
| 4b7610f39f | |||
| a06e903c5c | |||
| f79f46269f | |||
| b82ddc1c59 | |||
| f4dc6ab838 | |||
| 62dde63206 | |||
| 5c034013fe | |||
| 23717c15d1 | |||
| 09acc3ccaa | |||
| 7c3f4f6a64 | |||
| 8dc48b20cb | |||
| 165b17e034 | |||
| 4255e2ad85 | |||
| 16b7c1ed76 | |||
| d179bde348 | |||
| e2234b19ea | |||
| 45259f304b | |||
| 220c7940a8 | |||
| 9665dbcb4e | |||
| 423a17070c | |||
| 8d88b59e3d | |||
| ae9d1dfc9b | |||
| 6930df940f | |||
| fd523f4017 | |||
| 4c8f903256 | |||
| d2ba6aadc1 | |||
| 0023066e32 | |||
| 39bcf63e3c | |||
| 656f32e755 | |||
| f66279980b | |||
| 1f65841e62 | |||
| 0422e7fee8 | |||
| 7fdf165d57 | |||
| 31d1b8536d | |||
| 20ac0ef7da | |||
| a72c849693 | |||
| 48f3bf53ca | |||
| e78a1189b0 | |||
| 955d6420b3 | |||
| f773e419d5 | |||
| 08bceff27a | |||
| aacf09aebc | |||
| 0ad02979e7 | |||
| b33839c7a2 | |||
| 4d5fca4b18 | |||
| 598049a49f | |||
| e0f9b44f4d | |||
| 13ffd76459 | |||
| 5eae7eab10 | |||
| bc855990c8 | |||
| 55d643be1c | |||
| 1e726be44d | |||
| 648ea4be67 | |||
| 030d70e5c3 | |||
| 4a7c47fb5c | |||
| b404122960 | |||
| 9d075d79c8 | |||
| 4e1847c12d | |||
| de2f7882b3 | |||
| 28b6241255 | |||
| 3358efac88 | |||
| c7069494a9 | |||
| b98826612b | |||
| 5ef8443217 | |||
| 5e03039633 | |||
| f13375ea40 | |||
| b5d0a9156b | |||
| 46e79baae6 | |||
| 55e51461a7 | |||
| c086b805a9 | |||
| ffaef60f9a | |||
| 556a217e41 | |||
| a91ccd49db | |||
| e42fffbee7 | |||
| 1209d8e32a | |||
| b89da81989 | |||
| 171f17a7e0 | |||
| 149b5195ca | |||
| b10eb982cd | |||
| f44c4e66a0 | |||
| c99bdbb8d0 | |||
| ccc8c5c7c1 | |||
| 8dbb39a001 | |||
| 80a6a2049e | |||
| 9b62c27afa | |||
| 20ffd88a3a | |||
| 0f0c114710 | |||
| b922c47fc2 | |||
| f0110dcbb8 | |||
| ff0d5f535b | |||
| 0f5ca9647d | |||
| 1e26c366f8 | |||
| 74aa8defae | |||
| d013641e53 | |||
| b0a5cbc74e | |||
| a6d8bedde2 | |||
| e9824e86f4 | |||
| 220837d2fb | |||
| 1bfdcb732a | |||
| 9865f91b6d | |||
| 838b1b3b93 | |||
| 0f7a30992d | |||
| 1c2c997b6b | |||
| bbbaeb86d0 | |||
| 9ca9207e02 | |||
| 0ae11ddc8c | |||
| a13c7313d6 | |||
| 804c2d7c19 | |||
| 1a58243141 | |||
| 574b1fe414 | |||
| d127f3b6e7 | |||
| 2b14f52db9 | |||
| 4143912ef2 | |||
| 45cbecb21e | |||
| a8189f28b5 | |||
| d626ed67f9 | |||
| 34921b166e | |||
| f9b10a1174 | |||
| 6b20fa8f7b | |||
| bc5fb017cf | |||
| ce82f53568 | |||
| 4f5ef38d1b | |||
| 26e2ed5bbf | |||
| a5d42f3687 | |||
| 811e49327a | |||
| a8bb34c2d8 | |||
| 13b426eca6 | |||
| b1347b063d | |||
| caaacf868a | |||
| 99cf6b8945 | |||
| 2aa9d8afb5 | |||
| 37dce9769e | |||
| cdd6d77fc4 | |||
| 0ce21036a7 | |||
| f7fd662fef | |||
| 46687e5068 | |||
| 9c5cf5160a | |||
| d391e13f66 | |||
| df166f3dd0 | |||
| 0cc5f8cbb1 | |||
| 06622c4088 | |||
| a8ca0b26b3 | |||
| c15696a5b8 | |||
| 249caa1a82 | |||
| fab45876bf | |||
| fdb381ca6c | |||
| 392d2656a3 | |||
| 9ba8af438d | |||
| 65b2a5c385 | |||
| 61a3685d6c | |||
| a1aeab1d90 | |||
| 4cb9482e27 | |||
| 5d62c6c0e9 | |||
| 6bfe735b60 | |||
| 7d919e9dcf | |||
| 4293fd9d1b | |||
| af69c821a7 | |||
| 36eca807ad | |||
| b217fcf9c0 | |||
| ef202e33ec | |||
| 89ac6077be | |||
| 80412e536e | |||
| c8e4812967 | |||
| b9850effca | |||
| e9286822ab | |||
| 9d7cd708c7 | |||
| c674fce0c0 | |||
| 2aed523480 | |||
| 7f5a297b87 | |||
| 6c5190eacb | |||
| 6f6da723e7 | |||
| b9fda11d34 | |||
| 2931b58276 | |||
| 68fd4111ad | |||
| 698eab012f | |||
| e18caca70f | |||
| d556350eef | |||
| 16aa65afed | |||
| 7e10d28d28 | |||
| 58faea04a3 | |||
| ee95df202d | |||
| bd2038cc79 | |||
| 31183473ab | |||
| 605a383963 | |||
| 802d0533c8 | |||
| a886ccb981 | |||
| b8abe30e39 | |||
| b8e2bb73f5 | |||
| 714837286f | |||
| a786be653c | |||
| bdfb7a156f | |||
| c626b850c9 | |||
| 5a5d31f9ac | |||
| 16db775379 | |||
| b2f76d7aaa | |||
| 383f065d1b | |||
| 3216eddde6 | |||
| 77ab238863 | |||
| ca5c86dbf1 | |||
| 9fbf81f8f2 | |||
| 0372f7a1d5 | |||
| 79ecaf3d15 | |||
| 31d8925615 | |||
| 9050d84b03 | |||
| 4d0cc4a6fe | |||
| 91f7179d5e | |||
| d22fb0dcf4 | |||
| 3f0b6c2db7 | |||
| 66f113ae45 | |||
| efe03f41b9 | |||
| 055d8b2bcc | |||
| 6b724d8040 | |||
| b983467cfc | |||
| d378312dbd | |||
| 55e7145ba2 | |||
| 77f6db9b6c | |||
| 47474f5c11 | |||
| 3db5cb70b7 | |||
| 87c37b18d3 | |||
| 160efbfafd | |||
| 3be2100160 | |||
| c4d942eb2e | |||
| 1ca62ba2f5 | |||
| c5f871d810 | |||
| e0d70bd882 | |||
| 7423df43c5 | |||
| 8cb78e8550 | |||
| 4308ba5125 | |||
| 02753999f1 | |||
| 702486020f | |||
| 6b12b7bc74 | |||
| 5bf674d782 | |||
| 6df2c98955 | |||
| 77bc6236f8 | |||
| 57e0c73a31 | |||
| f038ae79fb | |||
| 63775a5e99 | |||
| 8930009398 | |||
| 9dce72250e | |||
| 0ea41da41c | |||
| 36c1eb20fc | |||
| 341e8aed99 | |||
| abdc05298b | |||
| b7db145517 | |||
| dceb09ec36 | |||
| 57ab0b9ff2 | |||
| 398494c320 | |||
| 43e4a0866c | |||
| 4e64ae93c2 | |||
| eec011d9f0 | |||
| 08b0a5c689 | |||
| 21dee2ec57 | |||
| c172b1ed81 | |||
| 69918d0f3f | |||
| d390050183 | |||
| 31f38820d2 | |||
| 8372d3bed9 | |||
| 46f5f9486c | |||
| 1e6351aaf9 | |||
| f9edf33097 | |||
| f815695298 | |||
| bbbbf50551 | |||
| 0c74e9683b | |||
| b1b4d13dfc | |||
| 5860ab8eb9 | |||
| a4af268720 | |||
| 092b7fbd77 | |||
| 58c8c32a58 | |||
| 69c4202899 | |||
| 43cc008011 | |||
| 821e487c93 | |||
| 42e9c2ed58 | |||
| 6ea7f45d40 | |||
| 5c2edcf558 | |||
| 3333924511 | |||
| d200444d75 | |||
| 82b33fbf95 | |||
| c985fd09bd | |||
| c312b6ede8 | |||
| e76adf7a5f | |||
| 7dae0bf77f | |||
| ed9bc0c3a8 | |||
| 9d6638c35e | |||
| 5ba670505b | |||
| ef000b7eda | |||
| cfda3830db | |||
| f0cf76a5fe | |||
| ce7438825b | |||
| 0d0ed47455 | |||
| 8217a577a0 | |||
| 4c36f2321a | |||
| 4223a17341 | |||
| 6bb99ace5c | |||
| de86519282 | |||
| 3a30e5fbc9 | |||
| 68ee96b8e3 | |||
| cf78b2b21d | |||
| e89199fec3 | |||
| 0a5c158657 | |||
| 46766ec0ff | |||
| 300fad0010 | |||
| 84450419c1 | |||
| fd5c14a1bd | |||
| cd8dae5976 | |||
| 5e2dd10035 | |||
| df4df8add1 | |||
| 4544ee5622 | |||
| dd7bc3556d | |||
| 788b7598b0 | |||
| a4f4eb5558 | |||
| 43cdcbf765 | |||
| 2a9d7f3a15 | |||
| 5c5e6c7439 | |||
| 322faa6a92 | |||
| 701e91462d | |||
| 2b34d643a9 | |||
| 4a7949fd2a | |||
| 47fce8a6dd | |||
| 4d6d3cf4f8 | |||
| 26236ba024 | |||
| dcb932859b | |||
| a9646209e1 | |||
| 6ce7bc94df | |||
| 5b82f4c162 | |||
| 5dc72a76ba | |||
| 58172606f3 | |||
| 6e07adb990 | |||
| 4abf0e9ec4 | |||
| 269e6de18b | |||
| fdf8351adf | |||
| fbf2fff618 | |||
| 0dfdba702d | |||
| 4f41cd2cf3 | |||
| 6d2e3412d4 | |||
| fa200abb1d | |||
| 513aef87fc | |||
| 9fbceb1fe4 | |||
| 594a71ee36 | |||
| 7242c233f6 | |||
| 47314ffbfa | |||
| 7f37433819 | |||
| 69ea65f758 | |||
| 11b89eab9f | |||
| dd108d73e2 | |||
| 3d73ace19d | |||
| f1c879f811 | |||
| 47e1c58acf | |||
| 911ef41d60 | |||
| 93fc420974 | |||
| 6076483b38 | |||
| dc0d5661b6 | |||
| 55e94c9e5d | |||
| d6b7480283 | |||
| f7bd0f85f6 | |||
| bd40bf6519 | |||
| c628d88957 | |||
| 6d0a205f5a | |||
| 5c478979e9 | |||
| 417e538df6 | |||
| 573da853d7 | |||
| 3c7731be19 | |||
| 51487406fe | |||
| cf53ab43c8 | |||
| 7952615920 | |||
| 8c2292eae7 | |||
| 2207eca28d | |||
| 5e12baa35f | |||
| 1b2136ffb9 | |||
| 416cf41841 | |||
| 3940a0a06c | |||
| 6a987126c8 | |||
| 7b28255ffa | |||
| a4f68ebc8b | |||
| b7adfacfd1 | |||
| df20e0dfb5 | |||
| ee03a90f02 | |||
| 383d917e25 | |||
| e15d4c45d4 | |||
| 840ff225f8 | |||
| 6077e51203 | |||
| 079dc32429 | |||
| 01ef77832d | |||
| d29e6d39f5 | |||
| 4e7865e312 | |||
| 4702f67767 | |||
| 9d2ec1166e | |||
| 337697fafb | |||
| a43e238905 | |||
| d253d7aad0 | |||
| e75cd44872 | |||
| e76912004a | |||
| af95b24005 | |||
| 21d61ecaa7 | |||
| 98dccb1831 | |||
| e8cd849623 | |||
| 45ceae3b07 | |||
| cd11f8a39f | |||
| e9c5c21698 | |||
| 90de63c35f | |||
| fbb2eca661 | |||
| 7c2309c620 | |||
| 3b854d94a6 | |||
| ad51f88358 | |||
| 347e84247d | |||
| acb9990dfb | |||
| d5a0a295eb | |||
| c619d4a608 | |||
| a16fcacd69 | |||
| 93e4d22623 | |||
| 93dd11d5a2 | |||
| 0702c0db18 | |||
| d491b24149 |
@@ -4,6 +4,7 @@
|
||||
"global-require": "off",
|
||||
"import/no-dynamic-require": "off",
|
||||
"prettier/prettier": 0,
|
||||
"no-await-in-loop": "off",
|
||||
"import/prefer-default-export": "off",
|
||||
"no-empty-function": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
|
||||
@@ -10,6 +10,7 @@ import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
import { AppWindow } from "../../src/shared/models/window-manager/app-window.model"
|
||||
|
||||
// When an ESLint server is running, we can't set the NODE_ENV so we'll check if it's
|
||||
// at the dev webpack config is not accidentally run in a production environment
|
||||
@@ -39,6 +40,22 @@ if (
|
||||
execSync('npm run postinstall');
|
||||
}
|
||||
|
||||
const getHtmlPageOptions = (page: AppWindow): HtmlWebpackPlugin.Options => {
|
||||
return {
|
||||
filename: path.join(page),
|
||||
template: path.join(webpackPaths.srcRendererPath, page.replace(".html", ".ejs")),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
env: process.env.NODE_ENV,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
nodeModules: webpackPaths.appNodeModulesPath,
|
||||
}
|
||||
}
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
@@ -76,14 +93,6 @@ const configuration: webpack.Configuration = {
|
||||
},
|
||||
},
|
||||
'sass-loader',
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: [require('tailwindcss'), require('autoprefixer')],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
include: /\.module\.s?(c|a)ss$/,
|
||||
},
|
||||
@@ -96,8 +105,12 @@ const configuration: webpack.Configuration = {
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: [require('tailwindcss'), require('autoprefixer')],
|
||||
postcssOptions: {
|
||||
plugins:
|
||||
[
|
||||
require('tailwindcss'),
|
||||
require('autoprefixer'),
|
||||
]
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -151,33 +164,12 @@ const configuration: webpack.Configuration = {
|
||||
|
||||
new ReactRefreshWebpackPlugin(),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: path.join('index.html'),
|
||||
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
env: process.env.NODE_ENV,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
nodeModules: webpackPaths.appNodeModulesPath,
|
||||
}),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("index.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("launcher.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-map.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-playlist.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-model.html")),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: path.join('launcher.html'),
|
||||
template: path.join(webpackPaths.srcRendererPath, 'launcher.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
env: process.env.NODE_ENV,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
nodeModules: webpackPaths.appNodeModulesPath,
|
||||
})
|
||||
],
|
||||
|
||||
node: {
|
||||
|
||||
@@ -14,6 +14,7 @@ import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
import deleteSourceMaps from '../scripts/delete-source-maps';
|
||||
import { AppWindow } from "../../src/shared/models/window-manager/app-window.model"
|
||||
|
||||
checkNodeEnv('production');
|
||||
deleteSourceMaps();
|
||||
@@ -25,6 +26,23 @@ const devtoolsConfig =
|
||||
}
|
||||
: {};
|
||||
|
||||
|
||||
const getHtmlPageOptions = (page: AppWindow): HtmlWebpackPlugin.Options => {
|
||||
return {
|
||||
filename: path.join(page),
|
||||
template: path.join(webpackPaths.srcRendererPath, page.replace(".html", ".ejs")),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
env: process.env.NODE_ENV,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
nodeModules: webpackPaths.appNodeModulesPath,
|
||||
}
|
||||
}
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
...devtoolsConfig,
|
||||
|
||||
@@ -58,14 +76,6 @@ const configuration: webpack.Configuration = {
|
||||
},
|
||||
},
|
||||
'sass-loader',
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: [require('tailwindcss'), require('autoprefixer')],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
include: /\.module\.s?(c|a)ss$/,
|
||||
},
|
||||
@@ -78,8 +88,12 @@ const configuration: webpack.Configuration = {
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: [require('tailwindcss'), require('autoprefixer')],
|
||||
postcssOptions: {
|
||||
plugins:
|
||||
[
|
||||
require('tailwindcss'),
|
||||
require('autoprefixer'),
|
||||
]
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -132,29 +146,12 @@ const configuration: webpack.Configuration = {
|
||||
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
|
||||
}),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
}),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("index.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("launcher.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-map.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-playlist.html")),
|
||||
new HtmlWebpackPlugin(getHtmlPageOptions("oneclick-download-model.html")),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'launcher.html',
|
||||
template: path.join(webpackPaths.srcRendererPath, 'launcher.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||
})
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ module.exports = {
|
||||
"global-require": 0,
|
||||
"import/prefer-default-export": "off",
|
||||
"no-empty-function": "off",
|
||||
"no-await-in-loop": "off",
|
||||
"no-continue": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
'@typescript-eslint/lines-between-class-members': "off",
|
||||
"class-methods-use-this": "off",
|
||||
@@ -30,7 +32,10 @@ module.exports = {
|
||||
"@typescript-eslint/no-throw-literal": "off",
|
||||
"@typescript-eslint/no-unused-expressions": "off",
|
||||
"no-param-reassign": "off",
|
||||
"no-useless-escape": "off"
|
||||
"no-useless-escape": "off",
|
||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||
"no-async-promise-executor": "off",
|
||||
"new-cap": "off"
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: "[BUG] Bug report"
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG] : "
|
||||
labels: bug
|
||||
assignees: Zagrios
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: "[FEAT.] Feature request"
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEAT.] : "
|
||||
labels: enhancement
|
||||
assignees: Zagrios
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,16 @@
|
||||
## [0.2.0](https://github.com/Zagrios/bs-manager/releases/tag/v0.2.0) (October 23, 2022)
|
||||
### Features
|
||||
- Mods management fully implementd [5c47897](https://github.com/Zagrios/bs-manager/commit/5c478979e96b14dd54a3889e551c163ece701b4a)
|
||||
- Add close button in settings page #5
|
||||
- Add GitHub and contribution actions in settings page #3
|
||||
### Fixes
|
||||
- Lunch Beat Saber multiple times #1
|
||||
- Placeholders and some texts not with light theme #6
|
||||
- Wrong background color when version is downloading #7
|
||||
- Add missing translations [5817260](https://github.com/Zagrios/bs-manager/commit/58172606f3f4731c90c9aa838fb89ac95458e032)
|
||||
- Error when loading downloaded versions when Steam is not installed [6e07adb](https://github.com/Zagrios/bs-manager/commit/6e07adb990f78073dd68c2b9cf6209562bb4bf2b)
|
||||
|
||||
|
||||
## [0.1.0](https://github.com/Zagrios/bs-manager/releases/tag/v0.1.0) (September 19, 2022)
|
||||
|
||||
- Initial public release
|
||||
@@ -0,0 +1,132 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at contact@bsmanager.io.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -0,0 +1,32 @@
|
||||
## Contributing
|
||||
|
||||
[code-of-conduct]: CODE_OF_CONDUCT.md
|
||||
[fork]: https://github.com/Zagrios/bs-manager/fork
|
||||
[pr]: https://github.com/Zagrios/bs-manager/compare
|
||||
[style]: https://github.com/basarat/typescript-book/blob/master/docs/styleguide/styleguide.md
|
||||
|
||||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
|
||||
|
||||
## Issues and PRs
|
||||
|
||||
If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.
|
||||
|
||||
We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
1. [Fork][fork] and clone the repository.
|
||||
1. Configure and install the dependencies: `npm install`.
|
||||
1. Create a new branch following naming convention: `git checkout -b (feature|bufix|hotfix)/(short-description)(/issue-id)`.
|
||||
1. Make your change, test, and make sure BSManager work fine.
|
||||
1. Push to your fork and [submit a pull request][pr].
|
||||
1. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
||||
|
||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||
|
||||
- Follow the [style guide][style] which is using standard.
|
||||
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
||||
|
||||
Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.
|
||||
@@ -1,21 +1,339 @@
|
||||
The MIT License (MIT)
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (c) 2015-present Electron React Boilerplate
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
@@ -1,76 +1,243 @@
|
||||
<p align="center">
|
||||
<a href="https://github.com/RiskiVR/BSLegacyLauncher">
|
||||
<img src="https://raw.githubusercontent.com/Zagrios/bs-manager/master/resources/readme/icon.svg" alt="logo" width="250px"/>
|
||||
</a>
|
||||
<h3 align="center">BSManager</h3>
|
||||
<p align="center">Simple and fancy tools that alow you to download, launch and manage BeatSaber versions, Maps and Mods easily and quickly.</p>
|
||||
</p>
|
||||
<a name="readme-top"></a>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/Zagrios/bs-manager/blob/master/resources/readme/beat-running.png?raw=true" width="130"/>
|
||||
</p>
|
||||
<!-- PROJECT SHIELDS -->
|
||||
<!--
|
||||
*** I'm using markdown "reference style" links for readability.
|
||||
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
|
||||
*** See the bottom of this document for the declaration of the reference variables
|
||||
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
|
||||
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
|
||||
-->
|
||||
|
||||
<details open="open">
|
||||
<summary>
|
||||
<h2>Table of Contents</h2>
|
||||
</summary>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="#about-the-project">About The Project</a>
|
||||
<ul><li><a href="#built-with">Built With</a></li></ul>
|
||||
</li>
|
||||
<li><a href="#how-to-use">How To Use</a></li>
|
||||
<li><a href="#having-problems">Having problems?</a></li>
|
||||
<li><a href="#acknowledgements">Acknowledgements</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
<h2 id="about-the-project">About The Project</h2>
|
||||
<p>
|
||||
Have you ever wanted to switch between multiple BeatSaber version? To have a specific version for you and your friends, or for personal use and Streaming use? Have you ever wanted to manage easily <b>Maps</b> and <b>Mods</b> between versions? All of that in one place? <b>Then this program is made for you!</b>
|
||||
<br/><br/>
|
||||
BSManager is designed to download any BeatSaber version from Steam's depots, and launch it within the same program!<br>
|
||||
- You can install as many versions as you want, customize them to quickly differentiate them, clone them to separate the additional contents of the same version!<br>
|
||||
- You can clone and launch your Steam version from the program!<br/><br/>
|
||||
<b>In the near future</b><br/>
|
||||
- You can Create a master Maps folder and link it across all versions!<br/>
|
||||
- You can download Maps with "OneClick"!<br/>
|
||||
- You can download Maps from BSManager!<br/>
|
||||
- You can download and manage Mods for each versions!<br/>
|
||||
- And even more!
|
||||
</p>
|
||||
<h3 id="built-with">Built With</h3>
|
||||
<!-- TITLE -->
|
||||
<div align="center">
|
||||
<a href="https://github.com/Zagrios/bs-manager">
|
||||
<img src="resources/readme/icon.svg" alt="Logo" width="250" height="250">
|
||||
</a>
|
||||
<br><br>
|
||||
<h2><b>BSManager</b></h2>
|
||||
<i>(Beat Saber Manager)</i>
|
||||
<br><br>
|
||||
<span>
|
||||
Download, manage and customize your versions of Beat Saber with a simple click!
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+">Report Bug</a>
|
||||
·
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=-feat---feature-request.md&title=%5BFEAT.%5D+%3A+">Request Feature</a>
|
||||
·
|
||||
<a href="https://github.com/Zagrios/bs-manager/security/policy">Report a security vulnerability</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- BADGES -->
|
||||
---
|
||||
<br>
|
||||
<div align="center" >
|
||||
<a href="https://github.com/Zagrios/bs-manager/stargazers"><img src ="https://img.shields.io/github/stars/Zagrios/bs-manager?style=for-the-badge" alt="Stargazers"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/network/members"><img src ="https://img.shields.io/github/forks/Zagrios/bs-manager?style=for-the-badge" alt="Forks"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/blob/master/LICENSE"><img src ="https://img.shields.io/github/license/Zagrios/bs-manager?style=for-the-badge" alt="License"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/graphs/contributors"><img src ="https://img.shields.io/github/contributors/Zagrios/bs-manager?style=for-the-badge" alt="Contributors"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/Zagrios/bs-manager?style=for-the-badge"></a>
|
||||
<br>
|
||||
<a href="https://discord.gg/uSqbHVpKdV"><img src ="https://img.shields.io/badge/-DISCORD-5865f2?style=for-the-badge&logo=discord&logoColor=ffffff" alt="discord"/></a>
|
||||
<a href="https://www.patreon.com/bsmanager"><img src ="https://img.shields.io/badge/-🥰%20Support%20BSM-EC4546?style=for-the-badge" alt="Donation"/></a>
|
||||
<a href="https://twitter.com/BSManager_"><img src ="https://img.shields.io/badge/-Twitter-F5F8FA?style=for-the-badge&logo=Twitter" alt="Twitter"/></a>
|
||||
<br>
|
||||
[<a href="#readme-bot">Go to bottom</a>]
|
||||
</div>
|
||||
|
||||
---
|
||||
<!-- TABLE OF CONTENTS -->
|
||||
<b>Table of Contents</b>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/electron-react-boilerplate/electron-react-boilerplate">Electron React Boilerplate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/SteamRE/DepotDownloader">DepotDownloader</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#about-the-project">About The Project</a>
|
||||
<ul>
|
||||
<li><a href="#built-with">Built With</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#usage">Usage</a></li>
|
||||
<ul>
|
||||
<li><a href="#how-to-install">How to install?</a></li>
|
||||
<li><a href="#manage-versions">Manage Versions</a></li>
|
||||
<li><a href="#customize-your-versions">Customize your versions</a></li>
|
||||
<li><a href="#install-mods">Install Mods</a></li>
|
||||
<li><a href="#install-maps">Install Maps</a></li>
|
||||
<li><a href="#one-click">One Click</a></li>
|
||||
<li><a href="#having-problems">Having problems?</a></li>
|
||||
</ul>
|
||||
<li><a href="#credits">Credits</a></li>
|
||||
<li><a href="#contributing">Contributing</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="how-to-use">How To Use</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Download the latest release from <a href="https://github.com/Zagrios/bs-manager/releases">Releases</a>.
|
||||
</li>
|
||||
<li>Execute the installer and BSManager will start itself.</li>
|
||||
<li>Once its done if you want to download a version, select a version and download it!</li>
|
||||
<li>From the version page you can choose launch options, launch the version, and more from the dropdown menu!</li>
|
||||
</ul>
|
||||
<!-- ABOUT THE PROJECT -->
|
||||
<div align="center">
|
||||
<h1> </h1>
|
||||
<h1><b>About The Project</b></h1>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> was created to unify and improve the two most used Apps in the community (<a href="https://github.com/RiskiVR/BSLegacyLauncher">BS legacy launcher</a> and <a href="https://github.com/Assistant/ModAssistant">Mod Assistant</a>).
|
||||
<br><br>
|
||||
<h4><a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to:</h4>
|
||||
<ul>
|
||||
<li><b>Manage multiple BeatSaber versions</b>, designed for people who need to play on different versions or have multiple profiles for the same version.</li>
|
||||
<li><b>Download your maps in the same way</b>, in addition to that, depending on your choice, maps are not version dependent. so you will be able to find your maps whatever version you are using without having to transfer them.</li>
|
||||
<li><b>Install your mods in one click</b>, just like <a href="https://github.com/Assistant/ModAssistant">Mod Assistant</a>, <a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to install your mods quickly and securely depending on the version you choose.</li>
|
||||
<li><b>Customize your interface</b>, we know that some of you like to customize your interfaces to the maximum. That's why <a href="https://github.com/Zagrios/bs-manager">BSManager</a> brings you peace of mind on this point, you can change the name of the versions, their color, and you can even change the color of the logo! Of course, a dark theme has been added to protect your eyes at night.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
<img src="resources/readme/preview.png" alt="preview">
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h2 id="having-problems">Having problems?</h2>
|
||||
<p>
|
||||
See the <a href="https://github.com/Zagrios/bs-manager/issues">open issues</a> for a list of known issues, from there you can create a new issue for the problem you have!
|
||||
Otherwise you can add on to existing issues if one matches what you're encountering.
|
||||
</p>
|
||||
<h2 id="acknowledgements">Acknowledgement</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/Zagrios">Zagrios</a> (Mathieu GRIES) - Founder, Lead Developer & Project Lead</li>
|
||||
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Custom DepotDownloader Developer</li>
|
||||
<li><a href="https://github.com/GaetanGrd">Gaëtan Gerard</a> - Main Alpha Tester</li>
|
||||
</ul>
|
||||
<p align="center">
|
||||
<img src="https://github.com/Zagrios/bs-manager/blob/master/resources/readme/beat-conflict.png?raw=true" width="130"/>
|
||||
</p>
|
||||
<!--BUILT WITH-->
|
||||
<div>
|
||||
<h2><b>Built With</b></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://electron-react-boilerplate.js.org/"><img src="https://img.shields.io/badge/-Electron%20React%20Boilerplate-black?style=for-the-badge&logo=Electron" alt="Electron React Boilerplate"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/SteamRE/DepotDownloader"><img src="https://img.shields.io/badge/-Depot%20Downloader-2a475e?style=for-the-badge&logo=steam" alt="Depot Downloader"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://rxjs.dev/"><img src="https://img.shields.io/badge/-RxJs-purple?style=for-the-badge&logo=ReactiveX" alt="RxJs"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://tailwindcss.com/"><img src="https://img.shields.io/badge/-Tailwind%20CSS-white?style=for-the-badge&logo=Tailwind%20CSS" alt="TailWind CSS"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!--USAGE-->
|
||||
<div align="center">
|
||||
<h1> </h1>
|
||||
<h1><b>Usage</b></h1>
|
||||
</div>
|
||||
|
||||
<!--HOW TO INSTALL?-->
|
||||
<div>
|
||||
<h2><b>How to install?</b></h2>
|
||||
<ul>
|
||||
<li>Download the <a href="https://github.com/Zagrios/bs-manager/releases/latest">latest release</a> from <a href="https://github.com/Zagrios/bs-manager/releases">Releases</a>.</li>
|
||||
<li>Execute the installer and <a href="../..">BSManager</a> will start itself.</li>
|
||||
<li>Once its done if you want to download a version, select a version and download it! </li>
|
||||
<li>From the version page you can choose options, launch the version, and more!</li>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!--MANAGE VERSIONS-->
|
||||
<div>
|
||||
<h2><b>Manage Versions</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage your versions of Beat Saber. It gives you the ability to download any version of Beat Saber as long as you have a Steam account that already owns the game. Using <a href="https://github.com/Zagrios/bs-manager">BSManager</a>, you can easily manage and update your collection of Beat Saber versions.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213008824-25cfdda3-6350-42dc-aa53-2132b4b8e838.mov
|
||||
</div>
|
||||
|
||||
<!--CUSTOM UR VERSIONS-->
|
||||
<div>
|
||||
<h2><b>Customize your versions</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to completely customize each of your downloaded versions, you can change the color of the icon, choose a name for the version and finally install your mods,maps and other contents according to the Beat Saber version!
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296794-74a1e20b-12dc-44ec-a67f-e25d7010bd3d.mov
|
||||
</div>
|
||||
|
||||
<!--INSTALL MODS-->
|
||||
<div>
|
||||
<h2><b>Install Mods</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage Beat Saber mods in a quick and easy way. It uses the <a href="https://beatmods.com/#/">BeatMod API</a> to allow you to install, update or uninstall mods for each version of your collection. So the app can help you manage them efficiently.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296816-bdaafc90-da76-4835-8d83-9ac6a4e1c549.mov
|
||||
</div>
|
||||
|
||||
<!--INSTALL MAPS-->
|
||||
<div>
|
||||
<h2><b>Install Maps</b></h2>
|
||||
<span>
|
||||
In addition to managing mods, <a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage and organize custom beatmaps existing on <a href="https://beatsaver.com">Beat Saver</a>, a popular site for sharing custom beatmaps for beat Saber. Moreover the app allow you to share your maps across all your versions.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296838-f775fe83-866d-4764-a7d0-648dbb8ec983.mov
|
||||
</div>
|
||||
|
||||
<!--ONE CLICK-->
|
||||
<div>
|
||||
<h2><b>One Click</b></h2>
|
||||
<span>
|
||||
The "One-Click" feature of <a href="https://github.com/Zagrios/bs-manager">BSManager</a> is an incredibly convenient feature for Beat Saber users. It allows easy and quick installation of models, maps and playlists for all versions of Beat Saber you own.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213435051-7feb815d-f32b-4135-b095-ef49726a836c.mov
|
||||
</div>
|
||||
|
||||
<!--HAVING PROBLEMS?-->
|
||||
<div>
|
||||
<h2><b>Having problems?</b></h2>
|
||||
<span>
|
||||
See the <a href="https://github.com/Zagrios/bs-manager/issues">open issues</a> to show the list of known issues, from there you can create a new issue for your problem!
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
<!-- Credits -->
|
||||
<div>
|
||||
<h1><b>Credits</b></h1>
|
||||
<ul>
|
||||
<li><a href="https://github.com/Zagrios">Zagrios</a> - Founder & Lead Developer</li>
|
||||
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Project Team & Developpement help</li>
|
||||
<li><a href="https://github.com/GaetanGrd">GaetanGrd</a> - Project Team & Developpement help</li>
|
||||
<li><a href="https://github.com/cheddZy">cheddZy</a> - Icon creator</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Contributing -->
|
||||
<br>
|
||||
<!--CONTRIBUTING-->
|
||||
<div>
|
||||
<h1><b>Contributing</b></h1>
|
||||
<p>
|
||||
If you'd like to contribute, check out the <a href="https://github.com/Zagrios/bs-manager/blob/master/CONTRIBUTING.md">contributing guide</a>
|
||||
</p>
|
||||
<p>Thank you to all the people who already contributed to BSManager!</p>
|
||||
<div>
|
||||
<a href="https://github.com/Zagrios/bs-manager/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=Zagrios/bs-manager" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div align="right">
|
||||
[<a href="#readme-top">Return to top</a>]
|
||||
</div>
|
||||
|
||||
<h1> </h1>
|
||||
<a name="readme-bot"></a>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Reporting Security Issues
|
||||
|
||||
If you discover a security issue in BSManager, please report it by sending an
|
||||
email to [contact@bsmanager.io](mailto:contact@bsmanager.io).
|
||||
|
||||
This will allow us to assess the risk, and make a fix available before we add a
|
||||
bug report to the GitHub repository.
|
||||
|
||||
Thanks for helping make BSManager safe for everyone.
|
||||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" version="1.1" viewBox="0 0 717.2 717.2" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:url(#SVGID_1_);}
|
||||
</style>
|
||||
<linearGradient id="SVGID_1_" x1="61.604" x2="647.04" y1="373.65" y2="373.06" gradientTransform="matrix(1 .0010142 -.0010142 1 4.6349 -15.227)" gradientUnits="userSpaceOnUse">
|
||||
<stop style="stop-color:#DC2DE2" offset=".010541"/>
|
||||
<stop style="stop-color:#972DE2" offset=".3269"/>
|
||||
<stop style="stop-color:#8F28E2" offset=".4648"/>
|
||||
<stop style="stop-color:#7A1BE1" offset=".6756"/>
|
||||
<stop style="stop-color:#5706E0" offset=".9318"/>
|
||||
<stop style="stop-color:#4D00E0" offset="1"/>
|
||||
</linearGradient>
|
||||
<path class="st0" d="m565.85 141.83c-19.8 11.3-37 22.3-55.2 31.1-14.1 6.8-28.8 4.5-42.4-3.6-29.4-17.4-58.9-34.5-88.2-52-12.9-7.7-25.7-9.5-39-1.9-50.3 28.9-100.6 58-150.8 87.1-8.8 5.1-9.2 10 0 15.3 52 30.2 103.9 60.4 155.7 91 10.9 6.4 20.4 4.2 30.2-1.5 68.7-39.9 137.4-79.8 206.1-119.7 5.3-3.1 10.5-6.2 16-9 19.3-9.8 25.3-10.1 36.2 8.3 8.5 14.2 15.2 31.8 15.7 48.1 1.8 64.6 1.1 129.3 1 193.9 0 22.4-0.1 44.8-1.5 67.1-1 20.4-12.2 38.9-29.8 49.2-55.9 33.5-112.6 65.7-169 98.3-2.8 0.9-5.8 1.6-8.7 2 1-24.6 0.4-47.9 4.3-70.5 1.6-9.2 12-18.8 20.8-24.3 31.5-19.8 63.8-38.3 96.3-56.3 11.3-6.3 15-13.9 14.9-26.8-0.7-58-0.2-116-0.2-174 0-12.7-5.1-16.3-16.2-10-52.1 29.9-104.2 59.9-155.7 90.9-5.5 3.3-9.9 13.4-9.9 20.3-0.6 65.7 0.2 131.4 0.4 197.2 0.1 22.9-0.1 45.8-0.4 68.7-0.1 11.5-4.9 19.4-17 21.9-20.7 4.3-40.3 3-59-8-67.7-39.5-134.6-79.5-202.9-117.2-35.7-19.7-52.4-47.2-51.7-87.8 0.9-58 0.4-116.1 0.5-174.2-0.2-1.9 0.5-3.8 1.4-10.2 25.3 21 61.8 24.5 70.5 60.3 3.8 15.4 1.4 32.4 1.6 48.7 0.3 26 0 52 1.3 77.9 0.3 6.1 4 14.8 8.8 17.7 52.9 31.5 106.6 62.1 159.9 92.9 3.5 1.3 7.1 2.3 10.8 2.9 0.6-17.9 1.4-34.4 1.5-50.9 0.1-47.4 0.4-94.7-0.7-142.1-1-7.8-5.3-14.8-11.8-19.1-61.5-36.7-123.7-72.6-185.8-108.7-16.2-9.5-33-18.3-48.5-28.9-5-4.2-7.6-10.5-7.2-17 3.7-21.4 16.8-40 35.6-50.8 71.6-41.3 143-82.6 214.4-123.9 27.1-15.7 54.2-16 81.3-0.4 52.5 30.4 104.9 60.9 157.3 91.4 2.1 1.2 4.1 2.9 9.1 6.6z" style="fill:url(#SVGID_1_)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -477,5 +477,69 @@
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/82c29d674bc57596102a6b815f66e956f217e658.png",
|
||||
"ReleaseDate": "1661864214",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.25.0",
|
||||
"BSManifest": "4529582051007915041",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3312985013538143172",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/54ac649877eca25a2a6449662337e2c63c51bbcf.png",
|
||||
"ReleaseDate": "1665068529",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.25.1",
|
||||
"BSManifest": "7372469314660649150",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/5346361068670142187",
|
||||
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/52cbd15b5e226f509e051565f6e4935eb0e44e2c.png",
|
||||
"ReleaseDate": "1665673269",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.26.0",
|
||||
"BSManifest": "3634450655207470002",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3414318646334948892",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d18ad9d7f45a5cc2a467d75f0bdf9d32b9141b14.png",
|
||||
"ReleaseDate": "1667923560",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.27.0",
|
||||
"BSManifest": "3485516174915301618",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3629368753553708497",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d9ed8771498be7fc83721aaaaa5b15a08fbeadb1.png",
|
||||
"ReleaseDate": "1670943003",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.28.0",
|
||||
"BSManifest": "7463243155526905423",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3666530358620442392",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/8f978bbf292810004bca12523e76be8a7eec8c4e.png",
|
||||
"ReleaseDate": "1677593822",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.0",
|
||||
"BSManifest": "3341527958186345367",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105082976092",
|
||||
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/255fd49cd96042b97089f754609be291293e783f.png",
|
||||
"ReleaseDate": "1680188760",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.1",
|
||||
"BSManifest": "886973241045584398",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105101272202",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/c328e407367e9914abaf92f609501877ee5abb63.png",
|
||||
"ReleaseDate": "1680623885",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.4",
|
||||
"BSManifest": "6291266771922375922",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3708194993422325380",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/9c3d476c03e4a2ac72ca5df016b7c94d242b41cb.png",
|
||||
"ReleaseDate": "1683644991",
|
||||
"year": "2023"
|
||||
}
|
||||
]
|
||||
@@ -1 +1,10 @@
|
||||
[]
|
||||
[
|
||||
{"username": "Shidorien"},
|
||||
{"username": "iPixelGalaxy", "type": "diamond", "link": "https://twitch.tv/ipixelgalaxy"},
|
||||
{"username": "Emyte", "type": "gold"},
|
||||
{"username": "GoodOldNervy"},
|
||||
{"username": "Carbon", "type": "gold"},
|
||||
{"username": "Naysy"},
|
||||
{"username": "Falmil"},
|
||||
{"username": "K1Lc4m"}
|
||||
]
|
||||
@@ -0,0 +1,911 @@
|
||||
{
|
||||
"misc": {
|
||||
"download": "Laden",
|
||||
"add": "Hinzufügen",
|
||||
"verify": "Prüfen",
|
||||
"launch": "Starten",
|
||||
"mods": "Mods",
|
||||
"maps": "Maps",
|
||||
"playlists": "Playlisten",
|
||||
"models": "Modelle",
|
||||
"cancel": "Abbruch",
|
||||
"delete": "Löschen",
|
||||
"accept": "Akzeptieren",
|
||||
"refuse": "Ablehnen",
|
||||
"apply": "Übernehmen",
|
||||
"copy": "Kopieren",
|
||||
"copied": "Kopiert!"
|
||||
},
|
||||
"nav-bar":{
|
||||
"add-version": "Version Hinzufügen",
|
||||
"settings": "Einstellungen",
|
||||
"shared": {
|
||||
"text": "Geteilt",
|
||||
"tooltip": "Geteilte Inhalte"
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps":{
|
||||
"title": "Geteilte Maps"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Modus",
|
||||
"oculus-description": "Wenn du Beat Saber über Steam benutzt, es ermöglicht dir Oculus's VR-Composer zu nutzen ohne SteamVR, um bessere Leistung zu erhalten. Dies wird nicht benötigt für Oculus Headsets",
|
||||
"desktop": "Desktop Modus",
|
||||
"desktop-description": "Auf diese Weise kannst du WASD und die Maus verwenden, um im Spiel durch das Menü zu navigieren. Dies erleichtert das Testen erheblich, da Du dein Headset nicht aufsetzen musst!",
|
||||
"debug": "Debug Modus",
|
||||
"debug-description": "Aktiviert das Ausgabeprotokollfenster für IPA. Dies zeigt die Debug-Konsole, die Mods verwenden.",
|
||||
"advanced-launch": {
|
||||
"button": "Erweiterter Start",
|
||||
"placeholder": "Weitere Argumente Bspw: --revert; --nowait"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Geteilte Maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Suche eine Map",
|
||||
"filters-btn": "Filter",
|
||||
"dropdown": {
|
||||
"export-maps": "Maps Exportieren",
|
||||
"delete-maps": "Maps Löschen"
|
||||
}
|
||||
},
|
||||
"tabs": {
|
||||
"maps": {
|
||||
"actions": {
|
||||
"add-maps": {
|
||||
"text": "Hinzufügen"
|
||||
},
|
||||
"link-maps": {
|
||||
"tooltips": {
|
||||
"link": "Maps Verknüpfen",
|
||||
"unlink": "Maps Verknüpfung aufheben"
|
||||
}
|
||||
}
|
||||
},
|
||||
"empty-maps":{
|
||||
"text":"Keine Maps",
|
||||
"button":"Maps Herunterladen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mods": {
|
||||
"loading-mods": "Lade Mods...",
|
||||
"no-internet": "Kein Internet",
|
||||
"mods-not-available": "Für diese Version von Beat Saber sind noch keine Mods verfügbar",
|
||||
"buttons": {
|
||||
"more-infos": "Mehr Infos",
|
||||
"install-or-update": "Installieren oder aktualisieren"
|
||||
},
|
||||
"mods-grid": {
|
||||
"header-bar": {
|
||||
"name": "Name",
|
||||
"installed": "Installiert",
|
||||
"latest": "Neueste",
|
||||
"description": "Beschreibung",
|
||||
"dropdown": {
|
||||
"uninstall-all": "Alle deinstallieren"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dropdown": {
|
||||
"open-folder": "Ordner Öffnen",
|
||||
"verify-files": "Daten Prüfen",
|
||||
"clone": "Klonen",
|
||||
"edit": "Bearbeiten",
|
||||
"uninstall": "Entfernen",
|
||||
"shared-folders": "Geteilte Ordner"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
"title": "Wähle eine Version",
|
||||
"steam-release": "Versions Seite",
|
||||
"dropdown": {
|
||||
"refresh": "Liste aktualisieren",
|
||||
"import-version" :"Importiere eine Version"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"steam": {
|
||||
"title": "Steam",
|
||||
"description": "Wenn Du dich von Steam abmeldest, musst Du dich erneut anmelden, um eine neue Version von Beat Saber herunterzuladen.",
|
||||
"logout": "Abmelden"
|
||||
},
|
||||
"appearance": {
|
||||
"title": "Aussehen",
|
||||
"description": "Wähle Zwei von den Hauptfarben von BSManager",
|
||||
"reset": "Zurücksetzen",
|
||||
"sub-title": "Design",
|
||||
"themes": {
|
||||
"dark": "Dunkel",
|
||||
"light": "Hell",
|
||||
"os": "Mit Computer Synchronisieren"
|
||||
}
|
||||
},
|
||||
"installation-folder": {
|
||||
"title": "Installations Ordner",
|
||||
"description": "Ändern Sie den Standardordner für Beat Saber-Versionen und andere kommende Funktionen.",
|
||||
"choose-folder": "Ordner Wählen"
|
||||
},
|
||||
"additional-content": {
|
||||
"title": "Zusätzlicher Inhalt",
|
||||
"description": "Mit zusätzlichen Inhalten kannst du BeatSaber anpassen!",
|
||||
"deep-links": {
|
||||
"sub-title": "OneClick-Installationen"
|
||||
}
|
||||
},
|
||||
"language": {
|
||||
"title": "Sprache",
|
||||
"description": "Wähle eine Sprache.",
|
||||
"languages": {
|
||||
"en-EN": "English, UK",
|
||||
"en-US": "English, US",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Deutsch",
|
||||
"translated": {
|
||||
"en-EN": "Englisch, Vereinigtes Königreich",
|
||||
"en-US": "Englisch, USA",
|
||||
"fr-FR": "Französisch",
|
||||
"es-ES": "Spanisch",
|
||||
"de-DE": "Deutsch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"patreon": {
|
||||
"title": "BSManager Unterstützen 💖",
|
||||
"description": "Unterstütze das Projekt und helfe uns, BSManager kontinuierlich zu verbessern.",
|
||||
"buttons": {
|
||||
"support": "BSManager Unterstützen 🥰",
|
||||
"supporters": "Unterstützer 👀"
|
||||
},
|
||||
"view": {
|
||||
"no-supporters": "Noch keine Unterstützer",
|
||||
"sponsors": "Sponsoren",
|
||||
"supporters": "Unterstützer"
|
||||
}
|
||||
},
|
||||
"discord": {
|
||||
"description": "Trete der BSManager-Community bei, indem Du uns in unseren sozialen Medien folgst!"
|
||||
},
|
||||
"contribution": {
|
||||
"description": "Schlage neue Funktionen vor, oder melde einen Fehler und BSManager zu verbessern!",
|
||||
"buttons": {
|
||||
"request-features": "Funktion Vorschlagen",
|
||||
"report-bug": "Fehler melden",
|
||||
"open-logs": "Protokolle öffnen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"types": {
|
||||
"error": "🚨 Fehler",
|
||||
"warning": "⚠️ Warnung",
|
||||
"success": "🎉 Erfolg"
|
||||
},
|
||||
"common": {
|
||||
"msg": {
|
||||
"error-occurred": "Ein Fehler ist aufgetreten"
|
||||
}
|
||||
},
|
||||
"shared": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"operation-running": "Vorgang läuft",
|
||||
"no-internet": "Kein Internet"
|
||||
},
|
||||
"msg": {
|
||||
"operation-running": "Warte auf das Ende des Aktuellen Vorgangs und versuche es erneut",
|
||||
"no-internet": "Überprüfe deine Verbindung und versuche es erneut."
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-download": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"download-success": "Erfolgreich Heruntergeladen",
|
||||
"verification-finished": "Verifikation Erfolgreich"
|
||||
}
|
||||
},
|
||||
"warnings": {
|
||||
"msg": {
|
||||
"ManifestChecksum": "Die zuvor heruntergeladene Manifest stimmt nicht mit dem neuen überein 🤔",
|
||||
"ConnectionTimeout": "Deine Internetverbindung scheint instabil zu sein 🥶",
|
||||
"ConnectionLost": "Die Verbindung wurde unterbrochen, versuche es erneut...",
|
||||
"ConnectionError": "Kann keine Verbindung zu Steam herstellen, versuche es erneut...",
|
||||
"Unknown": "Etwas Seltsames ist passiert 🤔 Deine Verbindung ist wahrscheinlich instabil."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles":{
|
||||
"dotnet-required": ".NET 6 Benötigt"
|
||||
},
|
||||
"msg": {
|
||||
"401": "Steam scheint uns BeatSaber nicht herunterladen zu lassen 😢",
|
||||
"404": "Steam-Server können nicht kontaktiert werden.",
|
||||
"Password": "Passwort ist ungültig.",
|
||||
"InvalidCredentials": "Deine E-Mail oder Passwort ist ungültig 😴",
|
||||
"InvalidPassword": "Dein Passwort ist ungültig 😕",
|
||||
"NoManifest": "Es wurde keine Manifest gefunden",
|
||||
"DirectoryCreate": "Die erforderlichen Ordner können nicht installiert werden.",
|
||||
"NotAvailableApp": "Versuchst du, Beat Saber herunterzuladen, wenn Du es nicht hast? 🤣",
|
||||
"DepotNotFound": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NotCompleted": "Der Download konnte nicht beendet werden ¯\\_(ツ)_/¯",
|
||||
"InvalidManifest": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NoValidKey": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NoManifestCode": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"Unknown": "Ein Unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯",
|
||||
"NoServer": "Steam-Server können nicht kontaktiert werden.",
|
||||
"NotAllowed": "Anscheinend darfst Du BeatSaber nicht herunterladen 🥱",
|
||||
"ConnectionTimeout": "Kann keine Verbindung zu Steam herstellen 😕",
|
||||
"SteamLib": "Wenn dieser Fehler auftritt, melde den Fehler auf Github mit Protokollen, bitte.",
|
||||
"ConnectionError": "Kann nach 10 Versuchen keine Verbindung zu Steam herstellen 🤯",
|
||||
"LicenceError": "Die Liste der Lizenzen kann nicht abgerufen werden.",
|
||||
"verification-failed": "Verifikation fehlgeschlagen, versuche es später erneut.",
|
||||
"RateLimitExceeded": "Du hast es zu oft versucht, warte eine Weile und versuche es später erneut.",
|
||||
"AlreadyDownloading": "Ein Download ist bereits im Gange",
|
||||
"no-internet": "Keine Internet Verbindung",
|
||||
"dotnet-required": ".NET 6 Runtime muss installiert sein, um eine Version von BeatSaber herunterzuladen. Lade es herunter, indem Du auf die Schaltfläche unten klickst."
|
||||
},
|
||||
"actions":{
|
||||
"download-dotnet": ".NET 6 Herunterladen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-import-version":{
|
||||
"success":{
|
||||
"start-import": {
|
||||
"title": "Import im Gange 👌",
|
||||
"desc": "Der Import kann je nach Konfiguration einige Minuten dauern."
|
||||
},
|
||||
"imported": {
|
||||
"title": "Versionen Importiert 🎉"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"import-error":{
|
||||
"desc": "Überprüfe, ob der ausgewählte Ordner eine BeatSaber-Installation ist."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"move-folder": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"transfer-started": "Übertragung läuft",
|
||||
"transfer-finished": "Transfer abgeschlossen"
|
||||
},
|
||||
"descs": {
|
||||
"transfer-started": "Die Übertragung hat begonnen und kann je nach Konfiguration mehrere Minuten dauern."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"transfer-failed": "Transfer fehlgeschlagen 😕"
|
||||
},
|
||||
"descs": {
|
||||
"COPY_TO_SUBPATH": "Der Zielordner darf kein Unterordner des Quellordners sein.",
|
||||
"restore-linked-folders": "Beim Wiederherstellen von freigegebenen Ordnern ist ein Fehler aufgetreten. Du kannst sie dennoch manuell über das Menü 'Freigegebene Ordner' auf der Versionsseite wiederherstellen."
|
||||
}
|
||||
}
|
||||
},
|
||||
"steam": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"logout": "Von Steam getrennt."
|
||||
}
|
||||
}
|
||||
},
|
||||
"additional-content":{
|
||||
"deep-link": {
|
||||
"select-all": "Alle Auswählen",
|
||||
"activation":{
|
||||
"success":{
|
||||
"title":"OneClick aktiviert!",
|
||||
"description":"OneClick-Installationen wurden aktiviert."
|
||||
},
|
||||
"error":{
|
||||
"description":"OneClick-Installationen konnten nicht aktiviert werden."
|
||||
}
|
||||
},
|
||||
"deactivation":{
|
||||
"success":{
|
||||
"title":"OneClick deaktiviert!",
|
||||
"description":"OneClick-Installationen wurden deaktiviert."
|
||||
},
|
||||
"error":{
|
||||
"description":"Ein Unbekannter Fehler ist aufgetreten."
|
||||
}
|
||||
},
|
||||
"check-all-enabled":{
|
||||
"title": "OneClick deaktiviert",
|
||||
"description": "Eine oder mehrere OneClick-Installationen sind deaktiviert. Gehe in die Einstellungen, um sie zu aktivieren.",
|
||||
"actions":{
|
||||
"settings": "Einstellungen",
|
||||
"not-remind": "Erinnere mich nicht"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-launch": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"launching": "Starte...🚀"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"UNABLE_TO_LAUNCH": "Start nicht möglich",
|
||||
"STEAM_NOT_RUNNING": "Steam läuft nicht",
|
||||
"OCULUS_NOT_RUNNING": "Oculus läuft nicht",
|
||||
"BS_ALREADY_RUNNING": "BeatSaber läuft bereits",
|
||||
"EXE_NOT_FINDED": "Dateien Fehlen",
|
||||
"EXIT": "Abrupter Stop"
|
||||
},
|
||||
"msg": {
|
||||
"STEAM_NOT_RUNNING": "Steam muss laufen, um BeatSaber zu starten.",
|
||||
"OCULUS_NOT_RUNNING": "Oculus muss ausgeführt werden, um BeatSaber zu starten.",
|
||||
"BS_ALREADY_RUNNING": "Schließe BeatSaber, bevor Du es erneut startest.",
|
||||
"EXE_NOT_FINDED": "Einige Dateien scheinen zu fehlen, versuche die Dateien zu überprüfen.",
|
||||
"EXIT": "BeatSaber stoppte abrupt, versuche die Dateien zu überprüfen."
|
||||
},
|
||||
"actions":{
|
||||
"STEAM_NOT_RUNNING": "Starte Steam"
|
||||
}
|
||||
}
|
||||
},
|
||||
"steam":{
|
||||
"steam-launching":{
|
||||
"title": "Steam startet!",
|
||||
"description": "Abhängig von deiner Konfiguration kann es einige Zeit dauern, bis Steam gestartet wird."
|
||||
}
|
||||
},
|
||||
"custom-version": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"CantEditSteam": "Kann nicht bearbeitet werden",
|
||||
"CantRename": "Umbenennen unmöglich",
|
||||
"VersionAlreadExist": "Diese Version existiert bereits",
|
||||
"CantClone": "Klonen unmöglich"
|
||||
},
|
||||
"msg": {
|
||||
"CantEditSteam": "Die Steam-Version kann nicht bearbeitet werden. Du kannst es aber klonen."
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"titles": {
|
||||
"CloningFinished": "Klonen abgeschlossen 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mods": {
|
||||
"install-mods": {
|
||||
"titles": {
|
||||
"success": "Mods Installiert 🎉",
|
||||
"warning": "Mods Installiert 🤔"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Alle Mods wurden installiert.",
|
||||
"warning": "Eine oder mehr Mods konnten nicht installiert werden.",
|
||||
"errors": {
|
||||
"no-mods": "Keine Mods zum installieren.",
|
||||
"cannot-install-bsipa": "BSIPA installation fehlgeschlagen 😨"
|
||||
}
|
||||
}
|
||||
},
|
||||
"uninstall-mod": {
|
||||
"titles": {
|
||||
"success": "Mod entfernt 🎉"
|
||||
},
|
||||
"msg": {
|
||||
"errors": {
|
||||
"no-mods": "Diese Mod kann nicht installiert werden 😑"
|
||||
}
|
||||
}
|
||||
},
|
||||
"uninstall-all-mods": {
|
||||
"titles": {
|
||||
"success": "Mods entfernt 🎉"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Alle Mods wurden entfernt.",
|
||||
"errors": {
|
||||
"no-mods": "Keine Mods sind in dieser Version installiert 😑"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps":{
|
||||
"one-click-install":{
|
||||
"success":"Map installation abegschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation der Map"
|
||||
}
|
||||
},
|
||||
"playlists":{
|
||||
"one-click-install":{
|
||||
"success":"Playlist installation abgeschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation der Playlist"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"one-click-install":{
|
||||
"success":"Modell installation abgeschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation des Modells"
|
||||
}
|
||||
},
|
||||
"shared-folder": {
|
||||
"info": {
|
||||
"userdata-backup-created":{
|
||||
"title": "Sicherung erstellt",
|
||||
"msg": "Das Freigeben des Ordners „UserData“ kann zu Fehlern führen. Bei Problemen trenne den Ordner, um die Sicherung wiederherzustellen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"misc":{
|
||||
"remember-my-choice": "Merke meine Wahl"
|
||||
},
|
||||
"guard": {
|
||||
"title": "Steam Guard",
|
||||
"inputs": {
|
||||
"guard-code": {
|
||||
"label": "Guard-Code",
|
||||
"placeholder": "Gebe deinen Guard-Code ein"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
"submit": "Anmelden"
|
||||
}
|
||||
},
|
||||
"steam-login": {
|
||||
"title": "Steam Login",
|
||||
"inputs": {
|
||||
"username": {
|
||||
"label": "Nutzername",
|
||||
"placeholder": "Gebe deinen Nutzernamen ein"
|
||||
},
|
||||
"password": {
|
||||
"label": "Passwort",
|
||||
"placeholder": "Gebe dein Passwort ein"
|
||||
},
|
||||
"stay": {
|
||||
"label": "Verbunden bleiben"
|
||||
}
|
||||
},
|
||||
"why-credentials": "Warum braucht ihr meine Anmeldeinformationen?",
|
||||
"buttons": {
|
||||
"submit": "Anmelden"
|
||||
}
|
||||
},
|
||||
"steam-credentials":{
|
||||
"title": "Steam Anmeldeinformationen",
|
||||
"p-1": "Die Anmeldeinformationen werden nur zum Herunterladen des Spiels verwendet, da Steam überprüfen muss, ob Du das Spiel bezahlt hast, um es herunterladen zu dürfen. Sie werden nicht gespeichert und direkt an DepotDownloader weitergegeben. Wenn Du deine Anmeldeinformationen nicht eingeben möchtest, kannst Du diesem Tutorial folgen:",
|
||||
"p-2": "und klicke dann auf das Zahnradsymbol in der oberen rechten Ecke und wähle \"Version importieren\", wähle den Ordner aus, in den Beat Saber heruntergeladen wurde (Wenn Du dem obigen Tutorial folgst, solltest Du den richtigen Speicherort haben)"
|
||||
},
|
||||
"bs-import-version":{
|
||||
"title": "Importiere eine Version",
|
||||
"description": "Importiert eine Version von BeatSaber zur Verwendung mit BSManager. Der Import kopiert den ausgewählten BeatSaber-Installationsordner in den BSManager-Versionsordner.",
|
||||
"buttons":{
|
||||
"submit": "Importiere eine Version"
|
||||
}
|
||||
},
|
||||
"bs-uninstall": {
|
||||
"title": "Deinstallieren",
|
||||
"description": "Möchtest du BeatSaber {version} wirklich deinstallieren? Du musst es erneut herunterladen, um es zu spielen.",
|
||||
"buttons": {
|
||||
"submit": "Deinstallieren"
|
||||
}
|
||||
},
|
||||
"install-folder": {
|
||||
"title": "Installation Ordner",
|
||||
"description": "Das Ändern des Standardinstallationsordners führt dazu, dass alle installierten Daten in den neuen Ordner verschoben werden.",
|
||||
"buttons": {
|
||||
"submit": "Ordner Wählen"
|
||||
}
|
||||
},
|
||||
"edit-version": {
|
||||
"title": "Version ändern",
|
||||
"buttons": {
|
||||
"submit": "Ändern"
|
||||
}
|
||||
},
|
||||
"clone-version": {
|
||||
"title": "Version Klonen",
|
||||
"description": "Durch das Klonen der Version kannst Du zusätzlichen BeatSaber-Inhalt zwischen zwei Versionen trennen.",
|
||||
"inputs": {
|
||||
"name": {
|
||||
"label": "Name",
|
||||
"placeholder": "Versions Name"
|
||||
},
|
||||
"color": {
|
||||
"label": "Farbe"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
"submit": "Klonen"
|
||||
}
|
||||
},
|
||||
"uninstall-mod": {
|
||||
"title": "Entfernen",
|
||||
"description": "Bist du sicher das du die Mod {mod} entfernen möchtest? Es könnte dafür sorgen, dass andere installationen nicht mehr richtig funktionieren.",
|
||||
"description-bsipa": "Bist du sicher, dass du BSIPA entfernen möchtest? Dannach werden deine Mods nicht mehr funktionieren."
|
||||
},
|
||||
"uninstall-all-mods": {
|
||||
"title": "Entferne Alle Mods",
|
||||
"description": "Bist du sicher das du alle Mods von der Version {version} entfernen möchtest? Diese Aktion kann nicht rückgängig gemacht werden."
|
||||
},
|
||||
"maps-actions": {
|
||||
"delete-maps": {
|
||||
"title": {
|
||||
"single": "Map Entfernen?",
|
||||
"multiple": "Maps Entfernen?"
|
||||
},
|
||||
"desc": {
|
||||
"single": "Bist du sicher das du die Map {name} entfernen willst?",
|
||||
"multiple": "Bist du sicher das du alle {nb} maps entfernen willst?"
|
||||
},
|
||||
"info": {
|
||||
"desc": {
|
||||
"single": "Diese Map ist teil der geteilten Maps",
|
||||
"multiple": "Diese Maps sind teil der geteilten Maps"
|
||||
},
|
||||
"title": {
|
||||
"single": "Diese Map wird auch aus Versionen entfernt, die geteilte Maps verwenden",
|
||||
"multiple": "Diese Maps werden auch aus Versionen entfernt, die geteilte Maps verwenden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"link-maps": {
|
||||
"title": "Maps Verknüpfen",
|
||||
"desc": "Das Verknüpfen von Maps ermöglicht es, Maps zwischen allen Versionen zu teilen. Nach der Verknüpfung profitiert diese Version von den geteilten Maps",
|
||||
"info": "Das Hinzufügen und Löschen von Maps wird ebenfalls geteilt",
|
||||
"keep-maps": {
|
||||
"label": "Maps behalten",
|
||||
"title": "Maps behalten verschiebt die Maps der aktuellen Version in den geteilten Maps. Andernfalls gehen sie verloren."
|
||||
},
|
||||
"valid-btn": "Maps Verknüpfen"
|
||||
},
|
||||
"unlink-maps": {
|
||||
"title": "Maps Verknüpfung aufheben",
|
||||
"desc": "Bitte beachte, dass das Aufheben der Verknüpfung von Maps die Verwendung von geteilten Maps für diese Version nicht zulässt.",
|
||||
"keep-maps": {
|
||||
"label": "Maps behalten",
|
||||
"title": "Maps behalten verschiebt die Maps der aktuellen Version in den geteilten Maps. Andernfalls gehen sie verloren."
|
||||
},
|
||||
"valid-btn": "Verknüpfung aufheben"
|
||||
}
|
||||
},
|
||||
"download-maps": {
|
||||
"search-btn": "Suchen",
|
||||
"loading-maps": "Lade Maps...",
|
||||
"no-maps-found": "Keine Maps gefunden",
|
||||
"no-internet": "Kein Internet"
|
||||
},
|
||||
"mods-disclaimer":{
|
||||
"title": "Haftungsausschluss",
|
||||
"p-1": "Indem Du dich für die Verwendung von Mods entscheiden, verstehst Du Folgendes:",
|
||||
"li-1": "Möglicherweise treten Probleme auf, die im Vanilla-Spiel nicht vorhanden sind. 99.9% der Fehler, Abstürze und Verzögerungen sind auf Mods zurückzuführen.",
|
||||
"li-2": "Mods können durch Updates beschädigt werden und das ist normal - sei geduldig und respektvoll, wenn dies passiert, da Modder Freiwillige mit echtem Leben sind.",
|
||||
"li-3": "Beat Games versuchen nicht absichtlich, Mods kaputt zu machen. Sie möchten an der Codebasis arbeiten und manchmal macht dies Mods kaputt, aber sie sind nicht darauf aus, Mods zu verbieten.",
|
||||
"p-2": "Greife die Spieleentwickler nicht wegen Problemen im Zusammenhang mit Mods an und umgekehrt - Modder und Spieleentwickler sind zwei getrennte Gruppen. Sei einfach nicht gemein, okay?"
|
||||
},
|
||||
"shared-folders":{
|
||||
"title": "Geteilte Ordner",
|
||||
"description": "Verknüpfe BeatSaber-Ordner, um ihre Inhalte mit freigegebenen Ordnern in anderen Versionen zu synchronisieren. Beachte, dass auch das Löschen von Inhalten geteilt wird.",
|
||||
"buttons": {
|
||||
"add-folder": "Ordner Hinzufügen",
|
||||
"link-folder": "Ordner Verknüpfen",
|
||||
"unlink-folder": "Ordner Verknüpfung Aufheben",
|
||||
"link-all": "Alle verlinken"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Länge",
|
||||
"tags": "Stichworte",
|
||||
"specificities": "Allgemein",
|
||||
"requirements": "Anforderungen"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "Präzision",
|
||||
"balanced": "Ausgeglichen",
|
||||
"challenge": "Herausforderung",
|
||||
"dancestyle": "Tanz",
|
||||
"fitness": "Fitness",
|
||||
"speed": "Geschwindigkeit",
|
||||
"tech": "Tech"
|
||||
},
|
||||
"map-styles": {
|
||||
"dance": "Tanz",
|
||||
"swing": "Swing",
|
||||
"nightcore": "Nightcore",
|
||||
"folk": "Folk",
|
||||
"family": "Familie",
|
||||
"ambient": "umgebung",
|
||||
"funk": "Funk",
|
||||
"jazz": "Jazz",
|
||||
"soul": "Soul",
|
||||
"speedcore": "Speedcore",
|
||||
"punk": "Punk",
|
||||
"rb": "R&B",
|
||||
"holiday": "Urlaub",
|
||||
"vocaloid": "Vokaloid",
|
||||
"jrock": "J-Rock",
|
||||
"trance": "Trance",
|
||||
"drumbass": "Basstrommel",
|
||||
"comedy": "Komödie",
|
||||
"instrumental": "Instrumental",
|
||||
"hardcore": "Hardcore",
|
||||
"kpop": "K-Pop",
|
||||
"indie": "Indie",
|
||||
"techno": "Techno",
|
||||
"house": "House",
|
||||
"game": "Videospiele",
|
||||
"film": "Filme",
|
||||
"alt": "Alternativ",
|
||||
"dubstep": "Dubstep",
|
||||
"metal": "Metal",
|
||||
"anime": "Anime",
|
||||
"hiphop": "HipHop",
|
||||
"jpop": "J-Pop",
|
||||
"rock": "Rock",
|
||||
"pop": "Pop",
|
||||
"electronic": "Elektronisch",
|
||||
"classical-orchestral": "Klassisch & Orchestra"
|
||||
},
|
||||
"map-specificities": {
|
||||
"automapper": "KI",
|
||||
"ranked": "ranked",
|
||||
"curated": "curated",
|
||||
"verified": "verifiziert",
|
||||
"fullSpread": "full spread"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "einfach",
|
||||
"Normal": "normal",
|
||||
"Hard": "hard",
|
||||
"Expert": "expert",
|
||||
"ExpertPlus": "expert+"
|
||||
},
|
||||
"map-item": {
|
||||
"by": "Von {songAutor}",
|
||||
"mapped-by": "Gemapped von"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"types": {
|
||||
"singular": {
|
||||
"avatar": "Avatar",
|
||||
"saber": "Säbel",
|
||||
"platform": "Plattform",
|
||||
"bloq": "Block"
|
||||
},
|
||||
"plural": {
|
||||
"avatar": "Avatare",
|
||||
"saber": "Säbel",
|
||||
"platform": "Plattformen",
|
||||
"bloq": "Blöcke"
|
||||
}
|
||||
},
|
||||
"sorts": {
|
||||
"name": "Name",
|
||||
"date": "Datum",
|
||||
"author": "Autor"
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Ein Modell suchen",
|
||||
"drop-down": {
|
||||
"delete": "Modelle löschen",
|
||||
"export": "Modelle exportieren"
|
||||
},
|
||||
"link-models": "Modelle verlinken",
|
||||
"unlink-models": "Modelle trennen"
|
||||
},
|
||||
"grid":{
|
||||
"loading": "Modelle laden...",
|
||||
"no-models": "Keine Modelle",
|
||||
"download-models": "Modelle herunterladen"
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"delete-model" :{
|
||||
"title": "Das Modell löschen",
|
||||
"desc": "Sind Sie sicher, dass Sie das Modell {modelName} löschen möchten?",
|
||||
"linked-annotation": "Dieses Modell wird aus allen verlinkten Versionen entfernt."
|
||||
},
|
||||
"delete-models": {
|
||||
"title": "Modelle löschen",
|
||||
"desc": "Sind Sie sicher, dass Sie die {nb} Modelle löschen möchten?",
|
||||
"linked-annotation": "Diese Modelle werden aus allen verlinkten Versionen entfernt."
|
||||
},
|
||||
"download-models": {
|
||||
"search-btn": "Suche",
|
||||
"search-placeholder": "Ein Modell suchen",
|
||||
"search-tips": {
|
||||
"header": {
|
||||
"tag": "Tag",
|
||||
"desc": "Beschreibung"
|
||||
},
|
||||
"author-desc": "Nur Modelle vom angegebenen Autor anzeigen.",
|
||||
"hash-desc": "Nur Modelle mit dem angegebenen Hash anzeigen.",
|
||||
"tag-desc": "Nur Modelle mit dem angegebenen Tag anzeigen.",
|
||||
"name-desc": "Nur Modelle mit dem angegebenen Namen anzeigen.",
|
||||
"discordid-desc": "Nur Modelle vom angegebenen Discord-Benutzer anzeigen.",
|
||||
"status-desc": "Nur Modelle mit dem angegebenen Status anzeigen. (nur Profil, und nur für den Autor)"
|
||||
},
|
||||
"no-models": "Keine Modelle gefunden.",
|
||||
"no-internet": "Keine Internetverbindung.",
|
||||
"error-occured": "Ein Fehler ist aufgetreten, versuche es später erneut."
|
||||
},
|
||||
"link-models": {
|
||||
"avatar": {
|
||||
"title": "Avatare verbinden",
|
||||
"desc": "Das Verbinden von Avataren ermöglicht das Teilen von Avataren zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Avataren profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Avataren wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Avatare behalten",
|
||||
"title": "Das Behalten der Avatare wird die Avatare der aktuellen Version in den Ordner der geteilten Avatare verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Avatare verbinden"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Säbel verbinden",
|
||||
"desc": "Das Verbinden von Säbeln ermöglicht das Teilen von Säbeln zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Säbeln profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Säbeln wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Säbel behalten",
|
||||
"title": "Das Behalten der Säbel wird die Säbel der aktuellen Version in den Ordner der geteilten Säbel verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Säbel verbinden"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Plattformen verbinden",
|
||||
"desc": "Das Verbinden von Plattformen ermöglicht das Teilen von Plattformen zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Plattformen profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Plattformen wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Plattformen behalten",
|
||||
"title": "Das Behalten der Plattformen wird die Plattformen der aktuellen Version in den Ordner der geteilten Plattformen verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Plattformen verbinden"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Bloqs verbinden",
|
||||
"desc": "Das Verbinden von Bloqs ermöglicht das Teilen von Bloqs zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Bloqs profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Bloqs wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Bloqs behalten",
|
||||
"title": "Das Behalten der Bloqs wird die Bloqs der aktuellen Version in den Ordner der geteilten Bloqs verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Bloqs verbinden"
|
||||
}
|
||||
},
|
||||
"unlink-models": {
|
||||
"avatar": {
|
||||
"title": "Avatare trennen",
|
||||
"desc": "Achtung, das Trennen der Avatare wird die Nutzung der geteilten Avatare für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Avatare behalten",
|
||||
"title": "Das Behalten der Avatare wird eine Kopie der geteilten Avatare für die aktuelle Version erstellen. Andernfalls wird kein Avatar für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Avatare trennen"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Säbel trennen",
|
||||
"desc": "Achtung, das Trennen der Säbel wird die Nutzung der geteilten Säbel für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Säbel behalten",
|
||||
"title": "Das Behalten der Säbel wird eine Kopie der geteilten Säbel für die aktuelle Version erstellen. Andernfalls wird kein Säbel für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Säbel trennen"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Plattformen trennen",
|
||||
"desc": "Achtung, das Trennen der Plattformen wird die Nutzung der geteilten Plattformen für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Plattformen behalten",
|
||||
"title": "Das Behalten der Plattformen wird eine Kopie der geteilten Plattformen für die aktuelle Version erstellen. Andernfalls wird keine Plattform für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Plattformen trennen"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Bloqs trennen",
|
||||
"desc": "Achtung, das Trennen der Bloqs wird die Nutzung der geteilten Bloqs für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Bloqs behalten",
|
||||
"title": "Das Behalten der Bloqs wird eine Kopie der geteilten Bloqs für die aktuelle Version erstellen. Andernfalls wird kein Bloq für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Bloqs trennen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"prevent-for-mods": {
|
||||
"title": "Erforderliche Mods",
|
||||
"desc": "Stellen Sie sicher, dass Sie die notwendigen Mods installiert haben, um Modelle in BeatSaber zu verwenden",
|
||||
"go-to-mods": "Gehe zu Mods",
|
||||
"not-remind": "Erinnere mich nicht"
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Gebrochene Modelle",
|
||||
"desc": "Seit dem Update des BeatSaber-Motors sind Modelle für diese Version nicht mehr funktional."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export abgeschlossen 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"beat-saver": {
|
||||
"maps-sorts": {
|
||||
"Latest": "Neueste",
|
||||
"Relevance": "Relevanz",
|
||||
"Rating": "Bewertung",
|
||||
"Curated": "Curated"
|
||||
}
|
||||
},
|
||||
"auto-update": {
|
||||
"checking": "Prüfe auf Updates",
|
||||
"downloading": "Lade Updates Herunter"
|
||||
},
|
||||
"dateformat": {
|
||||
"dayNames": [
|
||||
"So",
|
||||
"Mo",
|
||||
"Di",
|
||||
"Mi",
|
||||
"Do",
|
||||
"Fr",
|
||||
"Sa",
|
||||
"Sonntag",
|
||||
"Montag",
|
||||
"Dienstag",
|
||||
"Mittwoch",
|
||||
"Donnerstag",
|
||||
"Freitag",
|
||||
"Samstag"
|
||||
],
|
||||
"monthNames": [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mär",
|
||||
"Apr",
|
||||
"Mai",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Okt",
|
||||
"Nov",
|
||||
"Dez",
|
||||
"Januar",
|
||||
"Februar",
|
||||
"März",
|
||||
"April",
|
||||
"Mai",
|
||||
"Juni",
|
||||
"Juli",
|
||||
"August",
|
||||
"September",
|
||||
"Oktober",
|
||||
"November",
|
||||
"Dezember"
|
||||
],
|
||||
"timeNames": [
|
||||
"a",
|
||||
"p",
|
||||
"am",
|
||||
"pm",
|
||||
"A",
|
||||
"P",
|
||||
"AM",
|
||||
"PM"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,11 @@
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
"nsis"
|
||||
"nsis",
|
||||
"nsis-web"
|
||||
],
|
||||
"icon": "assets/favicon.ico"
|
||||
"icon": "assets/favicon.ico",
|
||||
"certificateSha1": "f3363a89b084f8f6b616babea3c91f9d79e15000"
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
@@ -152,12 +154,16 @@
|
||||
"@types/dateformat": "^5.0.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "17.0.23",
|
||||
"@types/react": "^17.0.48",
|
||||
"@types/react-dom": "^17.0.17",
|
||||
"@types/node-fetch": "^2.6.3",
|
||||
"@types/react": "^18.0.33",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-outside-click-handler": "^1.3.1",
|
||||
"@types/react-test-renderer": "^17.0.2",
|
||||
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
||||
"@types/react-window": "^1.8.5",
|
||||
"@types/recursive-readdir": "^2.2.1",
|
||||
"@types/terser-webpack-plugin": "^5.0.4",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/use-double-click": "^1.0.1",
|
||||
"@types/webpack-bundle-analyzer": "^4.4.2",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.34.0",
|
||||
@@ -169,10 +175,10 @@
|
||||
"core-js": "^3.24.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.7.1",
|
||||
"css-minimizer-webpack-plugin": "^3.4.1",
|
||||
"css-minimizer-webpack-plugin": "^4.1.0",
|
||||
"detect-port": "^1.3.0",
|
||||
"electron": "^20.0.3",
|
||||
"electron-builder": "^23.3.3",
|
||||
"electron": "^24.3.1",
|
||||
"electron-builder": "^23.6.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-notarize": "^1.2.1",
|
||||
"electron-rebuild": "^3.2.9",
|
||||
@@ -199,6 +205,7 @@
|
||||
"postcss": "^8.4.16",
|
||||
"postcss-loader": "^6.2.1",
|
||||
"prettier": "^2.7.1",
|
||||
"ps-scrollbar-tailwind": "0.0.1",
|
||||
"react-refresh": "^0.12.0",
|
||||
"react-refresh-typescript": "^2.0.7",
|
||||
"react-test-renderer": "^18.2.0",
|
||||
@@ -206,8 +213,8 @@
|
||||
"sass": "^1.54.5",
|
||||
"sass-loader": "^12.6.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"tailwind-scrollbar": "^1.3.1",
|
||||
"tailwindcss": "^3.1.8",
|
||||
"tailwind-scrollbar": "^2.0.1",
|
||||
"tailwindcss": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.5",
|
||||
"ts-jest": "^27.1.5",
|
||||
"ts-loader": "^9.3.0",
|
||||
@@ -222,26 +229,43 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@node-steam/vdf": "^2.2.0",
|
||||
"@tippyjs/react": "^4.2.6",
|
||||
"@types/color": "^3.0.3",
|
||||
"archiver": "^5.3.1",
|
||||
"color": "^4.2.3",
|
||||
"dateformat": "^5.0.3",
|
||||
"dot-prop": "^7.2.0",
|
||||
"dot-prop": "^8.0.0",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^5.2.4",
|
||||
"framer-motion": "^7.2.1",
|
||||
"electron-updater": "^6.0.3",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"framer-motion": "^10.11.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
"history": "^5.3.0",
|
||||
"is-online": "^9.0.1",
|
||||
"md5-file": "^5.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"node-stream-zip": "^1.15.0",
|
||||
"react": "^18.2.0",
|
||||
"react-colorful": "^5.6.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-fitty": "^1.0.1",
|
||||
"react-outside-click-handler": "^1.3.0",
|
||||
"react-range": "^1.8.14",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"regedit": "^5.1.1",
|
||||
"rxjs": "^7.5.6",
|
||||
"react-virtualized-auto-sizer": "^1.0.12",
|
||||
"react-window": "^1.8.8",
|
||||
"recursive-readdir": "^2.2.3",
|
||||
"regedit": "^5.1.2",
|
||||
"rfdc": "^1.3.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
"semver": "^7.5.1",
|
||||
"striptags": "^4.0.0-alpha.4",
|
||||
"tailwind-scrollbar-hide": "^1.1.7",
|
||||
"uuid": "^8.3.2"
|
||||
"tailwindcss-scoped-groups": "^2.0.0",
|
||||
"tippy.js": "^6.3.7",
|
||||
"use-double-click": "^1.0.5",
|
||||
"use-fit-text": "^2.4.0"
|
||||
},
|
||||
"devEngines": {
|
||||
"node": ">=14.x",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
const tailwindcss = require("tailwindcss");
|
||||
const autoprefixer = require("autoprefixer");
|
||||
|
||||
module.exports = {
|
||||
plugins: [tailwindcss, autoprefixer],
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
<!--
|
||||
|
||||
Please use the content below as a template for your pull request.
|
||||
Feel free to remove sections which do not make sense.
|
||||
|
||||
-->
|
||||
|
||||
## Scope
|
||||
|
||||
<!-- Brief description of WHAT you’re doing and WHY. -->
|
||||
|
||||
[closes TICKET-###](https://link-to-your-ticket)
|
||||
|
||||
## Implementation
|
||||
|
||||
<!--
|
||||
|
||||
Some description of HOW you achieved it. Perhaps give a high level description of the program flow. Did you need to refactor something? What tradeoffs did you take? Are there things in here which you’d particularly like people to pay close attention to?
|
||||
|
||||
-->
|
||||
|
||||
## Screenshots
|
||||
|
||||
| before | after |
|
||||
| ------ | ----- |
|
||||
| | |
|
||||
|
||||
## How to Test
|
||||
|
||||
<!--
|
||||
|
||||
A straightforward scenario of how to test your changes could help colleagues that are not familiar with the part of the code that you are changing but want to see it in action. This section can include a description or step-by-step instructions of how to get to the state of v2 that your change affects.
|
||||
|
||||
A "How To Test" section can look something like this:
|
||||
|
||||
- Sign in with a user with tracks
|
||||
- Activate `show_awesome_cat_gifs` feature (add `?feature.show_awesome_cat_gifs=1` to your URL)
|
||||
- You should see a GIF with cats dancing
|
||||
|
||||
-->
|
||||
|
||||
## Emoji Guide
|
||||
|
||||
**For reviewers: Emojis can be added to comments to call out blocking versus non-blocking feedback.**
|
||||
|
||||
E.g: Praise, minor suggestions, or clarifying questions that don’t block merging the PR.
|
||||
|
||||
> 🟢 Nice refactor!
|
||||
|
||||
> 🟡 Why was the default value removed?
|
||||
|
||||
E.g: Blocking feedback must be addressed before merging.
|
||||
|
||||
> 🔴 This change will break something important
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| Blocking | 🔴 ❌ 🚨 | RED |
|
||||
| Non-blocking | 🟡 💡 🤔 💭 | Yellow, thinking, etc |
|
||||
| Praise | 🟢 💚 😍 👍 🙌 | Green, hearts, positive emojis, etc |
|
||||
@@ -1,922 +1,13 @@
|
||||
{
|
||||
"name": "BSManager",
|
||||
"version": "0.1.0",
|
||||
"name": "bs-manager",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz",
|
||||
"integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==",
|
||||
"requires": {
|
||||
"detect-libc": "^2.0.0",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"make-dir": "^3.1.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"nopt": "^5.0.0",
|
||||
"npmlog": "^5.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"tar": "^6.1.11"
|
||||
}
|
||||
},
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"requires": {
|
||||
"debug": "4"
|
||||
}
|
||||
},
|
||||
"ansi-escapes": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
|
||||
"integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
|
||||
"requires": {
|
||||
"type-fest": "^0.21.3"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"aproba": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
|
||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
||||
},
|
||||
"are-we-there-yet": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
|
||||
"integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
|
||||
"requires": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"array-back": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"builtins": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz",
|
||||
"integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ=="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"chardet": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
|
||||
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
|
||||
},
|
||||
"chownr": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="
|
||||
},
|
||||
"cli-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
|
||||
"integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
|
||||
"requires": {
|
||||
"restore-cursor": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"cli-width": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz",
|
||||
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw=="
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"color-support": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
|
||||
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="
|
||||
},
|
||||
"command-line-args": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz",
|
||||
"integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==",
|
||||
"requires": {
|
||||
"array-back": "^3.1.0",
|
||||
"find-replace": "^3.0.0",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"typical": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"command-line-commands": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/command-line-commands/-/command-line-commands-3.0.2.tgz",
|
||||
"integrity": "sha512-ac6PdCtdR6q7S3HN+JiVLIWGHY30PRYIEl2qPo+FuEuzwAUk0UYyimrngrg7FvF/mCr4Jgoqv5ZnHZgads50rw==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"command-line-usage": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz",
|
||||
"integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.2",
|
||||
"chalk": "^2.4.2",
|
||||
"table-layout": "^1.0.2",
|
||||
"typical": "^5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"ctrlc-windows": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.0.0.tgz",
|
||||
"integrity": "sha512-bpZLqGGwJ/2uLIXmhBYC4TObQlpfEeCCzmJ1At6TWFIWcY4FydkJLTolABFPUxmDYHeC9y95wdYBLa4U4PSktA==",
|
||||
"requires": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.5",
|
||||
"neon-cli": "^0.8.1"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
}
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||
"integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w=="
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="
|
||||
},
|
||||
"external-editor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
|
||||
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
|
||||
"requires": {
|
||||
"chardet": "^0.7.0",
|
||||
"iconv-lite": "^0.4.24",
|
||||
"tmp": "^0.0.33"
|
||||
}
|
||||
},
|
||||
"figures": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
|
||||
"integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
|
||||
"requires": {
|
||||
"escape-string-regexp": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"find-replace": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz",
|
||||
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
|
||||
"requires": {
|
||||
"array-back": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
|
||||
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||
},
|
||||
"gauge": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
|
||||
"integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
|
||||
"requires": {
|
||||
"aproba": "^1.0.3 || ^2.0.0",
|
||||
"color-support": "^1.1.2",
|
||||
"console-control-strings": "^1.0.0",
|
||||
"has-unicode": "^2.0.1",
|
||||
"object-assign": "^4.1.1",
|
||||
"signal-exit": "^3.0.0",
|
||||
"string-width": "^4.2.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wide-align": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"git-config": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/git-config/-/git-config-0.0.7.tgz",
|
||||
"integrity": "sha512-LidZlYZXWzVjS+M3TEwhtYBaYwLeOZrXci1tBgqp/vDdZTBMl02atvwb6G35L64ibscYoPnxfbwwUS+VZAISLA==",
|
||||
"requires": {
|
||||
"iniparser": "~1.0.5"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.7.7",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
|
||||
"integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
|
||||
"requires": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.0",
|
||||
"source-map": "^0.6.1",
|
||||
"uglify-js": "^3.1.4",
|
||||
"wordwrap": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"requires": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"requires": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"iniparser": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/iniparser/-/iniparser-1.0.5.tgz",
|
||||
"integrity": "sha512-i40MWqgTU6h/70NtMsDVVDLjDYWwcIR1yIEVDPfxZIJno9z9L4s83p/V7vAu2i48Vj0gpByrkGFub7ko9XvPrw=="
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "7.3.3",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
|
||||
"integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
|
||||
"requires": {
|
||||
"ansi-escapes": "^4.2.1",
|
||||
"chalk": "^4.1.0",
|
||||
"cli-cursor": "^3.1.0",
|
||||
"cli-width": "^3.0.0",
|
||||
"external-editor": "^3.0.3",
|
||||
"figures": "^3.0.0",
|
||||
"lodash": "^4.17.19",
|
||||
"mute-stream": "0.0.8",
|
||||
"run-async": "^2.4.0",
|
||||
"rxjs": "^6.6.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"through": "^2.3.6"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"lodash.camelcase": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
|
||||
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
|
||||
"requires": {
|
||||
"semver": "^6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"make-promises-safe": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-promises-safe/-/make-promises-safe-5.1.0.tgz",
|
||||
"integrity": "sha512-AfdZ49rtyhQR/6cqVKGoH7y4ql7XkS5HJI1lZm0/5N6CQosy1eYbBJ/qbhkKHzo17UH7M918Bysf6XB9f3kS1g=="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||
},
|
||||
"minipass": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz",
|
||||
"integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
||||
"requires": {
|
||||
"minipass": "^3.0.0",
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"mute-stream": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
|
||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
|
||||
},
|
||||
"neon-cli": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/neon-cli/-/neon-cli-0.8.3.tgz",
|
||||
"integrity": "sha512-I44MB8PD0AEyFr/b5icR4sX1tsjdkb2T2uWEStG4Uf5C/jzalZPn7eazbQrW6KDyXNd8bc+LVuOr1v6CGTa1KQ==",
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"command-line-args": "^5.1.1",
|
||||
"command-line-commands": "^3.0.1",
|
||||
"command-line-usage": "^6.1.0",
|
||||
"git-config": "0.0.7",
|
||||
"handlebars": "^4.7.6",
|
||||
"inquirer": "^7.3.3",
|
||||
"make-promises-safe": "^5.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.2",
|
||||
"toml": "^3.0.0",
|
||||
"ts-typed-json": "^0.3.2",
|
||||
"validate-npm-package-license": "^3.0.4",
|
||||
"validate-npm-package-name": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
||||
"integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
|
||||
"requires": {
|
||||
"abbrev": "1"
|
||||
}
|
||||
},
|
||||
"npmlog": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
|
||||
"integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
|
||||
"requires": {
|
||||
"are-we-there-yet": "^2.0.0",
|
||||
"console-control-strings": "^1.1.0",
|
||||
"gauge": "^3.0.0",
|
||||
"set-blocking": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"onetime": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
|
||||
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
|
||||
"requires": {
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g=="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"reduce-flatten": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz",
|
||||
"integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w=="
|
||||
},
|
||||
"restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
"integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
|
||||
"requires": {
|
||||
"onetime": "^5.1.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"run-async": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
|
||||
"integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
|
||||
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
|
||||
"integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
|
||||
"requires": {
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-exceptions": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
|
||||
"integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A=="
|
||||
},
|
||||
"spdx-expression-parse": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
|
||||
"integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
|
||||
"requires": {
|
||||
"spdx-exceptions": "^2.1.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-license-ids": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
|
||||
"integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g=="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"requires": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"requires": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"table-layout": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz",
|
||||
"integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.1",
|
||||
"deep-extend": "~0.6.0",
|
||||
"typical": "^5.2.0",
|
||||
"wordwrapjs": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
},
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "6.1.11",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
|
||||
"integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
|
||||
"requires": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^3.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"toml": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
|
||||
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"ts-typed-json": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-typed-json/-/ts-typed-json-0.3.2.tgz",
|
||||
"integrity": "sha512-Tdu3BWzaer7R5RvBIJcg9r8HrTZgpJmsX+1meXMJzYypbkj8NK2oJN0yvm4Dp/Iv6tzFa/L5jKRmEVTga6K3nA=="
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"type-fest": {
|
||||
"version": "0.21.3",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
|
||||
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="
|
||||
},
|
||||
"typical": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz",
|
||||
"integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw=="
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.16.2",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.2.tgz",
|
||||
"integrity": "sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==",
|
||||
"optional": true
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||
"integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
|
||||
"requires": {
|
||||
"spdx-correct": "^3.0.0",
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"validate-npm-package-name": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz",
|
||||
"integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==",
|
||||
"requires": {
|
||||
"builtins": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
|
||||
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
|
||||
"requires": {
|
||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
|
||||
},
|
||||
"wordwrapjs": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz",
|
||||
"integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==",
|
||||
"requires": {
|
||||
"reduce-flatten": "^2.0.0",
|
||||
"typical": "^5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.1.0.tgz",
|
||||
"integrity": "sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "BSManager",
|
||||
"version": "0.0.8",
|
||||
"name": "bs-manager",
|
||||
"version": "1.1.1",
|
||||
"description": "A foundation for scalable desktop apps",
|
||||
"main": "./dist/main/main.js",
|
||||
"author": {
|
||||
"name": "Zagrios",
|
||||
"email": "electronreactboilerplate@gmail.com",
|
||||
"email": "admin@bsmanager.io",
|
||||
"url": "https://github.com/Zagrios/bs-manager"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -14,7 +14,7 @@
|
||||
"postinstall": "npm run electron-rebuild && npm run link-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"ctrlc-windows": "^2.0.0"
|
||||
"ctrlc-windows": "^2.1.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 965 KiB |
@@ -1,6 +1,6 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { render } from '@testing-library/react';
|
||||
import App from '../renderer/App';
|
||||
import App from '../renderer/windows/App';
|
||||
|
||||
describe('App', () => {
|
||||
it('should render', () => {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
export const BS_EXECUTABLE = "Beat Saber.exe";
|
||||
export const OCULUS_BS_DIR = "hyperbolic-magnetism-beat-saber"
|
||||
export const BS_APP_ID = "620980";
|
||||
export const BS_DEPOT = "620981";
|
||||
export const APP_NAME = "BSManager";
|
||||
|
||||
export const STEAMVR_APP_ID = "250820";
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
import { CopyOptions, copy, ensureDir, move, symlink } from "fs-extra";
|
||||
import { access, mkdir, rm, readdir, unlink, lstat, readlink } from "fs/promises";
|
||||
import path from "path";
|
||||
import { Observable } from "rxjs";
|
||||
import log from "electron-log"
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
|
||||
export async function pathExist(path: string): Promise<boolean> {
|
||||
try{
|
||||
await access(path);
|
||||
return true;
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export async function ensureFolderExist(path: string): Promise<void> {
|
||||
if(await pathExist(path)){ return Promise.resolve(); }
|
||||
return mkdir(path, {recursive: true}).catch(log.error).then(() => {});
|
||||
}
|
||||
|
||||
export async function deleteFolder(folderPath: string): Promise<void> {
|
||||
if(!(await pathExist(folderPath))){ return; }
|
||||
return rm(folderPath, {recursive: true, force: true});
|
||||
}
|
||||
|
||||
export async function unlinkPath(path: string): Promise<void>{
|
||||
if(!(await pathExist(path))){ return; }
|
||||
return unlink(path);
|
||||
}
|
||||
|
||||
export async function getFoldersInFolder(folderPath: string, opts?: {ignoreSymlinkTargetError?: boolean}): Promise<string[]> {
|
||||
if(!(await pathExist(folderPath))){ return []; }
|
||||
|
||||
const files = await readdir(folderPath, {withFileTypes: true});
|
||||
|
||||
const promises = files.map(async file => {
|
||||
if(file.isDirectory()){ return path.join(folderPath, file.name); }
|
||||
if(!file.isSymbolicLink()){ return undefined; }
|
||||
try{
|
||||
const targetPath = await readlink(path.join(folderPath, file.name));
|
||||
return (await lstat(targetPath)).isDirectory() ? path.join(folderPath, file.name) : undefined;
|
||||
}catch(e: any){
|
||||
if(e.code === "ENOENT" && opts?.ignoreSymlinkTargetError === true && !path.extname(file.name)){
|
||||
return path.join(folderPath, file.name);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
||||
return (await Promise.all(promises)).filter(folder => folder);
|
||||
}
|
||||
|
||||
export function moveFolderContent(src: string, dest: string): Observable<Progression>{
|
||||
const progress: Progression = { current: 0, total: 0 };
|
||||
return new Observable<Progression>(subscriber => {
|
||||
subscriber.next(progress);
|
||||
(async () => {
|
||||
|
||||
const srcExist = await pathExist(src);
|
||||
|
||||
if(!srcExist){ return subscriber.complete(); }
|
||||
|
||||
ensureFolderExist(dest);
|
||||
|
||||
const files = await readdir(src, {encoding: "utf-8"});
|
||||
progress.total = files.length;
|
||||
|
||||
const promises = files.map(async file => {
|
||||
const srcFullPath = path.join(src, file);
|
||||
const destFullPath = path.join(dest, file);
|
||||
if(await pathExist(destFullPath)){
|
||||
progress.current++;
|
||||
return subscriber.next(progress);
|
||||
}
|
||||
await move(srcFullPath, destFullPath);
|
||||
progress.current++;
|
||||
subscriber.next(progress);
|
||||
});
|
||||
|
||||
Promise.allSettled(promises).then(() => subscriber.complete());
|
||||
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
export function isSubdirectory(parent: string, child: string): boolean {
|
||||
const parentNormalized = path.resolve(parent);
|
||||
const childNormalized = path.resolve(child);
|
||||
|
||||
if (parentNormalized === childNormalized) { return false; }
|
||||
|
||||
const relativePath = path.relative(parentNormalized, childNormalized);
|
||||
|
||||
if (path.parse(parentNormalized).root !== path.parse(childNormalized).root) { return false; }
|
||||
|
||||
return relativePath && !relativePath.startsWith('..') && !path.isAbsolute(relativePath);
|
||||
}
|
||||
|
||||
export async function copyDirectoryWithJunctions(src: string, dest: string, options?: CopyOptions): Promise<void> {
|
||||
|
||||
if(isSubdirectory(src, dest)){
|
||||
throw {message: `Cannot copy directory '${src}' into itself '${dest}'.`, code: "COPY_TO_SUBPATH"} as BsmException;
|
||||
}
|
||||
|
||||
await ensureDir(dest);
|
||||
const items = await readdir(src, { withFileTypes: true });
|
||||
|
||||
for (const item of items) {
|
||||
const sourcePath = path.join(src, item.name);
|
||||
const destinationPath = path.join(dest, item.name);
|
||||
|
||||
if (item.isDirectory()) {
|
||||
await copyDirectoryWithJunctions(sourcePath, destinationPath, options);
|
||||
} else if (item.isFile()) {
|
||||
await copy(sourcePath, destinationPath, options);
|
||||
} else if (item.isSymbolicLink()) {
|
||||
if(options?.overwrite){
|
||||
await unlinkPath(destinationPath);
|
||||
}
|
||||
const symlinkTarget = await readlink(sourcePath);
|
||||
const relativePath = path.relative(src, symlinkTarget);
|
||||
const newTarget = path.join(dest, relativePath);
|
||||
await symlink(newTarget, destinationPath, 'junction');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface Progression<T = unknown>{
|
||||
total: number;
|
||||
current: number;
|
||||
data?: T;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import { BeatSaverService } from "../services/thrid-party/beat-saver/beat-saver.service";
|
||||
import log from "electron-log";
|
||||
|
||||
ipcMain.on("bsv-search-map", async (event, request: IpcRequest<SearchParams>) => {
|
||||
const utlis = UtilsService.getInstance();
|
||||
const bsvService = BeatSaverService.getInstance();
|
||||
|
||||
bsvService.searchMaps(request.args).then(maps => {
|
||||
utlis.ipcSend(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(e => {
|
||||
utlis.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("bsv-get-map-details-from-hashs", async (event, request: IpcRequest<string[]>) => {
|
||||
const utlis = UtilsService.getInstance();
|
||||
const bsvService = BeatSaverService.getInstance();
|
||||
|
||||
bsvService.getMapDetailsFromHashs(request.args).then(maps => {
|
||||
utlis.ipcSend(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(e => {
|
||||
log.error(e);
|
||||
utlis.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("bsv-get-map-details-by-id", async (event, request: IpcRequest<string>) => {
|
||||
const utlis = UtilsService.getInstance();
|
||||
const bsvService = BeatSaverService.getInstance();
|
||||
|
||||
bsvService.getMapDetailsById(request.args).then(maps => {
|
||||
utlis.ipcSend(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(e => {
|
||||
utlis.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("bsv-get-playlist-details-by-id", async (event, request: IpcRequest<string>) => {
|
||||
const utlis = UtilsService.getInstance();
|
||||
const bsvService = BeatSaverService.getInstance();
|
||||
|
||||
bsvService.getPlaylistPage(request.args).then(maps => {
|
||||
utlis.ipcSend(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(e => {
|
||||
utlis.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSInstallerService, DownloadEventType } from '../services/bs-installer.service';
|
||||
import { BSInstallerService, DownloadEventType, DownloadInfo } from '../services/bs-installer.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { InstallationLocationService } from '../services/installation-location.service';
|
||||
import { UtilsService } from '../services/utils.service';
|
||||
import { BsmException } from 'shared/models/bsm-exception.model';
|
||||
import { LocalMapsManagerService } from '../services/additional-content/local-maps-manager.service';
|
||||
|
||||
|
||||
export interface InitDownloadInfoInterface {
|
||||
@@ -17,15 +17,17 @@ export interface InitDownloadInfoInterface {
|
||||
stay: boolean
|
||||
}
|
||||
|
||||
export interface DownloadInfo {
|
||||
bsVersion: BSVersion,
|
||||
username: string,
|
||||
password?: string,
|
||||
stay?: boolean
|
||||
}
|
||||
ipcMain.on('is-dotnet-6-installed', async (event, request: IpcRequest<void>) => {
|
||||
const installer = BSInstallerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
installer.isDotNet6Installed().then(installed => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: installed});
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on('bs-download.start', async (event, request: IpcRequest<DownloadInfo>) => {
|
||||
BSInstallerService.getInstance().downloadBsVersion(request.args).then(res => {
|
||||
BSInstallerService.getInstance().downloadBsVersion(request.args).then(async res => {
|
||||
await LocalMapsManagerService.getInstance().linkVersionMaps(request.args.bsVersion, true).catch(e => {});
|
||||
UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}).catch(e => {
|
||||
UtilsService.getInstance().ipcSend(request.responceChannel, {success: false, data: e});
|
||||
@@ -55,4 +57,14 @@ ipcMain.on('bs-download.set-installation-folder', (event, request: IpcRequest<st
|
||||
});
|
||||
})
|
||||
|
||||
ipcMain.on('bs-download.import-version', (event, request: IpcRequest<string>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const installer = BSInstallerService.getInstance();
|
||||
installer.importVersion(request.args).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
}).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ ipcMain.on('bs-launch.launch', (event, request: IpcRequest<LauchOption>) => {
|
||||
const utilsService = UtilsService.getInstance();
|
||||
|
||||
launcherService.launch(request.args).then(res => {
|
||||
console.log("BEAT SABER LANCER");
|
||||
utilsService.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}).catch((err: BsmException) => {
|
||||
utilsService.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
|
||||
import { LocalMapsManagerService } from "../services/additional-content/local-maps-manager.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { from } from "rxjs";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipc.on('load-version-maps', async (request: IpcRequest<BSVersion>, reply) => {
|
||||
const localMaps = LocalMapsManagerService.getInstance();
|
||||
reply(localMaps.getMaps(request.args));
|
||||
});
|
||||
|
||||
ipc.on("verion-have-maps-linked", async (request: IpcRequest<BSVersion>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
utils.ipcSend<boolean>(request.responceChannel, {success: true, data: await maps.versionIsLinked(request.args)});
|
||||
|
||||
});
|
||||
|
||||
ipc.on("link-version-maps", async (request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.linkVersionMaps(request.args.version, request.args.keepMaps).then(() => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true, error: err});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
ipc.on("unlink-version-maps", async (request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.unlinkVersionMaps(request.args.version, request.args.keepMaps).then(() => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true, error: err});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
ipc.on("delete-maps", async (request: IpcRequest<BsmLocalMap[]>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
reply(maps.deleteMaps(request.args));
|
||||
});
|
||||
|
||||
ipc.on("export-maps", async (request: IpcRequest<{version: BSVersion, maps: BsmLocalMap[], outPath: string}>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
reply(await maps.exportMaps(request.args.version, request.args.maps, request.args.outPath));
|
||||
});
|
||||
|
||||
ipc.on("download-map", async (request: IpcRequest<{map: BsvMapDetail, version: BSVersion}>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
reply(from(maps.downloadMap(request.args.map, request.args.version)))
|
||||
});
|
||||
|
||||
ipc.on("one-click-install-map", async (request: IpcRequest<BsvMapDetail>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.oneClickDownloadMap(request.args).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on("register-maps-deep-link", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.enableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on("unregister-maps-deep-link", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.disableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on("is-map-deep-links-enabled", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.isDeepLinksEnabled();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on("get-version-maps-path", async (req: IpcRequest<BSVersion>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
reply(from(maps.getMapsFolderPath(req.args)));
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { MSModel, MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { LocalModelsManagerService } from "../services/additional-content/local-models-manager.service";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { from } from "rxjs";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { ModelDownload } from "renderer/services/models-management/models-downloader.service";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on("one-click-install-model", async (event, request: IpcRequest<MSModel>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
|
||||
models.oneClickDownloadModel(request.args).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
}).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("register-models-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalModelsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.enableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("unregister-models-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalModelsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.disableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("is-models-deep-links-enabled", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalModelsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.isDeepLinksEnabled();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on<ModelDownload>("download-model", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.downloadModel(req.args.model, req.args.version));
|
||||
});
|
||||
|
||||
ipc.on<{version: BSVersion, type: MSModelType}>("get-version-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
const res = await models.getModels(req.args.type, req.args.version);
|
||||
reply(res);
|
||||
});
|
||||
|
||||
ipc.on<{version: BSVersion, models: BsmLocalModel[], outPath: string}>("export-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.exportModels(req.args.outPath, req.args.version, req.args.models));
|
||||
});
|
||||
|
||||
ipc.on<BsmLocalModel[]>("delete-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.deleteModels(req.args));
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { BsModsManagerService } from "../services/mods/bs-mods-manager.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { Mod } from "shared/models/mods/mod.interface";
|
||||
import { InstallModsResult } from "shared/models/mods";
|
||||
import log from "electron-log";
|
||||
|
||||
ipcMain.on("get-available-mods", (event, request: IpcRequest<BSVersion>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const modsManager = BsModsManagerService.getInstance();
|
||||
|
||||
modsManager.getAvailableMods(request.args).then(mods => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: mods});
|
||||
}).catch(err =>{
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
log.error("ipc", "get-available-mods", err, request);
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on("get-installed-mods", (event, request: IpcRequest<BSVersion>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const modsManager = BsModsManagerService.getInstance();
|
||||
|
||||
modsManager.getInstalledMods(request.args).then(mods => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: mods});
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
log.error("ipc", "get-installed-mods", err, request);
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on("install-mods", (event, request: IpcRequest<{mods: Mod[], version: BSVersion}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const modsManager = BsModsManagerService.getInstance();
|
||||
|
||||
modsManager.installMods(request.args.mods, request.args.version).then(nbInstalled => {
|
||||
utils.ipcSend<InstallModsResult>(request.responceChannel, {success: true, data: nbInstalled})
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
log.error("ipc", "install-mods", err, request);
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("uninstall-mods", (event, request: IpcRequest<{mods: Mod[], version: BSVersion}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const modsManager = BsModsManagerService.getInstance();
|
||||
|
||||
modsManager.uninstallMods(request.args.mods, request.args.version).then(nbInstalled => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: nbInstalled})
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
log.error("ipc", "uninstall-mods", err, request);
|
||||
})
|
||||
});
|
||||
|
||||
ipcMain.on("uninstall-all-mods", (event, request: IpcRequest<BSVersion>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const modsManager = BsModsManagerService.getInstance();
|
||||
|
||||
modsManager.uninstallAllMods(request.args).then(nbInstalled => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: nbInstalled})
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
log.error("ipc", "uninstall-all-mods", err, request);
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { LocalPlaylistsManagerService } from "../services/additional-content/local-playlists-manager.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
|
||||
ipcMain.on("one-click-install-playlist", async (event, request: IpcRequest<string>) => {
|
||||
|
||||
const utils = UtilsService.getInstance();
|
||||
const playlists = LocalPlaylistsManagerService.getInstance();
|
||||
|
||||
playlists.oneClickInstallPlaylist(request.args).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
}).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on("register-playlists-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalPlaylistsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.enableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("unregister-playlists-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalPlaylistsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.disableDeepLinks();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("is-playlists-deep-links-enabled", async (event, request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalPlaylistsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
|
||||
try{
|
||||
const res = maps.isDeepLinksEnabled();
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}
|
||||
catch(e){
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
@@ -2,14 +2,22 @@ import { ipcMain } from 'electron';
|
||||
import { UtilsService } from '../services/utils.service';
|
||||
import { BSVersionLibService } from '../services/bs-version-lib.service'
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import path from 'path';
|
||||
import { exec } from 'child_process';
|
||||
import { SteamService } from '../services/steam.service';
|
||||
import { BS_APP_ID } from '../constants';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { BSLocalVersionService } from '../services/bs-local-version.service';
|
||||
import { InstallationLocationService } from '../services/installation-location.service';
|
||||
import { BsmException } from 'shared/models/bsm-exception.model';
|
||||
import { IpcService } from '../services/ipc.service';
|
||||
import { from } from 'rxjs';
|
||||
import path from 'path';
|
||||
import { pathExist } from '../helpers/fs.helpers';
|
||||
import { FolderLinkerService, LinkOptions } from '../services/folder-linker.service';
|
||||
import { LocalMapsManagerService } from '../services/additional-content/local-maps-manager.service';
|
||||
import { readJSON, writeJSON } from 'fs-extra';
|
||||
import log from "electron-log"
|
||||
import { VersionLinkerAction } from 'renderer/services/version-folder-linker.service';
|
||||
import { VersionFolderLinkerService } from '../services/version-folder-linker.service';
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on('bs-version.get-version-dict', (event, req: IpcRequest<void>) => {
|
||||
BSVersionLibService.getInstance().getAvailableVersions().then(versions => {
|
||||
@@ -30,7 +38,7 @@ ipcMain.on('bs-version.installed-versions', async (event, req: IpcRequest<void>)
|
||||
ipcMain.on("bs-version.open-folder", async (event, req: IpcRequest<BSVersion>) => {
|
||||
const localVersionService = BSLocalVersionService.getInstance();
|
||||
const versionFolder = await localVersionService.getVersionPath(req.args);
|
||||
UtilsService.getInstance().pathExist(versionFolder) && exec(`start "" "${versionFolder}"`);
|
||||
(await pathExist(versionFolder)) && exec(`start "" "${versionFolder}"`);
|
||||
});
|
||||
|
||||
ipcMain.on("bs-version.edit", async (event, req: IpcRequest<{version: BSVersion, name: string, color: string}>) => {
|
||||
@@ -48,3 +56,104 @@ ipcMain.on("bs-version.clone", async (event, req: IpcRequest<{version: BSVersion
|
||||
UtilsService.getInstance().ipcSend(req.responceChannel, {success: false, error});
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on("get-version-full-path", async (req: IpcRequest<BSVersion>, reply) => {
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
reply(from( localVersions.getVersionPath(req.args) ));
|
||||
});
|
||||
|
||||
ipc.on("relative-version-path-to-full", async (req: IpcRequest<{version: BSVersion, relative: string}>, reply) => {
|
||||
path.isAbsolute(req.args.relative) && reply(from(Promise.resolve(req.args.relative)));
|
||||
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
const promise = localVersions.getVersionPath(req.args.version).catch(() => null).then(versionPath => {
|
||||
return path.join(versionPath, req.args.relative);
|
||||
});
|
||||
reply(from(promise));
|
||||
});
|
||||
|
||||
ipc.on("full-version-path-to-relative", async (req: IpcRequest<{version: BSVersion, fullPath: string}>, reply) => {
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
const promise = localVersions.getVersionPath(req.args.version).catch(() => null).then(versionPath => {
|
||||
return path.relative(versionPath, req.args.fullPath);
|
||||
});
|
||||
reply(from(promise));
|
||||
});
|
||||
|
||||
ipc.on("get-linked-folders", async (req: IpcRequest<{version: BSVersion, options?: { relative?: boolean }}>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.getLinkedFolders(req.args.version, req.args.options)));
|
||||
});
|
||||
|
||||
ipc.on("link-folder", async (req: IpcRequest<{ folder: string, options?: LinkOptions}>, reply) => {
|
||||
|
||||
req.args.options ??= {};
|
||||
|
||||
const linker = FolderLinkerService.getInstance();
|
||||
|
||||
const relativeMapsFolder = path.join(LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)
|
||||
|
||||
if(req.args.folder.includes(relativeMapsFolder)){
|
||||
return reply(from(linker.linkFolder(req.args.folder, {keepContents: req.args.options?.keepContents, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER})));
|
||||
}
|
||||
|
||||
if(req.args.folder.includes("UserData")){
|
||||
req.args.options = { ...req.args.options, backup: true };
|
||||
}
|
||||
|
||||
const res = from(linker.linkFolder(req.args.folder, req.args.options));
|
||||
|
||||
const jsonIPAPath = path.join(req.args.folder, "Beat Saber IPA.json");
|
||||
|
||||
if(!(await pathExist(jsonIPAPath))){ return reply(res); }
|
||||
|
||||
await res.toPromise();
|
||||
|
||||
try{
|
||||
const ipaData = (await readJSON(jsonIPAPath)) ?? {} as any;
|
||||
ipaData["YeetMods"] = false;
|
||||
await writeJSON(jsonIPAPath, ipaData, {spaces: 4});
|
||||
}catch(e){
|
||||
log.error("Disable YeetMods", e);
|
||||
}
|
||||
|
||||
reply(res);
|
||||
|
||||
});
|
||||
|
||||
ipc.on("link-version-folder-action", async (req: IpcRequest<VersionLinkerAction>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.doAction(req.args)));
|
||||
});
|
||||
|
||||
ipc.on("is-version-folder-linked", async (req: IpcRequest<{ version: BSVersion, relativeFolder: string }>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.isFolderLinked(req.args.version, req.args.relativeFolder)));
|
||||
});
|
||||
|
||||
ipc.on("unlink-folder", async (req: IpcRequest<{ folder: string, options?: LinkOptions}>, reply) => {
|
||||
|
||||
req.args.options ??= {};
|
||||
|
||||
const linker = FolderLinkerService.getInstance();
|
||||
|
||||
const relativeMapsFolder = path.join(LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)
|
||||
|
||||
if(req.args.folder.includes(relativeMapsFolder)){
|
||||
return reply(from(linker.unlinkFolder(req.args.folder, {...req.args.options, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER})));
|
||||
}
|
||||
|
||||
if(req.args.folder.includes("UserData")){
|
||||
req.args.options = { ...req.args.options, backup: true };
|
||||
}
|
||||
|
||||
reply(from(linker.unlinkFolder(req.args.folder, req.args.options)));
|
||||
|
||||
});
|
||||
|
||||
ipc.on("relink-all-versions-folders", async (req: IpcRequest<void>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.relinkAllVersionsFolders()));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,12 @@ import './os-controls-ipcs';
|
||||
import './bs-launcher-ipcs';
|
||||
import './bs-version-ipcs';
|
||||
import './bs-uninstall-ipcs';
|
||||
import './map-ipcs';
|
||||
import './supporters-ipcs';
|
||||
import './launcher-ipcs';
|
||||
import './window-manager-ipcs';
|
||||
import './bs-mods-ipcs';
|
||||
import './bs-maps-ipcs';
|
||||
import './beat-saver-ipcs';
|
||||
import './bs-playlist-ipcs';
|
||||
import './model-saber.ipcs';
|
||||
import './bs-model-ipcs';
|
||||
@@ -1,13 +0,0 @@
|
||||
import { ipcMain} from 'electron';
|
||||
import { MapService } from '../services/map.service';
|
||||
import { UtilsService } from '../services/utils.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { ExportVersionMapsOption } from 'shared/models/maps/export-version-maps.model';
|
||||
|
||||
ipcMain.on("map.export-version", (event, request: IpcRequest<ExportVersionMapsOption>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const mapService = MapService.getInstance();
|
||||
mapService.exportVersionMaps(request.args.version, request.args.path).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
}).catch(() => utils.ipcSend(request.responceChannel, {success: false, error: {title: "", msg: ""}}));
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { ModelSaberService } from "../services/thrid-party/model-saber/model-saber.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { MSGetQuery } from "shared/models/models/model-saber.model";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on("ms-get-model-by-id", async (event, request: IpcRequest<string|number>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const ms = ModelSaberService.getInstance();
|
||||
|
||||
ms.getModelById(request.args).then(model => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: model});
|
||||
}).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipc.on<MSGetQuery>("search-models", async (req, reply) => {
|
||||
const ms = ModelSaberService.getInstance();
|
||||
reply(ms.searchModels(req.args));
|
||||
});
|
||||
@@ -1,40 +1,52 @@
|
||||
import { ipcMain, shell, dialog, app } from 'electron';
|
||||
import { UtilsService } from '../services/utils.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { SystemNotificationOptions } from 'shared/models/notification/system-notification.model';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
import { SteamService } from '../services/steam.service';
|
||||
import { IpcService } from '../services/ipc.service';
|
||||
import { from } from 'rxjs';
|
||||
import { fstat, lstat } from 'fs';
|
||||
import { pathExist } from '../helpers/fs.helpers';
|
||||
|
||||
|
||||
// TODO IMPROVE WINDOW CONTROL BY USING WINDOW SERVICE
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on('window.close', async () => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindow()?.close();
|
||||
utils.getMainWindows("index.html")?.close();
|
||||
});
|
||||
|
||||
ipcMain.on('window.maximize', async () => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindow()?.maximize();
|
||||
utils.getMainWindows("index.html")?.maximize();
|
||||
});
|
||||
|
||||
ipcMain.on('window.minimize', async () => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindow()?.minimize();
|
||||
utils.getMainWindows("index.html")?.minimize();
|
||||
});
|
||||
|
||||
ipcMain.on('window.reset', async () => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindow()?.restore();
|
||||
utils.getMainWindows("index.html")?.restore();
|
||||
});
|
||||
|
||||
ipcMain.on('new-window', async (event, request: IpcRequest<string>) => {
|
||||
shell.openExternal(request.args);
|
||||
});
|
||||
|
||||
ipcMain.on('choose-folder', async (event, request: IpcRequest<void>) => {
|
||||
dialog.showOpenDialog({properties: ['openDirectory']}).then(res => {
|
||||
UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: res});
|
||||
});
|
||||
ipc.on('choose-folder', async (req: IpcRequest<string>, reply) => {
|
||||
reply(
|
||||
from(dialog.showOpenDialog({properties: ['openDirectory'], defaultPath: req.args ?? ""}))
|
||||
)
|
||||
});
|
||||
|
||||
ipcMain.on("window.progression", async (event, request: IpcRequest<number>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindow().setProgressBar(request.args / 100);
|
||||
utils.getMainWindows("index.html")?.setProgressBar(request.args / 100);
|
||||
});
|
||||
|
||||
ipcMain.on('save-file', async (event, request: IpcRequest<{filename?: string, filters?: Electron.FileFilter[]}>) => {
|
||||
@@ -48,3 +60,21 @@ ipcMain.on('save-file', async (event, request: IpcRequest<{filename?: string, fi
|
||||
ipcMain.on("current-version", async (event, request: IpcRequest<void>) => {
|
||||
UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: app.getVersion()});
|
||||
});
|
||||
|
||||
ipcMain.on("open-logs", async (event, request: IpcRequest<void>) => {
|
||||
shell.openPath(app.getPath("logs"));
|
||||
});
|
||||
|
||||
ipcMain.on("notify-system", async (event, request: IpcRequest<SystemNotificationOptions>) => {
|
||||
NotificationService.getInstance().notify(request.args)
|
||||
});
|
||||
|
||||
ipcMain.on("open-steam", async (event, request: IpcRequest<void>) => {
|
||||
const steam = SteamService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
steam.openSteam().then(res => {
|
||||
utils.ipcSend(request.responceChannel, {success: true, data: res});
|
||||
}).catch((e) => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
});
|
||||
});
|
||||
@@ -2,6 +2,9 @@ import { ipcMain } from "electron";
|
||||
import { WindowManagerService } from "../services/window-manager.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
import { BSLauncherService } from "../services/bs-launcher.service";
|
||||
|
||||
const launcher = BSLauncherService.getInstance();
|
||||
|
||||
ipcMain.on("open-window-then-close-all", async (event, request: IpcRequest<AppWindow>) => {
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
@@ -9,4 +12,16 @@ ipcMain.on("open-window-then-close-all", async (event, request: IpcRequest<AppWi
|
||||
windowManager.openWindow(request.args).then(window => {
|
||||
windowManager.closeAllWindows(request.args);
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on("close-all-windows", async (event, request: IpcRequest<AppWindow>) => {
|
||||
await launcher.restoreSteamVR();
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
windowManager.closeAllWindows(request.args);
|
||||
});
|
||||
|
||||
ipcMain.on("close-windows", async (event, request: IpcRequest<AppWindow[]>) => {
|
||||
await launcher.restoreSteamVR();
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
windowManager.close(...request.args);
|
||||
});
|
||||
@@ -9,28 +9,30 @@
|
||||
* `./src/main.js` using webpack. This gives us some performance wins.
|
||||
*/
|
||||
import path from 'path';
|
||||
import { app } from 'electron';
|
||||
import { app, ipcMain, protocol } from 'electron';
|
||||
import log from 'electron-log';
|
||||
import './ipcs';
|
||||
import { UtilsService } from './services/utils.service';
|
||||
import { WindowManagerService } from './services/window-manager.service';
|
||||
|
||||
export const PRELOAD_PATH = app.isPackaged ? path.join(__dirname, 'preload.js') : path.join(__dirname, '../../.erb/dll/preload.js')
|
||||
import { DeepLinkService } from './services/deep-link.service';
|
||||
import { AppWindow } from 'shared/models/window-manager/app-window.model';
|
||||
import { LocalMapsManagerService } from './services/additional-content/local-maps-manager.service';
|
||||
import { LocalPlaylistsManagerService } from './services/additional-content/local-playlists-manager.service';
|
||||
import { LocalModelsManagerService } from './services/additional-content/local-models-manager.service';
|
||||
import { APP_NAME } from './constants';
|
||||
import { BSLauncherService } from './services/bs-launcher.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { MSModelType } from '../shared/models/models/model-saber.model';
|
||||
|
||||
const isDebug = process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true';
|
||||
|
||||
log.transports.file.level = 'info';
|
||||
log.transports.file.resolvePath = (() => {
|
||||
const now = new Date();
|
||||
return path.join(app.getPath("logs"), `${now.getFullYear()}-${now.getMonth()+1}-${now.getDate()}.log`);
|
||||
return path.join(app.getPath("logs"), `${now.getFullYear()}-${now.getMonth()+1}-${now.getDate()}-v${app.getVersion()}.log`);
|
||||
});
|
||||
|
||||
log.catchErrors();
|
||||
|
||||
const utilsService = UtilsService.getInstance();
|
||||
utilsService.setAssetsPath(app.isPackaged ? path.join(process.resourcesPath, 'assets') : path.join(__dirname, '../../assets'));
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
const sourceMapSupport = require('source-map-support');
|
||||
sourceMapSupport.install();
|
||||
@@ -48,19 +50,61 @@ const installExtensions = async () => {
|
||||
return installer.default(extensions.map((name) => installer[name]), forceDownload).catch(console.log);
|
||||
};
|
||||
|
||||
const createWindow = async () => {
|
||||
const createWindow = async (window: AppWindow = "launcher.html") => {
|
||||
if(isDebug){ await installExtensions(); }
|
||||
WindowManagerService.getInstance().openWindow("launcher.html");
|
||||
WindowManagerService.getInstance().openWindow(window);
|
||||
};
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
// Respect the OSX convention of having the application in memory even
|
||||
// after all windows have been closed
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
const initServicesMustBeInitialized = () => {
|
||||
LocalMapsManagerService.getInstance();
|
||||
LocalPlaylistsManagerService.getInstance();
|
||||
LocalModelsManagerService.getInstance();
|
||||
// Model
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
}).catch(console.log);
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
if(!gotTheLock){
|
||||
app.quit();
|
||||
}
|
||||
else{
|
||||
|
||||
app.on('second-instance', (e, argv) => {
|
||||
|
||||
const deepLink = argv.find(arg => DeepLinkService.getInstance().isDeepLink(arg));
|
||||
|
||||
if(!deepLink){ return; }
|
||||
|
||||
DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
|
||||
|
||||
});
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
||||
app.setAppUserModelId(APP_NAME);
|
||||
|
||||
initServicesMustBeInitialized();
|
||||
|
||||
const deepLink = process.argv.find(arg => DeepLinkService.getInstance().isDeepLink(arg));
|
||||
|
||||
if(!deepLink){
|
||||
createWindow();
|
||||
}
|
||||
else{
|
||||
DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
|
||||
}
|
||||
|
||||
protocol.registerFileProtocol('file', (request, callback) => {
|
||||
const pathname = decodeURI(request.url.replace('file:///', ''));
|
||||
callback(pathname);
|
||||
});
|
||||
|
||||
BSLauncherService.getInstance().restoreSteamVR();
|
||||
|
||||
// Log renderer errors
|
||||
ipcMain.on('log-error', (event, args: IpcRequest<any>) => {
|
||||
log.error(args?.args);
|
||||
});
|
||||
|
||||
}).catch(log.error);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import archiver from "archiver";
|
||||
import { createWriteStream } from "fs";
|
||||
import { Observable } from "rxjs";
|
||||
import recursive from "recursive-readdir";
|
||||
import { lstatSync } from "fs";
|
||||
import * as _path from "path";
|
||||
import { ArchiveProgress } from "shared/models/archive.interface";
|
||||
import { Progression } from "main/helpers/fs.helpers";
|
||||
|
||||
export class Archive{
|
||||
|
||||
private archive: archiver.Archiver;
|
||||
private readonly output: string;
|
||||
|
||||
private readonly directories: string[] = [];
|
||||
private readonly files: string[] = [];
|
||||
|
||||
constructor(output: string, options?: archiver.ArchiverOptions){
|
||||
this.output = output;
|
||||
this.initArchive(options);
|
||||
}
|
||||
|
||||
private initArchive(options?: archiver.ArchiverOptions): void{
|
||||
const defaultOptions: archiver.ArchiverOptions = {
|
||||
zlib: {level: 9}
|
||||
};
|
||||
|
||||
this.archive = archiver("zip", {...defaultOptions, ...options});
|
||||
}
|
||||
|
||||
private async loadTotalFiles(): Promise<number>{
|
||||
let totalFiles = this.files.length;
|
||||
for(const path of this.directories){
|
||||
const files = await recursive(path);
|
||||
totalFiles += files.length;
|
||||
}
|
||||
return totalFiles;
|
||||
}
|
||||
|
||||
public addDirectory(path: string, destPath?: string|false): void{
|
||||
this.directories.push(path);
|
||||
destPath = destPath === false ? false : _path.basename(path);
|
||||
this.archive.directory(path, destPath);
|
||||
}
|
||||
|
||||
public addFile(path: string, destPath?: string): void{
|
||||
this.files.push(path);
|
||||
destPath = destPath ||= _path.basename(path);
|
||||
this.archive.file(path, {name: destPath});
|
||||
}
|
||||
|
||||
|
||||
public finalize(): Observable<Progression>{
|
||||
|
||||
const progress: Progression = {
|
||||
total: 0,
|
||||
current: 0
|
||||
};
|
||||
|
||||
return new Observable<Progression>(observer => {
|
||||
(async () => {
|
||||
|
||||
progress.total = await this.loadTotalFiles();
|
||||
|
||||
this.archive.on("entry", e => {
|
||||
if(e.stats.isDirectory()){ return; }
|
||||
progress.current++;
|
||||
observer.next(progress);
|
||||
});
|
||||
|
||||
this.archive.pipe(createWriteStream(this.output));
|
||||
|
||||
this.archive.on("error", err => observer.error(err));
|
||||
this.archive.finalize().then(() => observer.complete());
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
export type Channels = any;
|
||||
import { IpcChannel } from 'shared/models/ipc/ipc-response.interface';
|
||||
|
||||
contextBridge.exposeInMainWorld('electron', {
|
||||
ipcRenderer: {
|
||||
sendMessage(channel: Channels, args: unknown[]) {
|
||||
sendMessage(channel: IpcChannel, args: unknown[]) {
|
||||
ipcRenderer.send(channel, args);
|
||||
},
|
||||
on(channel: Channels, func: (...args: unknown[]) => void) {
|
||||
on(channel: IpcChannel, func: (...args: unknown[]) => void) {
|
||||
const subscription = (_event: IpcRendererEvent, ...args: unknown[]) =>
|
||||
func(...args);
|
||||
ipcRenderer.on(channel, subscription);
|
||||
|
||||
return () => ipcRenderer.removeListener(channel, subscription);
|
||||
},
|
||||
once(channel: Channels, func: (...args: unknown[]) => void) {
|
||||
once(channel: IpcChannel, func: (...args: unknown[]) => void) {
|
||||
ipcRenderer.once(channel, (_event, ...args) => func(...args));
|
||||
},
|
||||
removeAllListeners(channel: IpcChannel) {
|
||||
ipcRenderer.removeAllListeners(channel);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
import path from "path";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsvMapDetail, RawMapInfoData } from "shared/models/maps";
|
||||
import { BsmLocalMap, BsmLocalMapsProgress, DeleteMapsProgress } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import { InstallationLocationService } from "../installation-location.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import crypto from "crypto";
|
||||
import { lstatSync, unlinkSync } from "fs";
|
||||
import { copySync } from "fs-extra";
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import sanitize from "sanitize-filename";
|
||||
import { DeepLinkService } from "../deep-link.service";
|
||||
import log from 'electron-log';
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { ipcMain } from "electron";
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { Observable, lastValueFrom } from "rxjs";
|
||||
import { Archive } from "../../models/archive.class";
|
||||
import { deleteFolder, ensureFolderExist, getFoldersInFolder, pathExist } from "../../helpers/fs.helpers";
|
||||
import { readFile } from "fs/promises";
|
||||
import { FolderLinkerService } from "../folder-linker.service";
|
||||
import { allSettled } from "../../../shared/helpers/promise.helpers";
|
||||
|
||||
export class LocalMapsManagerService {
|
||||
|
||||
private static instance: LocalMapsManagerService;
|
||||
|
||||
public static getInstance(): LocalMapsManagerService{
|
||||
if(!LocalMapsManagerService.instance){ LocalMapsManagerService.instance = new LocalMapsManagerService(); }
|
||||
return LocalMapsManagerService.instance;
|
||||
}
|
||||
|
||||
public static readonly LEVELS_ROOT_FOLDER = "Beat Saber_Data";
|
||||
public static readonly CUSTOM_LEVELS_FOLDER = "CustomLevels";
|
||||
public static readonly SHARED_MAPS_FOLDER = "SharedMaps";
|
||||
|
||||
private readonly DEEP_LINKS = {
|
||||
BeatSaver: "beatsaver",
|
||||
ScoreSaber: "web+bsmap"
|
||||
};
|
||||
|
||||
private readonly localVersion: BSLocalVersionService;
|
||||
private readonly installLocation: InstallationLocationService;
|
||||
private readonly utils: UtilsService;
|
||||
private readonly reqService: RequestService;
|
||||
private readonly deepLink: DeepLinkService;
|
||||
private readonly windows: WindowManagerService;
|
||||
private readonly linker = FolderLinkerService.getInstance();
|
||||
|
||||
private constructor(){
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
this.installLocation = InstallationLocationService.getInstance();
|
||||
this.utils = UtilsService.getInstance();
|
||||
this.reqService = RequestService.getInstance();
|
||||
this.deepLink = DeepLinkService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
this.linker = FolderLinkerService.getInstance();
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link);
|
||||
this.openOneClickDownloadMapWindow(new URL(link).host);
|
||||
});
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ScoreSaber, link => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ScoreSaber, link);
|
||||
this.openOneClickDownloadMapWindow(new URL(link).host, true);
|
||||
});
|
||||
}
|
||||
|
||||
public async getMapsFolderPath(version?: BSVersion): Promise<string>{
|
||||
|
||||
if(version){ return path.join(await this.localVersion.getVersionPath(version), LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER); }
|
||||
const sharedMapsPath = path.join(this.installLocation.sharedContentPath, LocalMapsManagerService.SHARED_MAPS_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER);
|
||||
if(!(await pathExist(sharedMapsPath))){
|
||||
await ensureFolderExist(sharedMapsPath);
|
||||
}
|
||||
return sharedMapsPath;
|
||||
}
|
||||
|
||||
private async computeMapHash(mapPath: string, rawInfoString: string): Promise<string>{
|
||||
const mapRawInfo = JSON.parse(rawInfoString);
|
||||
const shasum = crypto.createHash("sha1");
|
||||
shasum.update(rawInfoString);
|
||||
for(const set of mapRawInfo._difficultyBeatmapSets){
|
||||
for(const diff of set._difficultyBeatmaps){
|
||||
const diffFilePath = path.join(mapPath, diff._beatmapFilename);
|
||||
const diffContent = await readFile(diffFilePath, {encoding: "utf-8"}).catch(() => null);
|
||||
diffContent && shasum.update(diffContent);
|
||||
}
|
||||
}
|
||||
|
||||
return shasum.digest("hex");
|
||||
}
|
||||
|
||||
private async loadMapInfoFromPath(mapPath: string): Promise<BsmLocalMap>{
|
||||
const infoFilePath = path.join(mapPath, "Info.dat");
|
||||
|
||||
if(!(await pathExist(infoFilePath))){ return null; }
|
||||
|
||||
const rawInfoString = await readFile(infoFilePath, {encoding: "utf-8"});
|
||||
|
||||
const rawInfo: RawMapInfoData = JSON.parse(rawInfoString);
|
||||
const coverUrl = new URL(`file:///${path.join(mapPath, rawInfo._coverImageFilename)}`).href;
|
||||
const songUrl = new URL(`file:///${path.join(mapPath, rawInfo._songFilename)}`).href;
|
||||
|
||||
const hash = await this.computeMapHash(mapPath, rawInfoString);
|
||||
|
||||
return {rawInfo, coverUrl, songUrl, hash, path: mapPath};
|
||||
}
|
||||
|
||||
private async downloadMapZip(zipUrl: string): Promise<{zip: StreamZip.StreamZipAsync, zipPath: string}>{
|
||||
const fileName = path.basename(zipUrl);
|
||||
const tempPath = this.utils.getTempPath();
|
||||
await ensureFolderExist(this.utils.getTempPath());
|
||||
const dest = path.join(tempPath, fileName);
|
||||
|
||||
const zipPath = (await lastValueFrom(this.reqService.downloadFile(zipUrl, dest))).data;
|
||||
const zip = new StreamZip.async({file : zipPath});
|
||||
|
||||
return {zip, zipPath};
|
||||
}
|
||||
|
||||
private openOneClickDownloadMapWindow(mapId: string, isHash = false): void{
|
||||
|
||||
ipcMain.once("one-click-map-info", async (event, req: IpcRequest<void>) => {
|
||||
this.utils.ipcSend(req.responceChannel, {success: true, data: {id: mapId, isHash}});
|
||||
});
|
||||
|
||||
this.windows.openWindow("oneclick-download-map.html");
|
||||
|
||||
}
|
||||
|
||||
public getMaps(version?: BSVersion): Observable<BsmLocalMapsProgress>{
|
||||
|
||||
const progression: BsmLocalMapsProgress = {
|
||||
total: 0,
|
||||
loaded: 0,
|
||||
maps: []
|
||||
};
|
||||
|
||||
return new Observable<BsmLocalMapsProgress>(observer => {
|
||||
(async () => {
|
||||
const levelsFolder = await this.getMapsFolderPath(version);
|
||||
|
||||
const levelsPaths = (await pathExist(levelsFolder)) ? await getFoldersInFolder(levelsFolder) : [];
|
||||
|
||||
progression.total = levelsPaths.length;
|
||||
|
||||
const promises = levelsPaths.map(async levelPath => {
|
||||
const mapInfo = await this.loadMapInfoFromPath(levelPath);
|
||||
if(!mapInfo){ return null; }
|
||||
progression.loaded++;
|
||||
observer.next(progression);
|
||||
return mapInfo;
|
||||
});
|
||||
|
||||
const mapsInfo = await allSettled(promises, {removeFalsy: true});
|
||||
|
||||
progression.maps = mapsInfo;
|
||||
|
||||
observer.next(progression);
|
||||
|
||||
observer.complete();
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
public async versionIsLinked(version: BSVersion): Promise<boolean>{
|
||||
|
||||
const levelsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
const isPathExist = await pathExist(levelsPath);
|
||||
|
||||
if(!isPathExist){ return false; }
|
||||
|
||||
return lstatSync(levelsPath).isSymbolicLink()
|
||||
}
|
||||
|
||||
public async linkVersionMaps(version: BSVersion, keepMaps: boolean): Promise<void>{
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
return this.linker.linkFolder(versionMapsPath, {keepContents: keepMaps, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER});
|
||||
}
|
||||
|
||||
public async unlinkVersionMaps(version: BSVersion, keepMaps: boolean): Promise<void>{
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
return this.linker.unlinkFolder(versionMapsPath, {keepContents: keepMaps, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER});
|
||||
}
|
||||
|
||||
public deleteMaps(maps: BsmLocalMap[]): Observable<DeleteMapsProgress>{
|
||||
|
||||
const mapsFolders = maps.map(map => map.path);
|
||||
const mapsHashsToDelete = maps.map(map => map.hash);
|
||||
|
||||
return new Observable<DeleteMapsProgress>(observer => {
|
||||
(async () => {
|
||||
const progress: DeleteMapsProgress = { total: maps.length, deleted: 0 };
|
||||
try{
|
||||
for(const folder of mapsFolders){
|
||||
const detail = await this.loadMapInfoFromPath(folder);
|
||||
if(!mapsHashsToDelete.includes(detail?.hash)){ continue; }
|
||||
await deleteFolder(folder);
|
||||
progress.deleted++;
|
||||
observer.next(progress);
|
||||
}
|
||||
}catch(e){
|
||||
observer.error(e);
|
||||
}
|
||||
observer.complete();
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
public async downloadMap(map: BsvMapDetail, version?: BSVersion): Promise<BsmLocalMap>{
|
||||
|
||||
if(!map.versions.at(0).hash){ throw "Cannot download map, no hash found"; }
|
||||
|
||||
const zipUrl = map.versions.at(0).downloadURL;
|
||||
|
||||
const mapsFolder = await this.getMapsFolderPath(version);
|
||||
|
||||
const {zip, zipPath} = await this.downloadMapZip(zipUrl);
|
||||
|
||||
const mapFolderName = sanitize(`${map.id}-${map.name}`);
|
||||
|
||||
const mapPath = path.join(mapsFolder, mapFolderName);
|
||||
|
||||
if(!zip){ throw `Cannot download ${zipUrl}`; }
|
||||
|
||||
await ensureFolderExist(mapPath);
|
||||
|
||||
await zip.extract(null, mapPath);
|
||||
await zip.close();
|
||||
|
||||
unlinkSync(zipPath);
|
||||
|
||||
const localMap = await this.loadMapInfoFromPath(mapPath);
|
||||
localMap.bsaverInfo = map;
|
||||
|
||||
return localMap;
|
||||
}
|
||||
|
||||
public async exportMaps(version: BSVersion, maps: BsmLocalMap[], outPath: string){
|
||||
|
||||
const archive = new Archive(outPath);
|
||||
|
||||
if(!maps || maps.length === 0){
|
||||
const mapsFolder = await this.getMapsFolderPath(version);
|
||||
archive.addDirectory(mapsFolder, false);
|
||||
}
|
||||
else{
|
||||
const mapsFolders = maps.map(map => map.path);
|
||||
mapsFolders.forEach(maps => archive.addDirectory(maps));
|
||||
}
|
||||
|
||||
return archive.finalize()
|
||||
|
||||
}
|
||||
|
||||
public async oneClickDownloadMap(map: BsvMapDetail): Promise<void>{
|
||||
|
||||
const downloadedMap = await this.downloadMap(map);
|
||||
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
|
||||
for(const version of versions){
|
||||
|
||||
if(await this.versionIsLinked(version)){ continue; }
|
||||
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
await ensureFolderExist(versionMapsPath);
|
||||
|
||||
copySync(downloadedMap.path, path.join(versionMapsPath, path.basename(downloadedMap.path)), {overwrite: true});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.registerDeepLink(link));
|
||||
}
|
||||
|
||||
public disableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.unRegisterDeepLink(link));
|
||||
}
|
||||
|
||||
public isDeepLinksEnabled(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
import { DeepLinkService } from "../deep-link.service";
|
||||
import log from "electron-log"
|
||||
import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { MSModel, MSModelType } from "../../../shared/models/models/model-saber.model";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import path from "path";
|
||||
import { RequestService } from "../request.service";
|
||||
import { copyFileSync } from "fs-extra";
|
||||
import sanitize from "sanitize-filename";
|
||||
import { Progression, ensureFolderExist, unlinkPath } from "../../helpers/fs.helpers";
|
||||
import { MODEL_FILE_EXTENSIONS, MODEL_TYPES, MODEL_TYPE_FOLDERS } from "../../../shared/models/models/constants";
|
||||
import { InstallationLocationService } from "../installation-location.service";
|
||||
import { Observable, Subscription, lastValueFrom, map } from "rxjs";
|
||||
import { readdir } from "fs/promises";
|
||||
import md5File from "md5-file";
|
||||
import { allSettled } from "../../../shared/helpers/promise.helpers";
|
||||
import { ModelSaberService } from "../thrid-party/model-saber/model-saber.service";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { ArchiveProgress } from "shared/models/archive.interface";
|
||||
import { Archive } from "../../models/archive.class";
|
||||
|
||||
export class LocalModelsManagerService {
|
||||
|
||||
private static instance: LocalModelsManagerService;
|
||||
|
||||
public static getInstance(): LocalModelsManagerService{
|
||||
if(!LocalModelsManagerService.instance){ LocalModelsManagerService.instance = new LocalModelsManagerService(); }
|
||||
return LocalModelsManagerService.instance;
|
||||
}
|
||||
|
||||
private readonly DEEP_LINKS = {
|
||||
ModelSaber: "modelsaber",
|
||||
};
|
||||
|
||||
private readonly deepLink: DeepLinkService;
|
||||
private readonly utils: UtilsService;
|
||||
private readonly windows: WindowManagerService;
|
||||
private readonly localVersion: BSLocalVersionService;
|
||||
private readonly installPaths: InstallationLocationService;
|
||||
private readonly request: RequestService;
|
||||
private readonly modelSaber: ModelSaberService;
|
||||
|
||||
private constructor(){
|
||||
this.deepLink = DeepLinkService.getInstance();
|
||||
this.utils = UtilsService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
this.request = RequestService.getInstance();
|
||||
this.installPaths = InstallationLocationService.getInstance();
|
||||
this.modelSaber = ModelSaberService.getInstance();
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ModelSaber, (link) => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ModelSaber, link);
|
||||
const url = new URL(link);
|
||||
|
||||
const type = url.host
|
||||
const id = url.pathname.replace("/", '').split("/").at(0);
|
||||
|
||||
this.openOneClickDownloadModelWindow(id, type);
|
||||
});
|
||||
}
|
||||
|
||||
private openOneClickDownloadModelWindow(id: string, type: string){
|
||||
|
||||
ipcMain.once("one-click-model-info", async (event, req: IpcRequest<void>) => {
|
||||
this.utils.ipcSend(req.responceChannel, {success: true, data: {id, type}});
|
||||
});
|
||||
|
||||
this.windows.openWindow("oneclick-download-model.html");
|
||||
|
||||
}
|
||||
|
||||
private async getModelFolderPath(type: MSModelType, version?: BSVersion): Promise<string>{
|
||||
|
||||
const rootPath = !!version ? await this.localVersion.getVersionPath(version) : this.installPaths.sharedContentPath;
|
||||
const modelFolderPath = path.join(rootPath, MODEL_TYPE_FOLDERS[type]);
|
||||
|
||||
await ensureFolderExist(modelFolderPath);
|
||||
|
||||
return modelFolderPath;
|
||||
|
||||
}
|
||||
|
||||
public downloadModel(model: MSModel, version: BSVersion): Observable<Progression<BsmLocalModel>>{
|
||||
return new Observable<Progression<BsmLocalModel>>(subscriber => {
|
||||
|
||||
const subs: Subscription[] = [];
|
||||
|
||||
(async () => {
|
||||
|
||||
const modelFolder = await this.getModelFolderPath(model.type, version);
|
||||
const modelDest = path.join(modelFolder, sanitize(path.basename(model.download)));
|
||||
|
||||
let url = model.download.split("/");
|
||||
url[url.length - 1] = encodeURIComponent(url[url.length - 1]);
|
||||
|
||||
const download$ = this.request.downloadFile(url.join("/"), modelDest);
|
||||
|
||||
subs.push(download$.subscribe({ next: value => subscriber.next({...value, data: undefined}), error: e => subscriber.error(e) }));
|
||||
|
||||
const downloaded = await lastValueFrom(download$);
|
||||
|
||||
const res: BsmLocalModel = {
|
||||
path: downloaded.data,
|
||||
fileName: path.basename(downloaded.data),
|
||||
hash: await md5File(downloaded.data),
|
||||
type: model.type,
|
||||
model,
|
||||
version
|
||||
}
|
||||
|
||||
subscriber.next({...downloaded, data: res});
|
||||
|
||||
})().catch(err => subscriber.error(err)).then(() => subscriber.complete());
|
||||
|
||||
return () => {
|
||||
subs.forEach(sub => sub.unsubscribe());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async oneClickDownloadModel(model: MSModel): Promise<void>{
|
||||
|
||||
if(!model){ return; }
|
||||
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
|
||||
if(versions?.length === 0){ return; }
|
||||
|
||||
const fisrtVersion = versions.shift();
|
||||
|
||||
const downloaded = await lastValueFrom(this.downloadModel(model, fisrtVersion));
|
||||
|
||||
for(const version of versions){
|
||||
|
||||
const modelDest = path.join(await this.getModelFolderPath(model.type, version), path.basename(downloaded.data.path));
|
||||
|
||||
copyFileSync(downloaded.data.path, modelDest);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async getModelsPaths(type: MSModelType, version?: BSVersion): Promise<string[]>{
|
||||
const modelsPath = await this.getModelFolderPath(type, version);
|
||||
const files = await readdir(modelsPath, {withFileTypes: true});
|
||||
|
||||
//return files.filter(file => file.isFile() && path.extname(file.name) === MODEL_FILE_EXTENSIONS[type]).map(file => path.join(modelsPath, file.name));
|
||||
return files.reduce((acc, file) => {
|
||||
if(!file.isFile() || path.extname(file.name) !== MODEL_FILE_EXTENSIONS[type]){ return acc; }
|
||||
acc.push(path.join(modelsPath, file.name));
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
||||
public getModels(type: MSModelType, version?: BSVersion): Observable<Progression<BsmLocalModel[]>>{
|
||||
|
||||
const progression: Progression<BsmLocalModel[]> = {
|
||||
total: 0,
|
||||
current: 0,
|
||||
data: null
|
||||
};
|
||||
|
||||
return new Observable<Progression<BsmLocalModel[]>>(subscriber => {
|
||||
(async () => {
|
||||
const modelsPaths = await this.getModelsPaths(type, version);
|
||||
progression.total = modelsPaths.length;
|
||||
|
||||
const models = await allSettled(modelsPaths.map(async modelPath => {
|
||||
|
||||
const hash = await md5File(modelPath)
|
||||
|
||||
const localModel: BsmLocalModel = {
|
||||
path: modelPath,
|
||||
fileName: path.basename(modelPath, MODEL_FILE_EXTENSIONS[type]),
|
||||
model: await this.modelSaber.getModelByHash(hash),
|
||||
type, hash, version
|
||||
}
|
||||
|
||||
progression.current++;
|
||||
|
||||
subscriber.next(progression);
|
||||
|
||||
return localModel;
|
||||
}));
|
||||
|
||||
progression.data = models;
|
||||
subscriber.next(progression);
|
||||
|
||||
})().catch(e => subscriber.error(e)).finally(() => subscriber.complete());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public exportModels(output: string, version?: BSVersion, models?: BsmLocalModel[]): Observable<Progression>{
|
||||
|
||||
return new Observable<Progression>(subscriber => {
|
||||
|
||||
const archive = new Archive(output);
|
||||
|
||||
(async () => {
|
||||
|
||||
if(models?.length){
|
||||
models.forEach(model => archive.addFile(model.path, path.join(MODEL_TYPE_FOLDERS[model.type], path.basename(model.path))));
|
||||
}
|
||||
else{
|
||||
for(const type of MODEL_TYPES){
|
||||
archive.addDirectory(await this.getModelFolderPath(type, version));
|
||||
}
|
||||
}
|
||||
|
||||
})().catch(e => subscriber.error(e)).then(() => (
|
||||
archive.finalize().subscribe(subscriber)
|
||||
));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public deleteModels(models: BsmLocalModel[]): Observable<Progression<BsmLocalModel[]>>{
|
||||
return new Observable<Progression<BsmLocalModel[]>>(subscriber => {
|
||||
(async () => {
|
||||
|
||||
const progression: Progression<BsmLocalModel[]> = {
|
||||
total: models.length,
|
||||
current: 0,
|
||||
data: []
|
||||
};
|
||||
|
||||
for(const model of models){
|
||||
await unlinkPath(model.path);
|
||||
progression.data.push(model);
|
||||
progression.current = progression.data.length;
|
||||
subscriber.next(progression);
|
||||
}
|
||||
|
||||
})().catch(e => subscriber.error(e)).finally(() => subscriber.complete());
|
||||
});
|
||||
}
|
||||
|
||||
public enableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.registerDeepLink(link));
|
||||
}
|
||||
|
||||
public disableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.unRegisterDeepLink(link));
|
||||
}
|
||||
|
||||
public isDeepLinksEnabled(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface BsmLocalModelsProgress {
|
||||
total: number;
|
||||
loaded: number;
|
||||
models: MSModel[];
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
import path from "path";
|
||||
import { BehaviorSubject, Observable, lastValueFrom } from "rxjs";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import { DeepLinkService } from "../deep-link.service";
|
||||
import { RequestService } from "../request.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { LocalMapsManagerService } from "./local-maps-manager.service";
|
||||
import log from "electron-log"
|
||||
import { isValidUrl } from "../../../shared/helpers/url.helpers";
|
||||
import { ipcMain } from "electron";
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { BPList, DownloadPlaylistProgression } from "shared/models/playlists/playlist.interface";
|
||||
import { copyFileSync, readFileSync } from "fs";
|
||||
import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service";
|
||||
import { copySync } from "fs-extra";
|
||||
import { ensureFolderExist, pathExist } from "../../helpers/fs.helpers";
|
||||
|
||||
export class LocalPlaylistsManagerService {
|
||||
|
||||
private static instance: LocalPlaylistsManagerService
|
||||
|
||||
public static getInstance(): LocalPlaylistsManagerService {
|
||||
if (!LocalPlaylistsManagerService.instance) { LocalPlaylistsManagerService.instance = new LocalPlaylistsManagerService(); }
|
||||
return LocalPlaylistsManagerService.instance;
|
||||
}
|
||||
|
||||
private readonly PLAYLISTS_FOLDER = "Playlists";
|
||||
private readonly DEEP_LINKS = {
|
||||
BeatSaver: "bsplaylist",
|
||||
};
|
||||
|
||||
|
||||
private readonly versions: BSLocalVersionService;
|
||||
private readonly maps: LocalMapsManagerService;
|
||||
private readonly utils: UtilsService;
|
||||
private readonly request: RequestService;
|
||||
private readonly deepLink: DeepLinkService;
|
||||
private readonly windows: WindowManagerService;
|
||||
private readonly bsaver: BeatSaverService;
|
||||
|
||||
private constructor(){
|
||||
this.maps = LocalMapsManagerService.getInstance();
|
||||
this.versions = BSLocalVersionService.getInstance();
|
||||
this.utils = UtilsService.getInstance();
|
||||
this.request = RequestService.getInstance();
|
||||
this.deepLink = DeepLinkService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
this.bsaver = BeatSaverService.getInstance();
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => {
|
||||
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link);
|
||||
const url = new URL(link);
|
||||
const bplistUrl = url.host === "playlist" ? url.pathname.replace("/", "") : "";
|
||||
|
||||
this.openOneClickDownloadPlaylistWindow(bplistUrl);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private getPlaylistIdFromDownloadUrl(url: string): string{
|
||||
|
||||
if(!isValidUrl(url)){ return ""; }
|
||||
|
||||
const splited = url.split("/")
|
||||
const idIndex = splited.indexOf("id");
|
||||
|
||||
if(idIndex < 0){ return ""; }
|
||||
|
||||
return splited[idIndex + 1];
|
||||
}
|
||||
|
||||
private async getPlaylistsFolder(version?: BSVersion){
|
||||
|
||||
if(!version){ throw "Playlists are not available to be linked yet" }
|
||||
|
||||
const versionFolder = await this.versions.getVersionPath(version);
|
||||
|
||||
const folder = path.join(versionFolder, this.PLAYLISTS_FOLDER);
|
||||
|
||||
await ensureFolderExist(folder)
|
||||
|
||||
return folder;
|
||||
|
||||
}
|
||||
|
||||
private async installBPListFile(bpListUrlOrPath: string, version: BSVersion): Promise<string>{
|
||||
|
||||
const playlistFolder = await this.getPlaylistsFolder(version);
|
||||
|
||||
const bpListDest = path.join(playlistFolder, path.basename(bpListUrlOrPath));
|
||||
|
||||
if(await pathExist(bpListUrlOrPath)){
|
||||
copyFileSync(bpListUrlOrPath, bpListDest);
|
||||
}
|
||||
else{
|
||||
await lastValueFrom(this.request.downloadFile(bpListUrlOrPath, bpListDest));
|
||||
}
|
||||
|
||||
return bpListDest;
|
||||
|
||||
}
|
||||
|
||||
private async readPlaylistFile(path: string): Promise<BPList>{
|
||||
|
||||
if(!(await pathExist(path))){ throw `bplist file not exist at ${path}`; }
|
||||
|
||||
const rawContent = readFileSync(path).toString();
|
||||
|
||||
return JSON.parse(rawContent);
|
||||
|
||||
}
|
||||
|
||||
private openOneClickDownloadPlaylistWindow(downloadUrl: string): void{
|
||||
|
||||
ipcMain.once("one-click-playlist-info", async (event, req: IpcRequest<void>) => {
|
||||
this.utils.ipcSend(req.responceChannel, {success: true, data: {bpListUrl: downloadUrl, id: this.getPlaylistIdFromDownloadUrl(downloadUrl)}});
|
||||
});
|
||||
|
||||
this.windows.openWindow("oneclick-download-playlist.html");
|
||||
|
||||
}
|
||||
|
||||
public downloadPlaylist(bpListUrl: string, version: BSVersion): Observable<DownloadPlaylistProgression>{
|
||||
|
||||
const res = new BehaviorSubject<DownloadPlaylistProgression>({progression: 0, current: null, downloadedMaps: [], mapsPath: [], bpListPath: ""});
|
||||
|
||||
const sub = res.subscribe(process => {
|
||||
this.utils.ipcSend("download-playlist-progress", {success: true, data: process});
|
||||
}, err => {
|
||||
this.utils.ipcSend("download-playlist-progress", {success: false, error: err});
|
||||
});
|
||||
|
||||
const observer = async () => {
|
||||
|
||||
try{
|
||||
|
||||
const bpListPath = await this.installBPListFile(bpListUrl, version);
|
||||
|
||||
res.next({...res.value, bpListPath});
|
||||
|
||||
const bpList = await this.readPlaylistFile(bpListPath);
|
||||
|
||||
for(const song of bpList.songs){
|
||||
|
||||
if(!song.key){ continue; }
|
||||
|
||||
const map = await this.bsaver.getMapDetailsById(song.key);
|
||||
|
||||
res.next({
|
||||
...res.value,
|
||||
current: map,
|
||||
progression: ((res.value.downloadedMaps.length + .5) / bpList.songs.length) * 100
|
||||
});
|
||||
|
||||
const mapPath = await this.maps.downloadMap(map, version);
|
||||
|
||||
const progression = ((res.value.downloadedMaps.length + 1) / bpList.songs.length) * 100;
|
||||
|
||||
res.next({
|
||||
...res.value,
|
||||
current: null,
|
||||
downloadedMaps: [...res.value.downloadedMaps, map],
|
||||
mapsPath: [...res.value.mapsPath, mapPath.path],
|
||||
progression
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch(e){
|
||||
res.error(e);
|
||||
}
|
||||
|
||||
res.complete();
|
||||
|
||||
}
|
||||
|
||||
observer().finally(() => sub.unsubscribe());
|
||||
return res.asObservable();
|
||||
|
||||
}
|
||||
|
||||
public async oneClickInstallPlaylist(bpListUrl: string): Promise<void>{
|
||||
|
||||
const versions = await this.versions.getInstalledVersions();
|
||||
|
||||
const firstVersion = versions.shift();
|
||||
const fistVersionLinked = await this.maps.versionIsLinked(firstVersion);
|
||||
|
||||
const {bpListPath, mapsPath} = await this.downloadPlaylist(bpListUrl, firstVersion).toPromise();
|
||||
|
||||
for(const version of versions){
|
||||
|
||||
await this.installBPListFile(bpListPath, version);
|
||||
|
||||
const versionIsLinked = await this.maps.versionIsLinked(version);
|
||||
|
||||
if(fistVersionLinked && versionIsLinked){ continue; }
|
||||
|
||||
for(const mapPath of mapsPath){
|
||||
const versionMapsFolder = await this.maps.getMapsFolderPath(version);
|
||||
const mapDest = path.join(versionMapsFolder, path.basename(mapPath));
|
||||
|
||||
copySync(mapPath, mapDest, {overwrite: true});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.registerDeepLink(link));
|
||||
}
|
||||
|
||||
public disableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.unRegisterDeepLink(link));
|
||||
}
|
||||
|
||||
public isDeepLinksEnabled(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import log from 'electron-log';
|
||||
import { UtilsService } from './utils.service';
|
||||
import { gt } from 'semver';
|
||||
export class AutoUpdaterService {
|
||||
|
||||
private static instance: AutoUpdaterService;
|
||||
@@ -24,8 +25,7 @@ export class AutoUpdaterService {
|
||||
autoUpdater.checkForUpdates().then(info => {
|
||||
const needUpdate = (() => {
|
||||
if(!info || !info.updateInfo){ return false; }
|
||||
if(autoUpdater.currentVersion.version === info.updateInfo.version){ return false; }
|
||||
return true;
|
||||
return gt(info.updateInfo.version, autoUpdater.currentVersion.version);
|
||||
})();
|
||||
resolve(needUpdate)}
|
||||
).catch(() => resolve(false));
|
||||
@@ -38,10 +38,6 @@ export class AutoUpdaterService {
|
||||
autoUpdater.addListener("download-progress", info => {
|
||||
this.utilsService.ipcSend("update-download-progress", {success: true, data: info.percent});
|
||||
});
|
||||
// const promise = new Promise<boolean>((resolve, reject) => {
|
||||
// autoUpdater.addListener("update-downloaded", () => resolve(true));
|
||||
// autoUpdater.addListener("error", () => reject(false))
|
||||
// });
|
||||
|
||||
return autoUpdater.downloadUpdate().then(res => !!res && !!res.length);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
/* eslint-disable prefer-promise-reject-errors */
|
||||
import { BS_APP_ID, BS_DEPOT } from "../constants";
|
||||
import path from "path";
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSVersion, PartialBSVersion } from 'shared/bs-version.interface';
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
|
||||
import { ChildProcessWithoutNullStreams, spawn, spawnSync } from "child_process";
|
||||
import log from "electron-log";
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import { ctrlc } from "ctrlc-windows";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import isOnline from 'is-online';
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { copy, copySync } from "fs-extra";
|
||||
import { clean, satisfies } from "semver";
|
||||
import { ensureFolderExist, pathExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class BSInstallerService{
|
||||
|
||||
@@ -16,6 +21,7 @@ export class BSInstallerService{
|
||||
private readonly utils: UtilsService;
|
||||
private readonly installLocationService: InstallationLocationService;
|
||||
private readonly localVersionService: BSLocalVersionService;
|
||||
private readonly windows: WindowManagerService;
|
||||
|
||||
private downloadProcess: ChildProcessWithoutNullStreams;
|
||||
|
||||
@@ -23,8 +29,9 @@ export class BSInstallerService{
|
||||
this.utils = UtilsService.getInstance();
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
this.localVersionService = BSLocalVersionService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
|
||||
this.utils.getMainWindow().on("close", () => {
|
||||
this.windows.getWindow("index.html")?.on("close", () => {
|
||||
this.killDownloadProcess();
|
||||
});
|
||||
}
|
||||
@@ -34,8 +41,12 @@ export class BSInstallerService{
|
||||
return BSInstallerService.instance;
|
||||
}
|
||||
|
||||
private escapeSpaces(path: string): string{
|
||||
return `\"${path}\"`
|
||||
}
|
||||
|
||||
private getDepotDownloaderExePath(): string{
|
||||
return path.join(this.utils.getAssetsScriptsPath(), 'depot-downloader', 'DepotDownloader.exe');
|
||||
return this.escapeSpaces(path.join(this.utils.getAssetsScriptsPath(), 'depot-downloader', 'DepotDownloader.exe'));
|
||||
}
|
||||
|
||||
private removeSpecialSchar(txt: string): string{ return txt.replaceAll(/\[|\]/g, ""); }
|
||||
@@ -62,6 +73,21 @@ export class BSInstallerService{
|
||||
});
|
||||
}
|
||||
|
||||
public async isDotNet6Installed(): Promise<boolean>{
|
||||
try{
|
||||
const process = spawnSync(this.getDepotDownloaderExePath(), {shell: true});
|
||||
if(process.stderr.toString()){
|
||||
log.error("no dotnet", process.stderr.toString());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch(e){
|
||||
log.error("Error while checking .NET 6", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async downloadBsVersion(downloadInfos: DownloadInfo): Promise<DownloadEvent>{
|
||||
|
||||
if(this.downloadProcess && this.downloadProcess.connected){ throw "AlreadyDownloading"; }
|
||||
@@ -69,7 +95,14 @@ export class BSInstallerService{
|
||||
if(!bsVersion){ return {type: "[Error]"}; }
|
||||
if(!(await isOnline({timeout: 1500}))){ throw "no-internet"; }
|
||||
|
||||
this.utils.createFolderIfNotExist(this.installLocationService.versionsDirectory);
|
||||
await ensureFolderExist(this.installLocationService.versionsDirectory);
|
||||
|
||||
const versionPath = await this.localVersionService.getVersionPath(bsVersion)
|
||||
|
||||
const dest = !downloadInfos.isVerification ? await this.getPathNotAleardyExist(versionPath) : versionPath;
|
||||
|
||||
const downloadVersion: BSVersion = {...downloadInfos.bsVersion, ...(path.basename(dest) !== downloadInfos.bsVersion.BSVersion && {name: path.basename(dest)})}
|
||||
|
||||
this.downloadProcess = spawn(
|
||||
this.getDepotDownloaderExePath(),
|
||||
[
|
||||
@@ -77,12 +110,13 @@ export class BSInstallerService{
|
||||
`-depot ${BS_DEPOT}`,
|
||||
`-manifest ${bsVersion.BSManifest}`,
|
||||
`-username ${downloadInfos.username}`,
|
||||
`-dir \"${this.localVersionService.getVersionFolder(bsVersion)}\"`,
|
||||
(downloadInfos.stay || !downloadInfos.password) && "-remember-password"
|
||||
`-dir \"${this.localVersionService.getVersionFolder(downloadVersion)}\"`
|
||||
],
|
||||
{shell: true, cwd: this.installLocationService.versionsDirectory}
|
||||
);
|
||||
|
||||
this.utils.ipcSend("start-download-version", {success: true, data: downloadVersion});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
this.downloadProcess.stdout.on('data', data => {
|
||||
@@ -127,16 +161,25 @@ export class BSInstallerService{
|
||||
this.downloadProcess.stdout.on('error', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
this.downloadProcess.stderr.on('data', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
this.downloadProcess.stderr.on('error', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
|
||||
@@ -144,6 +187,34 @@ export class BSInstallerService{
|
||||
})
|
||||
}
|
||||
|
||||
private async getPathNotAleardyExist(path: string): Promise<string>{
|
||||
let destPath = path;
|
||||
let folderExist = await pathExist(destPath);
|
||||
let i = 0;
|
||||
|
||||
while(folderExist){
|
||||
i++;
|
||||
destPath = `${path} (${i})`;
|
||||
folderExist = await pathExist(destPath);
|
||||
}
|
||||
|
||||
return destPath
|
||||
}
|
||||
|
||||
public async importVersion(path: string): Promise<PartialBSVersion>{
|
||||
|
||||
const rawBsVersion = await this.localVersionService.getVersionOfBSFolder(path);
|
||||
|
||||
if(!rawBsVersion){ throw new Error("NOT_BS_FOLDER"); }
|
||||
|
||||
const destPath = await this.getPathNotAleardyExist(await this.localVersionService.getVersionPath(rawBsVersion));
|
||||
|
||||
await copy(path, destPath, {dereference: true});
|
||||
|
||||
return rawBsVersion;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -153,12 +224,13 @@ export interface DownloadInfo {
|
||||
bsVersion: BSVersion,
|
||||
username: string,
|
||||
password?: string,
|
||||
stay?: boolean
|
||||
stay?: boolean,
|
||||
isVerification: boolean
|
||||
}
|
||||
|
||||
export interface DownloadEvent{
|
||||
type: DownloadEventType,
|
||||
data?: unknown,
|
||||
data?: unknown
|
||||
}
|
||||
|
||||
export type DownloadEventType = "[Password]" | "[Guard]" | "[2FA]" | "[Progress]" | "[Validated]" | "[Finished]" | "[AlreadyDownloading]" | "[Error]" | "[Warning]" | "[SteamID]" | "[Exit]" | "[NoInternet]";
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import path from "path";
|
||||
import { LaunchResult, LauchOption } from "shared/models/bs-launch";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { BS_EXECUTABLE, BS_APP_ID } from "../constants";
|
||||
import { BS_EXECUTABLE, BS_APP_ID, STEAMVR_APP_ID } from "../constants";
|
||||
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
|
||||
import { SteamService } from "./steam.service";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import { OculusService } from "./oculus.service";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import { rename } from "fs/promises";
|
||||
import log from "electron-log";
|
||||
import { timer } from "rxjs";
|
||||
|
||||
export class BSLauncherService{
|
||||
|
||||
@@ -12,6 +17,7 @@ export class BSLauncherService{
|
||||
|
||||
private readonly utilsService: UtilsService;
|
||||
private readonly steamService: SteamService;
|
||||
private readonly oculusService: OculusService;
|
||||
private readonly localVersionService: BSLocalVersionService;
|
||||
|
||||
private bsProcess: ChildProcessWithoutNullStreams;
|
||||
@@ -24,31 +30,77 @@ export class BSLauncherService{
|
||||
private constructor(){
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.steamService = SteamService.getInstance();
|
||||
this.oculusService = OculusService.getInstance();
|
||||
this.localVersionService = BSLocalVersionService.getInstance();
|
||||
}
|
||||
|
||||
private getSteamVRPath(): Promise<string>{
|
||||
return this.steamService.getGameFolder(STEAMVR_APP_ID, "SteamVR");
|
||||
}
|
||||
|
||||
private async backupSteamVR(): Promise<void>{
|
||||
const steamVrFolder = await this.getSteamVRPath();
|
||||
if(!await pathExist(steamVrFolder)){ return; }
|
||||
return rename(steamVrFolder, steamVrFolder + ".bak").catch(log.error);
|
||||
}
|
||||
|
||||
public async restoreSteamVR(): Promise<void>{
|
||||
const steamVrFolder = await this.getSteamVRPath();
|
||||
const steamVrBackup = steamVrFolder + ".bak";
|
||||
if(!await pathExist(steamVrBackup)){ return; }
|
||||
return rename(steamVrFolder + ".bak", steamVrFolder).catch(log.error);
|
||||
}
|
||||
|
||||
public isBsRunning(): boolean{
|
||||
return this.bsProcess?.connected || this.utilsService.taskRunning(BS_EXECUTABLE);
|
||||
return this.bsProcess?.connected || this.utilsService.taskRunning(BS_EXECUTABLE) === true;
|
||||
}
|
||||
|
||||
public async launch(launchOptions: LauchOption): Promise<LaunchResult>{
|
||||
if(!this.steamService.steamRunning()){ return "STEAM_NOT_RUNNING" }
|
||||
if(this.isBsRunning()){ return "BS_ALREADY_RUNNING" }
|
||||
if(launchOptions.version.oculus && this.oculusService.oculusRunning() === false){ return "OCULUS_NOT_RUNNING" }
|
||||
if(!launchOptions.version.oculus && this.steamService.steamRunning() === false){ return "STEAM_NOT_RUNNING" }
|
||||
if(this.isBsRunning() === true){ return "BS_ALREADY_RUNNING" }
|
||||
|
||||
const cwd = await this.localVersionService.getVersionPath(launchOptions.version);
|
||||
const exePath = path.join(cwd, BS_EXECUTABLE);
|
||||
|
||||
console.log(exePath);
|
||||
|
||||
if(!this.utilsService.pathExist(exePath)){ return "EXE_NOT_FINDED"; }
|
||||
if(!(await pathExist(exePath))){ return "EXE_NOT_FINDED"; }
|
||||
|
||||
const launchMods = [launchOptions.oculus && "-vrmode oculus", launchOptions.desktop && "fpfc", launchOptions.debug && "--verbose"];
|
||||
let launchArgs = [];
|
||||
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchMods, {shell: true, cwd: cwd, env: {...process.env, "SteamAppId": BS_APP_ID}});
|
||||
if(!launchOptions.version.steam && !launchOptions.version.oculus){ launchArgs.push("--no-yeet"); }
|
||||
if(launchOptions.oculus){ launchArgs.push("-vrmode oculus"); }
|
||||
if(launchOptions.desktop){ launchArgs.push("fpfc"); }
|
||||
if(launchOptions.debug){ launchArgs.push("--verbose"); }
|
||||
if(launchOptions.additionalArgs){ launchArgs.push(...launchOptions.additionalArgs); }
|
||||
|
||||
this.bsProcess.on('message', msg => { /** EMIT HERE **/ });
|
||||
this.bsProcess.on('error', err => { /** EMIT HERE **/ });
|
||||
this.bsProcess.on('exit', code => this.utilsService.ipcSend("bs-launch.exit", {data: code, success: code === 0}));
|
||||
launchArgs = Array.from(new Set(launchArgs).values());
|
||||
|
||||
let restoreTimout: NodeJS.Timeout;
|
||||
|
||||
if(launchArgs.includes("fpfc")){
|
||||
await this.backupSteamVR().catch(() => {
|
||||
this.restoreSteamVR();
|
||||
}).finally(() => {
|
||||
restoreTimout = setTimeout(() => this.restoreSteamVR(), 35_000);
|
||||
});
|
||||
await timer(2_000).toPromise();
|
||||
}
|
||||
else{
|
||||
await this.restoreSteamVR();
|
||||
}
|
||||
|
||||
if(launchOptions.debug){
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchArgs, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID}, detached: true, windowsVerbatimArguments: true });
|
||||
}
|
||||
else{
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchArgs, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID} });
|
||||
}
|
||||
|
||||
this.bsProcess.on('error', err => log.error(err));
|
||||
this.bsProcess.on('exit', code => {
|
||||
this.restoreSteamVR().finally(() => clearTimeout(restoreTimout));
|
||||
this.utilsService.ipcSend("bs-launch.exit", {data: code, success: code === 0})
|
||||
});
|
||||
|
||||
return "LAUNCHED";
|
||||
}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import { BSVersionLibService } from "./bs-version-lib.service";
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSVersion, PartialBSVersion } from 'shared/bs-version.interface';
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import { SteamService } from "./steam.service";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { BS_APP_ID } from "../constants";
|
||||
import { BS_APP_ID, OCULUS_BS_DIR } from "../constants";
|
||||
import path from "path";
|
||||
import { createInterface } from "readline";
|
||||
import { createReadStream } from "fs";
|
||||
import fs from "fs-extra";
|
||||
import { ConfigurationService } from "./configuration.service";
|
||||
import { rename } from "fs/promises";
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
import log from "electron-log";
|
||||
import { OculusService } from "./oculus.service";
|
||||
import { DownloadLinkType } from "shared/models/mods";
|
||||
import sanitize from "sanitize-filename";
|
||||
import { copyDirectoryWithJunctions, deleteFolder, getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
|
||||
import { FolderLinkerService } from "./folder-linker.service";
|
||||
|
||||
export class BSLocalVersionService{
|
||||
|
||||
@@ -19,44 +22,57 @@ export class BSLocalVersionService{
|
||||
private readonly CUSTOM_VERSIONS_KEY = "custom-versions";
|
||||
|
||||
private readonly installLocationService: InstallationLocationService;
|
||||
private readonly utilsService: UtilsService;
|
||||
private readonly steamService: SteamService;
|
||||
private readonly oculusService: OculusService;
|
||||
private readonly remoteVersionService: BSVersionLibService;
|
||||
private readonly configService: ConfigurationService;
|
||||
private readonly linker: FolderLinkerService;
|
||||
|
||||
public static getInstance(): BSLocalVersionService{
|
||||
if(!BSLocalVersionService.instance){ BSLocalVersionService.instance = new BSLocalVersionService(); }
|
||||
return BSLocalVersionService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.steamService = SteamService.getInstance();
|
||||
this.remoteVersionService = BSVersionLibService.getInstance();
|
||||
this.configService = ConfigurationService.getInstance();
|
||||
}
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
this.steamService = SteamService.getInstance();
|
||||
this.oculusService = OculusService.getInstance();
|
||||
this.remoteVersionService = BSVersionLibService.getInstance();
|
||||
this.configService = ConfigurationService.getInstance();
|
||||
this.linker = FolderLinkerService.getInstance();
|
||||
}
|
||||
|
||||
private async getVersionOfBSFolder(bsPath: string): Promise<string>{
|
||||
|
||||
|
||||
public async getVersionOfBSFolder(bsPath: string): Promise<PartialBSVersion>{
|
||||
const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers');
|
||||
if(!this.utilsService.pathExist(versionFilePath)){ return null; }
|
||||
if(!(await pathExist(versionFilePath))){ return null; }
|
||||
const versionsAvailable = await this.remoteVersionService.getAvailableVersions();
|
||||
return new Promise<string>(resolve => {
|
||||
const readLine = createInterface({ input: createReadStream(versionFilePath) });
|
||||
let findVersion: string = null;
|
||||
readLine.on('line', (line) => {
|
||||
return new Promise<PartialBSVersion>(resolve => {
|
||||
const stream = createReadStream(versionFilePath);
|
||||
let findVersion: PartialBSVersion = null;
|
||||
stream.on('data', (line) => {
|
||||
line = line.toString();
|
||||
for(const version of versionsAvailable){
|
||||
if(line.includes(version.BSVersion)){
|
||||
findVersion = version.BSVersion;
|
||||
readLine.close();
|
||||
if(line.includes(version.BSVersion)){
|
||||
findVersion = {BSVersion: version.BSVersion};
|
||||
if(findVersion.BSVersion !== path.basename(bsPath)){
|
||||
findVersion.name = path.basename(bsPath);
|
||||
}
|
||||
stream.close();
|
||||
stream.destroy();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
readLine.on('close', () => {
|
||||
stream.on('end', () => {
|
||||
if(findVersion){ resolve(findVersion) }
|
||||
resolve(findVersion);
|
||||
});
|
||||
stream.on('close', () => {
|
||||
if(findVersion){ resolve(findVersion) }
|
||||
resolve(findVersion);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -79,6 +95,7 @@ export class BSLocalVersionService{
|
||||
|
||||
public async getVersionPath(version: BSVersion): Promise<string>{
|
||||
if(version.steam){ return this.steamService.getGameFolder(BS_APP_ID, "Beat Saber") }
|
||||
if(version.oculus){ return this.oculusService.getGameFolder(OCULUS_BS_DIR); }
|
||||
return path.join(
|
||||
this.installLocationService.versionsDirectory,
|
||||
this.getVersionFolder(version)
|
||||
@@ -86,57 +103,89 @@ export class BSLocalVersionService{
|
||||
}
|
||||
|
||||
private removeSpecialChar(seq: string): string{
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
return seq.replace( /[<>:"\/\\|?*]+/g, '' );
|
||||
return sanitize(seq);
|
||||
}
|
||||
|
||||
public getVersionFolder(version: BSVersion){
|
||||
return version.name ? `${version.BSVersion}-${version.name}` : version.BSVersion;
|
||||
}
|
||||
public getVersionFolder(version: BSVersion): string{
|
||||
return version.name ?? version.BSVersion;
|
||||
}
|
||||
|
||||
public async getInstalledVersions(): Promise<BSVersion[]>{
|
||||
const versions: BSVersion[] = [];
|
||||
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber")
|
||||
if(steamBsFolder && this.utilsService.pathExist(steamBsFolder)){
|
||||
const steamBsVersion = await this.getVersionOfBSFolder(steamBsFolder);
|
||||
if(steamBsVersion){
|
||||
const steamVersionDetails = this.remoteVersionService.getVersionDetails(steamBsVersion);
|
||||
versions.push(steamVersionDetails ? {...steamVersionDetails, steam: true} : {BSVersion: steamBsVersion, steam: true});
|
||||
}
|
||||
}
|
||||
if(!this.utilsService.pathExist(this.installLocationService.versionsDirectory)){ return versions }
|
||||
public getVersionType(version: BSVersion): DownloadLinkType{
|
||||
if(version.steam){ return "steam"; }
|
||||
if(version.oculus){ return "oculus"; }
|
||||
return "universal"
|
||||
}
|
||||
|
||||
const folderInInstallation = this.utilsService.listDirsInDir(this.installLocationService.versionsDirectory);
|
||||
folderInInstallation.forEach(f => {
|
||||
let version = this.remoteVersionService.getVersionDetails(f);
|
||||
if(version){ version = this.getCustomVersions().find(v => v.BSVersion === version.BSVersion && v.name === version.name) ?? version; }
|
||||
else { version = this.getCustomVersions().find(v => {
|
||||
const [version, ...rest] = f.split("-");
|
||||
if(rest.length < 1){ return false; }
|
||||
const name = rest.join("-");
|
||||
return name === v.name && version === v.BSVersion;
|
||||
})
|
||||
}
|
||||
version && versions.push(version);
|
||||
});
|
||||
this.setCustomVersions(versions.filter(v => !!v.name || !!v.color));
|
||||
return versions;
|
||||
private async getSteamVersion(): Promise<BSVersion>{
|
||||
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber");
|
||||
if(!steamBsFolder || !(await pathExist(steamBsFolder))){ return null; }
|
||||
const steamBsVersion = await this.getVersionOfBSFolder(steamBsFolder);
|
||||
|
||||
if(!steamBsVersion){ return null; }
|
||||
const version = await this.remoteVersionService.getVersionDetails(steamBsVersion.BSVersion);
|
||||
if(!version){ return null; }
|
||||
return {...version, steam: true};
|
||||
}
|
||||
|
||||
private async getOculusVersion(): Promise<BSVersion>{
|
||||
const oculusBsFolder = await this.oculusService.getGameFolder(OCULUS_BS_DIR);
|
||||
if(!oculusBsFolder){ return null; }
|
||||
const oculusBsVersion = await this.getVersionOfBSFolder(oculusBsFolder);
|
||||
if(!oculusBsVersion){ return null; }
|
||||
const version = await this.remoteVersionService.getVersionDetails(oculusBsVersion.BSVersion);
|
||||
if(!version){ return null; }
|
||||
return {...version, oculus: true};
|
||||
}
|
||||
|
||||
public async getInstalledVersions(): Promise<BSVersion[]>{
|
||||
|
||||
const versions: BSVersion[] = [];
|
||||
|
||||
const steamVersion = await this.getSteamVersion();
|
||||
if(steamVersion){ versions.push(steamVersion); }
|
||||
|
||||
const oculusVersion = await this.getOculusVersion();
|
||||
if(oculusVersion){ versions.push(oculusVersion); }
|
||||
|
||||
if(!(await pathExist(this.installLocationService.versionsDirectory))){ return versions }
|
||||
|
||||
const folderInInstallation = await getFoldersInFolder(this.installLocationService.versionsDirectory);
|
||||
|
||||
for(const f of folderInInstallation){
|
||||
log.info("try get version from folder", f);
|
||||
const rawVersion = await this.getVersionOfBSFolder(f);
|
||||
if(!rawVersion){ continue; }
|
||||
const bsVersion = {...await this.remoteVersionService.getVersionDetails(rawVersion.BSVersion)};
|
||||
if(!bsVersion){ continue; }
|
||||
bsVersion.name = path.basename(f) !== bsVersion.BSVersion ? path.basename(f) : undefined;
|
||||
|
||||
const customVersion = this.getCustomVersions().find(custom => custom.BSVersion === bsVersion.BSVersion && custom.name === bsVersion.name);
|
||||
|
||||
if(customVersion){
|
||||
bsVersion.color = customVersion.color;
|
||||
}
|
||||
|
||||
versions.push(bsVersion);
|
||||
};
|
||||
this.setCustomVersions(versions.filter(v => !!v.color));
|
||||
|
||||
return versions;
|
||||
}
|
||||
|
||||
public async deleteVersion(version: BSVersion): Promise<boolean>{
|
||||
if(version.steam){ return false; }
|
||||
if(version.steam || version.oculus){ return false; }
|
||||
const versionFolder = await this.getVersionPath(version);
|
||||
if(!this.utilsService.pathExist(versionFolder)){ return true; }
|
||||
if(!(await pathExist(versionFolder))){ return true; }
|
||||
|
||||
return this.utilsService.deleteFolder(versionFolder)
|
||||
return deleteFolder(versionFolder)
|
||||
.then(() => { return true; })
|
||||
.catch(() => { return false; })
|
||||
}
|
||||
|
||||
public async editVersion(version: BSVersion, name: string, color: string): Promise<BSVersion>{
|
||||
if(version.steam){ throw {title: "CantEditSteam", msg: "CantEditSteam"} as BsmException; }
|
||||
if(version.steam || version.oculus){ throw {title: "CantEditSteam", message: "CantEditSteam"} as BsmException; }
|
||||
const oldPath = await this.getVersionPath(version);
|
||||
const editedVersion: BSVersion = version.BSVersion === name
|
||||
const editedVersion: BSVersion = version.BSVersion === name
|
||||
? {...version, name: undefined, color}
|
||||
: {...version, name: this.removeSpecialChar(name), color};
|
||||
const newPath = await this.getVersionPath(editedVersion);
|
||||
@@ -147,38 +196,53 @@ export class BSLocalVersionService{
|
||||
return editedVersion;
|
||||
}
|
||||
|
||||
if(this.utilsService.pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
if((await pathExist(newPath)) && newPath === oldPath){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
|
||||
return rename(oldPath, newPath).then(() => {
|
||||
this.deleteCustomVersion(version);
|
||||
this.addCustomVersion(editedVersion);
|
||||
return editedVersion;
|
||||
}).catch((err: Error) => {
|
||||
throw {title: "CantRename", error: err} as BsmException;
|
||||
log.error("edit version error", err, version, name, color);
|
||||
throw {title: "CantRename", ...err} as BsmException;
|
||||
});
|
||||
}
|
||||
|
||||
public async cloneVersion(version: BSVersion, name: string, color: string): Promise<BSVersion>{
|
||||
const originPath = await this.getVersionPath(version);
|
||||
const cloneVersion: BSVersion = version.BSVersion === name
|
||||
const cloneVersion: BSVersion = version.BSVersion === name
|
||||
? {...version, name: undefined, color}
|
||||
: {...version, name: this.removeSpecialChar(name), color, steam: false};
|
||||
: {...version, name: this.removeSpecialChar(name), color, steam: false, oculus: false};
|
||||
const newPath = await this.getVersionPath(cloneVersion);
|
||||
|
||||
if(originPath === newPath){
|
||||
this.deleteCustomVersion(version);
|
||||
this.addCustomVersion(cloneVersion);
|
||||
return cloneVersion;
|
||||
}
|
||||
|
||||
if(this.utilsService.pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
if(await pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
|
||||
return fs.copy(originPath, newPath).then(() => {
|
||||
return copyDirectoryWithJunctions(originPath, newPath).then(() => {
|
||||
this.addCustomVersion(cloneVersion);
|
||||
return cloneVersion;
|
||||
}).catch((err: Error) => {
|
||||
throw {title: "CantClone", error: err} as BsmException
|
||||
log.error("clone version error", err, version, name, color);
|
||||
throw {title: "CantClone", ...err} as BsmException
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
public async getLinkedFolders(version: BSVersion): Promise<string[]>{
|
||||
const versionPath = await this.getVersionPath(version);
|
||||
const [rootFolders, beatSaberDataFolders] = await Promise.all([
|
||||
getFoldersInFolder(versionPath),
|
||||
getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"))
|
||||
]);
|
||||
|
||||
const linkedFolder = Promise.all([...rootFolders, ...beatSaberDataFolders].map(async folder => {
|
||||
if(!(await this.linker.isFolderSymlink(folder))){ return null; }
|
||||
return folder;
|
||||
}));
|
||||
|
||||
return (await linkedFolder).filter(folder => folder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { get } from 'https'
|
||||
import { UtilsService } from './utils.service';
|
||||
import path from 'path';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import isOnline from 'is-online';
|
||||
import { RequestService } from "./request.service"
|
||||
import { readJSON } from 'fs-extra';
|
||||
import { allSettled } from '../../shared/helpers/promise.helpers';
|
||||
|
||||
export class BSVersionLibService{
|
||||
|
||||
@@ -13,11 +14,13 @@ export class BSVersionLibService{
|
||||
private static instance: BSVersionLibService;
|
||||
|
||||
private utilsService: UtilsService;
|
||||
private requestService: RequestService
|
||||
|
||||
private bsVersions: BSVersion[] = [];
|
||||
private bsVersions: BSVersion[];
|
||||
|
||||
private constructor(){
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.requestService = RequestService.getInstance();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,24 +29,13 @@ export class BSVersionLibService{
|
||||
return BSVersionLibService.instance;
|
||||
}
|
||||
|
||||
private getRemoteVersions(): Promise<BSVersion[]>{
|
||||
return new Promise<BSVersion[]>((resolve, reject) => {
|
||||
let body = ''
|
||||
get(this.REMOTE_BS_VERSIONS_URL, (res) => {
|
||||
res.on('data', chunk => body += chunk);
|
||||
res.on('end', () => {
|
||||
this.bsVersions = JSON.parse(body);
|
||||
resolve(this.bsVersions);
|
||||
});
|
||||
res.on('error', () => reject(null))
|
||||
})
|
||||
})
|
||||
}
|
||||
private getRemoteVersions(): Promise<BSVersion[]>{
|
||||
return this.requestService.get<BSVersion[]>(this.REMOTE_BS_VERSIONS_URL);
|
||||
}
|
||||
|
||||
private async getLocalVersions(): Promise<BSVersion[]>{
|
||||
const localVersionsPath = path.join(this.utilsService.getAssestsJsonsPath(), this.VERSIONS_FILE);
|
||||
const rawVersion = (await this.utilsService.readFileAsync(localVersionsPath)).toString();
|
||||
return JSON.parse(rawVersion);
|
||||
return readJSON(localVersionsPath);
|
||||
}
|
||||
|
||||
private async updateLocalVersions(versions: BSVersion[]): Promise<void>{
|
||||
@@ -52,24 +44,28 @@ export class BSVersionLibService{
|
||||
};
|
||||
|
||||
private async loadBsVersions(): Promise<BSVersion[]>{
|
||||
const [localVersions, remoteVersions] = await Promise.all([
|
||||
this.getLocalVersions(), (await isOnline({timeout: 1500}) && this.getRemoteVersions())
|
||||
]);
|
||||
let resVersions = localVersions;
|
||||
if(remoteVersions && remoteVersions.length){ resVersions = remoteVersions; this.updateLocalVersions(resVersions); }
|
||||
this.bsVersions = resVersions;
|
||||
return this.bsVersions;
|
||||
}
|
||||
|
||||
if(this.bsVersions){ return this.bsVersions; }
|
||||
|
||||
const [localVersions, remoteVersions] = await allSettled([
|
||||
this.getLocalVersions(), this.getRemoteVersions()
|
||||
], {keepStructure: true});
|
||||
|
||||
let resVersions = localVersions;
|
||||
if(remoteVersions && remoteVersions.length){ resVersions = remoteVersions; this.updateLocalVersions(resVersions); }
|
||||
this.bsVersions = resVersions;
|
||||
return this.bsVersions;
|
||||
}
|
||||
|
||||
public async getAvailableVersions(): Promise<BSVersion[]>{
|
||||
if(this.bsVersions && this.bsVersions.length){ return this.bsVersions; }
|
||||
const bsVersions = await this.loadBsVersions();
|
||||
if(!bsVersions || !bsVersions.length){ return []; }
|
||||
return bsVersions;
|
||||
}
|
||||
|
||||
public getVersionDetails(version: string): BSVersion{
|
||||
return this.bsVersions.find(v => v.BSVersion === version);
|
||||
}
|
||||
public async getVersionDetails(version: string): Promise<BSVersion>{
|
||||
const versions = await this.getAvailableVersions();
|
||||
return versions.find(v => v.BSVersion === version);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +1,37 @@
|
||||
import ElectronStore from "electron-store";
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
|
||||
export class ConfigurationService {
|
||||
|
||||
private static instance: ConfigurationService;
|
||||
|
||||
private readonly _store: ElectronStore;
|
||||
|
||||
public static getInstance(): ConfigurationService{
|
||||
if(!ConfigurationService.instance){ ConfigurationService.instance = new ConfigurationService(); }
|
||||
return ConfigurationService.instance;
|
||||
}
|
||||
|
||||
private readonly locations: InstallationLocationService;
|
||||
|
||||
private store: ElectronStore;
|
||||
|
||||
private constructor(){
|
||||
this._store = new ElectronStore();
|
||||
this.locations = InstallationLocationService.getInstance();
|
||||
this.initStore();
|
||||
|
||||
this.locations.onInstallLocationUpdate(() => this.initStore());
|
||||
|
||||
}
|
||||
|
||||
public get store(): ElectronStore{ return this._store; }
|
||||
private initStore(){
|
||||
const contentPath = this.locations.installationDirectory;
|
||||
this.store = new ElectronStore({
|
||||
cwd: contentPath,
|
||||
name: "config",
|
||||
fileExtension: "cfg",
|
||||
});
|
||||
}
|
||||
|
||||
public set(key: string, value: any): void{
|
||||
public set(key: string, value: unknown): void{
|
||||
this.store.set(key, value);
|
||||
}
|
||||
|
||||
@@ -29,4 +43,4 @@ export class ConfigurationService {
|
||||
this.store.delete(key);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
import { app } from "electron";
|
||||
import path from "path";
|
||||
import { URL } from "url";
|
||||
import log from "electron-log"
|
||||
|
||||
export class DeepLinkService {
|
||||
|
||||
// See docs : https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app#main-process-mainjs
|
||||
|
||||
private static instance: DeepLinkService;
|
||||
|
||||
public static getInstance(): DeepLinkService{
|
||||
if(!DeepLinkService.instance){ DeepLinkService.instance = new DeepLinkService(); }
|
||||
return DeepLinkService.instance;
|
||||
}
|
||||
|
||||
private readonly listeners = new Map<string, Listerner[]>()
|
||||
|
||||
private constructor(){}
|
||||
|
||||
public registerDeepLink(protocol: string): boolean{
|
||||
|
||||
if(process.defaultApp && process.argv.length >= 2){
|
||||
return app.setAsDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1])]);
|
||||
}
|
||||
|
||||
return app.setAsDefaultProtocolClient(protocol);
|
||||
}
|
||||
|
||||
public unRegisterDeepLink(protocol: string): boolean{
|
||||
|
||||
if(process.defaultApp && process.argv.length >= 2) {
|
||||
return app.removeAsDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1])]);
|
||||
}
|
||||
|
||||
return app.removeAsDefaultProtocolClient(protocol);
|
||||
}
|
||||
|
||||
public isDeepLinkRegistred(protocol: string): boolean{
|
||||
|
||||
if(process.defaultApp && process.argv.length >= 2) {
|
||||
return app.isDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1])]);
|
||||
}
|
||||
|
||||
return app.isDefaultProtocolClient(protocol);
|
||||
}
|
||||
|
||||
public addLinkOpenedListener(protocol: string, fn: Listerner){
|
||||
|
||||
if(!this.listeners.has(protocol)){
|
||||
this.listeners.set(protocol, [] as Listerner[]);
|
||||
}
|
||||
|
||||
this.listeners.get(protocol).push(fn);
|
||||
}
|
||||
|
||||
public removeLinkOpenedListener(protocol: string, fn: Listerner){
|
||||
|
||||
if(!this.listeners.get(protocol)?.length){ return; }
|
||||
|
||||
const listeners = this.listeners.get(protocol);
|
||||
const fnIndex = listeners.findIndex(listener => listener === fn);
|
||||
|
||||
if(fnIndex < 0){ return; }
|
||||
|
||||
listeners.splice(fnIndex, 1);
|
||||
|
||||
}
|
||||
|
||||
public dispatchLinkOpened(link: string){
|
||||
|
||||
log.info("DEISPATCH", link);
|
||||
|
||||
const url = new URL(link);
|
||||
|
||||
const protocolListeners = this.listeners.get(url.protocol.replace(":", "")) ?? [];
|
||||
|
||||
protocolListeners.forEach(listerner => {
|
||||
listerner(link);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public isDeepLink(link: string): boolean{
|
||||
|
||||
try{
|
||||
const url = new URL(link);
|
||||
const protocol = url.protocol.replace(":", "");
|
||||
return Array.from(this.listeners.keys()).some(key => key === protocol);
|
||||
}
|
||||
catch(e){
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
type Listerner = (link: string) => void;
|
||||
@@ -0,0 +1,122 @@
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import log from "electron-log";
|
||||
import { deleteFolder, ensureFolderExist, moveFolderContent, pathExist, unlinkPath } from "../helpers/fs.helpers";
|
||||
import { lstat, symlink } from "fs/promises";
|
||||
import path from "path";
|
||||
import { copy, readlink } from "fs-extra";
|
||||
|
||||
export class FolderLinkerService {
|
||||
|
||||
private static instance: FolderLinkerService;
|
||||
|
||||
public static getInstance(): FolderLinkerService {
|
||||
if (!FolderLinkerService.instance) {
|
||||
FolderLinkerService.instance = new FolderLinkerService();
|
||||
}
|
||||
return FolderLinkerService.instance;
|
||||
}
|
||||
|
||||
private readonly installLocationService = InstallationLocationService.getInstance();
|
||||
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
}
|
||||
|
||||
private get sharedFolder(): string{
|
||||
return this.installLocationService.sharedContentPath;
|
||||
}
|
||||
|
||||
private getSharedFolder(folderPath: string, intermediateFolder?: string): string {
|
||||
return path.join(this.sharedFolder, intermediateFolder ?? "", path.basename(folderPath));
|
||||
}
|
||||
|
||||
private getBackupFolder(folderPath: string): string {
|
||||
return folderPath + "_backup";
|
||||
}
|
||||
|
||||
private async backupFolder(folderPath: string): Promise<void> {
|
||||
if(!await pathExist(folderPath)){ return; }
|
||||
return copy(folderPath, this.getBackupFolder(folderPath), { overwrite: true, errorOnExist: false });
|
||||
}
|
||||
|
||||
private async restoreFolder(folderPath: string): Promise<void> {
|
||||
if(!await pathExist( this.getBackupFolder(folderPath) )){ return; }
|
||||
return copy(this.getBackupFolder(folderPath), folderPath, { overwrite: true, errorOnExist: false }).then(() => {
|
||||
return deleteFolder(this.getBackupFolder(folderPath));
|
||||
});
|
||||
}
|
||||
|
||||
public async linkFolder(folderPath: string, options?: LinkOptions): Promise<void> {
|
||||
|
||||
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder);
|
||||
|
||||
if(await this.isFolderSymlink(folderPath)){
|
||||
const isTargetedToSharedPath = await readlink(folderPath).then(target => target === sharedPath).catch(() => false);
|
||||
if(isTargetedToSharedPath){ return; }
|
||||
await unlinkPath(folderPath);
|
||||
return symlink(sharedPath, folderPath, "junction");
|
||||
}
|
||||
|
||||
await ensureFolderExist(sharedPath);
|
||||
|
||||
if(options?.backup === true){
|
||||
await this.backupFolder(folderPath);
|
||||
}
|
||||
|
||||
await ensureFolderExist(folderPath);
|
||||
|
||||
if(options?.keepContents !== false){
|
||||
await moveFolderContent(folderPath, sharedPath).toPromise();
|
||||
}
|
||||
|
||||
await deleteFolder(folderPath);
|
||||
|
||||
return symlink(sharedPath, folderPath, "junction");
|
||||
}
|
||||
|
||||
public async unlinkFolder(folderPath: string, options?: UnlinkOptions): Promise<void> {
|
||||
|
||||
if(!(await this.isFolderSymlink(folderPath))){ return; }
|
||||
await unlinkPath(folderPath);
|
||||
|
||||
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder);
|
||||
|
||||
await ensureFolderExist(folderPath);
|
||||
|
||||
if(options?.backup === true){
|
||||
return this.restoreFolder(folderPath);
|
||||
}
|
||||
|
||||
if(options.moveContents === true){
|
||||
return moveFolderContent(sharedPath, folderPath).toPromise().then(() => {});
|
||||
}
|
||||
|
||||
if(options?.keepContents === false){ return; }
|
||||
|
||||
await ensureFolderExist(sharedPath);
|
||||
|
||||
return copy(sharedPath, folderPath, { errorOnExist: false, recursive: true });
|
||||
}
|
||||
|
||||
public async isFolderSymlink(folder: string): Promise<boolean> {
|
||||
try{
|
||||
if(!(await pathExist(folder))){ return false; }
|
||||
return lstat(folder).then(stat => stat.isSymbolicLink());
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface LinkOptions {
|
||||
keepContents?: boolean,
|
||||
intermediateFolder?: string,
|
||||
backup?: boolean,
|
||||
}
|
||||
|
||||
export interface UnlinkOptions extends LinkOptions {
|
||||
moveContents?: boolean,
|
||||
};
|
||||
@@ -1,59 +1,82 @@
|
||||
import path from "path";
|
||||
import { ConfigurationService } from "./configuration.service";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import fs from 'fs-extra';
|
||||
import log from "electron-log";
|
||||
import { app } from "electron";
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
import ElectronStore from "electron-store";
|
||||
import { copyDirectoryWithJunctions, deleteFolder, ensureFolderExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class InstallationLocationService {
|
||||
|
||||
private static instance: InstallationLocationService;
|
||||
|
||||
public static getInstance(): InstallationLocationService{
|
||||
if(!InstallationLocationService.instance){ InstallationLocationService.instance = new InstallationLocationService(); }
|
||||
return InstallationLocationService.instance;
|
||||
}
|
||||
|
||||
private readonly INSTALLATION_FOLDER = "BSManager";
|
||||
private readonly VERSIONS_FOLDER = "BSInstances";
|
||||
|
||||
private readonly SHARED_CONTENT_FOLDER = "SharedContent";
|
||||
|
||||
private readonly STORE_INSTALLATION_PATH_KEY = "installation-folder";
|
||||
|
||||
|
||||
private readonly configService: ConfigurationService;
|
||||
private readonly utilsService: UtilsService;
|
||||
|
||||
private readonly installPathConfig: ElectronStore;
|
||||
private readonly updateListeners: Set<Listener> = new Set();
|
||||
|
||||
private _installationDirectory: string;
|
||||
|
||||
public static getInstance(): InstallationLocationService{
|
||||
if(!InstallationLocationService.instance){ InstallationLocationService.instance = new InstallationLocationService(); }
|
||||
return InstallationLocationService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.configService = ConfigurationService.getInstance();
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.installPathConfig = new ElectronStore({watch: true});
|
||||
this.initInstallationLocation();
|
||||
|
||||
this.installPathConfig.onDidChange(this.STORE_INSTALLATION_PATH_KEY, () => {
|
||||
this.triggerListeners();
|
||||
})
|
||||
}
|
||||
|
||||
private initInstallationLocation(): void{
|
||||
this._installationDirectory = this.configService.get<string>(this.STORE_INSTALLATION_PATH_KEY) || app.getPath("documents");
|
||||
this._installationDirectory = this.installPathConfig.get<string>(this.STORE_INSTALLATION_PATH_KEY) as string || app.getPath("documents");
|
||||
}
|
||||
|
||||
public get installationDirectory(): string{ return path.join(this._installationDirectory, this.INSTALLATION_FOLDER); }
|
||||
public get versionsDirectory(): string { return path.join(this.installationDirectory, this.VERSIONS_FOLDER); }
|
||||
private triggerListeners(): void{
|
||||
this.updateListeners.forEach(listener => listener());
|
||||
}
|
||||
|
||||
public setInstallationDirectory(newDir: string): Promise<string>{
|
||||
const oldDir = this.installationDirectory;
|
||||
const newDest = path.join(newDir, this.INSTALLATION_FOLDER);
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
if(!this.utilsService.pathExist(oldDir)){ this.utilsService.createFolderIfNotExist(oldDir); }
|
||||
fs.move(oldDir, newDest, { overwrite: true }).then(() => {
|
||||
return new Promise<string>(async (resolve, reject) => {
|
||||
|
||||
await ensureFolderExist(oldDir);
|
||||
|
||||
try{
|
||||
await copyDirectoryWithJunctions(oldDir, newDest, {overwrite: true});
|
||||
|
||||
this._installationDirectory = newDir;
|
||||
this.configService.store.set(this.STORE_INSTALLATION_PATH_KEY, newDir);
|
||||
resolve(this.installationDirectory);
|
||||
}).catch((err: Error) => {
|
||||
reject({title: "CantMoveFolder", error: err} as BsmException);
|
||||
this.installPathConfig.set(this.STORE_INSTALLATION_PATH_KEY, newDir);
|
||||
|
||||
deleteFolder(oldDir);
|
||||
|
||||
return resolve(this.installationDirectory);
|
||||
}
|
||||
catch(err){
|
||||
log.error(err);
|
||||
})
|
||||
})
|
||||
|
||||
reject(err);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
public onInstallLocationUpdate(fn: Listener){
|
||||
this.updateListeners.add(fn);
|
||||
}
|
||||
|
||||
public get installationDirectory(): string{ return path.join(this._installationDirectory, this.INSTALLATION_FOLDER); }
|
||||
|
||||
public get versionsDirectory(): string { return path.join(this.installationDirectory, this.VERSIONS_FOLDER); }
|
||||
|
||||
public get sharedContentPath(): string { return path.join(this.installationDirectory, this.SHARED_CONTENT_FOLDER); }
|
||||
|
||||
}
|
||||
|
||||
type Listener = () => void;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { ipcMain } from "electron";
|
||||
import { Observable } from "rxjs";
|
||||
import { IpcChannel, IpcCompleteChannel, IpcErrorChannel } from "shared/models/ipc/ipc-response.interface";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { IpcReplier } from "shared/models/ipc/ipc-request.interface";
|
||||
import log from "electron-log";
|
||||
|
||||
export class IpcService {
|
||||
|
||||
private static instance: IpcService;
|
||||
|
||||
public static getInstance(): IpcService {
|
||||
if (!IpcService.instance) { IpcService.instance = new IpcService(); }
|
||||
return IpcService.instance;
|
||||
}
|
||||
|
||||
private readonly windows: WindowManagerService;
|
||||
|
||||
private constructor() {
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
}
|
||||
|
||||
private getErrorChannel(channel: IpcChannel): IpcErrorChannel {
|
||||
return `${channel}_error`;
|
||||
}
|
||||
|
||||
private getCompleteChannel(channel: IpcChannel): IpcCompleteChannel {
|
||||
return `${channel}_complete`;
|
||||
}
|
||||
|
||||
private buildProxyListener<T>(listener: (req: IpcRequest<T>, replier: IpcReplier) => void) {
|
||||
|
||||
return (event: Electron.IpcMainEvent, req: IpcRequest<T>) => {
|
||||
const window = this.windows.getAppWindowFromWebContents(event.sender);
|
||||
const replier = (data: Observable<unknown>) => this.connectStream(req.responceChannel, window, data);
|
||||
listener(req, replier);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public send<T>(channel: IpcChannel, window: AppWindow, response?: T|Error): void{
|
||||
this.windows.getWindow(window)?.webContents?.send(channel, response);
|
||||
}
|
||||
|
||||
public connectStream(channel: IpcChannel, window: AppWindow, observable: Observable<unknown>): void{
|
||||
observable.subscribe(data => {
|
||||
this.send(channel, window, data);
|
||||
}, error => {
|
||||
log.error(error);
|
||||
this.send(this.getErrorChannel(channel), window, error);
|
||||
}, () => {
|
||||
this.send(this.getCompleteChannel(channel), window);
|
||||
});
|
||||
}
|
||||
|
||||
public on<T>(channel: IpcChannel, listener: (req: IpcRequest<T>, replier: IpcReplier) => void): void{
|
||||
ipcMain.on(channel, this.buildProxyListener(listener));
|
||||
}
|
||||
|
||||
public once<T>(channel: IpcChannel, listener: (req: IpcRequest<T>, replier: IpcReplier) => void): void{
|
||||
ipcMain.once(channel, this.buildProxyListener(listener));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import path from "path";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import archiver from "archiver";
|
||||
import { createWriteStream } from "fs";
|
||||
import log from "electron-log";
|
||||
|
||||
export class MapService{
|
||||
|
||||
private readonly MAP_PATH = path.join("Beat Saber_Data", "CustomLevels");
|
||||
|
||||
private static instance: MapService;
|
||||
|
||||
private readonly localVersionService: BSLocalVersionService;
|
||||
|
||||
public static getInstance(): MapService{
|
||||
if(!MapService.instance){ MapService.instance = new MapService(); }
|
||||
return MapService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.localVersionService = BSLocalVersionService.getInstance();
|
||||
}
|
||||
|
||||
private getMapsPath(versionPath: string): string{
|
||||
return path.join(versionPath, this.MAP_PATH);
|
||||
}
|
||||
|
||||
public async exportVersionMaps(version: BSVersion, outputZip: string): Promise<void>{
|
||||
const versionPath = await this.localVersionService.getVersionPath(version);
|
||||
const mapsPath = this.getMapsPath(versionPath);
|
||||
|
||||
const output = createWriteStream(outputZip);
|
||||
const archive = archiver("zip", {zlib: {level: 9}});
|
||||
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
archive.pipe(output);
|
||||
archive.directory(mapsPath, false);
|
||||
archive.on("error", reject);
|
||||
output.on("close", resolve);
|
||||
archive.finalize()
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { Mod } from "shared/models/mods/mod.interface";
|
||||
import { RequestService } from "../request.service";
|
||||
|
||||
export class BeatModsApiService {
|
||||
|
||||
private static instance: BeatModsApiService;
|
||||
|
||||
private readonly requestService: RequestService;
|
||||
|
||||
private readonly BEAT_MODS_VERSIONS = "https://versions.beatmods.com/versions.json";
|
||||
private readonly BEAT_MODS_ALIAS = "https://alias.beatmods.com/aliases.json";
|
||||
|
||||
private readonly BEAT_MODS_API_URL = "https://beatmods.com/api/v1/";
|
||||
public readonly BEAT_MODS_URL = "https://beatmods.com";
|
||||
|
||||
private readonly aliasesCache = new Map<string, BSVersion[]>();
|
||||
private readonly versionModsCache = new Map<string, Mod[]>();
|
||||
|
||||
private allModsCache: Mod[];
|
||||
|
||||
public static getInstance(): BeatModsApiService{
|
||||
if(!BeatModsApiService.instance){ BeatModsApiService.instance = new BeatModsApiService(); }
|
||||
return BeatModsApiService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.requestService = RequestService.getInstance();
|
||||
}
|
||||
|
||||
private getVersionModsUrl(version: BSVersion): string{
|
||||
return `${this.BEAT_MODS_API_URL}mod?status=approved&gameVersion=${version.BSVersion}&sort=&sortDirection=1`;
|
||||
}
|
||||
|
||||
private getAllModsUrl(): string{
|
||||
return `${this.BEAT_MODS_API_URL}mod`;
|
||||
}
|
||||
|
||||
private async getVersionAlias(): Promise<Map<string, BSVersion[]>>{
|
||||
if(this.aliasesCache.size){ return this.aliasesCache; }
|
||||
return this.requestService.get<Record<string, string[]>>(this.BEAT_MODS_ALIAS).then(rawAliases => {
|
||||
Object.entries(rawAliases).forEach(([key, value]) => {
|
||||
this.aliasesCache.set(key, value.map(s => ({BSVersion: s} as BSVersion)));
|
||||
});
|
||||
return this.aliasesCache;
|
||||
})
|
||||
}
|
||||
|
||||
private async getAliasOfVersion(version: BSVersion): Promise<BSVersion>{
|
||||
return this.getVersionAlias().then(aliases => {
|
||||
if(Array.from(aliases.keys()).some(k => k === version.BSVersion)){ return version; }
|
||||
const alias = Array.from(aliases.entries()).find(([key, value]) => value.find(v => v.BSVersion === version.BSVersion))[0];
|
||||
return {BSVersion: alias} as BSVersion
|
||||
});
|
||||
}
|
||||
|
||||
private asignDependencies(mod: Mod, mods: Mod[]): Mod{
|
||||
mod.dependencies = mod.dependencies.map(dep => mods.find(mod => mod.name === dep.name));
|
||||
return mod;
|
||||
}
|
||||
|
||||
public async getVersionMods(version: BSVersion): Promise<Mod[]>{
|
||||
if(this.versionModsCache.has(version.BSVersion)){ return this.versionModsCache.get(version.BSVersion); }
|
||||
|
||||
const alias = await this.getAliasOfVersion(version);
|
||||
|
||||
return this.requestService.get<Mod[]>(this.getVersionModsUrl(alias)).then(mods => {
|
||||
mods = mods.map(mod => this.asignDependencies(mod, mods));
|
||||
this.versionModsCache.set(version.BSVersion, mods);
|
||||
return mods;
|
||||
});
|
||||
}
|
||||
|
||||
public async getAllMods(): Promise<Mod[]>{
|
||||
if(!!this.allModsCache){ return this.allModsCache; }
|
||||
return this.requestService.get<Mod[]>(this.getAllModsUrl()).then(mods => {
|
||||
this.allModsCache = mods;
|
||||
return this.allModsCache;
|
||||
});
|
||||
}
|
||||
|
||||
public loadAllMods(){ return this.getAllMods(); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { DownloadLink, InstallModsResult, Mod, ModInstallProgression, UninstallModsResult } from "shared/models/mods";
|
||||
import { BeatModsApiService } from "./beat-mods-api.service";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service"
|
||||
import path from "path";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import md5File from "md5-file";
|
||||
import fs from "fs"
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import { spawn } from "child_process";
|
||||
import { BS_EXECUTABLE } from "../../constants";
|
||||
import log from "electron-log";
|
||||
import { deleteFolder, ensureFolderExist, pathExist, unlinkPath } from "../../helpers/fs.helpers";
|
||||
import { lastValueFrom } from "rxjs";
|
||||
|
||||
export class BsModsManagerService {
|
||||
|
||||
private static instance: BsModsManagerService;
|
||||
|
||||
private readonly beatModsApi: BeatModsApiService;
|
||||
private readonly bsLocalService: BSLocalVersionService;
|
||||
private readonly utilsService: UtilsService;
|
||||
private readonly requestService: RequestService
|
||||
|
||||
private manifestMatches: Mod[];
|
||||
|
||||
private nbModsToInstall = 0;
|
||||
private nbInstalledMods = 0;
|
||||
|
||||
private nbModsToUninstall = 0;
|
||||
private nbUninstalledMods = 0;
|
||||
|
||||
public static getInstance(): BsModsManagerService{
|
||||
if(!BsModsManagerService.instance){ BsModsManagerService.instance = new BsModsManagerService(); }
|
||||
return BsModsManagerService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.beatModsApi = BeatModsApiService.getInstance();
|
||||
this.bsLocalService = BSLocalVersionService.getInstance();
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.requestService = RequestService.getInstance();
|
||||
}
|
||||
|
||||
private async getModFromHash(hash: string): Promise<Mod>{
|
||||
const allMods = await this.beatModsApi.getAllMods();
|
||||
return allMods.find(mod => {
|
||||
if(mod.name.toLowerCase() === "bsipa" || mod.status === "declined"){ return false; }
|
||||
return mod.downloads.some(download => download.hashMd5.some(md5 => md5.hash === hash));
|
||||
})
|
||||
}
|
||||
|
||||
private async getIpaFromHash(hash: string): Promise<Mod>{
|
||||
const allMods = await this.beatModsApi.getAllMods();
|
||||
return allMods.find(mod => {
|
||||
if(mod.name.toLowerCase() !== "bsipa"){ return false; }
|
||||
return mod.downloads.some(download => download.hashMd5.some(md5 => md5.hash === hash));
|
||||
})
|
||||
}
|
||||
|
||||
private async getModsInDir(version: BSVersion, modsDir: ModsInstallFolder): Promise<Mod[]>{
|
||||
const bsPath = await this.bsLocalService.getVersionPath(version);
|
||||
const modsPath = path.join(bsPath, modsDir);
|
||||
if(!(await pathExist(modsPath))){ return []; }
|
||||
const files = fs.readdirSync(modsPath);
|
||||
const promises = files.map(f => {
|
||||
return (async() => {
|
||||
const filePath = path.join(modsPath, f)
|
||||
const ext = path.extname(f);
|
||||
if(ext !== ".dll" && ext !== ".exe" && ext !== ".manifest"){ return undefined; }
|
||||
const hash = await md5File(filePath);
|
||||
const mod = await this.getModFromHash(hash);
|
||||
if(!mod){ return undefined; }
|
||||
if(ext === ".manifest"){
|
||||
this.manifestMatches.push(mod);
|
||||
return undefined;
|
||||
}
|
||||
if(filePath.includes("Libs")){
|
||||
if(!this.manifestMatches.some(m => m.name === mod.name)){ return undefined; }
|
||||
const modIndex = this.manifestMatches.indexOf(mod);
|
||||
if(modIndex > -1){ this.manifestMatches.splice(modIndex, 1); }
|
||||
}
|
||||
return mod;
|
||||
})()
|
||||
});
|
||||
const mods = await Promise.all(promises)
|
||||
return mods.filter(m => !!m);
|
||||
}
|
||||
|
||||
private async getBsipaInstalled(version: BSVersion): Promise<Mod>{
|
||||
const bsPath = await this.bsLocalService.getVersionPath(version);
|
||||
const injectorPath = path.join(bsPath, "Beat Saber_Data", "Managed", "IPA.Injector.dll");
|
||||
if(!(await pathExist(injectorPath))){ return undefined; }
|
||||
const injectorMd5 = await md5File(injectorPath);
|
||||
return this.getIpaFromHash(injectorMd5);
|
||||
}
|
||||
|
||||
private async downloadZip(zipUrl: string): Promise<{zip: StreamZip.StreamZipAsync, zipPath: string}>{
|
||||
zipUrl = path.join(this.beatModsApi.BEAT_MODS_URL, zipUrl);
|
||||
const fileName = path.basename(zipUrl);
|
||||
const tempPath = this.utilsService.getTempPath();
|
||||
await ensureFolderExist(this.utilsService.getTempPath());
|
||||
const dest = path.join(tempPath, fileName);
|
||||
|
||||
const zipPath = (await lastValueFrom(this.requestService.downloadFile(zipUrl, dest))).data;
|
||||
const zip = new StreamZip.async({file : zipPath});
|
||||
|
||||
return {zip, zipPath};
|
||||
}
|
||||
|
||||
private async executeBSIPA(version: BSVersion, args: string[]): Promise<boolean>{
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
const ipaPath = path.join(versionPath, "IPA.exe");
|
||||
const bsExePath = path.join(versionPath, BS_EXECUTABLE);
|
||||
if(!(await pathExist(ipaPath)) || !(await pathExist(bsExePath))){ return false; }
|
||||
|
||||
return new Promise<boolean>(resolve => {
|
||||
const processIPA = spawn(`start /wait /min "" "${ipaPath}" ${args.join(" ")}`, {cwd: versionPath, detached: true, shell: true});
|
||||
processIPA.once("exit", code => {
|
||||
if(code === 0){ return resolve(true); }
|
||||
log.error("IPA PROCESS", "exit code", code);
|
||||
resolve(false);
|
||||
});
|
||||
|
||||
setTimeout(() => resolve(false), (1 * 60) * 1000); //timeout 1min
|
||||
});
|
||||
}
|
||||
|
||||
private getModDownload(mod: Mod, version: BSVersion): DownloadLink{
|
||||
return mod.downloads.find(download => {
|
||||
const type = download.type.toLowerCase()
|
||||
return type === "universal" || type === this.bsLocalService.getVersionType(version);
|
||||
});
|
||||
}
|
||||
|
||||
private async installMod(mod: Mod, version: BSVersion): Promise<boolean>{
|
||||
|
||||
this.utilsService.ipcSend<ModInstallProgression>("mod-installed", {success: true, data: {name: mod.name, progression: ((this.nbInstalledMods + 1) / this.nbModsToInstall) * 100}})
|
||||
|
||||
const download = this.getModDownload(mod, version);
|
||||
|
||||
if(!download){ return false; }
|
||||
|
||||
const {zip, zipPath} = await this.downloadZip(download.url);
|
||||
|
||||
if(!zip){ return false; }
|
||||
|
||||
const crypto = require('crypto');
|
||||
const entries = await zip.entries();
|
||||
|
||||
const checkedEntries = (await Promise.all(Object.values(entries).map(async (entry) => {
|
||||
if(!entry.isFile){ return undefined; }
|
||||
const data = await zip.entryData(entry);
|
||||
const entryMd5 = crypto.createHash('md5').update(data).digest('hex')
|
||||
return download.hashMd5.some(md5 => md5.hash === entryMd5) ? entry : undefined;
|
||||
}))).filter(entry => !!entry);
|
||||
|
||||
if(checkedEntries.length != download.hashMd5.length){ return false; }
|
||||
|
||||
const verionPath = await this.bsLocalService.getVersionPath(version);
|
||||
const isBSIPA = mod.name.toLowerCase() === "bsipa";
|
||||
const destDir = isBSIPA ? verionPath : path.join(verionPath, ModsInstallFolder.PENDING);
|
||||
|
||||
const extracted = await zip.extract(null, destDir).then(() => true).catch(err => {log.error(err); return false});
|
||||
|
||||
await zip.close();
|
||||
await unlinkPath(zipPath);
|
||||
|
||||
const res = isBSIPA ? (extracted && (await this.executeBSIPA(version, ["-n"]))) : extracted;
|
||||
|
||||
res && this.nbInstalledMods++;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private isDependency(mod: Mod, selectedMods: Mod[], availableMods: Mod[]){
|
||||
return selectedMods.some(m => {
|
||||
const deps = m.dependencies.map(dep => Array.from(availableMods.values()).find(m => dep.name === m.name));
|
||||
if(deps.some(depMod => depMod.name === mod.name)){ return true; }
|
||||
return deps.some(depMod => depMod.dependencies.some(depModDep => depModDep.name === mod.name));
|
||||
});
|
||||
}
|
||||
|
||||
private async resolveDependencies(mods: Mod[], version: BSVersion): Promise<Mod[]>{
|
||||
const availableMods = await this.beatModsApi.getVersionMods(version);
|
||||
return Array.from(new Map<string, Mod>(availableMods.reduce((res, mod) => {
|
||||
if(this.isDependency(mod, mods, availableMods)){
|
||||
res.push([mod.name, mod]);
|
||||
}
|
||||
return res;
|
||||
}, [])).values());
|
||||
}
|
||||
|
||||
private async uninstallBSIPA(mod: Mod, version: BSVersion): Promise<void>{
|
||||
const download = this.getModDownload(mod, version);
|
||||
|
||||
const verionPath = await this.bsLocalService.getVersionPath(version);
|
||||
const hasIPAExe = await pathExist(path.join(verionPath, "IPA.exe"));
|
||||
const hasIPADir = await pathExist(path.join(verionPath, "IPA"));
|
||||
|
||||
if(!hasIPADir || !hasIPAExe){ return; }
|
||||
|
||||
await this.executeBSIPA(version, ["--revert", "-n"]);
|
||||
|
||||
const promises = download.hashMd5.map(files => {
|
||||
const file = files.file.replaceAll("IPA/", "").replaceAll("Data", "Beat Saber_Data");
|
||||
return unlinkPath(path.join(verionPath, file));
|
||||
})
|
||||
|
||||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
private async uninstallMod(mod: Mod, version: BSVersion): Promise<void>{
|
||||
|
||||
this.nbUninstalledMods++;
|
||||
this.utilsService.ipcSend<ModInstallProgression>("mod-uninstalled", {success: true, data: {name: mod.name, progression: (this.nbUninstalledMods / this.nbModsToUninstall) * 100}})
|
||||
|
||||
if(mod.name.toLowerCase() === "bsipa"){ return this.uninstallBSIPA(mod, version); }
|
||||
|
||||
const download = this.getModDownload(mod, version);
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
|
||||
const promises = download.hashMd5.map(async files => {
|
||||
return Promise.all([
|
||||
unlinkPath(path.join(versionPath, files.file)),
|
||||
unlinkPath(path.join(versionPath, "IPA", "Pending", files.file))
|
||||
]);
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
public getAvailableMods(version: BSVersion): Promise<Mod[]>{
|
||||
return this.beatModsApi.getVersionMods(version);
|
||||
}
|
||||
|
||||
public async getInstalledMods(version: BSVersion): Promise<Mod[]>{
|
||||
this.manifestMatches = [];
|
||||
await this.beatModsApi.loadAllMods();
|
||||
const bsipa = await this.getBsipaInstalled(version);
|
||||
return Promise.all([
|
||||
this.getModsInDir(version, ModsInstallFolder.PLUGINS_PENDING),
|
||||
this.getModsInDir(version, ModsInstallFolder.LIBS_PENDING),
|
||||
this.getModsInDir(version, ModsInstallFolder.PLUGINS),
|
||||
this.getModsInDir(version, ModsInstallFolder.LIBS)
|
||||
]).then(dirMods => {
|
||||
const res = [];
|
||||
if(!!bsipa){ res.push(bsipa); }
|
||||
const installedMods = Array.from(new Map<string, Mod>(dirMods.flat().map(m => [m.name, m])).values());
|
||||
res.push(...installedMods);
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
public async installMods(mods: Mod[], version: BSVersion): Promise<InstallModsResult>{
|
||||
if(!mods || !mods.length){ throw "no-mods"; }
|
||||
|
||||
const deps = await this.resolveDependencies(mods, version);
|
||||
mods.push(...deps);
|
||||
|
||||
const bsipa = mods.find(mod => mod.name.toLowerCase() === "bsipa");
|
||||
if(bsipa){ mods = mods.filter(mod => mod.name.toLowerCase() !== "bsipa"); }
|
||||
|
||||
this.nbModsToInstall = mods.length + (bsipa && 1);
|
||||
this.nbInstalledMods = 0;
|
||||
|
||||
if(bsipa){
|
||||
const installed = await this.installMod(bsipa, version).catch(err => {log.error("INSTALL BSIPA", err); return false; })
|
||||
if(!installed){ throw "cannot-install-bsipa"; }
|
||||
}
|
||||
|
||||
for(const mod of mods){
|
||||
await this.installMod(mod, version);;
|
||||
}
|
||||
|
||||
return {
|
||||
nbModsToInstall: this.nbModsToInstall,
|
||||
nbInstalledMods: this.nbInstalledMods
|
||||
};
|
||||
}
|
||||
|
||||
public async uninstallMods(mods: Mod[], version: BSVersion): Promise<UninstallModsResult>{
|
||||
if(!mods || !mods.length){ throw "no-mods"; }
|
||||
|
||||
this.nbModsToUninstall = mods.length;
|
||||
this.nbUninstalledMods = 0;
|
||||
|
||||
for(const mod of mods){
|
||||
await this.uninstallMod(mod, version);
|
||||
}
|
||||
|
||||
return {
|
||||
nbModsToUninstall: this.nbModsToUninstall,
|
||||
nbUninstalledMods: this.nbUninstalledMods
|
||||
};
|
||||
}
|
||||
|
||||
public async uninstallAllMods(version: BSVersion): Promise<UninstallModsResult>{
|
||||
const mods = await this.getInstalledMods(version);
|
||||
|
||||
if(!mods || !mods.length){ throw "no-mods"; }
|
||||
|
||||
this.nbModsToUninstall = mods.length;
|
||||
this.nbUninstalledMods = 0;
|
||||
|
||||
for(const mod of mods){
|
||||
await this.uninstallMod(mod, version);
|
||||
}
|
||||
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.PLUGINS));
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.LIBS));
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.IPA));
|
||||
|
||||
path.resolve
|
||||
|
||||
return {
|
||||
nbModsToUninstall: this.nbModsToUninstall,
|
||||
nbUninstalledMods: this.nbUninstalledMods
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const enum ModsInstallFolder {
|
||||
PLUGINS = "Plugins",
|
||||
LIBS = "Libs",
|
||||
IPA = "IPA",
|
||||
PENDING = "IPA/Pending",
|
||||
PLUGINS_PENDING = "IPA/Pending/Plugins",
|
||||
LIBS_PENDING = "IPA/Pending/Libs"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Notification } from "electron";
|
||||
import { SystemNotificationOptions } from "shared/models/notification/system-notification.model";
|
||||
import { UtilsService } from "./utils.service";
|
||||
|
||||
export class NotificationService {
|
||||
|
||||
private static instance: NotificationService;
|
||||
|
||||
public static getInstance(): NotificationService{
|
||||
if(!NotificationService.instance){ NotificationService.instance = new NotificationService(); }
|
||||
return NotificationService.instance;
|
||||
}
|
||||
|
||||
private readonly APP_ICON: string;
|
||||
|
||||
private readonly utils: UtilsService;
|
||||
|
||||
private constructor(){
|
||||
this.utils = UtilsService.getInstance();
|
||||
this.APP_ICON = this.utils.getAssetsPath("favicon.ico");
|
||||
}
|
||||
|
||||
public notify(options: SystemNotificationOptions){
|
||||
new Notification({...options, icon: this.APP_ICON}).show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import { UtilsService } from "./utils.service";
|
||||
import regedit from 'regedit'
|
||||
import path from "path";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class OculusService {
|
||||
|
||||
private static instance: OculusService;
|
||||
|
||||
private readonly utils: UtilsService;
|
||||
|
||||
private oculusPaths: string[];
|
||||
|
||||
public static getInstance(): OculusService{
|
||||
if(!OculusService.instance){ OculusService.instance = new OculusService(); }
|
||||
return OculusService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.utils = UtilsService.getInstance();
|
||||
}
|
||||
|
||||
public oculusRunning(): boolean | null{
|
||||
return this.utils.taskRunning("OculusClient.exe");
|
||||
}
|
||||
|
||||
public async getOculusLibsPath(): Promise<string[]>{
|
||||
|
||||
if(this.oculusPaths){ return this.oculusPaths; }
|
||||
|
||||
const oculusLibsRegKey = "HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries";
|
||||
|
||||
const libsRegData = (await regedit.promisified.list([oculusLibsRegKey]))["HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries"];
|
||||
|
||||
if(!libsRegData.exists || !libsRegData.keys){ return null; }
|
||||
|
||||
const libsPath = (await Promise.all(libsRegData.keys.map(async key => {
|
||||
const originalPath = (await regedit.promisified.list([`${oculusLibsRegKey}\\${key}`]))[`${oculusLibsRegKey}\\${key}`];
|
||||
if(!originalPath.exists || !libsRegData.values || !originalPath.values["OriginalPath"]){ return null; }
|
||||
|
||||
return originalPath.values["OriginalPath"].value as string;
|
||||
|
||||
}, []))).filter(path => !!path);
|
||||
|
||||
this.oculusPaths = libsPath;
|
||||
|
||||
return libsPath;
|
||||
|
||||
}
|
||||
|
||||
public async getGameFolder(gameFolder: string): Promise<string>{
|
||||
|
||||
const libsFolders = await this.getOculusLibsPath();
|
||||
|
||||
if(!libsFolders){ return null; }
|
||||
|
||||
const rootLibDir = "Software"
|
||||
|
||||
for(const lib of libsFolders){
|
||||
const gameFullPath = path.join(lib, rootLibDir, gameFolder);
|
||||
if(await pathExist(gameFullPath)){ return gameFullPath; }
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { RequestOptions, get } from "https";
|
||||
import { createWriteStream, unlink } from "fs";
|
||||
import { Progression, unlinkPath } from "main/helpers/fs.helpers";
|
||||
import { Observable, buffer, shareReplay, tap } from "rxjs";
|
||||
import log from "electron-log";
|
||||
|
||||
export class RequestService {
|
||||
|
||||
private static instance: RequestService;
|
||||
|
||||
public static getInstance(): RequestService{
|
||||
if(!RequestService.instance){ RequestService.instance = new RequestService(); }
|
||||
return RequestService.instance;
|
||||
}
|
||||
|
||||
private constructor(){}
|
||||
|
||||
public get<T = any>(options: string|RequestOptions): Promise<T>{
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
let body = ''
|
||||
get(options, (res) => {
|
||||
res.on('data', chunk => body += chunk);
|
||||
res.on('end', () => {
|
||||
resolve(JSON.parse(body));
|
||||
});
|
||||
res.on('error', (err) => reject(err))
|
||||
}).on("error", err => reject(err));
|
||||
});
|
||||
}
|
||||
|
||||
public downloadFile(url: string, dest: string): Observable<Progression<string>>{
|
||||
|
||||
return new Observable<Progression<string>>(subscriber => {
|
||||
const progress: Progression<string> = { current: 0, total: 0 };
|
||||
|
||||
const file = createWriteStream(dest);
|
||||
|
||||
file.on("close", () => {
|
||||
progress["data"] = dest;
|
||||
subscriber.next(progress); subscriber.complete();
|
||||
});
|
||||
file.on("error", err => unlink(dest, () => subscriber.error(err)));
|
||||
|
||||
const req = get(url, res => {
|
||||
|
||||
progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
|
||||
|
||||
res.on("data", chunk => {
|
||||
progress.current += chunk.length;
|
||||
subscriber.next(progress);
|
||||
});
|
||||
|
||||
res.pipe(file);
|
||||
|
||||
});
|
||||
|
||||
req.on("error", err => { subscriber.error(err); });
|
||||
|
||||
}).pipe(tap({error: e => log.error(e)}), shareReplay(1));
|
||||
|
||||
}
|
||||
|
||||
public downloadBuffer(url: string): Observable<Buffer>{
|
||||
|
||||
return new Observable<Buffer>(subscriber => {
|
||||
const allChunks: Buffer[] = [];
|
||||
|
||||
const req = get(url, res => {
|
||||
res.on("data", chunk => {
|
||||
allChunks.push(chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
subscriber.next(Buffer.concat(allChunks));
|
||||
subscriber.complete();
|
||||
});
|
||||
res.on('error', (err) => subscriber.error(err))
|
||||
});
|
||||
|
||||
req.on("error", err => { subscriber.error(err); });
|
||||
|
||||
}).pipe(tap({error: e => log.error(e)}), shareReplay(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,9 @@ import regedit from 'regedit'
|
||||
import path from "path";
|
||||
import { parse } from "@node-steam/vdf";
|
||||
import { readFile } from "fs/promises";
|
||||
import { spawn } from "child_process";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import log from "electron-log";
|
||||
|
||||
export class SteamService{
|
||||
|
||||
@@ -22,40 +25,59 @@ export class SteamService{
|
||||
return SteamService.instance;
|
||||
}
|
||||
|
||||
public steamRunning(): boolean{
|
||||
public steamRunning(): boolean | null{
|
||||
return this.utils.taskRunning('steam.exe');
|
||||
}
|
||||
|
||||
public async getSteamPath(): Promise<string>{
|
||||
if(this.steamPath !== ''){ return this.steamPath; }
|
||||
|
||||
if(!!this.steamPath){ return this.steamPath; }
|
||||
|
||||
const [win32Res, win64Res] = await Promise.all([
|
||||
regedit.promisified.list(['HKLM\\SOFTWARE\\Valve\\Steam']),
|
||||
regedit.promisified.list(['HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam'])
|
||||
]);
|
||||
|
||||
const [win32, win64] = [win32Res["HKLM\\SOFTWARE\\Valve\\Steam"], win64Res["HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam"]];
|
||||
let res = ''
|
||||
if(win64.values.InstallPath.value){ res = win64.values.InstallPath.value as string; }
|
||||
else if(win32.values.InstallPath.value){ res = win32.values.InstallPath.value as string; }
|
||||
|
||||
let res = '';
|
||||
if(win64.exists && win64?.values?.InstallPath?.value){ res = win64.values.InstallPath.value as string; }
|
||||
else if(win32.exists && win32?.values?.InstallPath?.value){ res = win32.values.InstallPath.value as string; }
|
||||
this.steamPath = res;
|
||||
return this.steamPath;
|
||||
}
|
||||
|
||||
public async getGameFolder(gameId: string, gameFolder?: string): Promise<string>{
|
||||
const steamPath = await this.getSteamPath();
|
||||
let libraryFolders: any = path.join(steamPath, 'steamapps', 'libraryfolders.vdf');
|
||||
try{
|
||||
const steamPath = await this.getSteamPath();
|
||||
|
||||
if(!this.utils.pathExist(libraryFolders)){ return null; }
|
||||
libraryFolders = parse(await readFile(libraryFolders, {encoding: 'utf-8'}));
|
||||
let libraryFolders: any = path.join(steamPath, 'steamapps', 'libraryfolders.vdf');
|
||||
|
||||
if(!(await pathExist(libraryFolders))){ return null; }
|
||||
libraryFolders = parse(await readFile(libraryFolders, {encoding: 'utf-8'}));
|
||||
|
||||
if(!libraryFolders.libraryfolders){ return null; }
|
||||
libraryFolders = libraryFolders.libraryfolders
|
||||
if(!libraryFolders.libraryfolders){ return null; }
|
||||
libraryFolders = libraryFolders.libraryfolders
|
||||
|
||||
for(const libKey in Object.keys(libraryFolders)){
|
||||
if(!libraryFolders[libKey] || !libraryFolders[libKey]["apps"]){ continue; }
|
||||
if(libraryFolders[libKey]["apps"][gameId]){ return path.join(libraryFolders[libKey]["path"], "steamapps", "common", gameFolder); };
|
||||
for(const libKey in Object.keys(libraryFolders)){
|
||||
if(!libraryFolders[libKey] || !libraryFolders[libKey]["apps"]){ continue; }
|
||||
if(libraryFolders[libKey]["apps"][gameId] != null){ return path.join(libraryFolders[libKey]["path"], "steamapps", "common", gameFolder); };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public openSteam(): Promise<boolean>{
|
||||
const process = spawn("start", ["steam://open/games"], {shell: true});
|
||||
|
||||
return new Promise(resolve => {
|
||||
process.on("exit", () => resolve(true));
|
||||
process.on("error", () => resolve(false));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { writeFileSync } from "fs";
|
||||
import { readJSON } from "fs-extra";
|
||||
import { get } from "https";
|
||||
import isOnline from "is-online";
|
||||
import path from "path";
|
||||
@@ -43,8 +44,7 @@ export class SupportersService {
|
||||
|
||||
private async getLocalSupporters(): Promise<Supporter[]>{
|
||||
const patreonsPath = path.join(this.utilsService.getAssestsJsonsPath(), this.PATREONS_FILE);
|
||||
const rawPatreons = (await this.utilsService.readFileAsync(patreonsPath)).toString();
|
||||
return JSON.parse(rawPatreons);
|
||||
return readJSON(patreonsPath);
|
||||
}
|
||||
|
||||
private async loadSupporters(): Promise<Supporter[]>{
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
import { ApiResult } from "renderer/models/api/api.model";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { BsvPlaylist, BsvPlaylistPage, MapFilter, SearchParams, SearchResponse } from "shared/models/maps/beat-saver.model";
|
||||
import fetch from "node-fetch"
|
||||
|
||||
export class BeatSaverApiService {
|
||||
|
||||
private static instance: BeatSaverApiService;
|
||||
|
||||
public static getInstance(): BeatSaverApiService{
|
||||
if(!BeatSaverApiService.instance){ BeatSaverApiService.instance = new BeatSaverApiService(); }
|
||||
return BeatSaverApiService.instance;
|
||||
}
|
||||
|
||||
private readonly bsaverApiUrl = "https://beatsaver.com/api"
|
||||
|
||||
private constructor(){}
|
||||
|
||||
private mapFilterToUrlParams(filter: MapFilter): URLSearchParams{
|
||||
|
||||
if(!filter){ return new URLSearchParams(); }
|
||||
|
||||
const enbledTagsString = filter.enabledTags ? Array.from(filter.enabledTags) : null;
|
||||
const excludedTagsString = filter.excludedTags ? Array.from(filter.excludedTags).map(tag => `!${tag}`) : null;
|
||||
|
||||
const tags = (enbledTagsString || excludedTagsString) ? [...enbledTagsString, excludedTagsString].join("|") : null;
|
||||
|
||||
const params = {
|
||||
...(filter.automapper && {automapper: String(filter.automapper)}),
|
||||
...(filter.chroma && {chroma: String(filter.chroma)}),
|
||||
...(filter.cinema && {cinema: String(filter.cinema)}),
|
||||
...(filter.me && {me: String(filter.me)}),
|
||||
...(filter.noodle && {noodle: String(filter.noodle)}),
|
||||
...(filter.ranked && {ranked: String(filter.ranked)}),
|
||||
...(filter.verified && {verified: String(filter.verified)}),
|
||||
...(filter.curated && {curated: String(filter.curated)}),
|
||||
...(filter.fullSpread && {fullSpread: String(filter.fullSpread)}),
|
||||
...(filter.from && {from: String(filter.from)}),
|
||||
...(filter.to && {to: String(filter.to)}),
|
||||
...(tags && {tags: String(tags)}),
|
||||
...(filter.minDuration && {minDuration: String(filter.minDuration)}),
|
||||
...(filter.maxDuration && {maxDuration: String(filter.maxDuration)}),
|
||||
...(filter.minNps && {minNps: String(filter.minNps)}),
|
||||
...(filter.maxNps && {maxNps: String(filter.maxNps)})
|
||||
};
|
||||
|
||||
return new URLSearchParams(params);
|
||||
|
||||
}
|
||||
|
||||
private searchParamsToUrlParams(search: SearchParams): URLSearchParams{
|
||||
|
||||
if(!search){ return new URLSearchParams(); }
|
||||
|
||||
const searchParams = {
|
||||
...(search.includeEmpty && {includeEmpty: String(search.includeEmpty)}),
|
||||
...(search.sortOrder && {sortOrder: search.sortOrder}),
|
||||
...(search.q && {q: search.q})
|
||||
};
|
||||
|
||||
const filterUrlParms = this.mapFilterToUrlParams(search.filter);
|
||||
|
||||
return new URLSearchParams({
|
||||
...searchParams,
|
||||
...Object.fromEntries(filterUrlParms)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async getMapsDetailsByHashs<T extends string>(hashs: T[]): Promise<ApiResult<Record<Lowercase<T>, BsvMapDetail>>>{
|
||||
|
||||
if(hashs.length > 50){ throw "too musch map hashs"; }
|
||||
|
||||
const paramsHashs = hashs.join(",");
|
||||
const resp = await fetch(`${this.bsaverApiUrl}/maps/hash/${paramsHashs}`);
|
||||
|
||||
const data = await resp.json() as Record<Lowercase<T>, BsvMapDetail> | BsvMapDetail;
|
||||
|
||||
if((data as BsvMapDetail).id){
|
||||
const key = (data as BsvMapDetail).versions.at(0).hash.toLowerCase();
|
||||
const parsedData = {
|
||||
[key]: data as BsvMapDetail
|
||||
} as Record<Lowercase<T>, BsvMapDetail>;
|
||||
|
||||
return {status: resp.status, data: parsedData}
|
||||
}
|
||||
|
||||
return {status: resp.status, data: (data as Record<Lowercase<T>, BsvMapDetail>)};
|
||||
|
||||
}
|
||||
|
||||
public async getMapDetailsById(id: string): Promise<ApiResult<BsvMapDetail>>{
|
||||
|
||||
const res = await fetch(`${this.bsaverApiUrl}/maps/id/${id}`);
|
||||
|
||||
const data = await res.json() as BsvMapDetail;
|
||||
|
||||
return {status: res.status, data};
|
||||
|
||||
}
|
||||
|
||||
public async searchMaps(search: SearchParams): Promise<ApiResult<SearchResponse>>{
|
||||
|
||||
const url = new URL(`${this.bsaverApiUrl}/search/text/${search?.page ?? 0}`);
|
||||
|
||||
url.search = this.searchParamsToUrlParams(search).toString();
|
||||
|
||||
const res = await fetch(url.toString());
|
||||
|
||||
if(!res.ok){
|
||||
return {status: res.status, data: null};
|
||||
}
|
||||
|
||||
const data: any = await res.json();
|
||||
|
||||
return {status: res.status, data};
|
||||
|
||||
}
|
||||
|
||||
public async getPlaylistDetails(id: string): Promise<ApiResult<BsvPlaylist>>{
|
||||
|
||||
const res = await fetch(`${this.bsaverApiUrl}/playlists/id/${id}/0`);
|
||||
|
||||
const data = await res.json() as BsvPlaylistPage;
|
||||
|
||||
return {status: res.status, data: data.playlist};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import { splitIntoChunk } from "../../../../shared/helpers/array.helpers";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { BsvPlaylist, SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import { BeatSaverApiService } from "./beat-saver-api.service";
|
||||
|
||||
export class BeatSaverService {
|
||||
|
||||
private static instance: BeatSaverService;
|
||||
|
||||
public static getInstance(): BeatSaverService{
|
||||
if(!BeatSaverService.instance){ BeatSaverService.instance = new BeatSaverService(); }
|
||||
return BeatSaverService.instance;
|
||||
}
|
||||
|
||||
private readonly bsaverApi: BeatSaverApiService;
|
||||
|
||||
private readonly cachedMapsDetails = new Map<string, BsvMapDetail>();
|
||||
|
||||
private constructor(){
|
||||
this.bsaverApi = BeatSaverApiService.getInstance();
|
||||
}
|
||||
|
||||
public async getMapDetailsFromHashs(hashs: string[]): Promise<BsvMapDetail[]>{
|
||||
|
||||
const filtredHashs = hashs.map(h => h.toLowerCase()).filter(hash => !Array.from(this.cachedMapsDetails.keys()).includes(hash));
|
||||
const chunkHash = splitIntoChunk(filtredHashs, 50);
|
||||
|
||||
const mapDetails = Array.from(this.cachedMapsDetails.entries()).reduce((res , [hash, details]) => {
|
||||
if(hashs.includes(hash)){
|
||||
res.push(details);
|
||||
}
|
||||
return res;
|
||||
}, [] as BsvMapDetail[]);
|
||||
|
||||
await Promise.allSettled(chunkHash.map(async hashs => {
|
||||
const res = await this.bsaverApi.getMapsDetailsByHashs(hashs);
|
||||
|
||||
if(res.status === 200){
|
||||
mapDetails.push(...Object.values<BsvMapDetail>(res.data).filter(detail => !!detail));
|
||||
mapDetails.forEach(detail => {
|
||||
this.cachedMapsDetails.set(detail.versions.at(0).hash.toLowerCase(), detail);
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
||||
return mapDetails;
|
||||
}
|
||||
|
||||
public async getMapDetailsById(id: string): Promise<BsvMapDetail>{
|
||||
|
||||
const res = await this.bsaverApi.getMapDetailsById(id);
|
||||
return res.data;
|
||||
|
||||
}
|
||||
|
||||
public searchMaps(search: SearchParams): Promise<BsvMapDetail[]>{
|
||||
|
||||
return this.bsaverApi.searchMaps(search).then(res => {
|
||||
return res.status === 200 ? res.data.docs : [];
|
||||
}).catch(err => {
|
||||
return [];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async getPlaylistPage(id: string): Promise<BsvPlaylist>{
|
||||
|
||||
const res = await this.bsaverApi.getPlaylistDetails(id);
|
||||
return res.data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import fetch from "node-fetch";
|
||||
import { ApiResult } from "renderer/models/api/api.model";
|
||||
import { MSGetQuery, MSGetQueryFilter, MSGetResponse } from "../../../../shared/models/models/model-saber.model";
|
||||
|
||||
export class ModelSaberApiService {
|
||||
|
||||
private static instance: ModelSaberApiService;
|
||||
|
||||
public static getInstance(): ModelSaberApiService{
|
||||
if(!ModelSaberApiService.instance){ ModelSaberApiService.instance = new ModelSaberApiService(); }
|
||||
return ModelSaberApiService.instance;
|
||||
}
|
||||
|
||||
private readonly API_URL = "https://modelsaber.com/api/v2/";
|
||||
private readonly ENDPOINTS = {get: "get.php", types: "types.php"};
|
||||
|
||||
private constructor(){}
|
||||
|
||||
private parseFilters(filters: MSGetQueryFilter[]): string{
|
||||
|
||||
if(!filters){ return null; }
|
||||
|
||||
const parsed = filters.map(filter => {
|
||||
const stringFilter = filter.type === "searchName" ? filter.value : `${filter.type}:${filter.value}`;
|
||||
return filter.isNegative ? `-${stringFilter}` : stringFilter;
|
||||
});
|
||||
|
||||
return parsed.join(",");
|
||||
|
||||
}
|
||||
|
||||
private buildUrlQuery(query: MSGetQuery): URLSearchParams{
|
||||
|
||||
if(!query){ return new URLSearchParams(); }
|
||||
|
||||
const filterQuery = this.parseFilters(query.filter);
|
||||
|
||||
const searchParams = {
|
||||
...(query.type && {type: query.type}),
|
||||
...(query.platform && {platform: query.platform}),
|
||||
...(query.start && {start: `${query.start}`}),
|
||||
...(query.end && {end: `${query.end}`}),
|
||||
...(query.sort && {sort: query.sort}),
|
||||
...(query.sortDirection && {sortDirection: query.sortDirection}),
|
||||
...(filterQuery && {filter: filterQuery}),
|
||||
}
|
||||
|
||||
return new URLSearchParams(searchParams);
|
||||
|
||||
}
|
||||
|
||||
public async searchModel(query: MSGetQuery): Promise<ApiResult<MSGetResponse>>{
|
||||
|
||||
const url = new URL(this.ENDPOINTS.get, this.API_URL);
|
||||
|
||||
url.search = this.buildUrlQuery(query).toString();
|
||||
|
||||
const res = await fetch(url.toString());
|
||||
|
||||
if(!res.ok){
|
||||
return {data: null, status: res.status};
|
||||
}
|
||||
|
||||
const data = await res.json() as MSGetResponse;
|
||||
|
||||
return {data, status: res.status};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import { Observable } from "rxjs";
|
||||
import { MSGetQuery, MSGetQueryFilterType, MSModel, MSModelPlatform } from "../../../../shared/models/models/model-saber.model";
|
||||
import { ModelSaberApiService } from "./model-saber-api.service";
|
||||
import log from "electron-log";
|
||||
import striptags from "striptags"
|
||||
|
||||
export class ModelSaberService {
|
||||
|
||||
private static instance: ModelSaberService;
|
||||
|
||||
public static getInstance(): ModelSaberService{
|
||||
if(!ModelSaberService.instance){ ModelSaberService.instance = new ModelSaberService(); }
|
||||
return ModelSaberService.instance;
|
||||
}
|
||||
|
||||
private readonly modelsHashCache: Map<string, MSModel> = new Map(); // key: hash, value: model
|
||||
|
||||
private readonly modelSaberApi: ModelSaberApiService;
|
||||
|
||||
private constructor(){
|
||||
this.modelSaberApi = ModelSaberApiService.getInstance();
|
||||
}
|
||||
|
||||
public async getModelById(id: number|string): Promise<MSModel>{
|
||||
|
||||
const query: MSGetQuery = {
|
||||
start: 0,
|
||||
end: 1,
|
||||
platform: MSModelPlatform.PC,
|
||||
filter: [{type: MSGetQueryFilterType.ID, value: id}]
|
||||
}
|
||||
|
||||
try{
|
||||
const res = await this.modelSaberApi.searchModel(query);
|
||||
|
||||
if(res.status !== 200){ return null; }
|
||||
|
||||
if(Object.keys(res.data).length === 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
return res.data[`${id}`];
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async getModelByHash(hash: string): Promise<MSModel>{
|
||||
|
||||
if(this.modelsHashCache.has(hash)){
|
||||
return this.modelsHashCache.get(hash);
|
||||
}
|
||||
|
||||
const query: MSGetQuery = {
|
||||
start: 0,
|
||||
end: 1,
|
||||
platform: MSModelPlatform.PC,
|
||||
filter: [{type: MSGetQueryFilterType.Hash, value: hash}]
|
||||
}
|
||||
|
||||
try{
|
||||
const res = await this.modelSaberApi.searchModel(query);
|
||||
|
||||
if(res.status !== 200){ return null;}
|
||||
|
||||
if(Object.keys(res.data).length === 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
const model = Array.from(Object.values(res.data)).at(0);
|
||||
|
||||
model.name = striptags(model.name ?? "");
|
||||
|
||||
this.modelsHashCache.set(hash, model);
|
||||
|
||||
return model
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public searchModels(query: MSGetQuery): Observable<MSModel[]>{
|
||||
return new Observable<MSModel[]>(observer => {
|
||||
(async () => {
|
||||
const res = await this.modelSaberApi.searchModel(query);
|
||||
if(res.status !== 200){ observer.error(res.status); }
|
||||
observer.next(Object.values(res.data).map(model => {
|
||||
if(!model || !model.name){ return model; }
|
||||
(model as MSModel).name = striptags(model.name);
|
||||
return model;
|
||||
}));
|
||||
})().catch(e => observer.error(e)).then(() => observer.complete());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
import { existsSync, mkdirSync, readdirSync, readFile } from "fs";
|
||||
import { spawnSync } from "child_process";
|
||||
import { homedir } from "os";
|
||||
import path from "path";
|
||||
import { BrowserWindow } from "electron";
|
||||
import { rm } from "fs/promises";
|
||||
import { app, BrowserWindow } from "electron";
|
||||
import { IpcResponse } from "shared/models/ipc";
|
||||
import log from "electron-log";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
|
||||
|
||||
// TODO : REFACTOR
|
||||
|
||||
export class UtilsService{
|
||||
|
||||
private static instance: UtilsService;
|
||||
|
||||
private assetsPath: string = '';
|
||||
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, 'assets') : path.join(__dirname, '../../../assets');
|
||||
|
||||
private mainWindow: BrowserWindow;
|
||||
private windows: Map<AppWindow, BrowserWindow> = new Map<AppWindow, BrowserWindow>();
|
||||
|
||||
private constructor(){}
|
||||
|
||||
@@ -27,52 +28,30 @@ export class UtilsService{
|
||||
|
||||
public getAssetsScriptsPath(): string { return this.getAssetsPath("scripts") }
|
||||
public getAssestsJsonsPath(): string { return this.getAssetsPath("jsons"); }
|
||||
public getTempPath(): string{ return path.join(app.getPath("temp"), app.getName()) }
|
||||
|
||||
public setMainWindow(win: BrowserWindow){ this.mainWindow = win; }
|
||||
public getMainWindow(){ return this.mainWindow; }
|
||||
public setMainWindows(windows: Map<AppWindow, BrowserWindow>){ this.windows = windows; }
|
||||
public getMainWindows(win: AppWindow){ return this.windows.get(win); }
|
||||
|
||||
public pathExist(path: string): boolean{ return existsSync(path); }
|
||||
public taskRunning(task: string): boolean | null{
|
||||
try{
|
||||
const tasks = spawnSync('tasklist').stdout;
|
||||
return tasks.toString().includes(task);
|
||||
}
|
||||
catch(error){
|
||||
log.error(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public createFolderIfNotExist(path: string): void{
|
||||
if(!this.pathExist(path)){ mkdirSync(path, {recursive: true}); }
|
||||
}
|
||||
|
||||
public taskRunning(task: string): boolean{
|
||||
const tasks = spawnSync('tasklist').stdout.toString();
|
||||
return tasks.includes(task);
|
||||
}
|
||||
|
||||
public getUserFolder(){ return homedir(); }
|
||||
|
||||
public getUserDocumentsFolder(): string{
|
||||
return path.join(this.getUserFolder(), 'Documents');
|
||||
}
|
||||
|
||||
public readFileAsync(path: string){
|
||||
return new Promise<Buffer>((resolve, reject) => {
|
||||
readFile(path, (err, data) => {
|
||||
if(err){ reject(err); }
|
||||
else{ resolve(data); }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public listDirsInDir(dirPath: string): string[]{
|
||||
let files = readdirSync(dirPath, { withFileTypes:true});
|
||||
files = files.filter(f => f.isDirectory())
|
||||
return files.map(f => f.name);
|
||||
}
|
||||
|
||||
public deleteFolder(folderPath: string): Promise<void>{
|
||||
return rm(folderPath, {recursive: true});
|
||||
}
|
||||
|
||||
public ipcSend(channel: string, response: IpcResponse<any>): void{
|
||||
public ipcSend<T = any>(channel: string, response: IpcResponse<T>): void{
|
||||
try {
|
||||
this.mainWindow.webContents.send(channel, response);
|
||||
Array.from(this.windows.values()).forEach(window => window?.webContents?.send(channel, response));
|
||||
} catch (error) {
|
||||
log.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
import { getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
|
||||
import path from "path";
|
||||
import { VersionLinkerAction, VersionLinkFolderAction, VersionUnlinkFolderAction } from "renderer/services/version-folder-linker.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { LocalMapsManagerService } from "./additional-content/local-maps-manager.service";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import { FolderLinkerService, LinkOptions } from "./folder-linker.service";
|
||||
import { allSettled } from "../../shared/helpers/promise.helpers";
|
||||
|
||||
export class VersionFolderLinkerService {
|
||||
|
||||
private static instance: VersionFolderLinkerService;
|
||||
|
||||
public static getInstance(): VersionFolderLinkerService{
|
||||
if(!VersionFolderLinkerService.instance){ VersionFolderLinkerService.instance = new VersionFolderLinkerService() }
|
||||
return VersionFolderLinkerService.instance;
|
||||
}
|
||||
|
||||
private readonly localVersion: BSLocalVersionService;
|
||||
private readonly folderLinker: FolderLinkerService;
|
||||
|
||||
private constructor(){
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
this.folderLinker = FolderLinkerService.getInstance();
|
||||
}
|
||||
|
||||
private specialFolderOption(relativeFolder: string, options: LinkOptions): LinkOptions{
|
||||
if(relativeFolder.includes(LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)){
|
||||
return {...options, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER};
|
||||
}
|
||||
|
||||
if(relativeFolder.includes("UserData")){
|
||||
return { ...options, backup: true };
|
||||
}
|
||||
|
||||
return options ?? {};
|
||||
}
|
||||
|
||||
private async isOtherVersionHaveFolderLinked(relativeFolder: string, ignorePath: string): Promise<boolean>{
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
const versionPaths = await allSettled(versions.map(version => this.localVersion.getVersionPath(version)));
|
||||
|
||||
for(const versionPath of versionPaths){
|
||||
const folderPath = this.relativeToFullPath(versionPath, relativeFolder);
|
||||
if(folderPath === ignorePath){ continue; }
|
||||
if(await this.folderLinker.isFolderSymlink(folderPath)){ return true; }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private relativeToFullPath(parentPath: string, relativePath: string): string{
|
||||
return path.join(parentPath, relativePath);
|
||||
}
|
||||
|
||||
|
||||
public async linkVersionFolder(action: VersionLinkerAction): Promise<boolean>{
|
||||
action.options = this.specialFolderOption(action.relativeFolder, action.options);
|
||||
const versionPath = await this.localVersion.getVersionPath(action.version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, action.relativeFolder);
|
||||
return this.folderLinker.linkFolder(folderPath, action.options).catch(() => false).then(() => true)
|
||||
}
|
||||
|
||||
public async unlinkVersionFolder(action: VersionUnlinkFolderAction): Promise<boolean>{
|
||||
action.options = this.specialFolderOption(action.relativeFolder, action.options);
|
||||
|
||||
const versionPath = await this.localVersion.getVersionPath(action.version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, action.relativeFolder);
|
||||
|
||||
action.options.moveContents = !(await this.isOtherVersionHaveFolderLinked(action.relativeFolder, folderPath));
|
||||
|
||||
return this.folderLinker.unlinkFolder(folderPath, action.options).catch(() => false).then(() => true);
|
||||
}
|
||||
|
||||
public async doAction(action: VersionLinkerAction): Promise<boolean>{
|
||||
if(action.type === "link"){
|
||||
return this.linkVersionFolder(action);
|
||||
}
|
||||
return this.unlinkVersionFolder(action as VersionUnlinkFolderAction);
|
||||
}
|
||||
|
||||
public async isFolderLinked(version: BSVersion, relativeFolder: string): Promise<boolean>{
|
||||
if(!version){ return Promise.reject("no version provided") }
|
||||
const versionPath = await this.localVersion.getVersionPath(version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, relativeFolder);
|
||||
return this.folderLinker.isFolderSymlink(folderPath);
|
||||
}
|
||||
|
||||
public async getLinkedFolders(version: BSVersion, options?: { relative?: boolean, ignoreSymlinkTargetError?: boolean }): Promise<string[]>{
|
||||
const versionPath = await this.localVersion.getVersionPath(version);
|
||||
const [rootFolders, beatSaberDataFolders] = await Promise.all([
|
||||
getFoldersInFolder(versionPath, {ignoreSymlinkTargetError: options?.ignoreSymlinkTargetError}),
|
||||
getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"), {ignoreSymlinkTargetError: options?.ignoreSymlinkTargetError})
|
||||
]);
|
||||
|
||||
const linkedFolders = await Promise.all([...rootFolders, ...beatSaberDataFolders].map(async folder => {
|
||||
if(!(await this.folderLinker.isFolderSymlink(folder))){ return null; }
|
||||
return folder;
|
||||
}));
|
||||
|
||||
if(options?.relative){
|
||||
return linkedFolders.filter(folder => folder).map(folder => path.relative(versionPath, folder));
|
||||
}
|
||||
|
||||
return linkedFolders.filter(folder => folder);
|
||||
}
|
||||
|
||||
public async relinkAllVersionsFolders(): Promise<void>{
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
|
||||
for(const version of versions){
|
||||
const linkedFolders = await this.getLinkedFolders(version, { relative: true, ignoreSymlinkTargetError: true });
|
||||
const actions = linkedFolders.map(folder => ({ type: "link", version, relativeFolder: folder } as VersionLinkFolderAction));
|
||||
await Promise.all(actions.map(action => this.doAction(action)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,25 +2,32 @@ import { app, BrowserWindow, BrowserWindowConstructorOptions } from "electron";
|
||||
import { resolveHtmlPath } from "../util";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
import { PRELOAD_PATH } from "../main";
|
||||
import path from "path";
|
||||
import { APP_NAME } from "../constants";
|
||||
|
||||
export class WindowManagerService{
|
||||
|
||||
private static instance: WindowManagerService;
|
||||
|
||||
private readonly PRELOAD_PATH = app.isPackaged ? path.join(__dirname, 'preload.js') : path.join(__dirname, '../../../.erb/dll/preload.js')
|
||||
|
||||
private readonly utilsService: UtilsService = UtilsService.getInstance();
|
||||
|
||||
private readonly appWindowsOptions: Record<AppWindow, BrowserWindowConstructorOptions> = {
|
||||
"launcher.html": {width: 380, height: 500, minWidth: 380, minHeight: 500, resizable: false},
|
||||
"index.html": {width: 1080, height: 720, minWidth: 900, minHeight: 500}
|
||||
"index.html": {width: 1080, height: 720, minWidth: 900, minHeight: 500},
|
||||
"oneclick-download-map.html": {width: 350, height: 400, minWidth: 350, minHeight: 400, resizable: false},
|
||||
"oneclick-download-playlist.html": {width: 350, height: 400, minWidth: 350, minHeight: 400, resizable: false},
|
||||
"oneclick-download-model.html": {width: 350, height: 400, minWidth: 350, minHeight: 400, resizable: false},
|
||||
}
|
||||
|
||||
private readonly baseWindowOption: BrowserWindowConstructorOptions = {
|
||||
title: APP_NAME,
|
||||
icon: this.utilsService.getAssetsPath("favicon.ico"),
|
||||
show: false,
|
||||
frame: false,
|
||||
titleBarOverlay: false,
|
||||
webPreferences: { preload: PRELOAD_PATH }
|
||||
webPreferences: { preload: this.PRELOAD_PATH, webSecurity: false }
|
||||
}
|
||||
|
||||
private readonly windows: Map<AppWindow, BrowserWindow> = new Map<AppWindow, BrowserWindow>();
|
||||
@@ -32,15 +39,16 @@ export class WindowManagerService{
|
||||
|
||||
private constructor(){}
|
||||
|
||||
public openWindow(windowType: AppWindow): Promise<BrowserWindow>{
|
||||
const window = new BrowserWindow({...this.appWindowsOptions[windowType], ...this.baseWindowOption});
|
||||
public openWindow(windowType: AppWindow, options?: BrowserWindowConstructorOptions): Promise<BrowserWindow>{
|
||||
const window = new BrowserWindow({...this.appWindowsOptions[windowType], ...this.baseWindowOption, ...options});
|
||||
|
||||
const promise = window.loadURL(resolveHtmlPath(windowType));
|
||||
window.removeMenu();
|
||||
window.setMenu(null);
|
||||
|
||||
window.once("ready-to-show", () => {
|
||||
if (!window) { throw new Error('"window" is not defined'); }
|
||||
return window.show();
|
||||
window.show();
|
||||
});
|
||||
|
||||
window.once("closed", () => {
|
||||
@@ -49,15 +57,11 @@ export class WindowManagerService{
|
||||
});
|
||||
|
||||
this.windows.set(windowType, window);
|
||||
this.utilsService.setMainWindow(window);
|
||||
this.utilsService.setMainWindows(this.windows);
|
||||
|
||||
return promise.then(() => window);
|
||||
}
|
||||
|
||||
public closeWindow(window: AppWindow){
|
||||
this.windows.get(window).close();
|
||||
}
|
||||
|
||||
public closeAllWindows(except?: AppWindow){
|
||||
this.windows.forEach((window, key) => {
|
||||
if(key === except){ return; }
|
||||
@@ -65,4 +69,18 @@ export class WindowManagerService{
|
||||
})
|
||||
}
|
||||
|
||||
public close(...win: AppWindow[]){
|
||||
win.forEach(window => {
|
||||
this.windows.get(window)?.close();
|
||||
});
|
||||
}
|
||||
|
||||
public getWindow(window: AppWindow): BrowserWindow{
|
||||
return this.windows.get(window);
|
||||
}
|
||||
|
||||
public getAppWindowFromWebContents(sender: Electron.WebContents): AppWindow{
|
||||
return Array.from(this.windows.entries()).find(([key, value]) => value.webContents.id === sender.id)[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { NavBar } from "./components/nav-bar/nav-bar.component";
|
||||
import TitleBar from "./components/title-bar/title-bar.component";
|
||||
import { Routes, Route } from "react-router-dom";
|
||||
import { AvailableVersionsList } from "./pages/available-versions-list.components";
|
||||
import { VersionViewer } from "./pages/version-viewer.component";
|
||||
import { Modal } from "./components/modal/modal.component";
|
||||
import { SettingsPage } from "./pages/settings-page.component";
|
||||
import { BsmProgressBar } from "./components/progress-bar/bsm-progress-bar.component";
|
||||
import { useEffect } from "react";
|
||||
import { ThemeService } from "./services/theme.service";
|
||||
import { NotificationOverlay } from "./components/notification/notification-overlay.component";
|
||||
|
||||
export default function App() {
|
||||
|
||||
const themeService = ThemeService.getInstance();
|
||||
|
||||
useEffect(() => {
|
||||
themeService.theme$.subscribe(() => {
|
||||
if(themeService.isDark || (themeService.isOS && window.matchMedia('(prefers-color-scheme: dark)').matches)){ document.documentElement.classList.add('dark'); }
|
||||
else { document.documentElement.classList.remove('dark'); }
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<div className="relative w-screen h-screen overflow-hidden flex bg-light-main-color-1 dark:bg-main-color-1 z-0 max-w-full">
|
||||
<Modal/>
|
||||
<NavBar/>
|
||||
<NotificationOverlay/>
|
||||
<div className="relative flex flex-col grow max-w-full min-w-0">
|
||||
<TitleBar/>
|
||||
<div className="bg-light-main-color-2 dark:bg-main-color-2 relative rounded-tl-lg grow overflow-hidden max-w-full">
|
||||
<Routes>
|
||||
<Route path={"/bs-version/:versionNumber"} element={<VersionViewer/>}/>
|
||||
<Route path={"/settings"} element={<SettingsPage/>}/>
|
||||
<Route path="*" element={<AvailableVersionsList/>}/>
|
||||
</Routes>
|
||||
<BsmProgressBar/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
.glow-on-hover {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
left:-4px;
|
||||
background-size: 400%;
|
||||
z-index: -1;
|
||||
filter: blur(3px);
|
||||
width: calc(100% + 8px);
|
||||
height: calc(100% + 8px);
|
||||
animation: glowing 20s linear infinite;
|
||||
opacity: 0;
|
||||
transition: opacity .2s ease-in-out;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
@keyframes glowing {
|
||||
0% { background-position: 0 0; }
|
||||
50% { background-position: 400% 0; }
|
||||
100% { background-position: 0 0; }
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import './available-version-item.component.css';
|
||||
import { useEffect, useState, memo } from "react";
|
||||
import { BsDownloaderService } from "renderer/services/bs-downloader.service";
|
||||
import { distinctUntilChanged } from "rxjs/operators";
|
||||
import defaultImage from '../../../../assets/images/default-version-img.jpg'
|
||||
import dateFormat from "dateformat";
|
||||
import { BsmImage } from "../shared/bsm-image.component";
|
||||
import { IpcService } from "renderer/services/ipc.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { LinkOpenerService } from 'renderer/services/link-opener.service';
|
||||
import { motion } from 'framer-motion';
|
||||
import { GlowEffect } from '../shared/glow-effect.component';
|
||||
|
||||
export const AvailableVersionItem = memo(function AvailableVersionItem(props: {version: BSVersion}) {
|
||||
|
||||
const bsDownloaderService = BsDownloaderService.getInstance();
|
||||
const ipcService = IpcService.getInstance();
|
||||
const linkOpener = LinkOpenerService.getInstance();
|
||||
|
||||
const [selected, setSelected] = useState(false);
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const t = useTranslation();
|
||||
|
||||
const formatedDate = (() => { return dateFormat(+props.version.ReleaseDate*1000, "ddd. d mmm yyyy"); })()
|
||||
@@ -26,7 +28,7 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
|
||||
else{ bsDownloaderService.selectedBsVersion$.next(props.version); }
|
||||
}
|
||||
|
||||
const openReleasePage = () => { ipcService.sendLazy("new-window", {args: props.version.ReleaseURL}); }
|
||||
const openReleasePage = () => { linkOpener.open(props.version.ReleaseURL) }
|
||||
|
||||
useEffect(() => {
|
||||
const sub = bsDownloaderService.selectedBsVersion$.pipe(distinctUntilChanged()).subscribe((version) => {
|
||||
@@ -38,25 +40,25 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="group m-3 relative w-72 h-60 transition-transform active:scale-[.98]" onClick={toggleSelect}>
|
||||
<div className={`absolute glow-on-hover group-hover:opacity-100 ${selected && "opacity-100"}`}></div>
|
||||
<div className={`relative flex flex-col overflow-hidden rounded-md w-72 h-60 cursor-pointer group-hover:shadow-none duration-300 bg-light-main-color-2 dark:bg-main-color-2 ${!selected && "shadow-lg shadow-gray-900"}`}>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="absolute top-0 right-0 w-full h-full opacity-40 blur-xl object-cover" loading="lazy"/>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="bg-black w-full h-3/4 object-cover" loading="lazy"/>
|
||||
<div className="relative z-[1] p-2 w-full flex items-center justify-between grow">
|
||||
<div>
|
||||
<span className="block text-xl font-bold text-white tracking-wider">{props.version.BSVersion}</span>
|
||||
<span className="text-sm text-gray-700 dark:text-gray-400">{formatedDate}</span>
|
||||
</div>
|
||||
{ props.version.ReleaseURL && (
|
||||
<a onClickCapture={e => { e.stopPropagation(); openReleasePage(); }} className="relative flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-[1px] hover:bg-opacity-50">
|
||||
<BsmIcon icon="steam" className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300"/>
|
||||
<span className="relative -left-[2px] text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<motion.li className="group relative w-72 h-60 transition-transform active:scale-[.98]" onClick={toggleSelect} onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)}>
|
||||
<GlowEffect visible={hovered || selected} className="absolute"/>
|
||||
<div className={`relative flex flex-col overflow-hidden rounded-md w-72 h-60 cursor-pointer group-hover:shadow-none duration-300 bg-light-main-color-2 dark:bg-main-color-2 ${!selected && "shadow-lg shadow-gray-900"}`}>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="absolute top-0 right-0 w-full h-full opacity-40 blur-xl object-cover" loading="lazy"/>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="bg-black w-full h-3/4 object-cover" loading="lazy"/>
|
||||
<div className="z-[1] p-2 w-full flex items-center justify-between grow">
|
||||
<div>
|
||||
<h2 className="block text-xl font-bold text-white tracking-wider">{props.version.BSVersion}</h2>
|
||||
<span className="text-sm text-gray-700 dark:text-gray-400">{formatedDate}</span>
|
||||
</div>
|
||||
{ props.version.ReleaseURL && (
|
||||
<a onClickCapture={e => { e.stopPropagation(); openReleasePage(); }} className="flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-px hover:bg-opacity-50">
|
||||
<BsmIcon icon="steam" className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300"/>
|
||||
<span className="relative -left-px text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span>
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</motion.li>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { useEffect, useState } from "react"
|
||||
import { BSVersionManagerService } from "renderer/services/bs-version-manager.service";
|
||||
import { filter, take } from "rxjs/operators";
|
||||
import { filter } from "rxjs/operators";
|
||||
import { AvailableVersionItem } from "./available-version-item.component";
|
||||
|
||||
export function AvailableVersionsSlide(props: {year: string}) {
|
||||
@@ -11,19 +11,16 @@ export function AvailableVersionsSlide(props: {year: string}) {
|
||||
const versionsService = BSVersionManagerService.getInstance();
|
||||
|
||||
useEffect(() => {
|
||||
versionsService.availableVersions$.pipe(filter(versions => !!versions?.length), take(1)).subscribe(() => {
|
||||
versionsService.availableVersions$.pipe(filter(versions => !!versions?.length)).subscribe(() => {
|
||||
setAvailableVersions(versionsService.getAvaibleVersionsOfYear(props.year));
|
||||
});
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-full max-h-full shrink-0 flex items-start justify-center overflow-x-hidden overflow-y-scroll content-start scrollbar-thin hover:scrollbar-thumb-neutral-900">
|
||||
<div className="relative left-[2px] flex justify-center items-start content-start flex-wrap max-w-6xl pb-4">
|
||||
{availableVersions.map((version, index) =>
|
||||
<AvailableVersionItem key={index} version={version}></AvailableVersionItem>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
return (
|
||||
<ol className="w-full flex items-start justify-center gap-6 shrink-0 content-start flex-wrap p-4 overflow-x-hidden overflow-y-scroll scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900">
|
||||
{availableVersions.map((version, index) =>
|
||||
<AvailableVersionItem key={index} version={version}></AvailableVersionItem>
|
||||
)}
|
||||
</ol>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { BSVersionManagerService } from "../../services/bs-version-manager.service";
|
||||
import { AvailableVersionsSlide } from "./available-versions-slide.component";
|
||||
import { filter, take } from "rxjs/operators";
|
||||
import { filter} from "rxjs/operators";
|
||||
import { TabNavBar } from "../shared/tab-nav-bar.component";
|
||||
|
||||
export function AvailableVersionsSlider() {
|
||||
|
||||
const [availableYears, setAvailableYears] = useState([]);
|
||||
const [yearIndex, setYearIndex] = useState(0);
|
||||
const versionManagerService = BSVersionManagerService.getInstance();
|
||||
|
||||
const versionManagerService = BSVersionManagerService.getInstance();
|
||||
const [availableYears, setAvailableYears] = useState([]);
|
||||
const [yearIndex, setYearIndex] = useState(0);
|
||||
|
||||
const setSelectedYear = (index: number) => {
|
||||
setYearIndex(index);
|
||||
}
|
||||
const setSelectedYear = (index: number) => {
|
||||
setYearIndex(index);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
versionManagerService.availableVersions$.pipe(filter(versions => !!versions?.length), take(1)).subscribe(() => {
|
||||
setAvailableYears(versionManagerService.getAvailableYears());
|
||||
});
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
versionManagerService.availableVersions$.pipe(filter(versions => !!versions?.length)).subscribe(() => {
|
||||
setAvailableYears(versionManagerService.getAvailableYears());
|
||||
});
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="w-full h-fit max-h-full relative flex flex-col items-center grow min-h-0">
|
||||
<TabNavBar tabsText={availableYears} onTabChange={setSelectedYear}/>
|
||||
<div className="w-full min-h-0 flex transition-transform duration-300" style={{transform: `translate(${-(yearIndex * 100)}%, 0)`}}>
|
||||
{ availableYears.map((year, index) =>
|
||||
<AvailableVersionsSlide key={index} year={year}></AvailableVersionsSlide>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className="w-full h-fit max-h-full flex flex-col items-center grow min-h-0 gap-3">
|
||||
<TabNavBar tabIndex={yearIndex} tabsText={availableYears} onTabChange={setSelectedYear}/>
|
||||
<ol className="w-full min-h-0 flex transition-transform duration-300" style={{transform: `translate(${-(yearIndex * 100)}%, 0)`}}>
|
||||
{ availableYears.map(year =>
|
||||
<AvailableVersionsSlide key={year} year={year}/>
|
||||
)}
|
||||
</ol>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
import { MapFilter, MapSpecificity, MapStyle, MapTag, MapType } from "shared/models/maps/beat-saver.model"
|
||||
import {motion} from "framer-motion"
|
||||
import { MutableRefObject, useEffect, useRef, useState} from "react"
|
||||
import { MAP_TYPES } from "renderer/partials/maps/map-tags/map-types"
|
||||
import { MAP_STYLES } from "renderer/partials/maps/map-tags/map-styles"
|
||||
import { BsmCheckbox } from "../shared/bsm-checkbox.component"
|
||||
import { min_to_s } from "renderer/helpers/time-utils"
|
||||
import dateFormat from "dateformat"
|
||||
import { BsmRange } from "../shared/bsm-range.component"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
import { MAP_SPECIFICITIES } from "renderer/partials/maps/map-general/map-specificity"
|
||||
import { MAP_REQUIREMENTS } from "renderer/partials/maps/map-requirements/map-requirements"
|
||||
import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors"
|
||||
import { BsmButton } from "../shared/bsm-button.component"
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import clone from "rfdc";
|
||||
import { GlowEffect } from "../shared/glow-effect.component"
|
||||
|
||||
export type Props = {
|
||||
className?: string,
|
||||
ref?: MutableRefObject<undefined>
|
||||
playlist?: boolean,
|
||||
filter: MapFilter,
|
||||
onChange?: (filter: MapFilter) => void,
|
||||
onApply?: (filter: MapFilter) => void,
|
||||
onClose?: (filter: MapFilter) => void
|
||||
}
|
||||
|
||||
export function FilterPanel({className, ref, playlist = false, filter, onChange, onApply, onClose}: Props) {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [haveChanged, setHaveChanged] = useState(false);
|
||||
const [firstFilter,] = useState(clone()(filter));
|
||||
const firstRun = useRef(true);
|
||||
|
||||
const MIN_NPS = 0;
|
||||
const MAX_NPS = 17;
|
||||
|
||||
const MIN_DURATION = 0;
|
||||
const MAX_DURATION = min_to_s(30);
|
||||
|
||||
const npss = [filter?.minNps || MIN_NPS, filter?.maxNps || MAX_NPS];
|
||||
const durations = [filter?.minDuration || MIN_DURATION, filter?.maxDuration || MAX_DURATION];
|
||||
|
||||
const isTagActivated = (tag: MapTag): boolean => filter?.enabledTags?.has(tag) || filter?.excludedTags?.has(tag);
|
||||
const isTagExcluded = (tag: MapTag): boolean => filter?.excludedTags?.has(tag);
|
||||
|
||||
useEffect(() => {
|
||||
if(firstRun.current){
|
||||
firstRun.current = false;
|
||||
return;
|
||||
}
|
||||
setHaveChanged(() => !equal(filter, firstFilter));
|
||||
}, [filter])
|
||||
|
||||
|
||||
const renderDurationLabel = (sec: number): JSX.Element => {
|
||||
|
||||
const textValue = (() => {
|
||||
if(sec === MIN_DURATION){ return t("maps.map-filter-panel.duration"); }
|
||||
if(sec === MAX_DURATION){ return "∞"; }
|
||||
const date = new Date(0);
|
||||
date.setSeconds(sec);
|
||||
return sec > 3600 ? dateFormat(date, "h:MM:ss") : dateFormat(date, "MM:ss");
|
||||
})();
|
||||
|
||||
return renderLabel(textValue, sec === MAX_DURATION);
|
||||
}
|
||||
|
||||
const renderNpsLabel = (nps: number): JSX.Element => {
|
||||
|
||||
const textValue = (() => {
|
||||
if(nps === MIN_NPS){ return "NPS"; }
|
||||
if(nps === MAX_NPS){ return "∞"; }
|
||||
return nps;
|
||||
})();
|
||||
|
||||
return renderLabel(textValue, nps === MAX_NPS);
|
||||
|
||||
}
|
||||
|
||||
const renderLabel = (text: unknown, isMax: boolean): JSX.Element => {
|
||||
return (
|
||||
<span className={`bg-inherit absolute top-[calc(100%+4px)] h-5 font-bold rounded-md shadow-center shadow-black px-1 flex items-center ${isMax ? "text-lg" : "text-sm"}`}>
|
||||
{text}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
const onNpssChange = ([min, max]: number[]) => {
|
||||
const newFilter: MapFilter = {...filter, minNps: min, maxNps: max};
|
||||
if(max === MAX_NPS){
|
||||
delete newFilter["maxNps"];
|
||||
}
|
||||
if(min === MIN_NPS){
|
||||
delete newFilter["minNps"];
|
||||
}
|
||||
onChange(newFilter);
|
||||
}
|
||||
|
||||
const onDurationsChange = ([min, max]: number[]) => {
|
||||
const newFilter: MapFilter = {...filter, minDuration: min, maxDuration: max};
|
||||
if(max === MAX_DURATION){
|
||||
delete newFilter["maxDuration"];
|
||||
}
|
||||
if(min === MIN_DURATION){
|
||||
delete newFilter["minDuration"];
|
||||
}
|
||||
onChange(newFilter);
|
||||
}
|
||||
|
||||
const handleTagClick = (tag: MapTag) => {
|
||||
|
||||
const enabledTags = filter.enabledTags ?? new Set<MapTag>();
|
||||
const excludedTags = filter.excludedTags ?? new Set<MapTag>();
|
||||
|
||||
if(isTagExcluded(tag)){
|
||||
excludedTags.delete(tag);
|
||||
}
|
||||
else if(isTagActivated(tag)){
|
||||
excludedTags.add(tag);
|
||||
enabledTags.delete(tag);
|
||||
}
|
||||
else{
|
||||
enabledTags.add(tag);
|
||||
}
|
||||
|
||||
const newFilter = {...filter, enabledTags, excludedTags};
|
||||
|
||||
if(newFilter.enabledTags.size === 0){
|
||||
delete newFilter["enabledTags"];
|
||||
}
|
||||
|
||||
if(newFilter.excludedTags.size === 0){
|
||||
delete newFilter["excludedTags"];
|
||||
}
|
||||
|
||||
onChange(newFilter);
|
||||
|
||||
}
|
||||
|
||||
const translateMapType = (type: MapType): string => {
|
||||
return t(`maps.map-types.${type}`);
|
||||
}
|
||||
|
||||
const translateMapStyle = (style: MapStyle): string => {
|
||||
return t(`maps.map-styles.${style}`)
|
||||
}
|
||||
|
||||
const translateMapSpecificity = (specificity: MapSpecificity): string => {
|
||||
return t(`maps.map-specificities.${specificity}`);
|
||||
}
|
||||
|
||||
type BooleanKeys<T> = { [k in keyof T]: T[k] extends boolean ? k : never }[keyof T];
|
||||
|
||||
const handleCheckbox = (key: BooleanKeys<MapFilter>) => {
|
||||
const newFilter = {...(filter ?? {})};
|
||||
if(newFilter[key] === true){
|
||||
delete newFilter[key];
|
||||
}
|
||||
else{
|
||||
newFilter[key] = true;
|
||||
}
|
||||
onChange(newFilter);
|
||||
}
|
||||
|
||||
const handleApply = () => {
|
||||
onApply(filter);
|
||||
setHaveChanged(() => false);
|
||||
onClose?.(filter);
|
||||
}
|
||||
|
||||
return !playlist ? (
|
||||
<motion.div ref={ref} className={`${className} bg-light-main-color-2 dark:bg-main-color-3`} initial={{opacity: 0}} animate={{opacity: 1}} exit={{opacity: 0}}>
|
||||
<div className="w-full h-6 grid grid-cols-2 gap-x-12 px-4 mb-6 pt-2">
|
||||
<BsmRange min={MIN_NPS} max={MAX_NPS} values={npss} onChange={onNpssChange} renderLabel={renderNpsLabel} step={.1}/>
|
||||
<BsmRange min={MIN_DURATION} max={MAX_DURATION} values={durations} onChange={onDurationsChange} renderLabel={renderDurationLabel} step={5}/>
|
||||
</div>
|
||||
<div className="w-full h-full flex gap-x-2">
|
||||
<section className="shrink-0">
|
||||
|
||||
<h2 className="mb-1 uppercase text-sm">{t("maps.map-filter-panel.specificities")}</h2>
|
||||
{MAP_SPECIFICITIES.map(specificity => (
|
||||
<div key={specificity} className="flex justify-start items-center h-[22px] z-20 relative py-0.5 cursor-pointer" onClick={() => handleCheckbox(specificity)}>
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1" checked={filter?.[specificity]} onChange={() => handleCheckbox(specificity)}/>
|
||||
<span className="grow capitalize">{translateMapSpecificity(specificity)}</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<h2 className="my-1 uppercase text-sm">{t("maps.map-filter-panel.requirements")}</h2>
|
||||
{MAP_REQUIREMENTS.map(requirement => (
|
||||
<div key={requirement} className="flex justify-start items-center h-[22px] z-20 relative py-0.5 cursor-pointer" onClick={() => handleCheckbox(requirement)}>
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1" checked={filter?.[requirement]} onChange={() => handleCheckbox(requirement)}/>
|
||||
<span className="grow capitalize">{requirement}</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
</section>
|
||||
<section className="grow capitalize">
|
||||
<h2 className="uppercase text-sm mb-1">{t("maps.map-filter-panel.tags")}</h2>
|
||||
<div className="w-full flex flex-row flex-wrap items-start justify-start content-start gap-1 mb-2">
|
||||
{MAP_TYPES.map(tag => (
|
||||
<span key={tag} onClick={() => handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? MAP_DIFFICULTIES_COLORS.Expert : MAP_DIFFICULTIES_COLORS.Normal}}>{translateMapType(tag)}</span>
|
||||
))}
|
||||
</div>
|
||||
<div className="w-full flex flex-row flex-wrap items-start justify-start content-start gap-1">
|
||||
{MAP_STYLES.map(tag => (
|
||||
<span key={tag} onClick={() => handleTagClick(tag)} className={`text-[12.5px] text-black rounded-md px-1 font-bold cursor-pointer ${(!isTagActivated(tag)) && "opacity-40 hover:opacity-90"}`} style={{backgroundColor: isTagExcluded(tag) ? MAP_DIFFICULTIES_COLORS.Expert : MAP_DIFFICULTIES_COLORS.Easy}}>{translateMapStyle(tag)}</span>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{onApply && (
|
||||
<div className="inline float-right relative w-fit h-fit mt-2">
|
||||
<BsmButton className="inline float-right rounded-md font-bold px-1 py-0.5 text-sm" text="misc.apply" typeColor="primary" withBar={false} onClick={handleApply}/>
|
||||
<GlowEffect visible={haveChanged}/>
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { motion } from "framer-motion"
|
||||
import { forwardRef } from "react"
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook"
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
title?: string,
|
||||
linked?: boolean
|
||||
disabled?: boolean,
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
export const LinkButton = motion(forwardRef((props: Props, ref) => {
|
||||
|
||||
const t = useTranslation()
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
const linkedColor = (() => {
|
||||
if(props.disabled){ return "orange"; }
|
||||
if(props.linked){ return color; }
|
||||
return "red";
|
||||
})()
|
||||
|
||||
return (
|
||||
<div ref={ref} className={props.className} title={props.title ? t(props.title) : undefined} onClick={e => {e.preventDefault(); e.stopPropagation(); !props.disabled && props.onClick?.()}} style={{pointerEvents: props.disabled ? "none" : "auto"}}>
|
||||
<span className="absolute top-0 left-0 h-full w-full rounded-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{backgroundColor: linkedColor}}/>
|
||||
<BsmIcon className="p-1 absolute top-0 left-0 h-full w-full !bg-transparent -rotate-45 brightness-150" icon={props.linked ? "link" : "unlink"} style={{color: linkedColor}} />
|
||||
</div>
|
||||
)
|
||||
}))
|
||||
@@ -0,0 +1,333 @@
|
||||
import { MapsManagerService } from "renderer/services/maps-manager.service"
|
||||
import { BSVersion } from "shared/bs-version.interface"
|
||||
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react"
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface"
|
||||
import { Subscription } from "rxjs"
|
||||
import { MapFilter } from "shared/models/maps/beat-saver.model"
|
||||
import { useInView } from "framer-motion"
|
||||
import { MapsDownloaderService } from "renderer/services/maps-downloader.service"
|
||||
import { VariableSizeList } from "react-window"
|
||||
import { MapsRow } from "./maps-row.component"
|
||||
import { BehaviorSubject } from "rxjs"
|
||||
import { debounceTime, last, map, mergeMap } from "rxjs/operators"
|
||||
import { BeatSaverService } from "renderer/services/thrird-partys/beat-saver.service"
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
import BeatWaitingImg from "../../../../assets/images/apngs/beat-waiting.png"
|
||||
import BeatConflict from "../../../../assets/images/apngs/beat-conflict.png"
|
||||
import { BsmImage } from "../shared/bsm-image.component"
|
||||
import { BsmButton } from "../shared/bsm-button.component"
|
||||
import TextProgressBar from "../progress-bar/text-progress-bar.component"
|
||||
|
||||
type Props = {
|
||||
version: BSVersion,
|
||||
className?: string,
|
||||
filter?: MapFilter
|
||||
search?: string,
|
||||
linked?: boolean
|
||||
}
|
||||
|
||||
export const LocalMapsListPanel = forwardRef(({version, className, filter, search, linked} : Props, forwardRef) => {
|
||||
|
||||
const mapsManager = MapsManagerService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const bsaver = BeatSaverService.getInstance();
|
||||
const os = OsDiagnosticService.getInstance();
|
||||
|
||||
const t = useTranslation();
|
||||
const ref = useRef(null)
|
||||
const isVisible = useInView(ref, {once: true, amount: .5});
|
||||
const [maps, setMaps] = useState<BsmLocalMap[]>(null);
|
||||
const [subs] = useState<Subscription[]>([]);
|
||||
const [selectedMaps$] = useState(new BehaviorSubject<BsmLocalMap[]>([]));
|
||||
const [itemPerRow, setItemPerRow] = useState(2);
|
||||
const [listHeight, setListHeight] = useState(0);
|
||||
|
||||
const [loadPercent$] = useState(new BehaviorSubject(0));
|
||||
|
||||
useImperativeHandle(forwardRef ,()=>({
|
||||
deleteMaps(){
|
||||
const mapsToDelete = selectedMaps$.value.length === 0 ? maps : selectedMaps$.value;
|
||||
mapsManager.deleteMaps(mapsToDelete, version).then(res => {
|
||||
if(!res){ return; }
|
||||
removeMapsFromList(mapsToDelete);
|
||||
selectedMaps$.next([]);
|
||||
});
|
||||
},
|
||||
exportMaps(){
|
||||
mapsManager.exportMaps(version, selectedMaps$.value);
|
||||
},
|
||||
getMaps(){
|
||||
return maps;
|
||||
}
|
||||
}), [selectedMaps$.value, maps, version]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if(isVisible){
|
||||
loadMaps();
|
||||
mapsDownloader.addOnMapDownloadedListener((map, targerVersion) => {
|
||||
if(targerVersion !== version){ return; }
|
||||
setMaps(maps => maps ? [map, ...maps] : [map]);
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
setMaps(() => null);
|
||||
loadPercent$.next(0);
|
||||
subs.forEach(s => s.unsubscribe());
|
||||
mapsDownloader.removeOnMapDownloadedListener(loadMaps);
|
||||
}
|
||||
}, [isVisible, version, linked]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if(!isVisible){ return () => {}; }
|
||||
|
||||
const updateItemPerRow = (listWidth: number) => {
|
||||
const newPerRow = Math.min(Math.floor(listWidth / 400), 3);
|
||||
if(newPerRow === itemPerRow){ return; }
|
||||
setItemPerRow(newPerRow);
|
||||
};
|
||||
|
||||
const heightObserver$ = new BehaviorSubject(0);
|
||||
|
||||
const observer = new ResizeObserver(() => {
|
||||
updateItemPerRow(ref.current?.clientWidth || 0);
|
||||
heightObserver$.next(ref.current?.clientHeight || 0)
|
||||
});
|
||||
|
||||
observer.observe(ref.current);
|
||||
|
||||
const sub = heightObserver$.pipe(debounceTime(100)).subscribe(setListHeight);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
sub.unsubscribe();
|
||||
}
|
||||
|
||||
}, [isVisible, itemPerRow])
|
||||
|
||||
const loadMaps = () => {
|
||||
|
||||
setMaps(() => null);
|
||||
loadPercent$.next(0);
|
||||
|
||||
const loadMapsObs$ = mapsManager.getMaps(version);
|
||||
|
||||
loadMapsObs$.pipe(map(progess => {
|
||||
return Math.floor(((progess.loaded / progess.total) * 100));
|
||||
})).subscribe(percent => loadPercent$.next(percent));
|
||||
|
||||
subs.push(loadMapsObs$.pipe(
|
||||
last(),
|
||||
mergeMap(async progress => {
|
||||
if(os.isOffline){ return progress.maps; }
|
||||
const maps = progress.maps;
|
||||
const details = await bsaver.getMapDetailsFromHashs(maps.map(map => map.hash));
|
||||
return maps.map(map => {
|
||||
map.bsaverInfo = details.find(d => d.versions.at(0).hash === map.hash);
|
||||
return map;
|
||||
})
|
||||
})
|
||||
).subscribe({
|
||||
next: maps => setMaps(() => maps),
|
||||
complete: () => loadPercent$.next(0)
|
||||
}));
|
||||
}
|
||||
|
||||
const removeMapsFromList = (mapsToRemove: BsmLocalMap[]) => {
|
||||
const filtredMaps = maps.filter(map => !mapsToRemove.some(toDeleteMaps => map.hash === toDeleteMaps.hash));
|
||||
setMaps(() => filtredMaps);
|
||||
};
|
||||
|
||||
const handleDelete = useCallback((map: BsmLocalMap) => {
|
||||
mapsManager.deleteMaps([map], version).then(res => res && removeMapsFromList([map]));
|
||||
}, [version, maps]);
|
||||
|
||||
const onMapSelected = useCallback((map: BsmLocalMap) => {
|
||||
|
||||
const mapsCopy = [...selectedMaps$.value];
|
||||
if(mapsCopy.some(selectedMap => selectedMap.hash === map.hash)){
|
||||
const i = mapsCopy.findIndex(selectedMap => selectedMap.hash === map.hash);
|
||||
mapsCopy.splice(i, 1);
|
||||
}
|
||||
else{
|
||||
mapsCopy.push(map);
|
||||
}
|
||||
|
||||
selectedMaps$.next(mapsCopy);
|
||||
|
||||
}, [selectedMaps$.value]);
|
||||
|
||||
const isMapFitFilter = (map: BsmLocalMap): boolean => {
|
||||
|
||||
// Can be more clean and optimized i think
|
||||
|
||||
const fitEnabledTags = (() => {
|
||||
if(!filter?.enabledTags || filter.enabledTags.size === 0){ return true; }
|
||||
if(!map?.bsaverInfo?.tags){ return false; }
|
||||
return Array.from(filter.enabledTags.values()).every(tag => map.bsaverInfo.tags.some(mapTag => mapTag === tag));
|
||||
})();
|
||||
|
||||
if(!fitEnabledTags){ return false; }
|
||||
|
||||
const fitExcluedTags = (() => {
|
||||
if(!filter?.excludedTags || filter.excludedTags.size === 0){ return true; }
|
||||
if(!map?.bsaverInfo?.tags){ return true; }
|
||||
return !map.bsaverInfo.tags.some(tag => filter.excludedTags.has(tag));
|
||||
})();
|
||||
|
||||
if(!fitExcluedTags){ return false; }
|
||||
|
||||
const fitMinNps = (() => {
|
||||
if(!filter?.minNps){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return !map.bsaverInfo.versions.some(version => {
|
||||
return version.diffs.some(diff => diff.nps < filter.minNps);
|
||||
});
|
||||
})();
|
||||
|
||||
if(!fitMinNps){ return false; }
|
||||
|
||||
const fitMaxNps = (() => {
|
||||
if(!filter?.maxNps){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return !map.bsaverInfo.versions.some(version => {
|
||||
return version.diffs.some(diff => diff.nps > filter.maxNps);
|
||||
});
|
||||
})();
|
||||
|
||||
if(!fitMaxNps){ return false; }
|
||||
|
||||
const fitMinDuration = (() => {
|
||||
if(!filter?.minDuration){ return true; }
|
||||
|
||||
if(!map?.bsaverInfo?.metadata?.duration){ return false; }
|
||||
return map.bsaverInfo.metadata.duration >= filter.minDuration;
|
||||
})();
|
||||
|
||||
if(!fitMinDuration){ return false; }
|
||||
|
||||
const fitMaxDuration = (() => {
|
||||
if(!filter?.maxDuration){ return true; }
|
||||
if(!map?.bsaverInfo?.metadata?.duration){ return false; }
|
||||
return map.bsaverInfo.metadata.duration <= filter.maxDuration;
|
||||
})();
|
||||
|
||||
if(!fitMaxDuration){ return false; }
|
||||
|
||||
const fitNoodle = (() => {
|
||||
if(!filter?.noodle){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return map.bsaverInfo.versions.some(version => version.diffs.some(diff => !!diff.ne));
|
||||
})();
|
||||
|
||||
if(!fitNoodle){ return false; }
|
||||
|
||||
const fitMe = (() => {
|
||||
if(!filter?.me){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return map.bsaverInfo.versions.some(version => version.diffs.some(diff => !!diff.me));
|
||||
})();
|
||||
|
||||
if(!fitMe){ return false; }
|
||||
|
||||
const fitCinema = (() => {
|
||||
if(!filter?.cinema){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return map.bsaverInfo.versions.some(version => version.diffs.some(diff => !!diff.cinema));
|
||||
})();
|
||||
|
||||
if(!fitCinema){ return false; }
|
||||
|
||||
const fitChroma =(() => {
|
||||
if(!filter?.chroma){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return map.bsaverInfo.versions.some(version => version.diffs.some(diff => !!diff.chroma));
|
||||
})();
|
||||
|
||||
if(!fitChroma){ return false; }
|
||||
|
||||
const fitFullSpread = (() => {
|
||||
if(!filter?.fullSpread){ return true; }
|
||||
if(!map?.bsaverInfo?.versions?.at(0)){ return false; }
|
||||
return map.bsaverInfo.versions.some(version => version?.diffs?.length >= 5);
|
||||
})();
|
||||
|
||||
if(!fitFullSpread){ return false; }
|
||||
|
||||
if(!(filter?.automapper ? map.bsaverInfo?.automapper === filter.automapper : true)){ return false }
|
||||
if(!(filter?.ranked ? map.bsaverInfo?.ranked === filter.ranked : true)){ return false }
|
||||
if(!(filter?.curated ? !!map.bsaverInfo?.curatedAt : true)){ return false }
|
||||
if(!(filter?.verified ? !!map.bsaverInfo?.uploader?.verifiedMapper : true)){ return false }
|
||||
|
||||
const searchCheck = (() => {
|
||||
return (
|
||||
((map.rawInfo?._songName ?? map.bsaverInfo?.name) || "")?.toLowerCase().includes(search.toLowerCase()) ||
|
||||
((map.rawInfo?._songAuthorName ?? map.bsaverInfo?.metadata?.songAuthorName) || "")?.toLowerCase().includes(search.toLowerCase()) ||
|
||||
((map.rawInfo?._levelAuthorName ?? map.bsaverInfo?.metadata?.levelAuthorName) || "")?.toLowerCase().includes(search.toLowerCase()));
|
||||
})();
|
||||
|
||||
if(!searchCheck){ return false };
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
const preppedMaps: BsmLocalMap[][] = (() => {
|
||||
|
||||
if(!maps){ return []; }
|
||||
|
||||
const res: BsmLocalMap[][] = [];
|
||||
let mapsRow: BsmLocalMap[] = []
|
||||
|
||||
for(const map of maps){
|
||||
if(!isMapFitFilter(map)){ continue; }
|
||||
if(mapsRow.length === itemPerRow){
|
||||
res.push(mapsRow);
|
||||
mapsRow = [];
|
||||
}
|
||||
mapsRow.push(map);
|
||||
}
|
||||
|
||||
if(mapsRow.length){
|
||||
res.push(mapsRow);
|
||||
}
|
||||
|
||||
return res;
|
||||
})();
|
||||
|
||||
if(!maps){
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="w-32 h-32 spin-loading" image={BeatWaitingImg}/>
|
||||
<span className="font-bold">{t("modals.download-maps.loading-maps")}</span>
|
||||
<TextProgressBar value$={loadPercent$}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if(!maps.length){
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="h-32" image={BeatConflict}/>
|
||||
<span className="font-bold">{t("pages.version-viewer.maps.tabs.maps.empty-maps.text")}</span>
|
||||
<BsmButton className="font-bold rounded-md p-2" text="pages.version-viewer.maps.tabs.maps.empty-maps.button" typeColor="primary" withBar={false} onClick={e => {e.preventDefault(); mapsDownloader.openDownloadMapModal(version)}}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<VariableSizeList className="p-0 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900" width={"100%"} height={listHeight} itemSize={() => 108} itemCount={preppedMaps.length} itemData={preppedMaps} layout="vertical" style={{scrollbarGutter: "stable both-edges"}} itemKey={(i, data) => data[i].map(map => map.hash).join()}>
|
||||
{(props) => <MapsRow maps={props.data[props.index]} style={props.style} selectedMaps$={selectedMaps$} onMapSelect={onMapSelected} onMapDelete={handleDelete}/>}
|
||||
</VariableSizeList>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
@@ -0,0 +1,244 @@
|
||||
import { BsmImage } from "../shared/bsm-image.component";
|
||||
import { BsvMapCharacteristic, BsvMapDifficultyType } from "shared/models/maps/beat-saver.model"
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { BsmLink } from "../shared/bsm-link.component";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { useState, Fragment, memo, useRef } from "react";
|
||||
import { LinkOpenerService } from "renderer/services/link-opener.service";
|
||||
import dateFormat from "dateformat";
|
||||
import { AudioPlayerService } from "renderer/services/audio-player.service";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { map } from "rxjs/operators";
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import { getMapZipUrlFromHash } from "renderer/helpers/maps-utils";
|
||||
import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component";
|
||||
import defaultImage from '../../../../assets/images/default-version-img.jpg'
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { MAP_DIFFICULTIES } from "renderer/partials/maps/map-difficulties/map-difficulties";
|
||||
import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors"
|
||||
import useDoubleClick from "use-double-click";
|
||||
import { GlowEffect } from "../shared/glow-effect.component";
|
||||
import { useDelayedState } from "renderer/hooks/use-delayed-state.hook";
|
||||
|
||||
export type ParsedMapDiff = {type: BsvMapDifficultyType, name: string, stars: number}
|
||||
|
||||
export type MapItemProps<T = any> = {
|
||||
hash: string,
|
||||
title: string,
|
||||
autor: string,
|
||||
songAutor: string,
|
||||
coverUrl: string,
|
||||
songUrl: string,
|
||||
autorId: number,
|
||||
mapId: string,
|
||||
diffs: Map<BsvMapCharacteristic, ParsedMapDiff[]>,
|
||||
ranked: boolean,
|
||||
bpm: number,
|
||||
duration: number,
|
||||
likes: number,
|
||||
createdAt: string,
|
||||
selected?: boolean,
|
||||
downloading?: boolean,
|
||||
showOwned?: boolean,
|
||||
callBackParam: T
|
||||
onDelete?: (param: T) => void,
|
||||
onDownload?: (param: T) => void,
|
||||
onSelected?: (param: T) => void,
|
||||
onCancelDownload?: (param: T) => void,
|
||||
onDoubleClick?: (param: T) => void
|
||||
}
|
||||
|
||||
export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, autorId, mapId, diffs, ranked, bpm, duration, likes, createdAt, selected, downloading, showOwned, callBackParam, onDelete, onDownload, onSelected, onCancelDownload, onDoubleClick}: MapItemProps) => {
|
||||
|
||||
const linkOpener = LinkOpenerService.getInstance();
|
||||
const audioPlayer = AudioPlayerService.getInstance();
|
||||
|
||||
const color = useThemeColor("first-color");
|
||||
const t = useTranslation();
|
||||
|
||||
const ref = useRef(null);
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const [bottomBarHovered, setBottomBarHovered, cancelBottomBarHovered] = useDelayedState(false);
|
||||
const [diffsPanelHovered, setDiffsPanelHovered] = useState(false);
|
||||
|
||||
useDoubleClick({
|
||||
ref,
|
||||
latency: onDoubleClick ? 200 : 0,
|
||||
onSingleClick: e => onSelected?.(callBackParam),
|
||||
onDoubleClick: e => onDoubleClick?.(callBackParam)
|
||||
})
|
||||
|
||||
const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
|
||||
|
||||
const zipUrl = getMapZipUrlFromHash(hash);
|
||||
const previewUrl = mapId ? `https://skystudioapps.com/bs-viewer/?url=${zipUrl}` : null;
|
||||
const mapUrl = mapId ? `https://beatsaver.com/maps/${mapId}` : null;
|
||||
const authorUrl = autorId ? `https://beatsaver.com/profile/${autorId}` : null;
|
||||
const createdDate = createdAt ? dateFormat(createdAt, "d mmm yyyy") : null;
|
||||
const likesText = likes ? Intl.NumberFormat(undefined, {notation: "compact"}).format(likes).split(" ").join("") : null;
|
||||
|
||||
const durationText = (() => {
|
||||
if(!duration){ return null; }
|
||||
const date = new Date(0);
|
||||
date.setSeconds(duration);
|
||||
return duration > 3600 ? dateFormat(date, "h:MM:ss") : dateFormat(date, "MM:ss");
|
||||
})();
|
||||
|
||||
const parseDiffLabel = (diffLabel: string) => {
|
||||
if(MAP_DIFFICULTIES.includes(diffLabel as BsvMapDifficultyType)){
|
||||
return t(`maps.difficulties.${diffLabel}`);
|
||||
}
|
||||
return diffLabel;
|
||||
}
|
||||
|
||||
const openPreview = () => {
|
||||
if(audioPlayer.playing){
|
||||
audioPlayer.pause();
|
||||
}
|
||||
linkOpener.open(previewUrl, true);
|
||||
}
|
||||
const copyBsr = () => navigator.clipboard.writeText(`!bsr ${mapId}`);
|
||||
const toogleMusic = () => {
|
||||
if(songPlaying){
|
||||
return audioPlayer.pause();
|
||||
}
|
||||
if(!audioPlayer.playing && audioPlayer.src === songUrl){
|
||||
return audioPlayer.resume();
|
||||
}
|
||||
audioPlayer.play(songUrl, bpm);
|
||||
}
|
||||
|
||||
const bottomBarHoverStart = () => {
|
||||
cancelBottomBarHovered();
|
||||
setBottomBarHovered(true, (diffsPanelHovered || bottomBarHovered) ? 0 : 300);
|
||||
}
|
||||
|
||||
const bottomBarHoverEnd = () => {
|
||||
cancelBottomBarHovered();
|
||||
setBottomBarHovered(false, 100);
|
||||
}
|
||||
|
||||
const diffsPanelHoverStart = () => setDiffsPanelHovered(true);
|
||||
const diffsPanelHoverEnd = () => setDiffsPanelHovered(false);
|
||||
|
||||
|
||||
const renderDiffPreview = () => {
|
||||
|
||||
const diffSets = Array.from(diffs.entries());
|
||||
|
||||
if(diffSets.length === 1){
|
||||
const [diffType, diffSet] = diffSets[0];
|
||||
|
||||
return (
|
||||
<>
|
||||
<BsmIcon className="h-4 w-4 mr-px" icon="bsMapDifficulty"/>
|
||||
<div className="flex py-[2px] gap-[1px] h-full">
|
||||
{diffSet.map(diff => (
|
||||
<span key={crypto.randomUUID()} className="h-full w-[6px] rounded-full" style={{backgroundColor: MAP_DIFFICULTIES_COLORS[diff.type]}}/>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
if(diffSets.length > 1){
|
||||
return diffSets.map(([diffType, diffSet]) => (
|
||||
<Fragment key={crypto.randomUUID()}>
|
||||
<BsmIcon className="h-full w-fit mr-px" icon={diffType}/>
|
||||
<span className="mr-2 font-bold text-[15px] h-full flex items-center pb-px">{diffSet.length}</span>
|
||||
</Fragment>
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.li className="relative h-[100px] w-[400px] min-w-[370px] shrink-0 grow basis-0 text-white group cursor-pointer" onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)} style={{zIndex: hovered && 5, transform: "translateZ(0) scale(1.0, 1.0)", backfaceVisibility: "hidden"}}>
|
||||
<GlowEffect visible={hovered || selected && !!onSelected}/>
|
||||
<AnimatePresence>
|
||||
{(diffsPanelHovered || bottomBarHovered) && (
|
||||
<motion.ul key={hash} className="absolute top-[calc(100%-10px)] w-full h-fit max-h-[200%] pt-4 pb-2 px-2 overflow-y-scroll bg-light-main-color-3 dark:bg-main-color-3 text-main-color-1 dark:text-current brightness-125 rounded-md flex flex-col gap-3 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 shadow-sm shadow-black" initial={{opacity: 0}} animate={{opacity: 1}} exit={{opacity: 0}} transition={{duration: .15}} onHoverStart={diffsPanelHoverStart} onHoverEnd={diffsPanelHoverEnd}>
|
||||
{Array.from(diffs.entries()).map(([charac, diffSet]) => (
|
||||
<ol key={crypto.randomUUID()} className="flex flex-col w-full gap-1">
|
||||
{diffSet.map(({type, name, stars}) => (
|
||||
<li key={`${type}${name}${stars}`} className="w-full h-4 flex items-center gap-1">
|
||||
<BsmIcon className="h-full w-fit p-px" icon={charac}/>
|
||||
<span className="h-full px-2 flex items-center text-xs font-bold bg-current rounded-full" style={{color: MAP_DIFFICULTIES_COLORS[type]}}>
|
||||
{
|
||||
stars ? (
|
||||
<span className="h-full block brightness-[.25]">★ {stars}</span>
|
||||
) : (
|
||||
<span className="h-full brightness-[.25] leading-4 pb-[2px] capitalize">{parseDiffLabel(type)}</span>
|
||||
)
|
||||
}
|
||||
</span>
|
||||
<span className="text-sm leading-4 pb-[2px] capitalize">{parseDiffLabel(name)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
))}
|
||||
</motion.ul>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<div className="h-full w-full relative pl-[100px] rounded-md overflow-hidden flex flex-row justify-end">
|
||||
<div className={`absolute top-0 left-0 h-full aspect-square cursor-pointer ${showOwned && "border-l-[5px]"}`} style={{borderColor: showOwned && color}}>
|
||||
<BsmImage className="w-full h-full object-cover" image={coverUrl} placeholder={defaultImage} errorImage={defaultImage} loading="lazy"/>
|
||||
<span className="absolute flex justify-center items-center w-full h-full pr-1 bg-transparent top-0 left-0 group-hover:bg-black group-hover:bg-opacity-40" style={{color}} onClick={(e) => {e.stopPropagation(); e.preventDefault(); toogleMusic()}}>
|
||||
<BsmIcon className="w-full h-full p-7 opacity-0 group-hover:opacity-100 text-white hover:text-current" icon={songPlaying ? "pause" : "play"}/>
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative h-full w-full z-[1] rounded-md overflow-hidden -translate-x-1" ref={ref}>
|
||||
<BsmImage className="absolute top-0 left-0 w-full h-full -z-[1] object-cover" image={coverUrl} placeholder={defaultImage} errorImage={defaultImage} loading="lazy"/>
|
||||
<div className="pt-1 pl-2 pr-7 top-0 left-0 w-full h-full bg-gray-600 bg-opacity-80 flex flex-col justify-between group-hover:bg-main-color-1 group-hover:bg-opacity-80">
|
||||
<h1 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full leading-5 tracking-wide text-lg" title={title}><BsmLink className="hover:underline" href={mapUrl}>{title}</BsmLink></h1>
|
||||
<h2 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full text-sm mb-[3px]">{songAutor && t("maps.map-item.by", {songAutor})}</h2>
|
||||
<h3 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full text-xs">{autor && (<> {t("maps.map-item.mapped-by")} <BsmLink href={authorUrl} className="brightness-200 hover:underline" style={{color}}>{autor}</BsmLink></>)}</h3>
|
||||
<div className="w-full h-4 text-xs gap-2 flex opacity-0 group-hover:opacity-100">
|
||||
{likesText && (
|
||||
<div className="h-full flex items-center">
|
||||
<BsmIcon className="h-full py-[2px] w-fit shrink-0 mr-1" icon="thumbUpFill"/>
|
||||
<span className="mb-[2px]">{likesText}</span>
|
||||
</div>
|
||||
)}
|
||||
{durationText && (
|
||||
<div className="h-full flex items-center">
|
||||
<BsmIcon className="h-full py-[2px] w-fit shrink-0 mr-1" icon="timerFill"/>
|
||||
<span className="mb-[2px]">{durationText}</span>
|
||||
</div>
|
||||
)}
|
||||
{createdAt && (
|
||||
<div className="h-full flex items-center">
|
||||
<BsmIcon className="h-full py-[2px] w-fit shrink-0 mr-1" icon="checkCircleIcon"/>
|
||||
<time className="mb-[2px]">{createdDate}</time>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<motion.div className="w-full h-5 pb-1 pr-7 flex items-center gap-1" onHoverStart={bottomBarHoverStart} onHoverEnd={bottomBarHoverEnd}>
|
||||
{ranked && (
|
||||
<div className="text-yellow-300 bg-current rounded-full px-1 h-full flex items-center justify-center">
|
||||
<span className="uppercase text-xs font-bold tracking-wide brightness-[.25]">{t("maps.map-specificities.ranked")}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="h-full grow flex items-start content-start">
|
||||
{renderDiffPreview()}
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="absolute bg-light-main-color-1 dark:bg-main-color-3 top-0 h-full z-[1] w-[30px] -right-5 group-hover:right-0 transition-all">
|
||||
<span className="absolute w-[10px] h-[10px] top-0 right-full bg-inherit" style={{clipPath: 'path("M11 -1 L11 10 L10 10 A10 10 0 0 0 0 0 L0 -1 Z")'}}/>
|
||||
<span className="absolute w-[10px] h-[10px] bottom-0 right-full bg-inherit" style={{clipPath: 'path("M11 11 L11 0 L10 0 A10 10 0 0 1 0 10 L 0 11 Z")'}}/>
|
||||
|
||||
<div className="flex flex-col justify-center items-center gap-1 w-full h-full overflow-hidden opacity-0 group-hover:opacity-100">
|
||||
{onDelete && !downloading && <BsmButton className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2" iconClassName="w-full h-full brightness-75 dark:brightness-200" iconColor={color} icon="trash" withBar={false} onClick={e => {e.stopPropagation(); onDelete(callBackParam)}}/>}
|
||||
{onDownload && !downloading && <BsmButton className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2" iconClassName="w-full h-full brightness-75 dark:brightness-200" iconColor={color} icon="download" withBar={false} onClick={e => {e.stopPropagation(); onDownload(callBackParam)}}/>}
|
||||
{onCancelDownload && !downloading && <BsmButton className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2" iconClassName="w-full h-full brightness-75 dark:brightness-200" iconColor="red" icon="cross" withBar={false} onClick={e => {e.stopPropagation(); onCancelDownload(callBackParam)}}/>}
|
||||
{downloading && <BsmBasicSpinner className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2 flex items-center justify-center" spinnerClassName="brightness-75 dark:brightness-200" style={{color}} thikness="3px"/>}
|
||||
{previewUrl && <BsmButton className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2" iconClassName="w-full h-full brightness-75 dark:brightness-200" iconColor={color} icon="eye" withBar={false} onClick={e => {e.stopPropagation(); openPreview()}}/>}
|
||||
{mapId && <BsmButton className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2" iconClassName="w-full h-full brightness-75 dark:brightness-200" iconColor={color} icon="twitch" withBar={false} onClick={e => {e.stopPropagation(); copyBsr()}}/>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.li>
|
||||
)
|
||||
}, equal);
|
||||
@@ -0,0 +1,172 @@
|
||||
import { DetailedHTMLProps, useEffect, useRef, useState } from "react"
|
||||
import { BSVersion } from "shared/bs-version.interface"
|
||||
import { TabNavBar } from "../shared/tab-nav-bar.component"
|
||||
import { LocalMapsListPanel } from "./local-maps-list-panel.component"
|
||||
import { BsmDropdownButton, DropDownItem } from "../shared/bsm-dropdown-button.component"
|
||||
import { FilterPanel } from "./filter-panel.component"
|
||||
import { MapFilter } from "shared/models/maps/beat-saver.model"
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook"
|
||||
import { MapsManagerService } from "renderer/services/maps-manager.service"
|
||||
import { motion, Variants } from "framer-motion";
|
||||
import { MapsDownloaderService } from "renderer/services/maps-downloader.service"
|
||||
import { BsmImage } from "../shared/bsm-image.component"
|
||||
import wipGif from "../../../../assets/images/gifs/wip.gif"
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service"
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook"
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
import { LinkButton } from "./link-button.component"
|
||||
import { debounceTime } from "rxjs/operators"
|
||||
import { VersionFolderLinkerService, VersionLinkerActionListener } from "renderer/services/version-folder-linker.service"
|
||||
|
||||
|
||||
type Props = {
|
||||
version?: BSVersion
|
||||
}
|
||||
|
||||
export function MapsPlaylistsPanel({version}: Props) {
|
||||
|
||||
const mapsService = MapsManagerService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const osDiagnostic = OsDiagnosticService.getInstance();
|
||||
const linker = VersionFolderLinkerService.getInstance();
|
||||
|
||||
const [tabIndex, setTabIndex] = useState(0);
|
||||
const [mapFilter, setMapFilter] = useState<MapFilter>({});
|
||||
const [mapSearch, setMapSearch] = useState("");
|
||||
const [playlistSearch, setPlaylistSearch] = useState("");
|
||||
const [mapsLinked, setMapsLinked] = useState(false);
|
||||
const [linkingPending, setLinkingPending] = useState(false);
|
||||
const isOnline = useObservable(osDiagnostic.isOnline$);
|
||||
const color = useThemeColor("first-color");
|
||||
const t = useTranslation();
|
||||
const mapsRef = useRef<any>();
|
||||
|
||||
useEffect(() => {
|
||||
if(!version){ return; }
|
||||
|
||||
loadMapIsLinked();
|
||||
|
||||
const sub = mapsService.$mapsLinkingPending(version).pipe(debounceTime(50)).subscribe(setLinkingPending);
|
||||
|
||||
const onMapsLinked: VersionLinkerActionListener = (action, linked) => {
|
||||
if(!action.relativeFolder.includes(MapsManagerService.RELATIVE_MAPS_FOLDER)){ return; }
|
||||
loadMapIsLinked();
|
||||
}
|
||||
|
||||
linker.onVersionFolderLinked(onMapsLinked);
|
||||
linker.onVersionFolderUnlinked(onMapsLinked);
|
||||
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
linker.removeVersionFolderLinkedListener(onMapsLinked);
|
||||
linker.removeVersionFolderUnlinkedListener(onMapsLinked);
|
||||
}
|
||||
|
||||
}, [version]);
|
||||
|
||||
const loadMapIsLinked = () => {
|
||||
mapsService.versionHaveMapsLinked(version).then(setMapsLinked);
|
||||
}
|
||||
|
||||
const handleSearch = (value: string) => {
|
||||
if(tabIndex === 0){
|
||||
return setMapSearch(() => value);
|
||||
}
|
||||
return setPlaylistSearch(() => value);
|
||||
}
|
||||
|
||||
const handleMapsLinkClick = () => {
|
||||
if(!mapsLinked){
|
||||
return mapsService.linkVersion(version);
|
||||
}
|
||||
return mapsService.unlinkVersion(version);
|
||||
}
|
||||
|
||||
const handleMapsAddClick = () => {
|
||||
mapsDownloader.openDownloadMapModal(version, mapsRef.current.getMaps?.());
|
||||
}
|
||||
|
||||
const renderTab = (props: DetailedHTMLProps<React.HTMLAttributes<HTMLLIElement>, HTMLLIElement>, text: string, index: number): JSX.Element => {
|
||||
|
||||
const onClickLink = (index: number) => {
|
||||
if(index === 0){ handleMapsLinkClick(); }
|
||||
}
|
||||
|
||||
const onClickAdd = (index: number) => {
|
||||
if(index === 0){ handleMapsAddClick(); }
|
||||
}
|
||||
|
||||
const variants: Variants = { hover: {rotate: 22.5}, tap: {rotate: 45} };
|
||||
|
||||
return (
|
||||
<li className="relative text-center text-lg font-bold hover:backdrop-brightness-75 flex justify-center items-center content-center" onClick={props.onClick}>
|
||||
<span className="text-main-color-1 dark:text-gray-200">{text}</span>
|
||||
{index === 0 &&(
|
||||
<div className="h-full flex absolute right-0 top-0 gap-1.5 items-center pr-2">
|
||||
{isOnline && (
|
||||
<motion.div whileHover="hover" whileTap="tap" className="relative h-[calc(100%-5px)] flex flex-row justify-center items-center shrink-0 rounded-full overflow-hidden pr-2" style={{color}} onClick={e => {e.stopPropagation(); onClickAdd(index)}}>
|
||||
<span className="absolute top-0 left-0 h-full w-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{backgroundColor: "currentcolor"}}/>
|
||||
<motion.div className="h-full p-0.5" variants={variants}>
|
||||
<BsmIcon className="block h-full aspect-square brightness-150" icon="add"/>
|
||||
</motion.div>
|
||||
<span className="text-sm brightness-150">{t("misc.add")}</span>
|
||||
</motion.div>
|
||||
)}
|
||||
{(!!version) && (
|
||||
<LinkButton
|
||||
variants={variants}
|
||||
disabled={linkingPending}
|
||||
whileHover="hover"
|
||||
whileTap="tap"
|
||||
initial={{rotate: 0}}
|
||||
className="block p-0.5 h-[calc(100%-5px)] aspect-square blur-0 hover:brightness-75"
|
||||
linked={mapsLinked}
|
||||
title={mapsLinked ? "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.unlink" : "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.link"}
|
||||
onClick={() => onClickLink(index)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
const dropDownItems = ((): DropDownItem[] => {
|
||||
if(tabIndex === 1){
|
||||
return [
|
||||
|
||||
]
|
||||
}
|
||||
return [
|
||||
{icon:"export", text: "pages.version-viewer.maps.search-bar.dropdown.export-maps", onClick: () => mapsRef.current.exportMaps?.()},
|
||||
{icon: "trash", text: "pages.version-viewer.maps.search-bar.dropdown.delete-maps", onClick: () => mapsRef.current.deleteMaps?.()}
|
||||
]
|
||||
|
||||
})()
|
||||
|
||||
return (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center gap-4">
|
||||
<nav className="w-full shrink-0 flex h-9 justify-center px-40 gap-2 text-main-color-1 dark:text-white">
|
||||
<div className="h-full rounded-full bg-light-main-color-2 dark:bg-main-color-2 grow p-[6px]">
|
||||
<input type="text" className="h-full w-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={tabIndex === 0 ? mapSearch : playlistSearch} onChange={e => handleSearch(e.target.value)} tabIndex={-1}/>
|
||||
</div>
|
||||
<BsmDropdownButton className="h-full relative z-[1] flex justify-center" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" withBar={false}>
|
||||
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[500px] h-fit p-2 rounded-md shadow-md shadow-black" filter={mapFilter} onChange={setMapFilter}/>
|
||||
</BsmDropdownButton>
|
||||
<BsmDropdownButton className="h-full flex aspect-square relative rounded-full z-[1] bg-light-main-color-1 dark:bg-main-color-3" buttonClassName="rounded-full h-full w-full p-[6px]" icon="three-dots" withBar={false} items={dropDownItems} menuTranslationY="6px" align="center"/>
|
||||
</nav>
|
||||
<div className="w-full h-full flex flex-col bg-light-main-color-3 dark:bg-main-color-2 rounded-md shadow-black shadow-md overflow-hidden">
|
||||
<TabNavBar className="!rounded-none shadow-sm" tabIndex={tabIndex} tabsText={["misc.maps", "misc.playlists"]} onTabChange={setTabIndex} renderTab={renderTab}/>
|
||||
<div className="w-full grow min-h-0 flex flex-row items-center transition-transform duration-300" style={{transform: `translate(${-(tabIndex * 100)}%, 0)`}}>
|
||||
<LocalMapsListPanel ref={mapsRef} className="w-full h-full shrink-0 flex flex-col" version={version} filter={mapFilter} search={mapSearch} linked={mapsLinked}/>
|
||||
<div className="w-full h-full shrink-0 flex flex-col justify-center items-center content-center gap-2 overflow-hidden text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="rounded-md" image={wipGif}/>
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import { CSSProperties, memo } from "react"
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook"
|
||||
import { distinctUntilChanged, map } from "rxjs/operators"
|
||||
import { BehaviorSubject } from "rxjs"
|
||||
import { BsvMapCharacteristic } from "shared/models/maps/beat-saver.model"
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface"
|
||||
import { ParsedMapDiff, MapItem } from "./map-item.component"
|
||||
import equal from "fast-deep-equal/es6"
|
||||
|
||||
type Props = {
|
||||
maps: BsmLocalMap[],
|
||||
style?: CSSProperties,
|
||||
onMapDelete: (map: BsmLocalMap) => void,
|
||||
onMapSelect: (map: BsmLocalMap) => void,
|
||||
selectedMaps$: BehaviorSubject<BsmLocalMap[]>
|
||||
}
|
||||
|
||||
export const MapsRow = memo(({maps, style, selectedMaps$, onMapSelect, onMapDelete}: Props) => {
|
||||
|
||||
const selectedMaps = useObservable<BsmLocalMap[]>(selectedMaps$.pipe(
|
||||
map(selectedMaps => selectedMaps.filter(selected => maps.some(map => map.hash === selected.hash))),
|
||||
distinctUntilChanged(equal)
|
||||
), []);
|
||||
|
||||
const extractMapDiffs = (map: BsmLocalMap): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
const res = new Map<BsvMapCharacteristic, ParsedMapDiff[]>();
|
||||
if(map.bsaverInfo?.versions[0]?.diffs){
|
||||
map.bsaverInfo.versions[0].diffs.forEach(diff => {
|
||||
const arr = res.get(diff.characteristic) || [];
|
||||
const diffName = map.rawInfo._difficultyBeatmapSets.find(set => set._beatmapCharacteristicName === diff.characteristic)._difficultyBeatmaps.find(rawDiff => rawDiff._difficulty === diff.difficulty)?._customData?._difficultyLabel || diff.difficulty
|
||||
arr.push({name: diffName, type: diff.difficulty, stars: diff.stars});
|
||||
res.set(diff.characteristic, arr);
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
map.rawInfo._difficultyBeatmapSets.forEach(set => {
|
||||
set._difficultyBeatmaps.forEach(diff => {
|
||||
const arr = res.get(set._beatmapCharacteristicName) || [];
|
||||
arr.push({name: diff._customData?._difficultyLabel || diff._difficulty, type: diff._difficulty, stars: null});
|
||||
res.set(set._beatmapCharacteristicName, arr);
|
||||
});
|
||||
});
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
const renderMapItem = (map: BsmLocalMap) => {
|
||||
|
||||
return <MapItem
|
||||
key={map.hash}
|
||||
hash={map.hash}
|
||||
title={map.rawInfo._songName}
|
||||
coverUrl={map.coverUrl}
|
||||
songUrl={map.songUrl}
|
||||
autor={map.rawInfo._levelAuthorName}
|
||||
songAutor={map.rawInfo._songAuthorName}
|
||||
bpm={map.rawInfo._beatsPerMinute}
|
||||
duration={map.bsaverInfo?.metadata?.duration}
|
||||
selected={selectedMaps.some(selected => selected.hash === map.hash)}
|
||||
diffs={extractMapDiffs(map)} mapId={map.bsaverInfo?.id} ranked={map.bsaverInfo?.ranked} autorId={map.bsaverInfo?.uploader?.id} likes={map.bsaverInfo?.stats?.upvotes} createdAt={map.bsaverInfo?.createdAt}
|
||||
onDelete={onMapDelete}
|
||||
onSelected={onMapSelect}
|
||||
callBackParam={map}
|
||||
/>;
|
||||
}
|
||||
|
||||
return (
|
||||
<ul className="h-fit w-full flex flex-nowrap basis-0 gap-x-[8px] py-1 px-3" style={style}>
|
||||
{maps && maps.map(renderMapItem)}
|
||||
</ul>
|
||||
)
|
||||
}, equal);
|
||||
@@ -0,0 +1,11 @@
|
||||
type Props = {
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function MapsToolbar({className}: Props) {
|
||||
return (
|
||||
<div className={className}>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { MapsManagerService } from "renderer/services/maps-manager.service";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import BeatConflict from '../../../../../assets/images/apngs/beat-conflict.png'
|
||||
|
||||
export const DeleteMapsModal: ModalComponent<void, {linked: boolean, maps: BsmLocalMap[]}> = ({resolver, data:{linked, maps}}) => {
|
||||
|
||||
const config = ConfigurationService.getInstance();
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [remember, setRemember] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const key = MapsManagerService.REMEMBER_CHOICE_DELETE_MAP_KEY;
|
||||
config.set(key, remember);
|
||||
}, [remember])
|
||||
|
||||
|
||||
const multiple = maps.length > 1;
|
||||
|
||||
const titleText = multiple ? "modals.maps-actions.delete-maps.title.multiple" : "modals.maps-actions.delete-maps.title.single";
|
||||
const descText = multiple ? "modals.maps-actions.delete-maps.desc.multiple" : "modals.maps-actions.delete-maps.desc.single";
|
||||
const infoText = multiple ? "modals.maps-actions.delete-maps.info.desc.multiple" : "modals.maps-actions.delete-maps.info.desc.single";
|
||||
const infoTitleText = multiple ? "modals.maps-actions.delete-maps.info.title.multiple" : "modals.maps-actions.delete-maps.info.title.single";
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t(titleText)}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict} />
|
||||
<p className="max-w-sm w-full">{t(descText, multiple ? {nb: maps.length.toString()} : {name: maps.at(0).rawInfo._songName})}</p>
|
||||
{linked && <p className="text-sm italic mt-2 cursor-help w-fit" title={t(infoTitleText)}>{t(infoText)}</p>}
|
||||
{!multiple && (
|
||||
<div className="flex items-center relative py-2 gap-1 mt-1">
|
||||
<BsmCheckbox className="h-5 relative z-[1]" checked={remember} onChange={(val) => setRemember(val)}/>
|
||||
<span className="italic">{t("modals.misc.remember-my-choice")}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-2">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="misc.delete"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { FilterPanel } from "renderer/components/maps-mangement-components/filter-panel.component";
|
||||
import { MapItem, ParsedMapDiff } from "renderer/components/maps-mangement-components/map-item.component";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmDropdownButton } from "renderer/components/shared/bsm-dropdown-button.component";
|
||||
import { BsmSelect, BsmSelectOption } from "renderer/components/shared/bsm-select.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { BSV_SORT_ORDER } from "renderer/partials/beat-saver/sort-order";
|
||||
import { BeatSaverService } from "renderer/services/thrird-partys/beat-saver.service";
|
||||
import { MapsDownloaderService } from "renderer/services/maps-downloader.service";
|
||||
import { MapsManagerService } from "renderer/services/maps-manager.service";
|
||||
import { ModalComponent } from "renderer/services/modale.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsvMapCharacteristic, BsvMapDetail, MapFilter, SearchOrder, SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import BeatWaitingImg from "../../../../../assets/images/apngs/beat-waiting.png";
|
||||
import BeatConflictImg from "../../../../../assets/images/apngs/beat-conflict.png";
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import { ProgressBarService } from "renderer/services/progress-bar.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
|
||||
export const DownloadMapsModal: ModalComponent<void, {version: BSVersion, ownedMaps: BsmLocalMap[]}> = ({resolver, data: { ownedMaps, version }}) => {
|
||||
|
||||
const beatSaver = BeatSaverService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const progressBar = ProgressBarService.getInstance();
|
||||
const os = OsDiagnosticService.getInstance();
|
||||
|
||||
const currentDownload = useObservable(mapsDownloader.currentMapDownload$);
|
||||
const mapsInQueue = useObservable(mapsDownloader.mapsInQueue$);
|
||||
const t = useTranslation();
|
||||
const filterContainerRef = useRef(null);
|
||||
const [filter, setFilter] = useState<MapFilter>({});
|
||||
const [query, setQuery] = useState("");
|
||||
const [maps, setMaps] = useState<BsvMapDetail[]>([]);
|
||||
const [sortOrder, setSortOrder] = useState<SearchOrder>(BSV_SORT_ORDER.at(0));
|
||||
const [ownedMapHashs, setOwnedMapHashs] = useState<string[]>(ownedMaps?.map(map => map.hash) ?? []);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const isOnline = useObservable(os.isOnline$);
|
||||
const [searchParams, setSearchParams] = useState<SearchParams>({
|
||||
sortOrder,
|
||||
filter,
|
||||
page: 0,
|
||||
q: query
|
||||
});
|
||||
|
||||
const loaderRef = useRef(null);
|
||||
|
||||
const sortOptions: BsmSelectOption<SearchOrder>[] = (() => {
|
||||
return BSV_SORT_ORDER.map(sort => ({text: `beat-saver.maps-sorts.${sort}`, value: sort}));
|
||||
})();
|
||||
|
||||
useEffect(() => {
|
||||
loadMaps(searchParams);
|
||||
}, [searchParams]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const onMapDownloaded = (map: BsmLocalMap, targerVersion: BSVersion) => {
|
||||
if(!equal(targerVersion, version)){ return; }
|
||||
const downloadedHash = map.hash;
|
||||
setOwnedMapHashs((prev) => [...prev, downloadedHash]);
|
||||
}
|
||||
|
||||
mapsDownloader.addOnMapDownloadedListener(onMapDownloaded);
|
||||
|
||||
if(mapsDownloader.isDownloading){
|
||||
progressBar.setStyle(mapsDownloader.progressBarStyle);
|
||||
}
|
||||
|
||||
return () => {
|
||||
mapsDownloader.removeOnMapDownloadedListener(onMapDownloaded);
|
||||
progressBar.setStyle(null);
|
||||
}
|
||||
}, [])
|
||||
|
||||
const loadMaps = (params: SearchParams) => {
|
||||
setLoading(() => true);
|
||||
beatSaver.searchMaps(params).then((maps => setMaps(prev => [...prev, ...maps]))).finally(() => setLoading(() => false));
|
||||
}
|
||||
|
||||
const extractMapDiffs = (map: BsvMapDetail): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
const res = new Map<BsvMapCharacteristic, ParsedMapDiff[]>();
|
||||
if(map.versions.at(0).diffs){
|
||||
map.versions.at(0).diffs.forEach(diff => {
|
||||
const arr = res.get(diff.characteristic) || [];
|
||||
arr.push({name: diff.difficulty, type: diff.difficulty, stars: diff.stars});
|
||||
res.set(diff.characteristic, arr);
|
||||
});
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
const renderMap = (map: BsvMapDetail) => {
|
||||
|
||||
const isMapOwned = map.versions.some(version => ownedMapHashs.includes(version.hash));
|
||||
const isDownloading = map.id === currentDownload?.map?.id;
|
||||
const inQueue = mapsInQueue.some(toDownload => equal(toDownload.version, version) && toDownload.map.id === map.id);
|
||||
|
||||
return (
|
||||
<MapItem
|
||||
autor={map.metadata.levelAuthorName}
|
||||
autorId={map.uploader.id}
|
||||
bpm={map.metadata.bpm}
|
||||
coverUrl={map.versions.at(0).coverURL}
|
||||
createdAt={map.createdAt}
|
||||
duration={map.metadata.duration}
|
||||
hash={map.versions.at(0).hash}
|
||||
likes={map.stats.upvotes}
|
||||
mapId={map.id}
|
||||
ranked={map.ranked}
|
||||
title={map.name}
|
||||
songAutor={map.metadata.songAuthorName}
|
||||
diffs={extractMapDiffs(map)}
|
||||
songUrl={map.versions.at(0).previewURL}
|
||||
key={map.id}
|
||||
onDownload={(!isMapOwned && !inQueue) && (handleDownloadMap)}
|
||||
onDoubleClick={(!isMapOwned && !inQueue) && (handleDownloadMap)}
|
||||
onCancelDownload={(inQueue && !isDownloading) && (handleCancelDownload)}
|
||||
downloading={isDownloading}
|
||||
showOwned={isMapOwned}
|
||||
callBackParam={map}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const handleDownloadMap = useCallback((map: BsvMapDetail) => {
|
||||
mapsDownloader.addMapToDownload({map, version})
|
||||
}, []);
|
||||
|
||||
const handleCancelDownload = useCallback((map: BsvMapDetail) => {
|
||||
mapsDownloader.removeMapToDownload({map, version});
|
||||
}, []);
|
||||
|
||||
const handleSortChange = (newSort: SearchOrder) => {
|
||||
setSortOrder(() => newSort);
|
||||
setMaps(() => []);
|
||||
setSearchParams(() => ({...searchParams, sortOrder: (newSort)}));
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
const searchParams: SearchParams = {
|
||||
sortOrder,
|
||||
filter,
|
||||
q: query.trim(),
|
||||
page: 0,
|
||||
};
|
||||
|
||||
setMaps(() => []);
|
||||
setSearchParams(() => searchParams);
|
||||
}
|
||||
|
||||
const handleLoadMore = () => {
|
||||
setSearchParams((prev) => {
|
||||
return {...prev, page: prev.page + 1}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200 flex flex-col max-w-[95vw] w-[970px] h-[85vh] gap-3" onSubmit={e => {e.preventDefault(); handleSearch()}}>
|
||||
<div className="flex h-9 gap-2 shrink-0">
|
||||
<BsmDropdownButton ref={filterContainerRef} className="shrink-0 h-full relative z-[1] flex justify-start" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1 !bg-light-main-color-1 dark:!bg-main-color-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" withBar={false}>
|
||||
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[450px] h-fit p-2 rounded-md shadow-md shadow-black" filter={filter} onChange={setFilter} onApply={handleSearch} onClose={() => filterContainerRef.current.close()}/>
|
||||
</BsmDropdownButton>
|
||||
<input className="h-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2 grow pb-0.5" type="text" name="" id="" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={query} onChange={e => setQuery(e.target.value)}/>
|
||||
<BsmButton className="shrink-0 rounded-full py-1 px-3 !bg-light-main-color-1 dark:!bg-main-color-1 flex justify-center items-center capitalize" icon="search" text="modals.download-maps.search-btn" withBar={false} onClick={e => {e.preventDefault(); handleSearch()}}/>
|
||||
<BsmSelect className="bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-1 pb-0.5 text-center" options={sortOptions} onChange={sort => handleSortChange(sort)}/>
|
||||
</div>
|
||||
<ul className="w-full grow flex content-start flex-wrap gap-2 pt-1.5 px-2 overflow-y-scroll overflow-x-hidden scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 z-0" >
|
||||
{maps.length === 0 ? (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center">
|
||||
<img className={`w-32 h-32 ${loading && "spin-loading"}`} src={loading ? BeatWaitingImg : BeatConflictImg} alt=" "/>
|
||||
<span className="text-lg">{t(loading ? "modals.download-maps.loading-maps" : isOnline ? "modals.download-maps.no-maps-found" : "modals.download-maps.no-internet")}</span>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{maps.map(renderMap)}
|
||||
<motion.span onViewportEnter={handleLoadMore} ref={loaderRef} className="block w-full h-8"/>
|
||||
</>
|
||||
)}
|
||||
</ul>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -5,18 +5,17 @@ import { BsmIcon } from "renderer/components/svgs/bsm-icon.component";
|
||||
import { DefaultConfigKey } from "renderer/config/default-configuration.config";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { ModalExitCode, ModalResponse, ModalService } from "renderer/services/modale.service";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
|
||||
export function EditVersionModal({resolver, clone = false}: {resolver: (x: ModalResponse<{name: string, color: string}>) => void, clone?: boolean}) {
|
||||
export const EditVersionModal: ModalComponent<{name: string, color: string}, {version: BSVersion, clone?: boolean}> = ({resolver, data}) => {
|
||||
|
||||
const {version, clone} = data;
|
||||
|
||||
const configService = ConfigurationService.getInstance();
|
||||
const modalService = ModalService.getInsance();
|
||||
|
||||
const modalData: BSVersion = modalService.getModalData();
|
||||
|
||||
const [name, setName] = useState(modalData.name || modalData.BSVersion);
|
||||
const [color, setColor] = useState(modalData.color ?? configService.get<string>("second-color" as DefaultConfigKey));
|
||||
const [name, setName] = useState(version.name || version.BSVersion);
|
||||
const [color, setColor] = useState(version.color ?? configService.get<string>("second-color" as DefaultConfigKey));
|
||||
const t = useTranslation();
|
||||
|
||||
const rename = () => {
|
||||
@@ -31,16 +30,16 @@ export function EditVersionModal({resolver, clone = false}: {resolver: (x: Modal
|
||||
return (
|
||||
<form className="static" onSubmit={(e) => {e.preventDefault(); rename();}}>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t(!clone ? "modals.edit-version.title" : "modals.clone-version.title")}</h1>
|
||||
<BsmIcon className="w-full h-11 my-3" icon="bsNote" style={{color: color}}/>
|
||||
<BsmIcon className="w-full h-11 my-3" icon="bsNote" style={{color}}/>
|
||||
{ clone && (
|
||||
<p className="max-w-sm mb-2 text-gray-800 dark:text-gray-200">{t("modals.clone-version.description")}</p>
|
||||
)}
|
||||
<div className="mb-3">
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="name">{t("Nom")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setName(e.target.value)} value={name} type="text" name="name" id="name" minLength={2} maxLength={15} placeholder={t("Nom de la version")}/>
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="name">{t("modals.clone-version.inputs.name.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setName(e.target.value)} value={name} type="text" name="name" id="name" minLength={2} maxLength={15} placeholder={t("modals.clone-version.inputs.name.placeholder")}/>
|
||||
</div>
|
||||
<div>
|
||||
<span className="block font-bold tracking-wide text-gray-800 dark:text-gray-200">Couleur</span>
|
||||
<span className="block font-bold tracking-wide text-gray-800 dark:text-gray-200">{t("modals.clone-version.inputs.color.label")}</span>
|
||||
<div className="relative w-full h-7 mb-4 bg-light-main-color-1 dark:bg-main-color-1 flex justify-center rounded-md py-1 z-[1]">
|
||||
<SettingColorChooser color={color} onChange={setColor} pickerClassName="!h-32 !w-32"/>
|
||||
<div className="absolute right-2 top-0 h-full flex items-center">
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { ModalExitCode, ModalResponse } from "../../../services/modale.service";
|
||||
import { ModalComponent, ModalExitCode } from "../../../services/modale.service";
|
||||
import { useState } from "react";
|
||||
import BeatConflict from "../../../../../assets/images/apngs/beat-conflict.png"
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
|
||||
export function GuardModal({resolver}: {resolver: (x: ModalResponse<string>) => void}) {
|
||||
export const GuardModal: ModalComponent<string> = ({resolver}) => {
|
||||
|
||||
const [guardCode, setGuardCode] = useState('');
|
||||
const t = useTranslation();
|
||||
@@ -21,7 +21,7 @@ export function GuardModal({resolver}: {resolver: (x: ModalResponse<string>) =>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict}/>
|
||||
<div className="mb-4">
|
||||
<label className="block font-bold tracking-wide text-gray-800 dark:text-gray-200" htmlFor="guard">{t("modals.guard.inputs.guard-code.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-2 rounded-md py-[2px]" onChange={e => setGuardCode(e.target.value.toUpperCase())} value={guardCode} type="guard" name="guard" id="guard" placeholder={t("modals.guard.inputs.guard-code.placeholder")}/>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-2 rounded-md py-[2px]" onChange={e => setGuardCode(e.target.value.toUpperCase().replaceAll(" ", ""))} value={guardCode} type="guard" name="guard" id="guard" placeholder={t("modals.guard.inputs.guard-code.placeholder")}/>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => {resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.cancel"/>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { BsmButton } from 'renderer/components/shared/bsm-button.component'
|
||||
import { BsmImage } from 'renderer/components/shared/bsm-image.component'
|
||||
import { useTranslation } from 'renderer/hooks/use-translation.hook'
|
||||
import { ModalComponent, ModalExitCode } from 'renderer/services/modale.service'
|
||||
import BeatImpatient from "../../../../../assets/images/apngs/beat-impatient.png"
|
||||
|
||||
export const ImportVersionModal: ModalComponent<void> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
return (
|
||||
<form>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.title")}</h1>
|
||||
<BsmImage className="mx-auto h-20" image={BeatImpatient}/>
|
||||
<p className="max-w-sm text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.description")}</p>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="modals.bs-import-version.buttons.submit"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ModalExitCode, ModalResponse } from "renderer/services/modale.service";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import BeatConflict from "../../../../../assets/images/apngs/beat-conflict.png"
|
||||
|
||||
export function InstallationFolderModal({resolver}: {resolver: (x: ModalResponse) => void}) {
|
||||
export const InstallationFolderModal: ModalComponent<void> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className="absolute bg-gradient-to-r from-blue-500 to-red-500 top-0 w-full left-0 h-1"></span>
|
||||
<form>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.install-folder.title")}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict}/>
|
||||
<p className="max-w-sm text-gray-800 dark:text-gray-200">{t("modals.install-folder.description")}</p>
|
||||
@@ -18,6 +17,6 @@ export function InstallationFolderModal({resolver}: {resolver: (x: ModalResponse
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="modals.install-folder.buttons.submit"/>
|
||||
</div>
|
||||
</>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { useState } from "react";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import BeatRunning from '../../../../../assets/images/apngs/beat-running.png'
|
||||
|
||||
export const LinkMapsModal: ModalComponent<boolean> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
const [keepMaps, setKeepMaps] = useState(true);
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t("modals.maps-actions.link-maps.title")}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatRunning} />
|
||||
<p className="max-w-sm w-full">{t("modals.maps-actions.link-maps.desc")}</p>
|
||||
<p className="max-w-sm w-full text-sm italic mt-2">{t("modals.maps-actions.link-maps.info")}</p>
|
||||
<div className="relative h-5 flex my-3 items-center">
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1.5 z-[1]" checked={keepMaps} onChange={setKeepMaps}/>
|
||||
<span className="text-sm mb-0.5 cursor-help" title={t("modals.maps-actions.link-maps.keep-maps.title")}>{t("modals.maps-actions.link-maps.keep-maps.label")}</span>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED, data: keepMaps})} withBar={false} text="modals.maps-actions.link-maps.valid-btn"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -2,14 +2,17 @@ import { useState } from "react";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ModalExitCode, ModalResponse } from "renderer/services/modale.service";
|
||||
import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service";
|
||||
import BeatImpatient from '../../../../../assets/images/apngs/beat-impatient.png'
|
||||
import { WhyCredentialsModal } from "./why-credentials-modal.component";
|
||||
|
||||
export function LoginModal({resolver}: {resolver: (x: ModalResponse<any>) => void}) {
|
||||
export const LoginModal: ModalComponent<{username: string, password: string, stay: boolean}> = ({resolver}) => {
|
||||
|
||||
const modal = ModalService.getInsance();
|
||||
|
||||
const [username, setUsername] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [stay, setStay] = useState(true);
|
||||
const [stay, setStay] = useState(false);
|
||||
const t = useTranslation();
|
||||
|
||||
const loggin = () => {
|
||||
@@ -17,10 +20,15 @@ export function LoginModal({resolver}: {resolver: (x: ModalResponse<any>) => voi
|
||||
resolver({exitCode: ModalExitCode.COMPLETED, data:{username, password, stay}});
|
||||
}
|
||||
|
||||
const whyCredentials = () => {
|
||||
modal.openModal(WhyCredentialsModal);
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={(e) => {e.preventDefault(); loggin();}}>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.steam-login.title")}</h1>
|
||||
<BsmImage className="mx-auto h-20" image={BeatImpatient} />
|
||||
|
||||
<div className="mb-2">
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="username">{t("modals.steam-login.inputs.username.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setUsername(e.target.value)} value={username} type="text" name="username" id="username" placeholder={t("modals.steam-login.inputs.username.placeholder")}/>
|
||||
@@ -29,13 +37,12 @@ export function LoginModal({resolver}: {resolver: (x: ModalResponse<any>) => voi
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="password">{t("modals.steam-login.inputs.password.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setPassword(e.target.value)} value={password} type="password" name="password" id="password" placeholder={t("modals.steam-login.inputs.password.placeholder")}/>
|
||||
</div>
|
||||
<div className="flex items-center content-center justify-start mb-3">
|
||||
<input onChange={e => setStay(e.target.checked)} checked={stay} className="mr-1" type="checkbox" name="stay" id="stay" />
|
||||
<label className="cursor-pointer text-gray-800 dark:text-gray-200" htmlFor="stay">{t("modals.steam-login.inputs.stay.label")}</label>
|
||||
</div>
|
||||
|
||||
<span onClick={whyCredentials} className="underline my-4 block cursor-pointer">{t("modals.steam-login.why-credentials")}</span>
|
||||
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => {resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" type="submit" withBar={false} text={t("modals.steam-login.buttons.submit")}/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" type="submit" withBar={false} text="modals.steam-login.buttons.submit"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { useState } from 'react'
|
||||
import { ModalComponent, ModalExitCode } from 'renderer/services/modale.service'
|
||||
import { BsmLocalModel } from 'shared/models/models/bsm-local-model.interface'
|
||||
import BeatConflict from '../../../../../../assets/images/apngs/beat-conflict.png'
|
||||
import { BsmImage } from 'renderer/components/shared/bsm-image.component'
|
||||
import { BsmCheckbox } from 'renderer/components/shared/bsm-checkbox.component'
|
||||
import { BsmButton } from 'renderer/components/shared/bsm-button.component'
|
||||
import { useTranslation } from 'renderer/hooks/use-translation.hook'
|
||||
import { useOnUpdate } from 'renderer/hooks/use-on-update.hook'
|
||||
import { useConstant } from 'renderer/hooks/use-constant.hook'
|
||||
import { ConfigurationService } from 'renderer/services/configuration.service'
|
||||
import { ModelsManagerService } from 'renderer/services/models-management/models-manager.service'
|
||||
|
||||
export const DeleteModelsModal: ModalComponent<void, {models: BsmLocalModel[], linked: boolean}> = ({resolver, data}) => {
|
||||
|
||||
const config = useConstant(() => ConfigurationService.getInstance());
|
||||
const t = useTranslation();
|
||||
const [remember, setRemember] = useState(config.get<boolean>(ModelsManagerService.REMEMBER_CHOICE_DELETE_MODEL_KEY) || false);
|
||||
|
||||
useOnUpdate(() => {
|
||||
config.set(ModelsManagerService.REMEMBER_CHOICE_DELETE_MODEL_KEY, remember);
|
||||
}, [remember]);
|
||||
|
||||
const isMultiple = data.models.length > 1;
|
||||
|
||||
const title = useConstant(() => isMultiple ? t("models.modals.delete-models.title") : t("models.modals.delete-model.title"));
|
||||
const desc = useConstant(() => isMultiple ? t("models.modals.delete-models.desc", {nb: `${data.models.length}`}) : t("models.modals.delete-model.desc", {modelName: data.models[0].model?.name ?? data.models[0].fileName}));
|
||||
const linkedAnnotation = useConstant(() => data.linked ? (isMultiple ? t("models.modals.delete-models.linked-annotation") : t("models.modals.delete-model.linked-annotation")) : undefined);
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{title}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict}/>
|
||||
<p className="max-w-sm w-full">{desc}</p>
|
||||
{data.linked && <p className="text-sm italic mt-2 w-fit">{linkedAnnotation}</p>}
|
||||
{!isMultiple && (
|
||||
<div className="flex items-center relative py-2 gap-1 mt-1">
|
||||
<BsmCheckbox className="h-5 relative z-[1]" checked={remember} onChange={(val) => setRemember(val)}/>
|
||||
<span className="italic">{t("modals.misc.remember-my-choice")}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-2">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="misc.delete"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||