mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
reduced the use of "playlistinfo"
This commit is contained in:
parent
0584f007fd
commit
1d74f466a4
@ -663,14 +663,14 @@ class Client(MPDClient):
|
|||||||
play(files)
|
play(files)
|
||||||
else:
|
else:
|
||||||
self.moveid(status["songid"], 0)
|
self.moveid(status["songid"], 0)
|
||||||
current_song_file=self.playlistinfo()[0]["file"]
|
current_song_file=self.currentsong()["file"]
|
||||||
try:
|
try:
|
||||||
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
self.delete((1,)) # delete all songs, but the first. bad song index possible
|
||||||
except MPDBase.CommandError:
|
except MPDBase.CommandError:
|
||||||
pass
|
pass
|
||||||
for f in files:
|
for f in files:
|
||||||
if f == current_song_file:
|
if f == current_song_file:
|
||||||
self.move(0, (len(self.playlistinfo())-1))
|
self.move(0, (int(self.status()["playlistlength"])-1))
|
||||||
else:
|
else:
|
||||||
self.add(f)
|
self.add(f)
|
||||||
if mode == "append":
|
if mode == "append":
|
||||||
|
Loading…
Reference in New Issue
Block a user