Cotton code
218 lines · 6.6 KB · JSONRaw
{  "views": [    {      "id": "all",      "label": "All",      "visibility": "owner",      "is_default": false,      "read": {        "table": "fetch",        "empty": {          "line": "empty_views.downloads.all",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    },    {      "id": "active",      "label": "Active",      "visibility": "owner",      "is_default": true,      "read": {        "table": "fetch",        "where": {          "state": [            "queued",            "fetching",            "landing"          ]        },        "empty": {          "line": "empty_views.downloads.active",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    },    {      "id": "done",      "label": "Done",      "visibility": "owner",      "is_default": false,      "read": {        "table": "fetch",        "where": {          "state": "done"        },        "empty": {          "line": "empty_views.downloads.done",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    },    {      "id": "failed",      "label": "Failed",      "visibility": "owner",      "is_default": false,      "read": {        "table": "fetch",        "where": {          "state": "failed"        },        "empty": {          "line": "empty_views.downloads.failed",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    },    {      "id": "cancelled",      "label": "Cancelled",      "visibility": "owner",      "is_default": false,      "read": {        "table": "fetch",        "where": {          "state": "cancelled"        },        "empty": {          "line": "empty_views.downloads.cancelled",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    }  ],  "id": "downloads",  "name": "Downloads",  "purpose": "Links you gave Cotton, fetched by your Mac into files you own, each in the tool that plays it.",  "picture": {    "photo": "photo:e464f3e788b961e3bbd2d60c4a274cc5b7d683770819f55606009aa99f3ccdeb",    "object": "tool-imports"  },  "fan_tile": {    "stock": {      "photo": "photo:84d1b36891159eff9c2514eeabfb0154874f3e0f433118399b926d332e5b4812"    },    "pictures": {      "list": {        "photo": "photo:ace376e500b50e204f9edb1b9fb7f2f21167f17617ebffb95c0de5d0919d69a5"      },      "more": {        "photo": "photo:35b658d10fc678f88ba2e2aa92be765b3c762dc834affd7b20eadaafa5b348a4"      },      "new_list": {        "photo": "photo:d0fa51641ae2d148d8be8e761f5d4e9cbd6cf66d08e76000fbb4bdbeb6c4d649"      }    },    "views": {      "active": {        "photo": "photo:9dcc8542b5e6fbc403333752cd719b8bdb0aa01ffd7518e5c7afc32dd48937b2"      },      "all": {        "photo": "photo:1bd660c96d12e3f735a8516b1f86d37be6d81d7b61d1f675dff79f1708530154"      },      "cancelled": {        "photo": "photo:c3826944e6e1c6628e2233a15ac070314c9203de610dfa493597ef2b016a541e"      },      "done": {        "photo": "photo:fe8491613634bcbc49f639d3407d3ed465bb3a8f561d337fa935919d47088c24"      },      "failed": {        "photo": "photo:88f467261e4f3fc5207108a6c4eee2e56ea7f0e2770235532eb2c487e186c98e"      }    },    "acts": {      "bin": {        "photo": "photo:15f5a6e437610b1f09b51bd1a8fa0fcb7ea8d9279fa10850c05bffa8b3388d74"      },      "cancel": {        "photo": "photo:9d08344fa5b84b2b2d3377c62f080d2819d7f98b2c824f6124c3a5045d593288"      },      "face": {        "photo": "photo:69a1ac7d1e71a84b393aa1143726a6cfd4c01b3273abf520379d541334393350"      },      "group": {        "photo": "photo:e28c4af08420ab118980fd0e8898c54a69ac72db814890c78c7aea1fb3cb069e"      },      "list_member_earlier": {        "photo": "photo:ca07e08f40771d8d5f3d41acb2700e6e8e5bf10bff83992d92c8660309b95d8e"      },      "list_member_later": {        "photo": "photo:ca07e08f40771d8d5f3d41acb2700e6e8e5bf10bff83992d92c8660309b95d8e"      },      "list_member_remove": {        "photo": "photo:553ac9bfeccfac5a69f8b6a405a2253b8edbff542f0ed8d3a8f29a078bd9f02a"      },      "list_move_earlier": {        "photo": "photo:ca07e08f40771d8d5f3d41acb2700e6e8e5bf10bff83992d92c8660309b95d8e"      },      "list_move_later": {        "photo": "photo:ca07e08f40771d8d5f3d41acb2700e6e8e5bf10bff83992d92c8660309b95d8e"      },      "list_remove": {        "photo": "photo:553ac9bfeccfac5a69f8b6a405a2253b8edbff542f0ed8d3a8f29a078bd9f02a"      },      "list_remove_picture": {        "photo": "photo:7b0c2be01c99ee1a681e52453543464fbf8826d71004bc51b9d9b5089031e75a"      },      "list_rename": {        "photo": "photo:ace376e500b50e204f9edb1b9fb7f2f21167f17617ebffb95c0de5d0919d69a5"      },      "list_set_picture": {        "photo": "photo:f0d5081c78ae08694985fcf622ee562cac559205f9e833615d0a3e4860527ec2"      },      "remove": {        "photo": "photo:553ac9bfeccfac5a69f8b6a405a2253b8edbff542f0ed8d3a8f29a078bd9f02a"      },      "repeat": {        "photo": "photo:ca07e08f40771d8d5f3d41acb2700e6e8e5bf10bff83992d92c8660309b95d8e"      },      "retry": {        "photo": "photo:00e76ff2bd6859f2748ee48665065dc2b7dcd9db8d49cf68649a6b7f212b4d0d"      },      "status": {        "photo": "photo:304613e9189829c14b8d5672f8b059913601b41385dc6bda8f33775076bba80e"      },      "when": {        "photo": "photo:a663d12478075bf62811d0cd9238573f8b6d624193bcd229df3ba4f88b913774"      }    },    "doors": {      "link": {        "photo": "photo:47dfd213d14c7c5617f562216f5d8679cc1747e9d9e4c695d897e81e655d6450"      }    }  },  "tables": [    "fetch",    "fetch_file",    "vault_key"  ],  "instructions": "Downloads is the queue of links the owner wants as owned files: a magnet, a .torrent, a file's link, or any page yt-dlp reads (a video page, as video or as audio). Push one with create_record { table: fetch, data: { source, wants? } } or the fetch_add act; the Mac (pnpm fetch:run) claims it, fetches it, lands each file in its own tool (films in Cinemas, songs in Music, books in Books, pictures in Photos, the rest in Documents) and links what it made. A failed row says why in error; fetch_retry queues a failed or cancelled one again, fetch_cancel stops one waiting or fetching, and Remove takes a finished, failed or cancelled row off the list (the files it landed stay in their tools). Cotton never strips a lock and never signs in to a site.",  "automations": [],  "author": {    "device": "cotton",    "name": "Cotton"  },  "signature": null}