Cotton code
350 lines · 10.4 KB · JSONRaw
{  "views": [    {      "id": "listening",      "label": "Listening",      "visibility": "owner",      "is_default": true,      "read": {        "table": "music_album",        "where": {          "last_played_at": {            "present": true          }        },        "empty": {          "line": "empty_views.music.listening",          "table": true        }      },      "sort": {        "column": "last_played_at",        "descending": true      }    },    {      "id": "albums",      "label": "Albums",      "visibility": "owner",      "is_default": false,      "read": {        "table": "music_album",        "empty": {          "line": "empty_views.music.albums",          "table": true        }      },      "sort": {        "column": "artist_name",        "descending": false,        "tie": "year"      }    },    {      "id": "artists",      "label": "Artists",      "visibility": "owner",      "is_default": false,      "read": {        "table": "artist",        "empty": {          "line": "empty_views.music.artists",          "table": true        }      },      "sort": {        "column": "sort_name",        "descending": false      }    },    {      "id": "songs",      "label": "Songs",      "visibility": "owner",      "is_default": false,      "read": {        "table": "song",        "empty": {          "line": "empty_views.music.songs",          "table": true        }      },      "sort": {        "column": "title",        "descending": false      }    },    {      "id": "favourites",      "label": "Favourites",      "visibility": "owner",      "is_default": false,      "read": {        "table": "song",        "where": {          "favourite": true        },        "empty": {          "line": "empty_views.music.favourites",          "table": true        }      },      "sort": {        "column": "last_played_at",        "descending": true      }    },    {      "id": "recently_added",      "label": "Recently added",      "visibility": "owner",      "is_default": false,      "read": {        "table": "song",        "empty": {          "line": "empty_views.music.recently_added",          "table": true        }      },      "sort": {        "column": "added_on",        "descending": true      }    },    {      "id": "on_phone",      "label": "On this phone",      "visibility": "owner",      "is_default": false,      "read": {        "table": "song",        "where": {          "on_phone": [            "kept"          ]        },        "empty": {          "line": "empty_views.music.on_phone",          "table": true        }      },      "sort": {        "column": "title",        "descending": false      },      "acts": [        "music_keep_everything",        "export_library"      ],      "lists_before": true    }  ],  "id": "music",  "name": "Music",  "purpose": "The music you own as files: albums, artists and songs, your playlists, and what you played.",  "picture": {    "photo": "photo:9490003d684898fc103fb5ca73bfef1156c94bc6a8a7a6286b65d014df57ec3e"  },  "card_stock": "rose",  "fan_tile": {    "stock": {      "photo": "photo:1a660138667d2bf3e7c0638938b5815a9689dac2d6c3cb1ac81495a1833e2ce8"    },    "type": "letterboard",    "words": {      "ink": "#211a12",      "name_baseline": 500,      "count_baseline_one": 586,      "count_baseline_two": 644    },    "pictures": {      "list": {        "photo": "photo:e5ee453ab4fd4b64b87dc96f0c8c73f7098a67cea8d7e7d8bd6d3077915fd1ef"      },      "more": {        "photo": "photo:2aa16d659dd83f6e4ce6dc005d2e6e0036990075aba20aaa4c858b7febcc44b9"      },      "new_list": {        "photo": "photo:93de01eb62dad84835feb6c0e7ad96c830ca20935f2e503921e738e1846e634a"      }    },    "views": {      "albums": {        "photo": "photo:c22cc667eb20d69fd5e44beefe3c47bf7cc1f840a3829ead3c71bce60ea82a10"      },      "artists": {        "photo": "photo:58b1a68b255030367730c0987202747b40854627abb09fec29fa3f2f287cef64"      },      "favourites": {        "photo": "photo:34eb7c87f35b023b9e55b3cb25ed6ae822c1dcb70f84679cd507cd3b46a3b8db"      },      "listening": {        "photo": "photo:0a464d85f457341f6f707349263e83565e63ca448ac95e9b9eb1d21bf82d0867"      },      "on_phone": {        "photo": "photo:bdf7067b283c7753e02107f7f16cc8d267bde3b11c7040acafd2bc15cbfb5e40"      },      "recently_added": {        "photo": "photo:7dddbfac32673e9b2319239766928e6c71d37bf9018fe19f82b22ba119ae22f0"      },      "songs": {        "photo": "photo:fe9d2ff4303a20fb3ece111c404dd6ca8d0adbf820161aa12352ed2d664e3d21"      }    },    "acts": {      "account_back_up": {        "photo": "photo:59f39e32cd73f02800cbd2ddcd17b37f018ed8f84838ceab990434fdc0b4dfa9"      },      "account_sign_in": {        "photo": "photo:2fbbe5fcb61996dcf98f110ddd62951896edd9cfe25a2d535ab48a60213e48d0"      },      "account_sign_out": {        "photo": "photo:a36076f997cd2220b64b6a4b095d8777b4ff1b23227da08f8a87fa3ef8bc6006"      },      "add_to_queue": {        "photo": "photo:d817d440d98e26476ebf057639206e32a1b68250a2a5ed2a2dec4f3291a53dbe"      },      "bin": {        "photo": "photo:c3a89d688eb9d0e6f2518033a0211e9d6f236e36ba78f4ef728791a66daaca79"      },      "export_library": {        "photo": "photo:32b945d6044cfe80c180ea1dcb1be8a3fafa996e59dd19d246c4846b54c5bdfc"      },      "face": {        "photo": "photo:05c1652dd7495a9fb3444bfc1a7d7ddbf20d789603839b612f514aa4807a0f89"      },      "favourite": {        "photo": "photo:4a4f93d7d584e78c6eb7d40b20a0bc6d3abdb339e05955f7b92bff38c852e0a6"      },      "find_details": {        "photo": "photo:6b9b635c291d56e2b69cfdbf91dcd89d0c33cdf31433b486483c3ae94a765812"      },      "find_lyrics": {        "photo": "photo:c8e563976bb3a9b952bf1762669c753912fe9c1502a8e4abce85e75b5d2366b2"      },      "group": {        "photo": "photo:2a1437a3a498caa453a611e42e427c75bd1761ad2c7919159e188ba2ba3c8b77"      },      "keep_on_phone": {        "photo": "photo:6ef157c1de8da9803b53eecc415486d5fa390a52bd176edb4f6659054467dc54"      },      "list_member_earlier": {        "photo": "photo:7ffa479aa90cc4e67245abaa21d6d945e08b323742ed65ef46478d479c8440d6"      },      "list_member_later": {        "photo": "photo:7ffa479aa90cc4e67245abaa21d6d945e08b323742ed65ef46478d479c8440d6"      },      "list_member_remove": {        "photo": "photo:c3a89d688eb9d0e6f2518033a0211e9d6f236e36ba78f4ef728791a66daaca79"      },      "list_move_earlier": {        "photo": "photo:7ffa479aa90cc4e67245abaa21d6d945e08b323742ed65ef46478d479c8440d6"      },      "list_move_later": {        "photo": "photo:7ffa479aa90cc4e67245abaa21d6d945e08b323742ed65ef46478d479c8440d6"      },      "list_remove": {        "photo": "photo:c3a89d688eb9d0e6f2518033a0211e9d6f236e36ba78f4ef728791a66daaca79"      },      "list_remove_picture": {        "photo": "photo:a373fa68dcbf31fc1a764d876fd13ad02fc3b7f9126d5d0373c33090448a2d87"      },      "list_rename": {        "photo": "photo:e5ee453ab4fd4b64b87dc96f0c8c73f7098a67cea8d7e7d8bd6d3077915fd1ef"      },      "list_set_picture": {        "photo": "photo:31b07dbceeeb04750a98b4b5b04bbed8ce086e6c7a9504a7fbaed11d5c474af4"      },      "music_keep_everything": {        "photo": "photo:360f55ca1d9ca13740cfbb2bc43f17eab6ee6151fdaf1de5d7e36ad9078d54c7"      },      "play": {        "photo": "photo:561e86115721823ca1fc88666e21efb7ea66461422785f4f58988023f915f1f2"      },      "play_next": {        "photo": "photo:988c0ed14993184b70e5c1b14e34ef4501f6a4a52c4bc50d9065b4151807f14d"      },      "remove_download": {        "photo": "photo:2a073cbec47d5e5bb5c3ef22716b64b415501f84ba386525db506dd7dd72a791"      },      "repeat": {        "photo": "photo:7ffa479aa90cc4e67245abaa21d6d945e08b323742ed65ef46478d479c8440d6"      },      "send": {        "photo": "photo:32b945d6044cfe80c180ea1dcb1be8a3fafa996e59dd19d246c4846b54c5bdfc"      },      "shuffle": {        "photo": "photo:ea4a3baf33f7a4b408f40f35649ef62d9d0c27e89ec1ef8fe75a09ced5380443"      },      "status": {        "photo": "photo:15af3a9fe6f505bae4c5532adcb51099445a17b68491c34410993652db01e863"      },      "unfavourite": {        "photo": "photo:f5274188c34bf7b5927d6735d64625f045883dab7a71796efa2c623d68c912c9"      },      "unsend": {        "photo": "photo:c3a89d688eb9d0e6f2518033a0211e9d6f236e36ba78f4ef728791a66daaca79"      },      "when": {        "photo": "photo:d8604a04379c50695780ffd32733bafee7b65945fafe834b17575056d89a5237"      }    },    "doors": {      "files": {        "photo": "photo:0e49d7566118e046117c871adee60e5b4ddff0355f51d982758c5f55ee70292f"      },      "folder": {        "photo": "photo:947c2e41f53aca40d7fd79ee5b9506e7a0f8ed8412c13f3f50c969c6a1780a4d"      }    }  },  "tables": [    "song",    "music_album",    "artist",    "listen",    "vault_key"  ],  "search": [    "music_album",    "artist",    "song"  ],  "instructions": "Music keeps the owner's own music files: one song row per audio file (its tags read from the file), the albums (music_album) and artists they gather into, and one listen row per time a song played, written by the player alone. Listening is the albums played lately, the last played first; Albums by album artist then year; Artists by sort_name; Songs by title; Favourites the songs marked favourite, last played first; Recently added the newest songs; then each playlist; On this phone the songs this phone keeps. Playlists are record groups of songs, ordered, a song at most once in each, made by the owner or by an assistant. Songs come in as files (the share sheet, and Plus's two doors on the decks: Add files and Add a folder); never make a song row without its file, and never guess an artist, an album, a year or a length. A lookup fills only empty columns: find_lyrics { song } asks LRCLIB for one song's words, fetch_cover { album } finds an album's cover.",  "automations": [],  "acts": [    {      "id": "music_keep_everything",      "label": "Keep everything",      "object": "tick"    },    {      "id": "account_sign_in",      "label": "Sign in",      "object": "arrow"    },    {      "id": "account_back_up",      "label": "Sync now",      "object": "cycle"    },    {      "id": "account_sign_out",      "label": "Sign out",      "object": "send"    },    {      "id": "export_library",      "label": "Export library",      "object": "parcel"    }  ],  "lists": {    "face": "list.cassette"  },  "author": {    "device": "cotton",    "name": "Cotton"  },  "signature": null}