|
@@ -173,11 +173,11 @@ def listplaylist():
|
|
|
f = open(udir + "/last", "r")
|
|
|
last = f.readline().rstrip()
|
|
|
else:
|
|
|
- last = os.path.basename(sorted(glob(udir + "/*.m4a"))[0]).split("|")[0]
|
|
|
+ last = os.path.basename(sorted(glob(udir + "/*"))[0]).split("|")[0]
|
|
|
#print ("LAST: " + last)
|
|
|
|
|
|
#leggi i file nella cartella
|
|
|
- files = sorted(glob(udir + "/*.m4a"))
|
|
|
+ files = [x for x in glob(udir + "/*") if not os.path.basename(x) == "last"]
|
|
|
seq = 0
|
|
|
for file in files:
|
|
|
bn = os.path.splitext(os.path.basename(file))[0]
|
|
@@ -204,7 +204,7 @@ def listfallback():
|
|
|
pl = []
|
|
|
pl2 = []
|
|
|
#leggi i file nella cartella
|
|
|
- files = sorted(glob("fallback/*.m4a"))
|
|
|
+ files = [x for x in glob("fallback/*") if not os.path.basename(x) == "last"]
|
|
|
seq = 0
|
|
|
for file in files:
|
|
|
bn = os.path.splitext(os.path.basename(file))[0]
|
|
@@ -246,7 +246,7 @@ def shuffleusers():
|
|
|
|
|
|
def shufflefallback():
|
|
|
#rinominare con un numero casuale i file in fallback
|
|
|
- files = sorted(glob("fallback/*.m4a"))
|
|
|
+ files = [x for x in glob("fallback/*") if not os.path.basename(x) == "last"]
|
|
|
for file in files:
|
|
|
fname = str(random.randrange(10**6)).zfill(14) + "|" + "|".join(os.path.basename(file).split("|")[1:])
|
|
|
fname = os.path.dirname(file) + "/" + fname
|