Cotton code
331 lines · 6.4 KB · JSONRaw
{  "format_version": 1,  "id": "film_season",  "name": "Season",  "plural": "Seasons",  "picture": null,  "builtin": false,  "visibility": "owner",  "engine": null,  "columns": [    {      "key": "film",      "name": "Series",      "type": "link",      "link_to": "film",      "required": true,      "contributes": {        "label": "Seasons"      }    },    {      "key": "number",      "name": "Season",      "type": "number",      "required": true    },    {      "key": "title",      "name": "Title",      "type": "text",      "required": true,      "placeholder": "Season one"    },    {      "key": "year",      "name": "Year",      "type": "text",      "placeholder": "2019"    },    {      "key": "series_title",      "name": "Series title",      "type": "text",      "computed": {        "lookup": {          "through": "film",          "column": "title"        }      }    },    {      "key": "poster",      "name": "Poster",      "type": "photo"    },    {      "key": "series_poster",      "name": "Series poster",      "type": "photo",      "computed": {        "lookup": {          "through": "film",          "column": "poster"        }      }    },    {      "key": "episodes",      "name": "Episodes",      "type": "number",      "computed": {        "rollup": {          "table": "film_episode",          "link": "season",          "op": "count"        }      }    },    {      "key": "watched",      "name": "Watched",      "type": "number",      "computed": {        "rollup": {          "table": "film_episode",          "link": "season",          "op": "count",          "where": {            "column": "status",            "values": [              "watched"            ]          }        }      }    },    {      "key": "tmdb_id",      "name": "TMDB",      "type": "text",      "readonly": true    },    {      "key": "intro_from",      "name": "Intro starts",      "type": "number",      "format": "duration"    },    {      "key": "intro_to",      "name": "Intro ends",      "type": "number",      "format": "duration"    },    {      "key": "on_phone",      "name": "On this phone",      "type": "choice",      "choices": [        "absent",        "keeping",        "kept"      ],      "labels": {        "absent": "Not on this phone",        "keeping": "Coming down",        "kept": "On this phone"      },      "readonly": true    },    {      "key": "sent_by",      "name": "Sent by",      "type": "text",      "readonly": true    },    {      "key": "sent_by_number",      "name": "Sent from",      "type": "text",      "readonly": true    },    {      "key": "sent_at",      "name": "Sent",      "type": "date",      "format": "calendar-datetime",      "readonly": true    },    {      "key": "send_id",      "name": "Send",      "type": "text",      "readonly": true    },    {      "key": "in_hidden",      "name": "In Hidden",      "type": "bool",      "readonly": true,      "hidden": true    }  ],  "seal": {    "clear": [      "film",      "number",      "year",      "poster",      "intro_from",      "intro_to",      "on_phone",      "sent_at",      "send_id"    ],    "blind": [      "title"    ]  },  "title": "title",  "date": null,  "project": null,  "order": null,  "slip": {    "title": "title",    "subtitle": "film",    "trailing": "year",    "photo": null,    "toggle": null  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "film",        "number",        "title",        "year",        "episodes"      ]    },    {      "heading": "Intro",      "columns": [        "intro_from",        "intro_to"      ]    }  ],  "sort": {    "column": "number",    "descending": false  },  "empty": {    "title": "No seasons yet",    "message": "Add a season to a series from the series' page."  },  "instructions": "One row per season of a series: the series (a film whose kind is series), its number, its title, the year it aired and its poster; episodes counts its film_episode rows and watched those whose status is watched; series_poster is its series' poster. tmdb_id is TMDB's, filled by find_film. intro_from and intro_to are the seconds the series' intro runs in its episodes, marked once by the owner. on_phone is answered by each phone (absent, keeping, kept) and never stored.",  "card": {    "face": "season.card",    "offers": [      "season.card"    ],    "fields": [      {        "slot": "photo",        "column": "series_poster"      },      {        "slot": "title",        "column": "title"      },      {        "slot": "number",        "column": "number"      },      {        "slot": "year",        "column": "year"      },      {        "slot": "subtitle",        "column": "episodes",        "line": "field.season_episodes"      },      {        "slot": "limit",        "column": "episodes"      },      {        "slot": "used",        "column": "watched"      },      {        "slot": "source",        "column": "series_title"      }    ],    "opens": {      "table": "film_episode",      "by": "season",      "order": [        "number"      ]    }  },  "commands": [    {      "id": "keep_season",      "label": "Keep season",      "kind": "update",      "method": "settings.openFlow",      "data": {        "flow": "keepFilm",        "origin_table": "film_season"      },      "bindings": {        "origin_id": "$id"      },      "when": {        "on_phone": "absent"      },      "receipt": "Keeping {name} on this phone",      "object": "folder"    },    {      "id": "remove_download",      "label": "Remove download",      "kind": "update",      "method": "settings.openFlow",      "data": {        "flow": "removeFilmDownload",        "origin_table": "film_season"      },      "bindings": {        "origin_id": "$id"      },      "when": {        "on_phone": [          "keeping",          "kept"        ]      },      "receipt": "Removed {name} from this phone",      "object": "bin"    }  ],  "send": {    "columns": [      "number",      "title",      "year",      "poster",      "tmdb_id",      "intro_from",      "intro_to"    ],    "files": [      "poster"    ],    "with": [      {        "table": "film_episode",        "by": "season"      }    ]  }}