Changed list function name

This commit is contained in:
itec 2020-04-17 18:54:28 +02:00
parent 52a63128b7
commit d701ebcd1c
3 changed files with 11 additions and 4 deletions

3
.gitignore vendored
View file

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

View file

@ -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]))

View file

@ -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")