{ "format_version": 1, "id": "song", "name": "Song", "plural": "Songs", "picture": null, "builtin": false, "visibility": "owner", "engine": null, "columns": [ { "key": "title", "name": "Title", "type": "text", "required": true, "placeholder": "The song's title" }, { "key": "artist_name", "name": "By", "type": "text", "placeholder": "Who it is by" }, { "key": "artist", "name": "Artist", "type": "link", "link_to": "artist" }, { "key": "album", "name": "Album", "type": "link", "link_to": "music_album" }, { "key": "album_title", "name": "On", "type": "text", "computed": { "lookup": { "through": "album", "column": "title" } } }, { "key": "cover", "name": "Cover", "type": "photo", "computed": { "lookup": { "through": "album", "column": "cover" } } }, { "key": "file", "name": "Recording", "type": "file", "readonly": true }, { "key": "format", "name": "Kind", "type": "choice", "choices": [ "mp3", "aac", "alac", "flac", "opus", "vorbis", "wav", "aiff" ], "labels": { "mp3": "MP3", "aac": "AAC", "alac": "Apple Lossless", "flac": "FLAC", "opus": "Opus", "vorbis": "Ogg Vorbis", "wav": "WAV", "aiff": "AIFF" }, "readonly": true }, { "key": "duration", "name": "Length", "type": "number", "format": "duration", "readonly": true }, { "key": "track_number", "name": "Track", "type": "number" }, { "key": "disc_number", "name": "Disc", "type": "number" }, { "key": "year", "name": "Year", "type": "text" }, { "key": "genre", "name": "Genre", "type": "text" }, { "key": "composer", "name": "Composer", "type": "text" }, { "key": "favourite", "name": "Favourite", "type": "bool" }, { "key": "play_count", "name": "Plays", "type": "number", "units": { "one": "play", "other": "plays" }, "readonly": true }, { "key": "skip_count", "name": "Skips", "type": "number", "units": { "one": "skip", "other": "skips" }, "readonly": true }, { "key": "last_played_at", "name": "Last played", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "added_on", "name": "Added", "type": "date" }, { "key": "lyrics", "name": "Lyrics", "type": "longtext", "placeholder": "The words" }, { "key": "synced_lyrics", "name": "Timed lyrics", "type": "longtext", "readonly": true }, { "key": "lyrics_source", "name": "Lyrics from", "type": "choice", "choices": [ "file", "sidecar", "lrclib", "typed" ], "labels": { "file": "The file", "sidecar": "A .lrc beside it", "lrclib": "LRCLIB", "typed": "Typed" }, "readonly": true }, { "key": "track_gain", "name": "Track gain", "type": "number", "units": { "one": "{n} dB", "other": "{n} dB" }, "readonly": true }, { "key": "track_peak", "name": "Track peak", "type": "number", "readonly": true }, { "key": "bitrate", "name": "Bitrate", "type": "number", "units": { "one": "{n} kbps", "other": "{n} kbps" }, "readonly": true }, { "key": "sample_rate", "name": "Sample rate", "type": "number", "units": { "one": "{n} Hz", "other": "{n} Hz" }, "readonly": true }, { "key": "isrc", "name": "ISRC", "type": "text" }, { "key": "mb_recording", "name": "MusicBrainz", "type": "text", "readonly": true }, { "key": "mb_release_track", "name": "MusicBrainz track", "type": "text", "readonly": true }, { "key": "path", "name": "Came in as", "type": "text", "readonly": true }, { "key": "source", "name": "Came from", "type": "choice", "choices": [ "file", "folder", "lookup", "typed" ], "labels": { "file": "The file's tags", "folder": "Its folder and name", "lookup": "MusicBrainz", "typed": "Typed" }, "readonly": true }, { "key": "filled_from", "name": "Filled from", "type": "longtext", "readonly": true }, { "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 } ], "seal": { "clear": [ "artist", "album", "file", "format", "duration", "track_number", "disc_number", "year", "favourite", "play_count", "skip_count", "last_played_at", "added_on", "lyrics_source", "track_gain", "track_peak", "bitrate", "sample_rate", "source", "filled_from", "on_phone", "sent_at", "send_id" ], "blind": [ "title", "artist_name" ] }, "title": "title", "date": "added_on", "project": null, "order": null, "slip": { "title": "title", "subtitle": [ "artist_name", "album_title" ], "trailing": "duration", "photo": "cover", "toggle": null }, "tile": { "face": "slip-list" }, "page": [ { "heading": null, "columns": [ "cover", "title", "artist_name", "artist", "album", "track_number", "disc_number", "duration", "favourite" ] }, { "heading": "Lyrics", "columns": [ "lyrics", "synced_lyrics", "lyrics_source" ] }, { "heading": "Listening", "columns": [ "play_count", "skip_count", "last_played_at", "added_on" ] }, { "heading": "Song", "columns": [ "year", "genre", "composer", "isrc", "format", "bitrate", "sample_rate", "track_gain", "track_peak", "on_phone", "source", "path", "mb_recording", "mb_release_track", "filled_from" ] } ], "sort": { "column": "title", "descending": false }, "empty": { "title": "No songs yet", "message": "Share audio files to the app, or add a folder of them with Plus." }, "create": { "label": "Add music", "doors": [ { "id": "files", "label": "Add files", "object": "singles", "files": { "types": [ "public.audio", "public.zip-archive" ], "many": true } }, { "id": "folder", "label": "Add a folder", "object": "crate", "files": { "types": [ "public.folder" ] } } ] }, "instructions": "One row per song the owner keeps as an audio file (the file in the object's media under music/, one object per file named by its bytes). The file's own tags come first: title, artist_name (the credit as tagged, \"A feat. B\"), track_number, disc_number, year, genre, composer, duration in seconds, bitrate, sample_rate, track_gain and track_peak (ReplayGain or R128), isrc, mb_recording (the MusicBrainz recording id: MUSICBRAINZ_TRACKID, ID3's UFID), mb_release_track (the MusicBrainz track id of this song on its release: MUSICBRAINZ_RELEASETRACKID) and the lyrics are read from the file when it comes in; the folder and the file's name (Artist/Album (Year)/01 Title) fill only what the tags left empty, and a lookup (MusicBrainz on the phone, LRCLIB through find_lyrics) fills only what both left empty. A column the owner edited is never written over by a tag, a folder or a lookup. filled_from says, as JSON, where each column a lookup filled came from ({\"year\": \"musicbrainz\"}). artist links the song's own artist and album its album (music_album), which brings album_title and cover. The same bytes twice is one song (the file key is the bytes' hash); the same song in two formats (artist, title, album, length within 2 seconds) is one song, the better file kept (lossless over lossy, then the higher bitrate). format, duration, bitrate, sample_rate and the gains are the file's and are never typed. play_count, skip_count and last_played_at are the player's alone: a play counts once the song has been heard for thirty seconds or half its length, whichever is sooner, and every play counted is a listen row, from which the core keeps play_count and last_played_at. A song left by Next (or Previous onto another song) before it counted is a skip: no listen row, and skip_count one more; a listen that ended skipped (heard enough, then left) makes play_count and skip_count each one more. lyrics is the plain text and synced_lyrics the timed lyrics as LRC; lyrics_source says where they came from (file, sidecar, lrclib, typed). find_lyrics { song } asks LRCLIB for one song whose lyrics are empty, never for many at once. favourite is the owner's own mark. source says where the row came from and path the file's path as it came in. on_phone is answered by each phone (absent, keeping, kept) and never stored. Playlists are this table's groups, ordered, a song at most once in each.", "commands": [ { "id": "play", "label": "Play", "kind": "update", "method": "shell.player", "data": { "table": "song", "op": "play" }, "bindings": { "id": "$id" }, "receipt": "Playing {name}", "object": "slip" }, { "id": "play_next", "label": "Play next", "kind": "update", "method": "shell.player", "data": { "table": "song", "op": "queue_next" }, "bindings": { "id": "$id" }, "receipt": "{name} plays next", "object": "slip" }, { "id": "add_to_queue", "label": "Add to queue", "kind": "update", "method": "shell.player", "data": { "table": "song", "op": "queue_add" }, "bindings": { "id": "$id" }, "receipt": "Added {name} to the queue", "object": "folder" }, { "id": "favourite", "label": "Mark as a favourite", "kind": "update", "verb": "update_record", "data": { "table": "song", "patch": { "favourite": true } }, "bindings": { "id": "$id" }, "when": { "favourite": false }, "receipt": "{name} is a favourite", "undo": "unfavourite", "object": "star" }, { "id": "unfavourite", "label": "Not a favourite", "kind": "update", "verb": "update_record", "data": { "table": "song", "patch": { "favourite": false } }, "bindings": { "id": "$id" }, "when": { "favourite": true }, "receipt": "{name} is not a favourite", "undo": "favourite", "object": "star" }, { "id": "find_lyrics", "label": "Find lyrics", "kind": "update", "method": "object.act", "data": { "act": "find_lyrics" }, "bindings": { "song": "$id" }, "when": { "lyrics": [ false, "" ] }, "receipt": "Looking for the words of {name}", "object": "loop" }, { "id": "keep_on_phone", "label": "Keep on phone", "kind": "update", "method": "settings.openFlow", "data": { "flow": "keepSong", "origin_table": "song" }, "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": "removeSongDownload", "origin_table": "song" }, "bindings": { "origin_id": "$id" }, "when": { "on_phone": [ "keeping", "kept" ] }, "receipt": "Removed {name} from this phone", "object": "bin" } ], "card": { "face": "song.single", "offers": [ "song.single", "song.tray", "song.cassette" ], "fields": [ { "slot": "photo", "column": "cover" }, { "slot": "title", "column": "title" }, { "slot": "subtitle", "column": "artist_name" }, { "slot": "album", "column": "album" }, { "slot": "number", "column": "track_number", "line": "field.track" }, { "slot": "length", "column": "duration", "form": "clock" }, { "slot": "count", "column": "play_count" }, { "slot": "play", "column": "file" }, { "slot": "body", "column": "lyrics" } ] }, "groups": { "stack": "slips" }, "send": { "columns": [ "title", "artist_name", "file", "format", "duration", "track_number", "disc_number", "year", "genre", "composer", "lyrics", "synced_lyrics", "lyrics_source", "track_gain", "track_peak", "bitrate", "sample_rate", "isrc", "mb_recording", "mb_release_track" ], "files": [ "file" ], "same": [ [ "file" ], [ "mb_recording" ], [ "isrc" ] ], "carry": { "album": [ "title", "artist_name", "cover", "year", "mb_release", "mb_release_group" ] } } }