Browse Source

Changed list function name

itec 4 years ago
parent
commit
d701ebcd1c
3 changed files with 11 additions and 4 deletions
  1. 3 0
      .gitignore
  2. 1 1
      pl_list.py
  3. 7 3
      playlistalo.py

+ 3 - 0
.gitignore

@@ -2,5 +2,8 @@ archive/**
 cache/**
 fallback/**
 playlist/**
+mpd/**
+announce/**
 __pycache__/**
 playlistalo.conf
+

+ 1 - 1
pl_list.py

@@ -4,6 +4,6 @@
 import playlistalo
 
 if __name__ == '__main__':
-    pl = playlistalo.list()
+    pl = playlistalo.listplaylist()
     print ('\n'.join([", ".join(x[1:]) for x in pl]))
     

+ 7 - 3
playlistalo.py

@@ -13,6 +13,7 @@ import time
 import subprocess
 import random
 import configparser
+from musicpd import MPDClient
 
 from telegram.ext import Updater, MessageHandler, Filters
 from mastodon import Mastodon, StreamListener
@@ -140,7 +141,7 @@ def __normalizetext(s):
     return s
     
 
-def list():
+def listplaylist():
     pl = []
     pl2 = []
     for udir in sorted(glob(scriptpath + "/playlist/*/")):
@@ -203,7 +204,7 @@ def listfallback():
 
 
 def playsingle():
-    pl = list()
+    pl = listplaylist()
     #print ('\n'.join([x[0] for x in pl]))
 
     if pl:
@@ -260,7 +261,7 @@ def shufflefallback():
         os.rename(file, fname)
 
 def getposition(file):
-    pl = list()
+    pl = listplaylist()
     try:
         return([x[0] for x in pl].index(file) + 1)
     except:
@@ -351,5 +352,8 @@ def mastodon_bot():
 
 
 
+
+
 if __name__ == '__main__':
     print ("This is a package, use other commands to run it")
+