From 776a88c4cfb02caf1c22da04010b009347596246 Mon Sep 17 00:00:00 2001 From: MCorange Date: Sat, 14 Sep 2024 19:50:13 +0300 Subject: [PATCH] Added playlist import for gui (yt only) --- manifest.json | 1220 +++++++++++++------------- src/commands/gui/mod.rs | 32 +- src/commands/gui/nav_bar.rs | 10 +- src/commands/gui/song_edit_window.rs | 128 ++- src/manifest/song.rs | 3 +- 5 files changed, 740 insertions(+), 653 deletions(-) diff --git a/manifest.json b/manifest.json index 09de885..6a08cce 100644 --- a/manifest.json +++ b/manifest.json @@ -1,66 +1,142 @@ { "format": "m4a", "playlists": { - "lietuviskos/sel": { + "rock": { "songs": { - "SEL - Leisk": { - "url": "https://youtu.be/DDPmFMrffXQ", - "typ": "Youtube" - }, - "SEL - Lyja": { - "url": "https://www.youtube.com/watch?v=KL6JBWnXCxw", - "typ": "Youtube" - }, - "SEL - Gyvenimo man vieno neuztenka": { - "url": "https://youtu.be/7Gd9XaEG5o4", - "typ": "Youtube" - }, - "SEL - Tik Tok": { - "url": "https://youtu.be/RkaIUateIxg", - "typ": "Youtube" - }, - "SEL - Ten kur sapnai": { - "url": "https://youtu.be/GDj3NgjDbRo", - "typ": "Youtube" - }, - "SEL - Tarp amzinybes": { - "url": "https://youtu.be/UfPj-0QpGFA", - "typ": "Youtube" - }, - "SEL - Uzmerkiu akis": { - "url": "https://youtu.be/SdWj06XRZms?si=9TNGzjK9ITom-jaD", - "typ": "Youtube" - }, - "SEL - Skrendu": { - "url": "https://youtu.be/G5Q_asvrXlA", - "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 - Ten kazkur giliai": { - "url": "https://youtu.be/N7YNlegeiqs?si=9BBH6hjrgOjJ01Nz", + "Black Sabbath": { + "url": "https://www.youtube.com/watch?v=BOTIIw76qiE", "typ": "Youtube" } } }, - "electronic": { + "techno": { "songs": { - "Benny Benassi - Satisfaction": { - "url": "https://www.youtube.com/watch?v=a0fkNdPiIL4", + "Raffaella Carra - Pedro (Jaxomy & Agatino Romero Remix)": { + "url": "https://www.youtube.com/watch?v=AIGnRc7F86Q", "typ": "Youtube" }, - "MONEY ON THE DASH": { - "url": "https://open.spotify.com/track/6nVEV8CIU4dw12oVZbKJtl", - "typ": "Spotify" + "Lily Allen - Not Fair": { + "url": "https://www.youtube.com/watch?v=WON_YIbeLis", + "typ": "Youtube" }, - "Zombie Nation - Kernkraft 400": { - "url": "https://www.youtube.com/watch?v=z5LW07FTJbI", + "Manian - Welcome To The Club": { + "url": "https://www.youtube.com/watch?v=7F9xDewtgNA", + "typ": "Youtube" + }, + "Nicolas Julian - Applause": { + "url": "https://www.youtube.com/watch?v=9qHLELnq1B0", + "typ": "Youtube" + }, + "$UICIDEBOY$ - PARIS (TECHNO)": { + "url": "https://www.youtube.com/watch?v=YYDJmGDkEyw", + "typ": "Youtube" + }, + "The Love Parade ( Bounce Invaderz )": { + "url": "https://www.youtube.com/watch?v=xogT6KBWjCU3", + "typ": "Youtube" + }, + "I WAS MADE FOR LOVIN' YOU (TECHNO)": { + "url": "https://www.youtube.com/watch?v=asVznhccYao", + "typ": "Youtube" + }, + "Restricted - Big Jet Plane": { + "url": "https://www.youtube.com/watch?v=NpVF0z5N-tE", + "typ": "Youtube" + }, + "08 Blumchen - Blaue Augen": { + "url": "https://www.youtube.com/watch?v=mE4PZcUfiwE", + "typ": "Youtube" + }, + "Beggin' (Techno)": { + "url": "https://www.youtube.com/watch?v=tXPs1FwW6lk", + "typ": "Youtube" + }, + "Gigi D'Agostino - Bla Bla Bla": { + "url": "https://www.youtube.com/watch?v=yKapqR2XRJE", + "typ": "Youtube" + }, + "Empire Of The Sun, southstar - We Are The People": { + "url": "https://www.youtube.com/watch?v=qguEGR5BK2k", + "typ": "Youtube" + }, + "Dance For Me": { + "url": "https://www.youtube.com/watch?v=5DTSvGO_944", + "typ": "Youtube" + }, + "Knock2 - dashstar": { + "url": "https://www.youtube.com/watch?v=58ml5b_On6w", + "typ": "Youtube" + }, + "MUTA - Party maker": { + "url": "https://www.youtube.com/watch?v=LT9VNK1aCXY", + "typ": "Youtube" + }, + "Give It To Me": { + "url": "https://www.youtube.com/watch?v=upQe8EeSyZU", + "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", + "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", + "typ": "Youtube" + } + } + }, + "pop": { + "songs": { + "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", + "typ": "Youtube" + }, + "Pitbul - Fireball": { + "url": "https://www.youtube.com/watch?v=HMqgVXSvwGo", + "typ": "Youtube" + }, + "Green Day - Basket Case": { + "url": "https://www.youtube.com/watch?v=wZ8eZRxFA-0", + "typ": "Youtube" + }, + "Mr President - Coco Jumbo": { + "url": "https://www.youtube.com/watch?v=cOrc37wNUqU", + "typ": "Youtube" + }, + "Cheri cheri lady": { + "url": "https://www.youtube.com/watch?v=lrIKt5uDWZo", + "typ": "Youtube" + } + } + }, + "lietuviskos/rave": { + "songs": { + "Sokoledas - Mano Skonis Sokolado (Matuze & Arnisxd Remix)": { + "url": "https://www.youtube.com/watch?v=hb41bfQxiM0", + "typ": "Youtube" + }, + "VainHouse - Malunas Prie Kelio": { + "url": "https://www.youtube.com/watch?v=bbwuNjDXCiM", "typ": "Youtube" } } @@ -73,58 +149,6 @@ } } }, - "lietuviskos/rave": { - "songs": { - "VainHouse - Malunas Prie Kelio": { - "url": "https://www.youtube.com/watch?v=bbwuNjDXCiM", - "typ": "Youtube" - }, - "Sokoledas - Mano Skonis Sokolado (Matuze & Arnisxd Remix)": { - "url": "https://www.youtube.com/watch?v=hb41bfQxiM0", - "typ": "Youtube" - } - } - }, - "alt": { - "songs": { - "ROMANCEPLANET - FALL FROM THE SKY": { - "url": "https://www.youtube.com/watch?v=HMhzxzXBisw", - "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" - }, - "ROMANCEPLANET - PLAIN WHITE TEE": { - "url": "https://www.youtube.com/watch?v=tdVQbNwjGac", - "typ": "Youtube" - } - } - }, - "rave": { - "songs": { - "EVERYTHING WHAT": { - "url": "https://www.youtube.com/watch?v=Gjdsq4kc5cA", - "typ": "Youtube" - }, - "Tricky Disco": { - "url": "https://www.youtube.com/watch?v=t78qVdbAiXw", - "typ": "Youtube" - }, - "Mason - Perfect remix 1991": { - "url": "https://open.spotify.com/track/1VKWQgq0g2uKtgNfL0ceNM?si=b3f1dc504ddb41ed", - "typ": "Spotify" - }, - "DR. VODKA - Tricky Disco": { - "url": "https://www.youtube.com/watch?v=IknAUhl3i2o", - "typ": "Youtube" - } - } - }, "hip-hop": { "songs": { "Drenchill - Freed from Desire": { @@ -137,538 +161,514 @@ } } }, - "pop": { - "songs": { - "Icona Pop - I Love It": { - "url": "https://www.youtube.com/watch?v=UxxajLWwzqY", - "typ": "Youtube" - }, - "Green Day - Basket Case": { - "url": "https://www.youtube.com/watch?v=wZ8eZRxFA-0", - "typ": "Youtube" - }, - "Pitbul - Fireball": { - "url": "https://www.youtube.com/watch?v=HMqgVXSvwGo", - "typ": "Youtube" - }, - "Cheri cheri lady": { - "url": "https://www.youtube.com/watch?v=lrIKt5uDWZo", - "typ": "Youtube" - }, - "Mr President - Coco Jumbo": { - "url": "https://www.youtube.com/watch?v=cOrc37wNUqU", - "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", - "typ": "Youtube" - } - } - }, - "rusiskos": { - "songs": { - "Eldzej and Feduk - Rozovoe vino": { - "url": "https://www.youtube.com/watch?v=S9oXj3a4gZ4", - "typ": "Youtube" - }, - "Pimp Schwab - vse shto nas ne Ubivaet": { - "url": "https://www.youtube.com/watch?v=NTEXFyUE9Ww", - "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" - }, - "Arash - Temptation": { - "url": "https://www.youtube.com/watch?v=6X3ZJh762-I", - "typ": "Youtube" - }, - "Dzaro and hansa - Visky Kola karaleva trans pola": { - "url": "https://www.youtube.com/watch?v=fflrMvZ2HtA", - "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" - }, - "Kanikuli": { - "url": "https://www.youtube.com/watch?v=GNMiDZTL7jo", - "typ": "Youtube" - } - } - }, - "lietuviskos": { - "songs": { - "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" - }, - "Mr.Bullet - UZ MUS IR JUS": { - "url": "https://www.youtube.com/watch?v=85q_7jXEgH8", - "typ": "Youtube" - }, - "NL - Juodas Golfas": { - "url": "https://www.youtube.com/watch?v=f2-ZmElSvPc", - "typ": "Youtube" - }, - "Depresinis - LEDINE": { - "url": "https://www.youtube.com/watch?v=qugvChkXMLk", - "typ": "Youtube" - }, - "Tnn - Parukom": { - "url": "https://www.youtube.com/watch?v=v9pBZK2RIPI", - "typ": "Youtube" - }, - "Grupe MX - 1.9 TDI": { - "url": "https://www.youtube.com/watch?v=8FBr5GQXsI8", - "typ": "Youtube" - }, - "Zilvinas Zvagulis - Amerikonas grizo sunus": { - "url": "https://www.youtube.com/watch?v=UvzJEz5ADY8", - "typ": "Youtube" - }, - "Depresinis - Volkswagina": { - "url": "https://www.youtube.com/watch?v=1lZR1VKsQHo", - "typ": "Youtube" - }, - "69 Danguje - Gyvenu": { - "url": "https://www.youtube.com/watch?v=HMXlhmAoux4", - "typ": "Youtube" - }, - "AVA - Eik Tu NA": { - "url": "https://www.youtube.com/watch?v=yRf3ijaIgOg", - "typ": "Youtube" - }, - "NL - Pasitusinam": { - "url": "https://www.youtube.com/watch?v=WhSFudvloog", - "typ": "Youtube" - }, - "Judam Lietuvoj": { - "url": "https://www.youtube.com/watch?v=WDzWSEgSy5U", - "typ": "Youtube" - }, - "SADBOY - Blizgantys Naikai": { - "url": "https://www.youtube.com/watch?v=p5KsYJGcfOM", - "typ": "Youtube" - }, - "Dzordana Butkute - Nebenoriu Laukt": { - "url": "https://www.youtube.com/watch?v=_AozFrAqNMk", - "typ": "Youtube" - }, - "Ciulpuoneliai - Jau Nutilo Sirgaliai": { - "url": "https://www.youtube.com/watch?v=s8qIVA1U0C0", - "typ": "Youtube" - }, - "Robertas Kupstas - Cia Mano Rojus": { - "url": "https://www.youtube.com/watch?v=xij_YeEInr8", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - 0,7": { - "url": "https://www.youtube.com/watch?v=rjwFjBgTzAA", - "typ": "Youtube" - }, - "Radvis - TU ESI MELAGIS (Techno Extended)": { - "url": "https://www.youtube.com/watch?v=kmvvP7GW_bw", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - Pavasaris": { - "url": "https://www.youtube.com/watch?v=yWWAucfQdN4", - "typ": "Youtube" - }, - "DJ Dalgis - Negeriau": { - "url": "https://www.youtube.com/watch?v=c89YvG3MCcs", - "typ": "Youtube" - }, - "Jovani, Karaliska Erdve - Is Leto Leidziasi Saule": { - "url": "https://www.youtube.com/watch?v=VqSu8iG1_DE", - "typ": "Youtube" - }, - "Funky - Be taves": { - "url": "https://www.youtube.com/watch?v=heTDrDukLWU", - "typ": "Youtube" - }, - "Vitalija Katunskyte - Robinzonas": { - "url": "https://www.youtube.com/watch?v=erDHG-QpbPY", - "typ": "Youtube" - }, - "Tipo grupe ir Kastaneda - Po stikliuka": { - "url": "https://www.youtube.com/watch?v=EtmE60nE7fI", - "typ": "Youtube" - }, - "Zas - Zalias Pasas": { - "url": "https://www.youtube.com/watch?v=SZA7IjlCfyI", - "typ": "Youtube" - }, - "Mercy Dance - I Pajuri": { - "url": "https://www.youtube.com/watch?v=RPpkMh47l9w", - "typ": "Youtube" - }, - "NL - R1": { - "url": "https://www.youtube.com/watch?v=hSgav4fYnZ8", - "typ": "Youtube" - }, - "Raketa - I Kluba": { - "url": "https://www.youtube.com/watch?v=FkSjtpYN3EI", - "typ": "Youtube" - }, - "MC ENDRAY - AUDI": { - "url": "https://www.youtube.com/watch?v=oIjNoMGEuRg", - "typ": "Youtube" - }, - "Rondo - Margarita": { - "url": "https://www.youtube.com/watch?v=rF4w-Rxsiv4", - "typ": "Youtube" - }, - "Wenona Waves - Topine Panele": { - "url": "https://www.youtube.com/watch?v=MPHuhmUomfE", - "typ": "Youtube" - }, - "SixthBoi - Nevaidink": { - "url": "https://www.youtube.com/watch?v=nOTNnnrqTII", - "typ": "Youtube" - }, - "Adomas Vysniauskas - As Judu": { - "url": "https://www.youtube.com/watch?v=dMm16TzZrjg", - "typ": "Youtube" - }, - "Nezinau, Kodel...": { - "url": "https://www.youtube.com/watch?v=A-i2CkCnPoc", - "typ": "Youtube" - }, - "Ka Tu Ka Vakare": { - "url": "https://www.youtube.com/watch?v=6SOS4ljHbJY", - "typ": "Youtube" - }, - "MG INTERNATIONAL - JUODA ORCHIDEJA": { - "url": "https://www.youtube.com/watch?v=HQvceFRBq9M", - "typ": "Youtube" - }, - "Deivas - Klaipeda On Top": { - "url": "https://www.youtube.com/watch?v=g_h2M3e2OYU", - "typ": "Youtube" - }, - "VAIKAI PO LELIJOM (REMIX)": { - "url": "https://www.youtube.com/watch?v=k1amBbsAZuo", - "typ": "Youtube" - }, - "Kastanenda - Sombrero": { - "url": "https://www.youtube.com/watch?v=3Z3_4TknCfQ", - "typ": "Youtube" - }, - "Rytis Cicinas - Ne, nereikia asaru": { - "url": "https://www.youtube.com/watch?v=48GSg1q2kPE", - "typ": "Youtube" - }, - "Depresinis, Jypas - O Mazuti": { - "url": "https://www.youtube.com/watch?v=4t_DPbe2r3M", - "typ": "Youtube" - }, - "SADBOY - Deginam": { - "url": "https://www.youtube.com/watch?v=w3R0Aq1EGXg", - "typ": "Youtube" - }, - "Zilviokas - Ryk Zuvedra ryk": { - "url": "https://www.youtube.com/watch?v=eN6BOI7UlSE", - "typ": "Youtube" - }, - "69 Danguje - 16 metu": { - "url": "https://www.youtube.com/watch?v=nwjoqPcUPrw", - "typ": "Youtube" - }, - "morre - Kaip Diena": { - "url": "https://www.youtube.com/watch?v=6LDgLWCQSSM", - "typ": "Youtube" - }, - "Tipo grupe - Lovoj Vezi": { - "url": "https://www.youtube.com/watch?v=M3zVMzWCy_c", - "typ": "Youtube" - }, - "Eugenijus Ostapenko - Dviratukas": { - "url": "https://www.youtube.com/watch?v=ILFHZQK33Mw", - "typ": "Youtube" - }, - "Grupiokai - Degtine": { - "url": "https://www.youtube.com/watch?v=8SqbG2VmEFw", - "typ": "Youtube" - }, - "SADBOY - Kaifuok": { - "url": "https://www.youtube.com/watch?v=vclryWgfy8I", - "typ": "Youtube" - }, - "Andzikas - I gamta": { - "url": "https://www.youtube.com/watch?v=UyLdjC-hihM", - "typ": "Youtube" - }, - "MAMA MANE RODYS PER FARUS": { - "url": "https://www.youtube.com/watch?v=F5HqXYRDZaE", - "typ": "Youtube" - }, - "Patruliai - Kur Tu": { - "url": "https://www.youtube.com/watch?v=OPWhiu3cvj0", - "typ": "Youtube" - }, - "Karaliska Erdve - Vakareja": { - "url": "https://www.youtube.com/watch?v=g0HmrlJ7fhE", - "typ": "Youtube" - }, - "Rycka klipas": { - "url": "https://www.youtube.com/watch?v=nuTUDSQ3BBI", - "typ": "Youtube" - }, - "Zas - Myliu kina": { - "url": "https://www.youtube.com/watch?v=ImFrfmi-qT8", - "typ": "Youtube" - }, - "16Hz - Baliavojam": { - "url": "https://www.youtube.com/watch?v=Ia-qERX8WLs", - "typ": "Youtube" - }, - "Vilija ir Marijonas mikutavicius - Dabar Geriausi Musu Vakarai": { - "url": "https://www.youtube.com/watch?v=MPnZkEscWo0", - "typ": "Youtube" - }, - "Dove - Naktinis Tusas": { - "url": "https://www.youtube.com/watch?v=pz-HEAwFEnk", - "typ": "Youtube" - }, - "Tweaxx - Mersas": { - "url": "https://www.youtube.com/watch?v=7ljAzgALPdA", - "typ": "Youtube" - }, - "Andzikas - Virs debesu": { - "url": "https://www.youtube.com/watch?v=PHJcVGhxra8", - "typ": "Youtube" - }, - "Parnesk alaus OG": { - "url": "https://www.youtube.com/watch?v=e7cB1JIlZ2k", - "typ": "Youtube" - }, - "Vytautas siskauskas - Lietuva (Nebelinksmas musu kaimas)": { - "url": "https://www.youtube.com/watch?v=31UkGzde14c", - "typ": "Youtube" - }, - "NIERKA - PENKTADIENIS": { - "url": "https://www.youtube.com/watch?v=h3TuZj_OAf0", - "typ": "Youtube" - }, - "SADBOY - 1001 Naktis": { - "url": "https://www.youtube.com/watch?v=mLJIjGvWmKI", - "typ": "Youtube" - }, - "RADVIS - KINO FILMAI": { - "url": "https://www.youtube.com/watch?v=vhAEkC3xNMo", - "typ": "Youtube" - }, - "Ganja - Truputi": { - "url": "https://www.youtube.com/watch?v=Pxve7CwiCHM", - "typ": "Youtube" - }, - "DJ Dalgis - Kauniete": { - "url": "https://www.youtube.com/watch?v=b3xPE9Iyuzc", - "typ": "Youtube" - }, - "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" - }, - "16Hz - Autostrada Vilnius - Kaunas": { - "url": "https://www.youtube.com/watch?v=ANS2TSegr40", - "typ": "Youtube" - }, - "Depresinis feat. Deivas - LEDUKAI": { - "url": "https://www.youtube.com/watch?v=R2-MtpkKgGI", - "typ": "Youtube" - }, - "Vairas - Svajoklis": { - "url": "https://www.youtube.com/watch?v=hs8_KTV0Vrw", - "typ": "Youtube" - }, - "Riaukenzo - Trys Trys Trys": { - "url": "https://www.youtube.com/watch?v=qJv6GRQCnCk", - "typ": "Youtube" - }, - "L1GHT CASH - Whiskey Cola Lietuviskai (sultys degtinele) remix": { - "url": "https://www.youtube.com/watch?v=YVaqDaf1KXU", - "typ": "Youtube" - }, - "Vaidas Baumila - Apzavai": { - "url": "https://www.youtube.com/watch?v=H8uGi4ZMgHA", - "typ": "Youtube" - }, - "DJ Dalgis - Zalia Siera": { - "url": "https://www.youtube.com/watch?v=nfentq_pez4", - "typ": "Youtube" - }, - "Depresinis & MERAKI2004 - VASARA ZJBS": { - "url": "https://www.youtube.com/watch?v=BD-pBjRy-5A", - "typ": "Youtube" - }, - "nemuno krantai - rytmecio rasos": { - "url": "https://www.youtube.com/watch?v=2-fGbsrofv4", - "typ": "Youtube" - }, - "PROFLAME - biznis": { - "url": "https://www.youtube.com/watch?v=t139Vd83pgs", - "typ": "Youtube" - } - } - }, - "techno": { - "songs": { - "$UICIDEBOY$ - PARIS (TECHNO)": { - "url": "https://www.youtube.com/watch?v=YYDJmGDkEyw", - "typ": "Youtube" - }, - "Give It To Me": { - "url": "https://www.youtube.com/watch?v=upQe8EeSyZU", - "typ": "Youtube" - }, - "The Love Parade ( Bounce Invaderz )": { - "url": "https://www.youtube.com/watch?v=xogT6KBWjCU3", - "typ": "Youtube" - }, - "08 Blumchen - Blaue Augen": { - "url": "https://www.youtube.com/watch?v=mE4PZcUfiwE", - "typ": "Youtube" - }, - "Raffaella Carra - Pedro (Jaxomy & Agatino Romero Remix)": { - "url": "https://www.youtube.com/watch?v=AIGnRc7F86Q", - "typ": "Youtube" - }, - "MUTA - Party maker": { - "url": "https://www.youtube.com/watch?v=LT9VNK1aCXY", - "typ": "Youtube" - }, - "Beggin' (Techno)": { - "url": "https://www.youtube.com/watch?v=tXPs1FwW6lk", - "typ": "Youtube" - }, - "Restricted - Big Jet Plane": { - "url": "https://www.youtube.com/watch?v=NpVF0z5N-tE", - "typ": "Youtube" - }, - "Lily Allen - Not Fair": { - "url": "https://www.youtube.com/watch?v=WON_YIbeLis", - "typ": "Youtube" - }, - "Dance For Me": { - "url": "https://www.youtube.com/watch?v=5DTSvGO_944", - "typ": "Youtube" - }, - "I WAS MADE FOR LOVIN' YOU (TECHNO)": { - "url": "https://www.youtube.com/watch?v=asVznhccYao", - "typ": "Youtube" - }, - "Empire Of The Sun, southstar - We Are The People": { - "url": "https://www.youtube.com/watch?v=qguEGR5BK2k", - "typ": "Youtube" - }, - "Nicolas Julian - Applause": { - "url": "https://www.youtube.com/watch?v=9qHLELnq1B0", - "typ": "Youtube" - }, - "Knock2 - dashstar": { - "url": "https://www.youtube.com/watch?v=58ml5b_On6w", - "typ": "Youtube" - }, - "Gigi D'Agostino - Bla Bla Bla": { - "url": "https://www.youtube.com/watch?v=yKapqR2XRJE", - "typ": "Youtube" - }, - "Manian - Welcome To The Club": { - "url": "https://www.youtube.com/watch?v=7F9xDewtgNA", - "typ": "Youtube" - } - } - }, - "rock": { - "songs": { - "Black Sabbath": { - "url": "https://www.youtube.com/watch?v=BOTIIw76qiE", - "typ": "Youtube" - } - } - }, "house": { "songs": { - "Ralph Castelli - Morning Sex (Mochakk Remix)": { - "url": "https://www.youtube.com/watch?v=6bCwJ_TIDG4", - "typ": "Youtube" - }, - "Men I Trust - Tailwhip (Lewii Edit)": { - "url": "https://www.youtube.com/watch?v=XhyM-JUWwWQ", - "typ": "Youtube" - }, "THEOS - Rhodes Trip": { "url": "https://www.youtube.com/watch?v=m7guRO0Uz_c", "typ": "Youtube" }, - "Baltra - Tears Drop": { - "url": "https://www.youtube.com/watch?v=EXXMtKPfuzY", - "typ": "Youtube" - }, - "Bauhouse - After Marvins Dance (Marvin Gaye's 'After The Dance' Edit)": { - "url": "https://www.youtube.com/watch?v=J-cgyYiExh8", - "typ": "Youtube" - }, - "Fidde - I Only See Things I Dont Have": { - "url": "https://www.youtube.com/watch?v=vX_Ye_ZzI-Y", - "typ": "Youtube" - }, - "Fidde - If Theres A Heaven I Wanna See It": { - "url": "https://www.youtube.com/watch?v=l2Nw7cIh7qg", - "typ": "Youtube" - }, "Unknown Artist - Kcik 23": { "url": "https://www.youtube.com/watch?v=SnnqDdZJpzA", "typ": "Youtube" }, - "Sweely - Le Son Dancefloor": { - "url": "https://www.youtube.com/watch?v=5uEvZgmoG6Y", + "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" } } }, - "noclue": { + "electronic": { "songs": { - "Discobitch - C'est Beau La Bourgeoisie": { - "url": "https://www.youtube.com/watch?v=RCeQN2aEWxo", + "Benny Benassi - Satisfaction": { + "url": "https://www.youtube.com/watch?v=a0fkNdPiIL4", "typ": "Youtube" }, - "Maco Mamuko - Whiskey, Cola i Tequila": { - "url": "https://www.youtube.com/watch?v=aBrN0k0Phtc", + "Zombie Nation - Kernkraft 400": { + "url": "https://www.youtube.com/watch?v=z5LW07FTJbI", "typ": "Youtube" }, - "DR. VODKA - DZIEWCZYNO Z TIKTOKA": { - "url": "https://www.youtube.com/watch?v=HLbw1WQt64o", + "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" }, - "Bad Boys": { - "url": "https://www.youtube.com/watch?v=NTC7RD8xzCY", + "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", + "typ": "Youtube" + }, + "Depresinis & MERAKI2004 - VASARA ZJBS": { + "url": "https://www.youtube.com/watch?v=BD-pBjRy-5A", + "typ": "Youtube" + }, + "L1GHT CASH - Whiskey Cola Lietuviskai (sultys degtinele) remix": { + "url": "https://www.youtube.com/watch?v=YVaqDaf1KXU", + "typ": "Youtube" + }, + "nemuno krantai - rytmecio rasos": { + "url": "https://www.youtube.com/watch?v=2-fGbsrofv4", + "typ": "Youtube" + }, + "Kastaneda - Kelyje": { + "url": "https://www.youtube.com/watch?v=JVE6NQqKPL4", + "typ": "Youtube" + }, + "SixthBoi - Nevaidink": { + "url": "https://www.youtube.com/watch?v=nOTNnnrqTII", + "typ": "Youtube" + }, + "Nezinau, Kodel...": { + "url": "https://www.youtube.com/watch?v=A-i2CkCnPoc", + "typ": "Youtube" + }, + "69 Danguje - 16 metu": { + "url": "https://www.youtube.com/watch?v=nwjoqPcUPrw", + "typ": "Youtube" + }, + "Grupiokai - Degtine": { + "url": "https://www.youtube.com/watch?v=8SqbG2VmEFw", + "typ": "Youtube" + }, + "Tipo grupe - Lovoj Vezi": { + "url": "https://www.youtube.com/watch?v=M3zVMzWCy_c", + "typ": "Youtube" + }, + "Depresinis - Volkswagina": { + "url": "https://www.youtube.com/watch?v=1lZR1VKsQHo", + "typ": "Youtube" + }, + "Dove - Naktinis Tusas": { + "url": "https://www.youtube.com/watch?v=pz-HEAwFEnk", + "typ": "Youtube" + }, + "Ganja - Truputi": { + "url": "https://www.youtube.com/watch?v=Pxve7CwiCHM", + "typ": "Youtube" + }, + "Zas - Zalias Pasas": { + "url": "https://www.youtube.com/watch?v=SZA7IjlCfyI", + "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", "typ": "Youtube" } } diff --git a/src/commands/gui/mod.rs b/src/commands/gui/mod.rs index 287fefa..c5b1610 100644 --- a/src/commands/gui/mod.rs +++ b/src/commands/gui/mod.rs @@ -4,16 +4,20 @@ mod song_edit_window; use egui::{Color32, Label, 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 self::song_edit_window::GuiSongEditor; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct Gui { manifest: Manifest, - song_editor: GuiSongEditor, + song_edit_w: GuiSongEditor, + new_song_w: GuiNewSong, + import_playlist_w: GuiImportPlaylist, + error_w: GuiError, filter: String, downloader: Downloader, cfg: ConfigWrapper @@ -23,18 +27,10 @@ impl Gui { fn new(_: &eframe::CreationContext<'_>, manifest: Manifest, downloader: Downloader, cfg: ConfigWrapper) -> Self { Self { manifest, - song_editor: GuiSongEditor { - is_new_open: false, - is_open: false, - song: Default::default(), - ed_url: String::new(), - ed_name: String::new(), - ed_playlist: Some(String::new()), - ed_type: SongType::Youtube - }, filter: String::new(), downloader, cfg, + ..Default::default() } } @@ -61,6 +57,10 @@ impl Gui { Ok(()) } + pub fn throw_error(&mut self, text: impl ToString) { + self.error_w.is_open = true; + self.error_w.text = text.to_string(); + } } impl eframe::App for Gui { @@ -68,6 +68,8 @@ impl eframe::App for Gui { self.draw_nav(ctx, frame); self.draw_song_edit_window(ctx, frame); self.draw_new_song_window(ctx, frame); + self.draw_import_playlist_window(ctx, frame); + self.draw_error_window(ctx, frame); egui::CentralPanel::default().show(ctx, |ui| { // The central panel the region left after adding TopPanel's and SidePanel's @@ -163,14 +165,14 @@ impl eframe::App for Gui { body.row(18.0, |mut row| { row.col(|ui| { if ui.add(Label::new("[edit]").sense(Sense::click())).clicked() { - self.song_editor.song = ( + self.song_edit_w.song = ( pname.clone(), sname.clone(), ); log::debug!("Label pressed"); - self.song_editor.is_open = true; - self.song_editor.ed_name = sname.clone(); - self.song_editor.ed_url = s.get_url_str().clone(); + 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(); } }); diff --git a/src/commands/gui/nav_bar.rs b/src/commands/gui/nav_bar.rs index 2a3caa3..2049149 100644 --- a/src/commands/gui/nav_bar.rs +++ b/src/commands/gui/nav_bar.rs @@ -21,13 +21,17 @@ impl Gui { if ui.button("Quit").clicked() { ctx.send_viewport_cmd(egui::ViewportCommand::Close); } - }); ui.menu_button("Song", |ui| { if ui.button("Add New").clicked() { - log::debug!("NEW SONG"); - self.song_editor.is_new_open = true; + self.new_song_w.is_open = true; + } + }); + + ui.menu_button("Playlist", |ui| { + if ui.button("Import").clicked() { + self.import_playlist_w.is_open = true; } }); diff --git a/src/commands/gui/song_edit_window.rs b/src/commands/gui/song_edit_window.rs index b23e03a..591ca81 100644 --- a/src/commands/gui/song_edit_window.rs +++ b/src/commands/gui/song_edit_window.rs @@ -1,28 +1,46 @@ -use egui::{Color32, TextBuffer}; +use egui::{Color32, RichText, TextBuffer}; use crate::manifest::{playlist::Playlist, song::{Song, SongType}}; use super::Gui; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct GuiSongEditor { pub is_open: bool, - pub is_new_open: bool, pub song: (String, String), pub ed_url: String, pub ed_name: String, - pub ed_playlist: Option, - pub ed_type: SongType, } +#[derive(Debug, Default)] +pub struct GuiNewSong { + pub is_open: bool, + ed_type: SongType, + ed_name: String, + ed_playlist: Option, + ed_url: String, +} + +#[derive(Debug, Default)] +pub struct GuiImportPlaylist { + pub is_open: bool, + ed_name: String, + ed_url: String, +} + +#[derive(Debug, Default)] +pub struct GuiError { + pub is_open: bool, + pub text: String, +} impl Gui { pub fn draw_song_edit_window(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { let mut save = false; - let (playlist, song_name) = self.song_editor.song.clone(); + let (playlist, song_name) = self.song_edit_w.song.clone(); let Some(song) = self.manifest.get_song(&playlist, &song_name) else { return; @@ -30,7 +48,7 @@ impl Gui { let song = song.clone(); egui::Window::new("Song editor") - .open(&mut self.song_editor.is_open) + .open(&mut self.song_edit_w.is_open) .show(ctx, |ui| { @@ -51,11 +69,11 @@ impl Gui { ui.horizontal(|ui| { ui.label("Name: "); - ui.text_edit_singleline(&mut self.song_editor.ed_name); + ui.text_edit_singleline(&mut self.song_edit_w.ed_name); }); ui.horizontal(|ui| { ui.label("Url: "); - ui.text_edit_singleline(&mut self.song_editor.ed_url); + ui.text_edit_singleline(&mut self.song_edit_w.ed_url); }); if ui.button("Save").clicked() { @@ -69,7 +87,7 @@ impl Gui { return; }; - *song.get_url_str_mut() = self.song_editor.ed_url.clone(); + *song.get_url_str_mut() = self.song_edit_w.ed_url.clone(); } let Some(playlist) = self.manifest.get_playlist_mut(&playlist) else { @@ -78,7 +96,7 @@ impl Gui { playlist.remove_song(&song_name); - playlist.add_song(self.song_editor.ed_name.clone(), song); + playlist.add_song(self.song_edit_w.ed_name.clone(), song); let _ = self.manifest.save(None); } } @@ -86,38 +104,38 @@ impl Gui { pub fn draw_new_song_window(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { let mut save = false; egui::Window::new("New song") - .open(&mut self.song_editor.is_new_open) + .open(&mut self.new_song_w.is_open) .show(ctx, |ui| { ui.horizontal(|ui| { ui.label("Type: "); egui::ComboBox::from_id_source("new_song_window_type") - .selected_text(format!("{:?}", self.song_editor.ed_type)) + .selected_text(format!("{:?}", self.new_song_w.ed_type)) .show_ui(ui, |ui| { - ui.selectable_value(&mut self.song_editor.ed_type, SongType::Youtube, "Youtube"); - ui.selectable_value(&mut self.song_editor.ed_type, SongType::Spotify, "Spotify"); - ui.selectable_value(&mut self.song_editor.ed_type, SongType::Soundcloud, "Soundcloud"); + ui.selectable_value(&mut self.new_song_w.ed_type, SongType::Youtube, "Youtube"); + ui.selectable_value(&mut self.new_song_w.ed_type, SongType::Spotify, "Spotify"); + ui.selectable_value(&mut self.new_song_w.ed_type, SongType::Soundcloud, "Soundcloud"); } ); }); ui.horizontal(|ui| { ui.label("Name: "); - ui.text_edit_singleline(&mut self.song_editor.ed_name); + ui.text_edit_singleline(&mut self.new_song_w.ed_name); }); ui.horizontal(|ui| { ui.label("Playlist: "); egui::ComboBox::from_id_source("new_song_window_playlist") - .selected_text(format!("{}", self.song_editor.ed_playlist.clone().unwrap())) + .selected_text(format!("{}", self.new_song_w.ed_playlist.clone().unwrap())) .show_ui(ui, |ui| { for p in self.manifest.get_playlists().keys() { - ui.selectable_value(&mut self.song_editor.ed_playlist, Option::Some(p.clone()), p.as_str()); + ui.selectable_value(&mut self.new_song_w.ed_playlist, Option::Some(p.clone()), p.as_str()); } } ); }); ui.horizontal(|ui| { ui.label("Url: "); - ui.text_edit_singleline(&mut self.song_editor.ed_url); + ui.text_edit_singleline(&mut self.new_song_w.ed_url); }); if ui.button("Save").clicked() { @@ -126,19 +144,81 @@ impl Gui { }); if save { - let Some(playlist) = self.manifest.get_playlist_mut(&self.song_editor.ed_playlist.clone().unwrap()) else { + let Some(playlist) = self.manifest.get_playlist_mut(&self.new_song_w.ed_playlist.clone().unwrap()) else { panic!("couldnt find playlist from a preset playlist list????????????"); }; playlist.add_song( - self.song_editor.ed_name.clone(), - Song::from_url_str(self.song_editor.ed_url.clone()).unwrap().set_type(self.song_editor.ed_type.clone()).clone() + self.new_song_w.ed_name.clone(), + Song::from_url_str(self.new_song_w.ed_url.clone()).unwrap().set_type(self.new_song_w.ed_type.clone()).clone() ); let _ = self.manifest.save(None); - self.song_editor.is_new_open = false; + self.new_song_w.is_open = false; } } + pub fn draw_import_playlist_window(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { + let mut save = false; + egui::Window::new("Import Playlist") + .open(&mut self.import_playlist_w.is_open) + .show(ctx, |ui| { + ui.horizontal(|ui| { + ui.label("Type: Youtube"); + }); + + ui.horizontal(|ui| { + ui.label("Name: "); + ui.text_edit_singleline(&mut self.import_playlist_w.ed_name); + }); + ui.horizontal(|ui| { + ui.label("Url: "); + ui.text_edit_singleline(&mut self.import_playlist_w.ed_url); + }); + + if ui.button("Import").clicked() { + save = true; + } + }); + + if save { + let name = self.import_playlist_w.ed_name.clone(); + let url = self.import_playlist_w.ed_url.clone(); + + if self.manifest.get_playlist(&name).is_some() { + log::error!("Playlist {name} already exists"); + self.throw_error(format!("Playlist {name} already exists")); + } + + let songs = self.downloader.download_playlist_nb(&self.cfg, &url, &name, &self.manifest.get_format()).unwrap(); + self.manifest.add_playlist(name.clone()); + + let playlist = self.manifest.get_playlist_mut(&name).expect("Unreachable"); + + for (sname, song) in songs { + log::info!("Added: {sname}"); + playlist.add_song(sname, song); + } + let _ = self.manifest.save(None); + self.import_playlist_w.is_open = false; + } + } + + pub fn draw_error_window(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) { + egui::Window::new("ERROR!!!! D:") + .open(&mut self.error_w.is_open) + .show(ctx, |ui| { + 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()); + }) + }) + }); + + } + + } diff --git a/src/manifest/song.rs b/src/manifest/song.rs index f206317..ca1f078 100644 --- a/src/manifest/song.rs +++ b/src/manifest/song.rs @@ -4,8 +4,9 @@ use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)] pub enum SongType { + #[default] Youtube, Spotify, Soundcloud,