1defmodule Sh.Comet.V0.Feed.Track do
2 use Atex.Lexicon
3
4 deflexicon(%{
5 "defs" => %{
6 "main" => %{
7 "description" =>
8 "A Comet audio track. TODO: should probably have some sort of pre-calculated waveform, or have a query to get one from a blob?",
9 "key" => "tid",
10 "record" => %{
11 "properties" => %{
12 "audio" => %{
13 "accept" => ["audio/ogg"],
14 "description" =>
15 "Audio of the track, ideally encoded as 96k Opus. Limited to 100mb.",
16 "maxSize" => 100_000_000,
17 "type" => "blob"
18 },
19 "createdAt" => %{
20 "description" => "Timestamp for when the track entry was originally created.",
21 "format" => "datetime",
22 "type" => "string"
23 },
24 "description" => %{
25 "description" => "Description of the track.",
26 "maxGraphemes" => 2000,
27 "maxLength" => 20000,
28 "type" => "string"
29 },
30 "descriptionFacets" => %{
31 "description" => "Annotations of the track's description.",
32 "ref" => "sh.comet.v0.richtext.facet",
33 "type" => "ref"
34 },
35 "explicit" => %{
36 "description" =>
37 "Whether the track contains explicit content that may objectionable to some people, usually swearing or adult themes.",
38 "type" => "boolean"
39 },
40 "image" => %{
41 "accept" => ["image/png", "image/jpeg"],
42 "description" => "Image to be displayed representing the track.",
43 "maxSize" => 1_000_000,
44 "type" => "blob"
45 },
46 "link" => %{"ref" => "sh.comet.v0.feed.defs#link", "type" => "ref"},
47 "releasedAt" => %{
48 "description" =>
49 "Timestamp for when the track was released. If in the future, may be used to implement pre-savable tracks.",
50 "format" => "datetime",
51 "type" => "string"
52 },
53 "tags" => %{
54 "description" => "Hashtags for the track, usually for genres.",
55 "items" => %{
56 "maxGraphemes" => 64,
57 "maxLength" => 640,
58 "type" => "string"
59 },
60 "maxLength" => 8,
61 "type" => "array"
62 },
63 "title" => %{
64 "description" =>
65 "Title of the track. Usually shouldn't include the creator's name.",
66 "maxGraphemes" => 256,
67 "maxLength" => 2560,
68 "minLength" => 1,
69 "type" => "string"
70 }
71 },
72 "required" => ["audio", "title", "createdAt"],
73 "type" => "object"
74 },
75 "type" => "record"
76 },
77 "view" => %{
78 "properties" => %{
79 "audio" => %{
80 "description" =>
81 "URL pointing to where the audio data for the track can be fetched. May be re-encoded from the original blob.",
82 "format" => "uri",
83 "type" => "string"
84 },
85 "author" => %{
86 "ref" => "sh.comet.v0.actor.profile#viewFull",
87 "type" => "ref"
88 },
89 "cid" => %{"format" => "cid", "type" => "string"},
90 "commentCount" => %{"type" => "integer"},
91 "image" => %{
92 "description" => "URL pointing to where the image for the track can be fetched.",
93 "format" => "uri",
94 "type" => "string"
95 },
96 "indexedAt" => %{"format" => "datetime", "type" => "string"},
97 "likeCount" => %{"type" => "integer"},
98 "playCount" => %{"type" => "integer"},
99 "record" => %{"ref" => "#main", "type" => "ref"},
100 "repostCount" => %{"type" => "integer"},
101 "uri" => %{"format" => "at-uri", "type" => "string"},
102 "viewer" => %{
103 "ref" => "sh.comet.v0.feed.defs#viewerState",
104 "type" => "ref"
105 }
106 },
107 "required" => ["uri", "cid", "author", "audio", "record", "indexedAt"],
108 "type" => "object"
109 }
110 },
111 "id" => "sh.comet.v0.feed.track",
112 "lexicon" => 1
113 })
114end