From 7d6d560d2b7469289f8cb8ee0edf840a6b972e5b Mon Sep 17 00:00:00 2001 From: MCorange Date: Tue, 17 Sep 2024 00:06:53 +0300 Subject: [PATCH] Added highlighting, right click menu, other fixes --- Cargo.lock | 371 ++++++++- Cargo.toml | 2 + manifest.json | 1082 +++++++++++++------------- src/commands/gui/mod.rs | 105 ++- src/commands/gui/nav_bar.rs | 7 + src/commands/gui/song_edit_window.rs | 10 +- src/downloader.rs | 16 +- src/manifest/song.rs | 1 + src/util.rs | 30 +- 9 files changed, 1021 insertions(+), 603 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6ecfff..d948534 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ dependencies = [ "futures-lite 1.13.0", "once_cell", "serde", - "zbus", + "zbus 3.15.2", ] [[package]] @@ -297,6 +297,18 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-broadcast" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-channel" version = "2.3.1" @@ -334,6 +346,17 @@ dependencies = [ "futures-lite 1.13.0", ] +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", +] + [[package]] name = "async-io" version = "1.13.0" @@ -416,6 +439,25 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io 2.3.4", + "async-lock 3.4.0", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener 5.3.1", + "futures-lite 2.3.0", + "rustix 0.38.37", + "tracing", +] + [[package]] name = "async-recursion" version = "1.1.1" @@ -488,9 +530,9 @@ dependencies = [ "enumflags2", "serde", "static_assertions", - "zbus", - "zbus_names", - "zvariant", + "zbus 3.15.2", + "zbus_names 2.6.1", + "zvariant 3.15.2", ] [[package]] @@ -502,7 +544,7 @@ dependencies = [ "atspi-common", "atspi-proxies", "futures-lite 1.13.0", - "zbus", + "zbus 3.15.2", ] [[package]] @@ -513,7 +555,7 @@ checksum = "6495661273703e7a229356dcbe8c8f38223d697aacfaf0e13590a9ac9977bb52" dependencies = [ "atspi-common", "serde", - "zbus", + "zbus 3.15.2", ] [[package]] @@ -797,6 +839,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cgl" version = "0.3.2" @@ -1084,6 +1132,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1255,6 +1324,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enum-map" version = "2.7.3" @@ -1683,7 +1758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" dependencies = [ "bitflags 2.6.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "cgl", "core-foundation", "dispatch", @@ -1706,7 +1781,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.1.1", "glutin", "raw-window-handle 0.5.2", "winit", @@ -2083,6 +2158,25 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -2195,6 +2289,16 @@ dependencies = [ "redox_syscall 0.4.1", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2229,6 +2333,19 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "mac-notification-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -2254,6 +2371,8 @@ dependencies = [ "lazy_static", "libc", "log", + "notify-rust", + "open", "reqwest", "serde", "serde_json", @@ -2438,12 +2557,38 @@ dependencies = [ "memoffset 0.7.1", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", + "memoffset 0.9.1", +] + [[package]] name = "nohash-hasher" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "notify-rust" +version = "4.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5134a72dc570b178bff81b01e81ab14a6fcc015391ed4b3b14853090658cd3a3" +dependencies = [ + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus 4.4.0", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -2490,6 +2635,17 @@ dependencies = [ "objc_exception", ] +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + [[package]] name = "objc-sys" version = "0.2.0-beta.2" @@ -2640,6 +2796,15 @@ dependencies = [ "cc", ] +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "object" version = "0.36.4" @@ -2655,6 +2820,17 @@ version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe" +[[package]] +name = "open" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "openssl" version = "0.10.66" @@ -2705,7 +2881,7 @@ version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "libredox", + "libredox 0.0.2", ] [[package]] @@ -2773,6 +2949,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "pbkdf2" version = "0.11.0" @@ -2939,6 +3121,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + [[package]] name = "quick-xml" version = "0.36.1" @@ -3026,6 +3217,17 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox 0.1.3", + "thiserror", +] + [[package]] name = "regex" version = "1.10.6" @@ -3573,6 +3775,17 @@ dependencies = [ "libc", ] +[[package]] +name = "tauri-winrt-notification" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89f5fb70d6f62381f5d9b2ba9008196150b40b75f3068eb24faeddf1c686871" +dependencies = [ + "quick-xml 0.31.0", + "windows 0.56.0", + "windows-version", +] + [[package]] name = "tempfile" version = "3.12.0" @@ -4159,7 +4372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.36.1", "quote", ] @@ -4220,7 +4433,7 @@ checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" dependencies = [ "arrayvec", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "js-sys", "log", "parking_lot", @@ -4245,7 +4458,7 @@ dependencies = [ "arrayvec", "bit-vec", "bitflags 2.6.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "codespan-reporting", "indexmap", "log", @@ -4272,7 +4485,7 @@ dependencies = [ "arrayvec", "ash", "bitflags 2.6.0", - "cfg_aliases", + "cfg_aliases 0.1.1", "core-graphics-types", "glow", "glutin_wgl_sys", @@ -4568,6 +4781,15 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-version" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -4712,7 +4934,7 @@ dependencies = [ "bitflags 2.6.0", "bytemuck", "calloop 0.12.4", - "cfg_aliases", + "cfg_aliases 0.1.1", "core-foundation", "core-graphics", "cursor-icon", @@ -4846,12 +5068,12 @@ version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ - "async-broadcast", + "async-broadcast 0.5.1", "async-executor", - "async-fs", + "async-fs 1.6.0", "async-io 1.13.0", "async-lock 2.8.0", - "async-process", + "async-process 1.8.1", "async-recursion", "async-task", "async-trait", @@ -4864,7 +5086,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -4876,9 +5098,47 @@ dependencies = [ "uds_windows", "winapi", "xdg-home", - "zbus_macros", - "zbus_names", - "zvariant", + "zbus_macros 3.15.2", + "zbus_names 2.6.1", + "zvariant 3.15.2", +] + +[[package]] +name = "zbus" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +dependencies = [ + "async-broadcast 0.7.1", + "async-executor", + "async-fs 2.1.2", + "async-io 2.3.4", + "async-lock 3.4.0", + "async-process 2.3.0", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener 5.3.1", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.29.0", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros 4.4.0", + "zbus_names 3.0.0", + "zvariant 4.2.0", ] [[package]] @@ -4892,7 +5152,20 @@ dependencies = [ "quote", "regex", "syn 1.0.109", - "zvariant_utils", + "zvariant_utils 1.0.1", +] + +[[package]] +name = "zbus_macros" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", + "zvariant_utils 2.1.0", ] [[package]] @@ -4903,7 +5176,18 @@ checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" dependencies = [ "serde", "static_assertions", - "zvariant", + "zvariant 3.15.2", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant 4.2.0", ] [[package]] @@ -5002,7 +5286,20 @@ dependencies = [ "libc", "serde", "static_assertions", - "zvariant_derive", + "zvariant_derive 3.15.2", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "zvariant_derive 4.2.0", ] [[package]] @@ -5015,7 +5312,20 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "zvariant_utils", + "zvariant_utils 1.0.1", +] + +[[package]] +name = "zvariant_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", + "zvariant_utils 2.1.0", ] [[package]] @@ -5028,3 +5338,14 @@ dependencies = [ "quote", "syn 1.0.109", ] + +[[package]] +name = "zvariant_utils" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] diff --git a/Cargo.toml b/Cargo.toml index 69b2651..e24a30d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,8 @@ futures = "0.3.30" lazy_static = "1.4.0" libc = "0.2.153" log = "0.4.21" +notify-rust = "4.11.3" +open = "5.3.0" reqwest = "0.12.3" serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.115" diff --git a/manifest.json b/manifest.json index 6a08cce..595dd7c 100644 --- a/manifest.json +++ b/manifest.json @@ -9,106 +9,182 @@ } } }, - "techno": { + "house": { "songs": { - "Raffaella Carra - Pedro (Jaxomy & Agatino Romero Remix)": { - "url": "https://www.youtube.com/watch?v=AIGnRc7F86Q", + "Ralph Castelli - Morning Sex (Mochakk Remix)": { + "url": "https://www.youtube.com/watch?v=6bCwJ_TIDG4", "typ": "Youtube" }, - "Lily Allen - Not Fair": { - "url": "https://www.youtube.com/watch?v=WON_YIbeLis", + "Men I Trust - Tailwhip (Lewii Edit)": { + "url": "https://www.youtube.com/watch?v=XhyM-JUWwWQ", "typ": "Youtube" }, - "Manian - Welcome To The Club": { - "url": "https://www.youtube.com/watch?v=7F9xDewtgNA", + "Bauhouse - After Marvins Dance (Marvin Gaye's 'After The Dance' Edit)": { + "url": "https://www.youtube.com/watch?v=J-cgyYiExh8", "typ": "Youtube" }, - "Nicolas Julian - Applause": { - "url": "https://www.youtube.com/watch?v=9qHLELnq1B0", + "Sweely - Le Son Dancefloor": { + "url": "https://www.youtube.com/watch?v=5uEvZgmoG6Y", "typ": "Youtube" }, - "$UICIDEBOY$ - PARIS (TECHNO)": { - "url": "https://www.youtube.com/watch?v=YYDJmGDkEyw", + "Fidde - I Only See Things I Dont Have": { + "url": "https://www.youtube.com/watch?v=vX_Ye_ZzI-Y", "typ": "Youtube" }, - "The Love Parade ( Bounce Invaderz )": { - "url": "https://www.youtube.com/watch?v=xogT6KBWjCU3", + "Billie Eilish - Bossa Nova (Lewii Edit)": { + "url": "https://www.youtube.com/watch?v=gNawHj2NCxA", "typ": "Youtube" }, - "I WAS MADE FOR LOVIN' YOU (TECHNO)": { - "url": "https://www.youtube.com/watch?v=asVznhccYao", + "Fidde - If Theres A Heaven I Wanna See It": { + "url": "https://www.youtube.com/watch?v=l2Nw7cIh7qg", "typ": "Youtube" }, - "Restricted - Big Jet Plane": { - "url": "https://www.youtube.com/watch?v=NpVF0z5N-tE", + "Baltra - Tears Drop": { + "url": "https://www.youtube.com/watch?v=EXXMtKPfuzY", "typ": "Youtube" }, - "08 Blumchen - Blaue Augen": { - "url": "https://www.youtube.com/watch?v=mE4PZcUfiwE", + "Unknown Artist - Kcik 23": { + "url": "https://www.youtube.com/watch?v=SnnqDdZJpzA", "typ": "Youtube" }, - "Beggin' (Techno)": { - "url": "https://www.youtube.com/watch?v=tXPs1FwW6lk", + "THEOS - Rhodes Trip": { + "url": "https://www.youtube.com/watch?v=m7guRO0Uz_c", + "typ": "Youtube" + } + } + }, + "rave": { + "songs": { + "Mason - Perfect remix 1991": { + "url": "https://open.spotify.com/track/1VKWQgq0g2uKtgNfL0ceNM?si=b3f1dc504ddb41ed", + "typ": "Spotify" + }, + "Tricky Disco": { + "url": "https://www.youtube.com/watch?v=t78qVdbAiXw", "typ": "Youtube" }, - "Gigi D'Agostino - Bla Bla Bla": { - "url": "https://www.youtube.com/watch?v=yKapqR2XRJE", + "EVERYTHING WHAT": { + "url": "https://www.youtube.com/watch?v=Gjdsq4kc5cA", "typ": "Youtube" }, - "Empire Of The Sun, southstar - We Are The People": { - "url": "https://www.youtube.com/watch?v=qguEGR5BK2k", + "DR. VODKA - Tricky Disco": { + "url": "https://www.youtube.com/watch?v=IknAUhl3i2o", + "typ": "Youtube" + } + } + }, + "electronic": { + "songs": { + "Zombie Nation - Kernkraft 400": { + "url": "https://www.youtube.com/watch?v=z5LW07FTJbI", "typ": "Youtube" }, - "Dance For Me": { - "url": "https://www.youtube.com/watch?v=5DTSvGO_944", + "MONEY ON THE DASH": { + "url": "https://open.spotify.com/track/6nVEV8CIU4dw12oVZbKJtl", + "typ": "Spotify" + }, + "Benny Benassi - Satisfaction": { + "url": "https://www.youtube.com/watch?v=a0fkNdPiIL4", + "typ": "Youtube" + } + } + }, + "lietuviskos/sel": { + "songs": { + "SEL - Nes as tik vejas": { + "url": "https://youtu.be/acMG37IZ6z8", "typ": "Youtube" }, - "Knock2 - dashstar": { - "url": "https://www.youtube.com/watch?v=58ml5b_On6w", + "SEL - Ten kur sapnai": { + "url": "https://youtu.be/GDj3NgjDbRo", "typ": "Youtube" }, - "MUTA - Party maker": { - "url": "https://www.youtube.com/watch?v=LT9VNK1aCXY", + "SEL - Tarp amzinybes": { + "url": "https://youtu.be/UfPj-0QpGFA", "typ": "Youtube" }, - "Give It To Me": { - "url": "https://www.youtube.com/watch?v=upQe8EeSyZU", + "SEL - Uzmerkiu akis": { + "url": "https://youtu.be/SdWj06XRZms?si=9TNGzjK9ITom-jaD", + "typ": "Youtube" + }, + "SEL - Leisk": { + "url": "https://youtu.be/DDPmFMrffXQ", + "typ": "Youtube" + }, + "SEL - Skrendu": { + "url": "https://youtu.be/G5Q_asvrXlA", + "typ": "Youtube" + }, + "SEL - Gyvenimo man vieno neuztenka": { + "url": "https://youtu.be/7Gd9XaEG5o4", + "typ": "Youtube" + }, + "SEL - Lyja": { + "url": "https://www.youtube.com/watch?v=KL6JBWnXCxw", + "typ": "Youtube" + }, + "SEL - As ziuriu i tave pasauli": { + "url": "https://youtu.be/_SPDjl80kKw", + "typ": "Youtube" + }, + "SEL - Tik Tok": { + "url": "https://youtu.be/RkaIUateIxg", + "typ": "Youtube" + }, + "SEL - Ten kazkur giliai": { + "url": "https://youtu.be/N7YNlegeiqs?si=9BBH6hjrgOjJ01Nz", "typ": "Youtube" } } }, "noclue": { "songs": { - "Maco Mamuko - Whiskey, Cola i Tequila": { - "url": "https://www.youtube.com/watch?v=aBrN0k0Phtc", - "typ": "Youtube" - }, - "Discobitch - C'est Beau La Bourgeoisie": { - "url": "https://www.youtube.com/watch?v=RCeQN2aEWxo", + "DR. VODKA - DZIEWCZYNO Z TIKTOKA": { + "url": "https://www.youtube.com/watch?v=HLbw1WQt64o", "typ": "Youtube" }, "Bad Boys": { "url": "https://www.youtube.com/watch?v=NTC7RD8xzCY", "typ": "Youtube" }, - "DR. VODKA - DZIEWCZYNO Z TIKTOKA": { - "url": "https://www.youtube.com/watch?v=HLbw1WQt64o", + "Discobitch - C'est Beau La Bourgeoisie": { + "url": "https://www.youtube.com/watch?v=RCeQN2aEWxo", + "typ": "Youtube" + }, + "Maco Mamuko - Whiskey, Cola i Tequila": { + "url": "https://www.youtube.com/watch?v=aBrN0k0Phtc", + "typ": "Youtube" + } + } + }, + "hip-hop": { + "songs": { + "Afroman - Because I Got High": { + "url": "https://www.youtube.com/watch?v=WeYsTmIzjkw", + "typ": "Youtube" + }, + "Drenchill - Freed from Desire": { + "url": "https://www.youtube.com/watch?v=6b6FBneAENQ", "typ": "Youtube" } } }, "pop": { "songs": { + "LT United - We are the winners": { + "url": "https://www.youtube.com/watch?v=DBAdOlQPbwg", + "typ": "Youtube" + }, + "Mr President - Coco Jumbo": { + "url": "https://www.youtube.com/watch?v=cOrc37wNUqU", + "typ": "Youtube" + }, "Icona Pop - I Love It": { "url": "https://www.youtube.com/watch?v=UxxajLWwzqY", "typ": "Youtube" }, - "Modern Talking - You're My Heart, You're My Soul": { - "url": "https://www.youtube.com/watch?v=4kHl4FoK1Ys", - "typ": "Youtube" - }, - "LT United - We are the winners": { - "url": "https://www.youtube.com/watch?v=DBAdOlQPbwg", + "Cheri cheri lady": { + "url": "https://www.youtube.com/watch?v=lrIKt5uDWZo", "typ": "Youtube" }, "Pitbul - Fireball": { @@ -119,12 +195,392 @@ "url": "https://www.youtube.com/watch?v=wZ8eZRxFA-0", "typ": "Youtube" }, - "Mr President - Coco Jumbo": { - "url": "https://www.youtube.com/watch?v=cOrc37wNUqU", + "Modern Talking - You're My Heart, You're My Soul": { + "url": "https://www.youtube.com/watch?v=4kHl4FoK1Ys", + "typ": "Youtube" + } + } + }, + "alt": { + "songs": { + "ROMANCEPLANET - FALL FROM THE SKY": { + "url": "https://www.youtube.com/watch?v=HMhzxzXBisw", "typ": "Youtube" }, - "Cheri cheri lady": { - "url": "https://www.youtube.com/watch?v=lrIKt5uDWZo", + "ROMANCEPLANET - PLAIN WHITE TEE": { + "url": "https://www.youtube.com/watch?v=tdVQbNwjGac", + "typ": "Youtube" + }, + "ROMANCEPLANET - DANCE": { + "url": "https://www.youtube.com/watch?v=ircOfMb4gEw", + "typ": "Youtube" + }, + "Artemas - i like the way you kiss me": { + "url": "https://www.youtube.com/watch?v=ODDRRXMi22E", + "typ": "Youtube" + } + } + }, + "rusiskos": { + "songs": { + "Pimp Schwab - vse shto nas ne Ubivaet": { + "url": "https://www.youtube.com/watch?v=NTEXFyUE9Ww", + "typ": "Youtube" + }, + "Kanikuli": { + "url": "https://www.youtube.com/watch?v=GNMiDZTL7jo", + "typ": "Youtube" + }, + "Raim & Artur feat. Zhenis - Diskoteka is 90 hit": { + "url": "https://www.youtube.com/watch?v=GfBhxlNhrn0", + "typ": "Youtube" + }, + "Ruki Verch - 18 mne uze": { + "url": "https://www.youtube.com/watch?v=Hxab_Sr132o", + "typ": "Youtube" + }, + "Dzaro and hansa - Visky Kola karaleva trans pola": { + "url": "https://www.youtube.com/watch?v=fflrMvZ2HtA", + "typ": "Youtube" + }, + "Eldzej and Feduk - Rozovoe vino": { + "url": "https://www.youtube.com/watch?v=S9oXj3a4gZ4", + "typ": "Youtube" + }, + "Topolini puh": { + "url": "https://www.youtube.com/watch?v=UUryvYF8tUs", + "typ": "Youtube" + }, + "Katja lel - moi marmeladni (paprobui mua mua)": { + "url": "https://www.youtube.com/watch?v=0JMdXFHo5SY", + "typ": "Youtube" + }, + "Arash - Temptation": { + "url": "https://www.youtube.com/watch?v=6X3ZJh762-I", + "typ": "Youtube" + } + } + }, + "lietuviskos": { + "songs": { + "Kastaneda - Kelyje": { + "url": "https://www.youtube.com/watch?v=JVE6NQqKPL4", + "typ": "Youtube" + }, + "Tipo Grupe - tipo daina": { + "url": "https://www.youtube.com/watch?v=PTIOaSjEgIU", + "typ": "Youtube" + }, + "L1GHT CASH - Whiskey Cola Lietuviskai (sultys degtinele) remix": { + "url": "https://www.youtube.com/watch?v=YVaqDaf1KXU", + "typ": "Youtube" + }, + "Depresinis feat. Deivas - LEDUKAI": { + "url": "https://www.youtube.com/watch?v=R2-MtpkKgGI", + "typ": "Youtube" + }, + "MC ENDRAY - AUDI": { + "url": "https://www.youtube.com/watch?v=oIjNoMGEuRg", + "typ": "Youtube" + }, + "Vairas - Svajoklis": { + "url": "https://www.youtube.com/watch?v=hs8_KTV0Vrw", + "typ": "Youtube" + }, + "Grupiokai - Degtine": { + "url": "https://www.youtube.com/watch?v=8SqbG2VmEFw", + "typ": "Youtube" + }, + "NIERKA - PENKTADIENIS": { + "url": "https://www.youtube.com/watch?v=h3TuZj_OAf0", + "typ": "Youtube" + }, + "Patruliai - Kur Tu": { + "url": "https://www.youtube.com/watch?v=OPWhiu3cvj0", + "typ": "Youtube" + }, + "Tipo grupe - Lovoj Vezi": { + "url": "https://www.youtube.com/watch?v=M3zVMzWCy_c", + "typ": "Youtube" + }, + "Mercy Dance - I Pajuri": { + "url": "https://www.youtube.com/watch?v=RPpkMh47l9w", + "typ": "Youtube" + }, + "Wenona Waves - Topine Panele": { + "url": "https://www.youtube.com/watch?v=MPHuhmUomfE", + "typ": "Youtube" + }, + "Vytautas siskauskas - Lietuva (Nebelinksmas musu kaimas)": { + "url": "https://www.youtube.com/watch?v=31UkGzde14c", + "typ": "Youtube" + }, + "DJ Dalgis - Negeriau": { + "url": "https://www.youtube.com/watch?v=c89YvG3MCcs", + "typ": "Youtube" + }, + "Vilija ir Marijonas mikutavicius - Dabar Geriausi Musu Vakarai": { + "url": "https://www.youtube.com/watch?v=MPnZkEscWo0", + "typ": "Youtube" + }, + "Ganja - Truputi": { + "url": "https://www.youtube.com/watch?v=Pxve7CwiCHM", + "typ": "Youtube" + }, + "SADBOY - 1001 Naktis": { + "url": "https://www.youtube.com/watch?v=mLJIjGvWmKI", + "typ": "Youtube" + }, + "Zas - Zalias Pasas": { + "url": "https://www.youtube.com/watch?v=SZA7IjlCfyI", + "typ": "Youtube" + }, + "Radvis - TU ESI MELAGIS (Techno Extended)": { + "url": "https://www.youtube.com/watch?v=kmvvP7GW_bw", + "typ": "Youtube" + }, + "Vitalija Katunskyte - Robinzonas": { + "url": "https://www.youtube.com/watch?v=erDHG-QpbPY", + "typ": "Youtube" + }, + "NL - R1": { + "url": "https://www.youtube.com/watch?v=hSgav4fYnZ8", + "typ": "Youtube" + }, + "Elektra - Juda Tavo rankos": { + "url": "https://www.youtube.com/watch?v=k2RuDoudnOE", + "typ": "Youtube" + }, + "Juodas Garvezys (Remix)": { + "url": "https://www.youtube.com/watch?v=D-7qQbXHSAw", + "typ": "Youtube" + }, + "Karaliska Erdve - Vakareja": { + "url": "https://www.youtube.com/watch?v=g0HmrlJ7fhE", + "typ": "Youtube" + }, + "Nezinau, Kodel...": { + "url": "https://www.youtube.com/watch?v=A-i2CkCnPoc", + "typ": "Youtube" + }, + "SADBOY - Deginam": { + "url": "https://www.youtube.com/watch?v=w3R0Aq1EGXg", + "typ": "Youtube" + }, + "NL - Juodas Golfas": { + "url": "https://www.youtube.com/watch?v=f2-ZmElSvPc", + "typ": "Youtube" + }, + "nemuno krantai - rytmecio rasos": { + "url": "https://www.youtube.com/watch?v=2-fGbsrofv4", + "typ": "Youtube" + }, + "Tnn - Parukom": { + "url": "https://www.youtube.com/watch?v=v9pBZK2RIPI", + "typ": "Youtube" + }, + "Adomas Vysniauskas - As Judu": { + "url": "https://www.youtube.com/watch?v=dMm16TzZrjg", + "typ": "Youtube" + }, + "Rondo - Margarita": { + "url": "https://www.youtube.com/watch?v=rF4w-Rxsiv4", + "typ": "Youtube" + }, + "Mr.Bullet - UZ MUS IR JUS": { + "url": "https://www.youtube.com/watch?v=85q_7jXEgH8", + "typ": "Youtube" + }, + "Ka Tu Ka Vakare": { + "url": "https://www.youtube.com/watch?v=6SOS4ljHbJY", + "typ": "Youtube" + }, + "AVA - Eik Tu NA": { + "url": "https://www.youtube.com/watch?v=yRf3ijaIgOg", + "typ": "Youtube" + }, + "Andzikas - Virs debesu": { + "url": "https://www.youtube.com/watch?v=PHJcVGhxra8", + "typ": "Youtube" + }, + "Depresinis & MERAKI2004 - VASARA ZJBS": { + "url": "https://www.youtube.com/watch?v=BD-pBjRy-5A", + "typ": "Youtube" + }, + "RADVIS - KINO FILMAI": { + "url": "https://www.youtube.com/watch?v=vhAEkC3xNMo", + "typ": "Youtube" + }, + "Depresinis, Jypas - O Mazuti": { + "url": "https://www.youtube.com/watch?v=4t_DPbe2r3M", + "typ": "Youtube" + }, + "Grupe MX - 1.9 TDI": { + "url": "https://www.youtube.com/watch?v=8FBr5GQXsI8", + "typ": "Youtube" + }, + "DJ Dalgis - Kauniete": { + "url": "https://www.youtube.com/watch?v=b3xPE9Iyuzc", + "typ": "Youtube" + }, + "morre - Kaip Diena": { + "url": "https://www.youtube.com/watch?v=6LDgLWCQSSM", + "typ": "Youtube" + }, + "Robertas Kupstas - Cia Mano Rojus": { + "url": "https://www.youtube.com/watch?v=xij_YeEInr8", + "typ": "Youtube" + }, + "Funky - Be taves": { + "url": "https://www.youtube.com/watch?v=heTDrDukLWU", + "typ": "Youtube" + }, + "PROFLAME - biznis": { + "url": "https://www.youtube.com/watch?v=t139Vd83pgs", + "typ": "Youtube" + }, + "Rytis Cicinas - Ne, nereikia asaru": { + "url": "https://www.youtube.com/watch?v=48GSg1q2kPE", + "typ": "Youtube" + }, + "Andzikas - I gamta": { + "url": "https://www.youtube.com/watch?v=UyLdjC-hihM", + "typ": "Youtube" + }, + "Depresinis feat. Deivas - Pavasaris": { + "url": "https://www.youtube.com/watch?v=yWWAucfQdN4", + "typ": "Youtube" + }, + "Judam Lietuvoj": { + "url": "https://www.youtube.com/watch?v=WDzWSEgSy5U", + "typ": "Youtube" + }, + "Vaidas Baumila - Apzavai": { + "url": "https://www.youtube.com/watch?v=H8uGi4ZMgHA", + "typ": "Youtube" + }, + "69 Danguje - Gyvenu": { + "url": "https://www.youtube.com/watch?v=HMXlhmAoux4", + "typ": "Youtube" + }, + "Depresinis - Volkswagina": { + "url": "https://www.youtube.com/watch?v=1lZR1VKsQHo", + "typ": "Youtube" + }, + "Riaukenzo - Trys Trys Trys": { + "url": "https://www.youtube.com/watch?v=qJv6GRQCnCk", + "typ": "Youtube" + }, + "SADBOY - Kaifuok": { + "url": "https://www.youtube.com/watch?v=vclryWgfy8I", + "typ": "Youtube" + }, + "Parnesk alaus OG": { + "url": "https://www.youtube.com/watch?v=e7cB1JIlZ2k", + "typ": "Youtube" + }, + "DJ Dalgis - Zalia Siera": { + "url": "https://www.youtube.com/watch?v=nfentq_pez4", + "typ": "Youtube" + }, + "Tweaxx - Mersas": { + "url": "https://www.youtube.com/watch?v=7ljAzgALPdA", + "typ": "Youtube" + }, + "Jovani, Karaliska Erdve - Is Leto Leidziasi Saule": { + "url": "https://www.youtube.com/watch?v=VqSu8iG1_DE", + "typ": "Youtube" + }, + "NL - Pasitusinam": { + "url": "https://www.youtube.com/watch?v=WhSFudvloog", + "typ": "Youtube" + }, + "VAIKAI PO LELIJOM (REMIX)": { + "url": "https://www.youtube.com/watch?v=k1amBbsAZuo", + "typ": "Youtube" + }, + "Tipo grupe ir Kastaneda - Po stikliuka": { + "url": "https://www.youtube.com/watch?v=EtmE60nE7fI", + "typ": "Youtube" + }, + "Zilviokas - Ryk Zuvedra ryk": { + "url": "https://www.youtube.com/watch?v=eN6BOI7UlSE", + "typ": "Youtube" + }, + "SADBOY - Blizgantys Naikai": { + "url": "https://www.youtube.com/watch?v=p5KsYJGcfOM", + "typ": "Youtube" + }, + "Zas - Myliu kina": { + "url": "https://www.youtube.com/watch?v=ImFrfmi-qT8", + "typ": "Youtube" + }, + "Ciulpuoneliai - Jau Nutilo Sirgaliai": { + "url": "https://www.youtube.com/watch?v=s8qIVA1U0C0", + "typ": "Youtube" + }, + "MAMA MANE RODYS PER FARUS": { + "url": "https://www.youtube.com/watch?v=F5HqXYRDZaE", + "typ": "Youtube" + }, + "SixthBoi - Nevaidink": { + "url": "https://www.youtube.com/watch?v=nOTNnnrqTII", + "typ": "Youtube" + }, + "Rycka klipas": { + "url": "https://www.youtube.com/watch?v=nuTUDSQ3BBI", + "typ": "Youtube" + }, + "69 Danguje - 16 metu": { + "url": "https://www.youtube.com/watch?v=nwjoqPcUPrw", + "typ": "Youtube" + }, + "16Hz - Autostrada Vilnius - Kaunas": { + "url": "https://www.youtube.com/watch?v=ANS2TSegr40", + "typ": "Youtube" + }, + "Eugenijus Ostapenko - Dviratukas": { + "url": "https://www.youtube.com/watch?v=ILFHZQK33Mw", + "typ": "Youtube" + }, + "Deivas - Klaipeda On Top": { + "url": "https://www.youtube.com/watch?v=g_h2M3e2OYU", + "typ": "Youtube" + }, + "Kastanenda - Sombrero": { + "url": "https://www.youtube.com/watch?v=3Z3_4TknCfQ", + "typ": "Youtube" + }, + "Zilvinas Zvagulis - Amerikonas grizo sunus": { + "url": "https://www.youtube.com/watch?v=UvzJEz5ADY8", + "typ": "Youtube" + }, + "Depresinis feat. Deivas - 0,7": { + "url": "https://www.youtube.com/watch?v=rjwFjBgTzAA", + "typ": "Youtube" + }, + "Dzordana Butkute - Nebenoriu Laukt": { + "url": "https://www.youtube.com/watch?v=_AozFrAqNMk", + "typ": "Youtube" + }, + "Depresinis - LEDINE": { + "url": "https://www.youtube.com/watch?v=qugvChkXMLk", + "typ": "Youtube" + }, + "Dove - Naktinis Tusas": { + "url": "https://www.youtube.com/watch?v=pz-HEAwFEnk", + "typ": "Youtube" + }, + "Raketa - I Kluba": { + "url": "https://www.youtube.com/watch?v=FkSjtpYN3EI", + "typ": "Youtube" + }, + "MG INTERNATIONAL - JUODA ORCHIDEJA": { + "url": "https://www.youtube.com/watch?v=HQvceFRBq9M", + "typ": "Youtube" + }, + "16Hz - Baliavojam": { + "url": "https://www.youtube.com/watch?v=Ia-qERX8WLs", "typ": "Youtube" } } @@ -149,529 +605,73 @@ } } }, - "hip-hop": { + "techno": { "songs": { - "Drenchill - Freed from Desire": { - "url": "https://www.youtube.com/watch?v=6b6FBneAENQ", + "Manian - Welcome To The Club": { + "url": "https://www.youtube.com/watch?v=7F9xDewtgNA", "typ": "Youtube" }, - "Afroman - Because I Got High": { - "url": "https://www.youtube.com/watch?v=WeYsTmIzjkw", - "typ": "Youtube" - } - } - }, - "house": { - "songs": { - "THEOS - Rhodes Trip": { - "url": "https://www.youtube.com/watch?v=m7guRO0Uz_c", - "typ": "Youtube" - }, - "Unknown Artist - Kcik 23": { - "url": "https://www.youtube.com/watch?v=SnnqDdZJpzA", - "typ": "Youtube" - }, - "Bauhouse - After Marvins Dance (Marvin Gaye's 'After The Dance' Edit)": { - "url": "https://www.youtube.com/watch?v=J-cgyYiExh8", - "typ": "Youtube" - }, - "Men I Trust - Tailwhip (Lewii Edit)": { - "url": "https://www.youtube.com/watch?v=XhyM-JUWwWQ", - "typ": "Youtube" - }, - "Billie Eilish - Bossa Nova (Lewii Edit)": { - "url": "https://www.youtube.com/watch?v=gNawHj2NCxA", - "typ": "Youtube" - }, - "Fidde - I Only See Things I Dont Have": { - "url": "https://www.youtube.com/watch?v=vX_Ye_ZzI-Y", - "typ": "Youtube" - }, - "Sweely - Le Son Dancefloor": { - "url": "https://www.youtube.com/watch?v=5uEvZgmoG6Y", - "typ": "Youtube" - }, - "Ralph Castelli - Morning Sex (Mochakk Remix)": { - "url": "https://www.youtube.com/watch?v=6bCwJ_TIDG4", - "typ": "Youtube" - }, - "Fidde - If Theres A Heaven I Wanna See It": { - "url": "https://www.youtube.com/watch?v=l2Nw7cIh7qg", - "typ": "Youtube" - }, - "Baltra - Tears Drop": { - "url": "https://www.youtube.com/watch?v=EXXMtKPfuzY", - "typ": "Youtube" - } - } - }, - "electronic": { - "songs": { - "Benny Benassi - Satisfaction": { - "url": "https://www.youtube.com/watch?v=a0fkNdPiIL4", - "typ": "Youtube" - }, - "Zombie Nation - Kernkraft 400": { - "url": "https://www.youtube.com/watch?v=z5LW07FTJbI", - "typ": "Youtube" - }, - "MONEY ON THE DASH": { - "url": "https://open.spotify.com/track/6nVEV8CIU4dw12oVZbKJtl", - "typ": "Spotify" - } - } - }, - "lietuviskos": { - "songs": { - "16Hz - Autostrada Vilnius - Kaunas": { - "url": "https://www.youtube.com/watch?v=ANS2TSegr40", - "typ": "Youtube" - }, - "PROFLAME - biznis": { - "url": "https://www.youtube.com/watch?v=t139Vd83pgs", - "typ": "Youtube" - }, - "NL - Juodas Golfas": { - "url": "https://www.youtube.com/watch?v=f2-ZmElSvPc", - "typ": "Youtube" - }, - "Tnn - Parukom": { - "url": "https://www.youtube.com/watch?v=v9pBZK2RIPI", - "typ": "Youtube" - }, - "Jovani, Karaliska Erdve - Is Leto Leidziasi Saule": { - "url": "https://www.youtube.com/watch?v=VqSu8iG1_DE", - "typ": "Youtube" - }, - "Depresinis - LEDINE": { - "url": "https://www.youtube.com/watch?v=qugvChkXMLk", - "typ": "Youtube" - }, - "Tipo grupe ir Kastaneda - Po stikliuka": { - "url": "https://www.youtube.com/watch?v=EtmE60nE7fI", - "typ": "Youtube" - }, - "Raketa - I Kluba": { - "url": "https://www.youtube.com/watch?v=FkSjtpYN3EI", - "typ": "Youtube" - }, - "Zilvinas Zvagulis - Amerikonas grizo sunus": { - "url": "https://www.youtube.com/watch?v=UvzJEz5ADY8", - "typ": "Youtube" - }, - "MAMA MANE RODYS PER FARUS": { - "url": "https://www.youtube.com/watch?v=F5HqXYRDZaE", - "typ": "Youtube" - }, - "Robertas Kupstas - Cia Mano Rojus": { - "url": "https://www.youtube.com/watch?v=xij_YeEInr8", - "typ": "Youtube" - }, - "SADBOY - 1001 Naktis": { - "url": "https://www.youtube.com/watch?v=mLJIjGvWmKI", - "typ": "Youtube" - }, - "16Hz - Baliavojam": { - "url": "https://www.youtube.com/watch?v=Ia-qERX8WLs", - "typ": "Youtube" - }, - "SADBOY - Deginam": { - "url": "https://www.youtube.com/watch?v=w3R0Aq1EGXg", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - Pavasaris": { - "url": "https://www.youtube.com/watch?v=yWWAucfQdN4", + "Dance For Me": { + "url": "https://www.youtube.com/watch?v=5DTSvGO_944", "typ": "Youtube" }, - "Depresinis & MERAKI2004 - VASARA ZJBS": { - "url": "https://www.youtube.com/watch?v=BD-pBjRy-5A", + "$UICIDEBOY$ - PARIS (TECHNO)": { + "url": "https://www.youtube.com/watch?v=YYDJmGDkEyw", "typ": "Youtube" }, - "L1GHT CASH - Whiskey Cola Lietuviskai (sultys degtinele) remix": { - "url": "https://www.youtube.com/watch?v=YVaqDaf1KXU", + "Beggin' (Techno)": { + "url": "https://www.youtube.com/watch?v=tXPs1FwW6lk", "typ": "Youtube" }, - "nemuno krantai - rytmecio rasos": { - "url": "https://www.youtube.com/watch?v=2-fGbsrofv4", + "Lily Allen - Not Fair": { + "url": "https://www.youtube.com/watch?v=WON_YIbeLis", "typ": "Youtube" }, - "Kastaneda - Kelyje": { - "url": "https://www.youtube.com/watch?v=JVE6NQqKPL4", + "Give It To Me": { + "url": "https://www.youtube.com/watch?v=upQe8EeSyZU", "typ": "Youtube" }, - "SixthBoi - Nevaidink": { - "url": "https://www.youtube.com/watch?v=nOTNnnrqTII", + "Empire Of The Sun, southstar - We Are The People": { + "url": "https://www.youtube.com/watch?v=qguEGR5BK2k", "typ": "Youtube" }, - "Nezinau, Kodel...": { - "url": "https://www.youtube.com/watch?v=A-i2CkCnPoc", + "I WAS MADE FOR LOVIN' YOU (TECHNO)": { + "url": "https://www.youtube.com/watch?v=asVznhccYao", "typ": "Youtube" }, - "69 Danguje - 16 metu": { - "url": "https://www.youtube.com/watch?v=nwjoqPcUPrw", + "Nicolas Julian - Applause": { + "url": "https://www.youtube.com/watch?v=9qHLELnq1B0", "typ": "Youtube" }, - "Grupiokai - Degtine": { - "url": "https://www.youtube.com/watch?v=8SqbG2VmEFw", + "Gigi D'Agostino - Bla Bla Bla": { + "url": "https://www.youtube.com/watch?v=yKapqR2XRJE", "typ": "Youtube" }, - "Tipo grupe - Lovoj Vezi": { - "url": "https://www.youtube.com/watch?v=M3zVMzWCy_c", + "Raffaella Carra - Pedro (Jaxomy & Agatino Romero Remix)": { + "url": "https://www.youtube.com/watch?v=AIGnRc7F86Q", "typ": "Youtube" }, - "Depresinis - Volkswagina": { - "url": "https://www.youtube.com/watch?v=1lZR1VKsQHo", + "MUTA - Party maker": { + "url": "https://www.youtube.com/watch?v=LT9VNK1aCXY", "typ": "Youtube" }, - "Dove - Naktinis Tusas": { - "url": "https://www.youtube.com/watch?v=pz-HEAwFEnk", + "Restricted - Big Jet Plane": { + "url": "https://www.youtube.com/watch?v=NpVF0z5N-tE", "typ": "Youtube" }, - "Ganja - Truputi": { - "url": "https://www.youtube.com/watch?v=Pxve7CwiCHM", + "Knock2 - dashstar": { + "url": "https://www.youtube.com/watch?v=58ml5b_On6w", "typ": "Youtube" }, - "Zas - Zalias Pasas": { - "url": "https://www.youtube.com/watch?v=SZA7IjlCfyI", + "08 Blumchen - Blaue Augen": { + "url": "https://www.youtube.com/watch?v=mE4PZcUfiwE", "typ": "Youtube" }, - "Andzikas - I gamta": { - "url": "https://www.youtube.com/watch?v=UyLdjC-hihM", - "typ": "Youtube" - }, - "AVA - Eik Tu NA": { - "url": "https://www.youtube.com/watch?v=yRf3ijaIgOg", - "typ": "Youtube" - }, - "Radvis - TU ESI MELAGIS (Techno Extended)": { - "url": "https://www.youtube.com/watch?v=kmvvP7GW_bw", - "typ": "Youtube" - }, - "Patruliai - Kur Tu": { - "url": "https://www.youtube.com/watch?v=OPWhiu3cvj0", - "typ": "Youtube" - }, - "Ciulpuoneliai - Jau Nutilo Sirgaliai": { - "url": "https://www.youtube.com/watch?v=s8qIVA1U0C0", - "typ": "Youtube" - }, - "NL - R1": { - "url": "https://www.youtube.com/watch?v=hSgav4fYnZ8", - "typ": "Youtube" - }, - "Andzikas - Virs debesu": { - "url": "https://www.youtube.com/watch?v=PHJcVGhxra8", - "typ": "Youtube" - }, - "Zilviokas - Ryk Zuvedra ryk": { - "url": "https://www.youtube.com/watch?v=eN6BOI7UlSE", - "typ": "Youtube" - }, - "Wenona Waves - Topine Panele": { - "url": "https://www.youtube.com/watch?v=MPHuhmUomfE", - "typ": "Youtube" - }, - "Elektra - Juda Tavo rankos": { - "url": "https://www.youtube.com/watch?v=k2RuDoudnOE", - "typ": "Youtube" - }, - "Rycka klipas": { - "url": "https://www.youtube.com/watch?v=nuTUDSQ3BBI", - "typ": "Youtube" - }, - "Kastanenda - Sombrero": { - "url": "https://www.youtube.com/watch?v=3Z3_4TknCfQ", - "typ": "Youtube" - }, - "NL - Pasitusinam": { - "url": "https://www.youtube.com/watch?v=WhSFudvloog", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - LEDUKAI": { - "url": "https://www.youtube.com/watch?v=R2-MtpkKgGI", - "typ": "Youtube" - }, - "Adomas Vysniauskas - As Judu": { - "url": "https://www.youtube.com/watch?v=dMm16TzZrjg", - "typ": "Youtube" - }, - "SADBOY - Kaifuok": { - "url": "https://www.youtube.com/watch?v=vclryWgfy8I", - "typ": "Youtube" - }, - "Rytis Cicinas - Ne, nereikia asaru": { - "url": "https://www.youtube.com/watch?v=48GSg1q2kPE", - "typ": "Youtube" - }, - "RADVIS - KINO FILMAI": { - "url": "https://www.youtube.com/watch?v=vhAEkC3xNMo", - "typ": "Youtube" - }, - "VAIKAI PO LELIJOM (REMIX)": { - "url": "https://www.youtube.com/watch?v=k1amBbsAZuo", - "typ": "Youtube" - }, - "Mercy Dance - I Pajuri": { - "url": "https://www.youtube.com/watch?v=RPpkMh47l9w", - "typ": "Youtube" - }, - "DJ Dalgis - Kauniete": { - "url": "https://www.youtube.com/watch?v=b3xPE9Iyuzc", - "typ": "Youtube" - }, - "Juodas Garvezys (Remix)": { - "url": "https://www.youtube.com/watch?v=D-7qQbXHSAw", - "typ": "Youtube" - }, - "NIERKA - PENKTADIENIS": { - "url": "https://www.youtube.com/watch?v=h3TuZj_OAf0", - "typ": "Youtube" - }, - "Judam Lietuvoj": { - "url": "https://www.youtube.com/watch?v=WDzWSEgSy5U", - "typ": "Youtube" - }, - "Vytautas siskauskas - Lietuva (Nebelinksmas musu kaimas)": { - "url": "https://www.youtube.com/watch?v=31UkGzde14c", - "typ": "Youtube" - }, - "Vairas - Svajoklis": { - "url": "https://www.youtube.com/watch?v=hs8_KTV0Vrw", - "typ": "Youtube" - }, - "Ka Tu Ka Vakare": { - "url": "https://www.youtube.com/watch?v=6SOS4ljHbJY", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - 0,7": { - "url": "https://www.youtube.com/watch?v=rjwFjBgTzAA", - "typ": "Youtube" - }, - "Grupe MX - 1.9 TDI": { - "url": "https://www.youtube.com/watch?v=8FBr5GQXsI8", - "typ": "Youtube" - }, - "MG INTERNATIONAL - JUODA ORCHIDEJA": { - "url": "https://www.youtube.com/watch?v=HQvceFRBq9M", - "typ": "Youtube" - }, - "Funky - Be taves": { - "url": "https://www.youtube.com/watch?v=heTDrDukLWU", - "typ": "Youtube" - }, - "Rondo - Margarita": { - "url": "https://www.youtube.com/watch?v=rF4w-Rxsiv4", - "typ": "Youtube" - }, - "MC ENDRAY - AUDI": { - "url": "https://www.youtube.com/watch?v=oIjNoMGEuRg", - "typ": "Youtube" - }, - "Eugenijus Ostapenko - Dviratukas": { - "url": "https://www.youtube.com/watch?v=ILFHZQK33Mw", - "typ": "Youtube" - }, - "Tipo Grupe - tipo daina": { - "url": "https://www.youtube.com/watch?v=PTIOaSjEgIU", - "typ": "Youtube" - }, - "DJ Dalgis - Negeriau": { - "url": "https://www.youtube.com/watch?v=c89YvG3MCcs", - "typ": "Youtube" - }, - "Zas - Myliu kina": { - "url": "https://www.youtube.com/watch?v=ImFrfmi-qT8", - "typ": "Youtube" - }, - "Tweaxx - Mersas": { - "url": "https://www.youtube.com/watch?v=7ljAzgALPdA", - "typ": "Youtube" - }, - "Vilija ir Marijonas mikutavicius - Dabar Geriausi Musu Vakarai": { - "url": "https://www.youtube.com/watch?v=MPnZkEscWo0", - "typ": "Youtube" - }, - "Mr.Bullet - UZ MUS IR JUS": { - "url": "https://www.youtube.com/watch?v=85q_7jXEgH8", - "typ": "Youtube" - }, - "SADBOY - Blizgantys Naikai": { - "url": "https://www.youtube.com/watch?v=p5KsYJGcfOM", - "typ": "Youtube" - }, - "Deivas - Klaipeda On Top": { - "url": "https://www.youtube.com/watch?v=g_h2M3e2OYU", - "typ": "Youtube" - }, - "Riaukenzo - Trys Trys Trys": { - "url": "https://www.youtube.com/watch?v=qJv6GRQCnCk", - "typ": "Youtube" - }, - "Dzordana Butkute - Nebenoriu Laukt": { - "url": "https://www.youtube.com/watch?v=_AozFrAqNMk", - "typ": "Youtube" - }, - "Karaliska Erdve - Vakareja": { - "url": "https://www.youtube.com/watch?v=g0HmrlJ7fhE", - "typ": "Youtube" - }, - "DJ Dalgis - Zalia Siera": { - "url": "https://www.youtube.com/watch?v=nfentq_pez4", - "typ": "Youtube" - }, - "Parnesk alaus OG": { - "url": "https://www.youtube.com/watch?v=e7cB1JIlZ2k", - "typ": "Youtube" - }, - "morre - Kaip Diena": { - "url": "https://www.youtube.com/watch?v=6LDgLWCQSSM", - "typ": "Youtube" - }, - "69 Danguje - Gyvenu": { - "url": "https://www.youtube.com/watch?v=HMXlhmAoux4", - "typ": "Youtube" - }, - "Vitalija Katunskyte - Robinzonas": { - "url": "https://www.youtube.com/watch?v=erDHG-QpbPY", - "typ": "Youtube" - }, - "Depresinis, Jypas - O Mazuti": { - "url": "https://www.youtube.com/watch?v=4t_DPbe2r3M", - "typ": "Youtube" - }, - "Vaidas Baumila - Apzavai": { - "url": "https://www.youtube.com/watch?v=H8uGi4ZMgHA", - "typ": "Youtube" - } - } - }, - "alt": { - "songs": { - "ROMANCEPLANET - FALL FROM THE SKY": { - "url": "https://www.youtube.com/watch?v=HMhzxzXBisw", - "typ": "Youtube" - }, - "Artemas - i like the way you kiss me": { - "url": "https://www.youtube.com/watch?v=ODDRRXMi22E", - "typ": "Youtube" - }, - "ROMANCEPLANET - PLAIN WHITE TEE": { - "url": "https://www.youtube.com/watch?v=tdVQbNwjGac", - "typ": "Youtube" - }, - "ROMANCEPLANET - DANCE": { - "url": "https://www.youtube.com/watch?v=ircOfMb4gEw", - "typ": "Youtube" - } - } - }, - "rusiskos": { - "songs": { - "Kanikuli": { - "url": "https://www.youtube.com/watch?v=GNMiDZTL7jo", - "typ": "Youtube" - }, - "Arash - Temptation": { - "url": "https://www.youtube.com/watch?v=6X3ZJh762-I", - "typ": "Youtube" - }, - "Pimp Schwab - vse shto nas ne Ubivaet": { - "url": "https://www.youtube.com/watch?v=NTEXFyUE9Ww", - "typ": "Youtube" - }, - "Eldzej and Feduk - Rozovoe vino": { - "url": "https://www.youtube.com/watch?v=S9oXj3a4gZ4", - "typ": "Youtube" - }, - "Raim & Artur feat. Zhenis - Diskoteka is 90 hit": { - "url": "https://www.youtube.com/watch?v=GfBhxlNhrn0", - "typ": "Youtube" - }, - "Katja lel - moi marmeladni (paprobui mua mua)": { - "url": "https://www.youtube.com/watch?v=0JMdXFHo5SY", - "typ": "Youtube" - }, - "Topolini puh": { - "url": "https://www.youtube.com/watch?v=UUryvYF8tUs", - "typ": "Youtube" - }, - "Ruki Verch - 18 mne uze": { - "url": "https://www.youtube.com/watch?v=Hxab_Sr132o", - "typ": "Youtube" - }, - "Dzaro and hansa - Visky Kola karaleva trans pola": { - "url": "https://www.youtube.com/watch?v=fflrMvZ2HtA", - "typ": "Youtube" - } - } - }, - "lietuviskos/sel": { - "songs": { - "SEL - Gyvenimo man vieno neuztenka": { - "url": "https://youtu.be/7Gd9XaEG5o4", - "typ": "Youtube" - }, - "SEL - Ten kur sapnai": { - "url": "https://youtu.be/GDj3NgjDbRo", - "typ": "Youtube" - }, - "SEL - Lyja": { - "url": "https://www.youtube.com/watch?v=KL6JBWnXCxw", - "typ": "Youtube" - }, - "SEL - Skrendu": { - "url": "https://youtu.be/G5Q_asvrXlA", - "typ": "Youtube" - }, - "SEL - Leisk": { - "url": "https://youtu.be/DDPmFMrffXQ", - "typ": "Youtube" - }, - "SEL - Uzmerkiu akis": { - "url": "https://youtu.be/SdWj06XRZms?si=9TNGzjK9ITom-jaD", - "typ": "Youtube" - }, - "SEL - Tarp amzinybes": { - "url": "https://youtu.be/UfPj-0QpGFA", - "typ": "Youtube" - }, - "SEL - Ten kazkur giliai": { - "url": "https://youtu.be/N7YNlegeiqs?si=9BBH6hjrgOjJ01Nz", - "typ": "Youtube" - }, - "SEL - Nes as tik vejas": { - "url": "https://youtu.be/acMG37IZ6z8", - "typ": "Youtube" - }, - "SEL - As ziuriu i tave pasauli": { - "url": "https://youtu.be/_SPDjl80kKw", - "typ": "Youtube" - }, - "SEL - Tik Tok": { - "url": "https://youtu.be/RkaIUateIxg", - "typ": "Youtube" - } - } - }, - "rave": { - "songs": { - "EVERYTHING WHAT": { - "url": "https://www.youtube.com/watch?v=Gjdsq4kc5cA", - "typ": "Youtube" - }, - "DR. VODKA - Tricky Disco": { - "url": "https://www.youtube.com/watch?v=IknAUhl3i2o", - "typ": "Youtube" - }, - "Mason - Perfect remix 1991": { - "url": "https://open.spotify.com/track/1VKWQgq0g2uKtgNfL0ceNM?si=b3f1dc504ddb41ed", - "typ": "Spotify" - }, - "Tricky Disco": { - "url": "https://www.youtube.com/watch?v=t78qVdbAiXw", + "The Love Parade ( Bounce Invaderz )": { + "url": "https://www.youtube.com/watch?v=xogT6KBWjCU3", "typ": "Youtube" } } } } -} +} \ No newline at end of file diff --git a/src/commands/gui/mod.rs b/src/commands/gui/mod.rs index c5b1610..bdb2e86 100644 --- a/src/commands/gui/mod.rs +++ b/src/commands/gui/mod.rs @@ -2,15 +2,16 @@ mod nav_bar; mod song_edit_window; -use egui::{Color32, Label, Sense}; +use std::collections::HashSet; + +use egui::{Button, Color32, Label, RichText, Sense}; use egui_extras::{Column, TableBuilder}; use song_edit_window::{GuiError, GuiImportPlaylist, GuiNewSong}; -use crate::{config::{Config, ConfigWrapper}, downloader::Downloader, manifest::{song::SongType, Manifest}}; +use crate::{config::{Config, ConfigWrapper}, downloader::Downloader, manifest::{song::{Song, SongType}, Manifest}}; use self::song_edit_window::GuiSongEditor; - #[derive(Debug, Default)] pub struct Gui { manifest: Manifest, @@ -20,14 +21,14 @@ pub struct Gui { error_w: GuiError, filter: String, downloader: Downloader, - cfg: ConfigWrapper + cfg: ConfigWrapper, + downloading: bool, } impl Gui { fn new(_: &eframe::CreationContext<'_>, manifest: Manifest, downloader: Downloader, cfg: ConfigWrapper) -> Self { Self { manifest, - filter: String::new(), downloader, cfg, ..Default::default() @@ -93,7 +94,7 @@ impl eframe::App for Gui { ui.vertical(|ui| { ui.horizontal(|ui| { - ui.colored_label(Color32::BLUE, "Filter: "); + ui.colored_label(Color32::from_hex("#4444aa").unwrap(), "Filter: "); ui.text_edit_singleline(&mut self.filter); }); }); @@ -104,7 +105,7 @@ impl eframe::App for Gui { .striped(true) .cell_layout(egui::Layout::left_to_right(egui::Align::Center)) .resizable(true) - .column(Column::auto()) + //.column(Column::auto()) .column(Column::auto()) //.column( // Column::remainder() @@ -132,7 +133,7 @@ impl eframe::App for Gui { }; table.header(20.0, |mut header| { - header.col(|_|{}); + // header.col(|_|{}); header.col(|ui| { ui.strong("Playlist"); }); @@ -161,31 +162,83 @@ impl eframe::App for Gui { continue; } } - body.row(18.0, |mut row| { + row.col(|ui| { - if ui.add(Label::new("[edit]").sense(Sense::click())).clicked() { - self.song_edit_w.song = ( + ui.label(pname.clone()) + .context_menu(|ui| context_menu(self, ui, &pname, &sname, &s)); + }); + row.col(|ui| { + let color = + match s.get_type() { + SongType::Youtube => Color32::from_hex("#FF0000").unwrap(), + SongType::Spotify => Color32::from_hex("#1db954").unwrap(), + SongType::Soundcloud => Color32::from_hex("#F26F23").unwrap() + }; + + ui.colored_label(color, s.get_type().to_string()) + .context_menu(|ui| context_menu(self, ui, &pname, &sname, &s)); + }); + row.col(|ui| { + ui.hyperlink_to(sname.clone(), s.get_url_str()) + .context_menu(|ui| context_menu(self, ui, &pname, &sname, &s)); + }); + + row.response() + .context_menu(|ui| context_menu(self, ui, &pname, &sname, &s)); + + fn context_menu(this: &mut Gui, ui: &mut egui::Ui, pname: &String, sname: &String, song: &Song) { + if ui.button("Edit").clicked() { + this.song_edit_w.song = ( pname.clone(), sname.clone(), ); - log::debug!("Label pressed"); - self.song_edit_w.is_open = true; - self.song_edit_w.ed_name = sname.clone(); - self.song_edit_w.ed_url = s.get_url_str().clone(); + this.song_edit_w.is_open = true; + this.song_edit_w.ed_name = sname.clone(); + this.song_edit_w.ed_url = song.get_url_str().clone(); + ui.close_menu() } - - }); - row.col(|ui| { - ui.label(pname.clone()); - }); - row.col(|ui| { - ui.label(s.get_type().to_string()); - }); - row.col(|ui| { - ui.hyperlink_to(sname.clone(), s.get_url_str()); - }); + if ui.button("Download").clicked() { + if let Err(e) = this.downloader.download_song_nb(&this.cfg, pname, sname, song, this.manifest.get_format()) { + log::error!("{e}"); + this.throw_error(format!("Failed to download song {sname}: {e}")); + } + ui.close_menu() + } + + if ui.button("Open Source").clicked() { + if let Err(e) = open::that(song.get_url_str()) { + log::error!("{e}"); + this.throw_error(format!("Failed to open song source: {e}")); + } + ui.close_menu() + } + if ui.button("Play").clicked() { + let p = crate::util::get_song_path(pname, sname, this.manifest.get_format()); + + if !p.exists() { + this.throw_error(format!("Song does not exist on disk")); + } else if let Err(e) = open::that(p) { + log::error!("{e}"); + this.throw_error(format!("Failed to play song: {e}")); + } + ui.close_menu() + } + if ui.button("Delete from disk").clicked() { + let p = crate::util::get_song_path(pname, sname, this.manifest.get_format()); + if p.exists() { + if let Err(e) = std::fs::remove_file(p) { + this.throw_error(format!("Failed to delete file: {e}")); + } + } + ui.close_menu(); + } + if ui.button(RichText::new("Delete").color(Color32::RED)).clicked() { + this.throw_error("TODO"); + ui.close_menu() + } + } }) } }); diff --git a/src/commands/gui/nav_bar.rs b/src/commands/gui/nav_bar.rs index 2049149..ee65176 100644 --- a/src/commands/gui/nav_bar.rs +++ b/src/commands/gui/nav_bar.rs @@ -46,7 +46,14 @@ impl Gui { ui.with_layout(egui::Layout::bottom_up(egui::Align::RIGHT), |ui| { ui.horizontal(|ui| { if self.downloader.get_songs_left_nb() > 0 { + self.downloading = true; ui.label(format!("Downloading: {}/{}", self.downloader.get_songs_left_nb(), self.downloader.get_initial_song_count_nb())); + } else if self.downloading { + let _ = notify_rust::Notification::new() + .summary("Done downloading") + .body("Your music has been downloaded") + .show(); + self.downloading = false; } let _ = self.downloader.download_all_nb_poll(&self.cfg); egui::widgets::global_dark_light_mode_buttons(ui); diff --git a/src/commands/gui/song_edit_window.rs b/src/commands/gui/song_edit_window.rs index 591ca81..c53e9af 100644 --- a/src/commands/gui/song_edit_window.rs +++ b/src/commands/gui/song_edit_window.rs @@ -1,5 +1,7 @@ -use egui::{Color32, RichText, TextBuffer}; +use std::sync::Arc; + +use egui::{text::{LayoutJob, TextWrapping}, Color32, Label, RichText, Style, TextBuffer, TextFormat, TextStyle}; use crate::manifest::{playlist::Playlist, song::{Song, SongType}}; @@ -97,6 +99,7 @@ impl Gui { playlist.remove_song(&song_name); playlist.add_song(self.song_edit_w.ed_name.clone(), song); + self.song_edit_w.is_open = false; let _ = self.manifest.save(None); } } @@ -125,7 +128,7 @@ impl Gui { ui.horizontal(|ui| { ui.label("Playlist: "); egui::ComboBox::from_id_source("new_song_window_playlist") - .selected_text(format!("{}", self.new_song_w.ed_playlist.clone().unwrap())) + .selected_text(format!("{}", self.new_song_w.ed_playlist.clone().unwrap_or("".to_string()))) .show_ui(ui, |ui| { for p in self.manifest.get_playlists().keys() { ui.selectable_value(&mut self.new_song_w.ed_playlist, Option::Some(p.clone()), p.as_str()); @@ -212,8 +215,7 @@ impl Gui { ui.vertical(|ui| { ui.label(RichText::new("Error:").size(30.0).color(Color32::RED)); ui.horizontal(|ui| { - ui.label("Mcmg had an error:"); - ui.label(self.error_w.text.clone()); + ui.add(Label::new(self.error_w.text.clone()).wrap(true)); }) }) }); diff --git a/src/downloader.rs b/src/downloader.rs index 1640a0a..c039778 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -37,7 +37,14 @@ impl Downloader { } pub fn get_songs_left_nb(&self) -> usize { - self.nb_cache.len() + self.nb_cache.len() + crate::process_manager::proc_count() + } + + pub fn download_song_nb(&mut self, cfg: &ConfigWrapper, pname: &String, sname: &String, song: &Song, format: &Format) -> anyhow::Result<()> { + self.nb_cache.push((pname.clone(), sname.clone(), song.clone(), format.clone())); + self.nb_initial_song_count += 1; + self.download_all_nb_poll(cfg)?; + Ok(()) } pub fn download_all_nb(&mut self, manifest: &Manifest, cfg: &ConfigWrapper) -> anyhow::Result> { @@ -57,7 +64,7 @@ impl Downloader { self.download_song(cfg, &sname, &song, &pname, &format)?; } } - if self.nb_cache.is_empty() { + if self.get_songs_left_nb() == 0 { self.nb_initial_song_count = 0; } if crate::process_manager::proc_count() == 0 && self.nb_cache.is_empty() { @@ -81,7 +88,8 @@ impl Downloader { self.count += crate::process_manager::wait_for_procs_untill(0)?; Ok(self.count) } - + + #[allow(dead_code)] pub fn download_playlist(&mut self, cfg: &ConfigWrapper, url: &String, pname: &String, format: &Format) -> anyhow::Result { self.download_playlist_nb(cfg, url, pname, format)?; let mut count = 0; @@ -126,7 +134,7 @@ impl Downloader { pub fn download_song(&mut self, cfg: &ConfigWrapper, name: &String, song: &Song, playlist: &String, format: &Format) -> anyhow::Result<()> { let dl_dir = format!("{}/{playlist}", cfg.cli.output); let dl_file = format!("{dl_dir}/{}.{}", name, &format); - + log::debug!("Checking: {dl_file}"); if PathBuf::from(&dl_file).exists() { log::debug!("File {dl_file} exists, skipping"); return Ok(()) diff --git a/src/manifest/song.rs b/src/manifest/song.rs index ca1f078..eba75ff 100644 --- a/src/manifest/song.rs +++ b/src/manifest/song.rs @@ -64,6 +64,7 @@ impl Song { + impl TryFrom for SongType { type Error = anyhow::Error; diff --git a/src/util.rs b/src/util.rs index 0b6def3..817f8c0 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,6 +1,6 @@ -use std::path::PathBuf; +use std::{any::Any, path::PathBuf}; -use crate::constants; +use crate::{constants, manifest::Format}; pub(crate) fn is_supported_host(url: url::Url) -> bool { let host = url.host_str(); @@ -52,6 +52,11 @@ pub(crate) fn isatty() -> bool { } } + +pub fn as_any_mut(val: &mut T) -> &mut dyn Any { + val as &mut dyn Any +} + // pub async fn dl_to_file(url: &str, p: PathBuf) -> anyhow::Result<()> { // log::info!("Downloading {} -> {:?}", url, p); // let ytdlp_req = reqwest::get(url).await?.bytes().await?; @@ -60,4 +65,23 @@ pub(crate) fn isatty() -> bool { // fd.write(&ytdlp_req)?; // log::debug!("Finished writing {:?}", p); // Ok(()) -// } \ No newline at end of file +// } + +pub fn get_song_path/*>*/(/*basepath: Option

,*/ pname: &String, sname: &String, format: &Format) -> PathBuf { + // let mut path: PathBuf; + /*if let Some(bp) = basepath { + if let Ok(bp) = bp.try_into() { + path = bp; + } else { + path = std::env::current_dir().unwrap_or(PathBuf::new()); + } + } else {*/ + let mut path = std::env::current_dir().unwrap_or(PathBuf::new()); + //} + // TODO: Get this from cfg + path.push("out"); + path.push(pname); + path.push(sname); + path.set_extension(format.to_string()); + path +}