fixed connection on showcase screen

This commit is contained in:
janis
2022-10-31 19:10:39 +01:00
parent 16601a9928
commit 27caf79371
5 changed files with 25 additions and 16 deletions

View File

@@ -1 +1 @@
1,songlist.csv
0,songlist.csv
1 1 0 songlist.csv

View File

@@ -1,3 +1,3 @@
0
Lupus Nocte - Hadouken (Royalty Free Music).mp3,Minecraft OST - Pigstep.mp3,The Day You Went Away.mp3,sha la la.mp3
163.7987518310547
3
Tennessee Waltz - New 101 Strings Orchestra | Slow Walz (Langsam),Morning has broken - Cat Stevens | Walzer (Mittel),Magia - Alvaro Soler | Flashmob (Mittel),Say So - Doja Cat | Discofox (Langsam),Save Your Tears (Remix) - The Weeknd & Ariana Grande | Discofox (Langsam),Shivers - Ed Sheeran | Jive/ Rocknroll (Mittel),I feel good - Ray Charles | Jive/Rocknroll (Mittel),Muevelo - Rey Ruiz | Cha cha cha (Mittel),Suelta la cintura - Ruben leon | Cha cha cha (Mittel),Como Volver a Ser Feliz - Luis Enrique | Salsa (Mittel),Mas que nada - black eyed peas | Salsa/Discofox (Mittel),Moon River - Henry Mancini | Slow Walz (Langsam),Dancing Queen - ABBA | Discofox (Langsam),Don't Call Me Up - Mabel | Discofox (Mittel),Magia - Alvaro Soler | Flashmob (Mittel),Lets have a Party - Wanda Jackson | Jive (mittel),Crazy Little Thing Called Love - Queen | Jive / Rocknroll (Schnell),El Diablo Anda Suelto - Rey Ruiz | Cha cha cha (Mittel),Lets get loud - Jennifer Lopez | Cha cha cha (Schnell),Enamorame - Somos del Barrio | Salsa (Mittel),Something Stupid (feat. Reese Witherspoon) - Michael Bublé | Rumba/cha cha cha (Langsam),When a man loves a woman - Percy Sledge | (Langsam),Scharlachrot - Patent Ochsner | Walzer (Langsam),Ily (i love you baby) [feat. Emilee] - Surf Mesa | Discofox (Mittel),Like a sex machine - James Brown | Discofox (Mittel),Uptown Funk (feat. Bruno Mars) - Discofox | Discofox (Schnell),Tutti Frutti - Little Richard | Jive / Rocknroll (Mittel),Jailhouse Rock - Elvis Presley | Jive / Rocknroll (Schnell),Are you lonesome - Elvis Presley | Slow Walz (Langsam),Ay Mujer - Rey Ruiz | Cha cha cha (Mittel),Rico Vacilon - Pedro Garcia & His Del Prado Orchestra | Cha cha cha (Mittel),Jeepers creepers - Benny Goodmann | Foxtrott (Mittel),An der schönen blauen Donau - New 101 Strings Orchestra | Wiener Walzer (Schnell),The Last Waltz - Engelbert Humperdinck | Walzer (Mittel),Stand by me - Sam Brown | Cha cha cha (Lansam),Stayin' Alive - Bee Gees | Discofox (Mittel),Easy On Me - Adele | (Langsam),Magia - Alvaro Soler | Flashmob (Mittel),Friday (feat. Mufasa & Hypeman) [Dopamine Re-Edit] - Riton & Nightcrawlers | Party (Mittel),YMCA - Village People | Party (Mittel),Cotton eyed Joe (Hennustall zermatt mix) - Rednex | Party (Mittel),Gangnam style - PSY | Party (Mittel),Take On Me - a-ha | Jive (Schnell),Rock Around the Clock - Bill Haley & His Comets | Jive / Rocknroll (Schnell),Satisfaction - Rolling Stones | Party (Mittel),"Un, dos, tres - Ricky Martin | Party (Mittel)",Party Rock anthem - LFMBQ | Party (Mittel),I don't care - Icona Pop | Party (Mittel),Love tonight - Shouse & David Guetta | Party (Mittel),Insomnia - Faithless | Party (Mittel),Angels - Robbie Williams | Slow (Langsam),Nothing compares to you - Sinead O'Connor | Slow (Langsam)
237.88844299316406
1 0 3
2 Lupus Nocte - Hadouken (Royalty Free Music).mp3,Minecraft OST - Pigstep.mp3,The Day You Went Away.mp3,sha la la.mp3 Tennessee Waltz - New 101 Strings Orchestra | Slow Walz (Langsam)
3 163.7987518310547 237.88844299316406

View File

@@ -1 +1 @@
/mnt/storage/SORTED/Music
/mnt/storage/SORTED/Music/KB/
1 /mnt/storage/SORTED/Music /mnt/storage/SORTED/Music/KB/

View File

@@ -3,18 +3,21 @@ import requests
class Com:
def __init__(self):
pass
self.connectok = True
def connect(self, url):
try:
self.x = requests.get(f"{url}/tryconnect")
except Exception:
self.connectok = False
return False
print(self.x.text)
if self.connectok:
if self.x.text == "ok":
return True
else:
return False
else:
pass
def getcurrentsong(self, url):
try:

View File

@@ -21,6 +21,7 @@ class ConnectionPU(Popup):
class LoginWindow(MDScreen):
def connect(self):
global address
self.url = self.ids.url.text
self.containsPort = False
for self.letter in self.url:
@@ -31,15 +32,20 @@ class LoginWindow(MDScreen):
self.connectionurl = ""
if self.url[:8] != "https://" and self.url[:7] != "http://" and self.url[len(self.url) - 1:] == "/" and not self.containsPort and len(self.url) > 2:
self.connectionurl = f"http://{self.url[:len(self.url) - 1]}:8000"
print(comHandler.connect(self.connectionurl))
elif self.url[:8] != "https://" and self.url[:7] != "http://" and self.url[len(self.url) - 1:] != "/" and not self.containsPort and len(self.url) > 2:
self.connectionurl = f"http://{self.url}:8000"
print(comHandler.connect(self.connectionurl))
else:
ConnectionPU().open()
global address
if comHandler.connect(self.connectionurl):
address = self.connectionurl
screen_manager.current = "ShowcaseScreen"
else:
ConnectionPU().open()
elif self.url[:8] != "https://" and self.url[:7] != "http://" and self.url[len(self.url) - 1:] != "/" and not self.containsPort and len(self.url) > 2:
self.connectionurl = f"http://{self.url}:8000"
if comHandler.connect(self.connectionurl):
address = self.connectionurl
screen_manager.current = "ShowcaseScreen"
else:
ConnectionPU().open()
else:
ConnectionPU().open()
class ShowcaseScreen(MDScreen):