Added editor for name/slug/description

This commit is contained in:
evilchili
2022-12-06 22:17:53 -08:00
parent e036eff4e2
commit 3fdd3ee9a5
6 changed files with 178 additions and 16 deletions
+1 -2
View File
@@ -48,9 +48,8 @@ class CommandPrompt(BasePrompt):
if cmd in self.commands:
self.commands[cmd].start(name)
else:
slug = slugify(name)
self._playlist = Playlist(
slug=slug,
slug=slugify(name),
name=name,
session=self.manager.session,
create_ok=True
+6 -1
View File
@@ -30,6 +30,7 @@ class _playlist(BasePrompt):
'show': self.show,
'delete': self.delete,
'add': self.add,
'edit': self.edit,
}
return self._commands
@@ -45,11 +46,15 @@ class _playlist(BasePrompt):
print(self.parent.playlist)
return True
def edit(self, parts):
self.parent.playlist.edit()
return True
def add(self, parts):
print("Add tracks one at a time by title. ENTER to finish.")
while True:
text = prompt(
' ? ',
' ?',
completer=self.manager.fuzzy_table_completer(
db.track,
db.track.c.relpath,