Add planning to shows and movies in one merged grid
This commit is contained in:
1 parent
cd9a8a186a
commit
d473aebb79
9 files changed
+56
-41
No files matched your search
@@ -8,7 +8,7 @@ import media
|
||||
from tui.content_pane import ContentPane
|
||||
from tui.dialogs import ConfirmDialog, FormDialog, FormField
|
||||
|
||||
STATUS_STYLES = {"watching": "blue", "watched": "green"}
|
||||
STATUS_STYLES = {"watching": "blue", "watched": "green", "planning": "magenta"}
|
||||
|
||||
|
||||
def rating_text(item: dict) -> str:
|
||||
@@ -19,7 +19,7 @@ class MediaPane(ContentPane):
|
||||
BINDINGS = [
|
||||
Binding("a", "add", "Add"),
|
||||
Binding("e", "rate", "Rate"),
|
||||
Binding("s", "status", "Watching"),
|
||||
Binding("s", "status", "Status"),
|
||||
Binding("g", "collection", "Group"),
|
||||
Binding("d", "delete", "Delete"),
|
||||
Binding("r", "reload", "Reload"),
|
||||
@@ -113,8 +113,14 @@ class MediaPane(ContentPane):
|
||||
if not item:
|
||||
return
|
||||
identifier = imdb.imdb_id(item["url"])
|
||||
next_status = "watched" if media.status_of(item) == "watching" else "watching"
|
||||
self.run_now(lambda: media.set_status(self.kind, identifier, next_status), f"{item['name']} is now {next_status}", identifier)
|
||||
fields = [FormField("status", f"Status for {item['name']}", kind="select", options=media.STATUSES, value=media.status_of(item))]
|
||||
|
||||
def changed(values: dict | None):
|
||||
if values:
|
||||
status = values["status"]
|
||||
self.run_now(lambda: media.set_status(self.kind, identifier, status), f"{item['name']} is now {status}", identifier)
|
||||
|
||||
self.app.push_screen(FormDialog("Change status", fields, "Save"), changed)
|
||||
|
||||
def action_collection(self):
|
||||
item = self.selected_item()
|
||||
|
||||
Reference in new issue
Block a user