Browse Source

Fixed listtot

itec78 3 years ago
parent
commit
4810d6945d
1 changed files with 6 additions and 3 deletions
  1. 6 3
      playlistalo.py

+ 6 - 3
playlistalo.py

@@ -364,8 +364,12 @@ def mastodon_bot():
 
 def listtot(res = sys.maxsize):
     plt = listplaylist()
-    if len(plt) < res:
+    if plt:
+        announcepos = 0
+    else:
         announcepos = getlastannounce()
+
+    if len(plt) < res:
         for x in listfallback():
             if announcepos == 0:
                 if os.path.exists("announce/repeat.mp3"):
@@ -373,7 +377,6 @@ def listtot(res = sys.maxsize):
                 announcepos = ANNOUNCEREPEAT - 1
             else:
                 announcepos = (announcepos - 1)
-            
             plt.append(x)
     return plt[:res]
 
@@ -458,7 +461,7 @@ def plaympd():
         client.rescan()
 
         #aggiunge l'annuncio iniziale
-        addstartannounce()
+        #addstartannounce()
         #resetta il lastannounce
         setlastannounce(ANNOUNCEREPEAT)