diff --git a/docs/openapi.json b/docs/openapi.json
index d863c4f..84633dd 100644
--- a/docs/openapi.json
+++ b/docs/openapi.json
@@ -4575,6 +4575,13 @@
"null"
]
},
+ "now_playing": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "\"Track by Artist\", or null"
+ },
"handle": {
"type": "string",
"example": "@alice@scrobble.example"
diff --git a/frontend/css/style.css b/frontend/css/style.css
index 9f4c983..1d80019 100644
--- a/frontend/css/style.css
+++ b/frontend/css/style.css
@@ -954,6 +954,14 @@ input {
white-space: pre-line;
}
+.now-playing {
+ padding: 0.6rem 1rem;
+ border-radius: var(--radius-control);
+ border-left: 4px solid var(--glow);
+ background: var(--paper-raised);
+ margin: 0.75rem 0;
+}
+
.profile-follow {
margin: 2rem 0 0.4rem;
}
diff --git a/frontend/js/profile.js b/frontend/js/profile.js
index bbf1031..31a4456 100644
--- a/frontend/js/profile.js
+++ b/frontend/js/profile.js
@@ -25,6 +25,9 @@ try {
h("h1", {}, profile.display_name),
h("div", { class: "approve-app handle" }, profile.handle),
profile.bio ? h("p", { class: "lede profile-bio" }, profile.bio) : null,
+ profile.now_playing
+ ? h("p", { class: "now-playing" }, "Now playing: ", h("strong", {}, profile.now_playing))
+ : null,
h("h2", { class: "profile-follow" }, "Follow from the fediverse"),
h(
"p",
diff --git a/frontend/js/sharing.js b/frontend/js/sharing.js
index 3fe7fb8..fd3f1cf 100644
--- a/frontend/js/sharing.js
+++ b/frontend/js/sharing.js
@@ -5,6 +5,7 @@ import { signedInPage } from "./layout.js";
const form = document.getElementById("sharing");
const messages = document.getElementById("messages");
const handlePanel = document.getElementById("handle-panel");
+const RADIO_GROUPS = ["visibility", "now_playing_mode"];
const FIELDS = [
"enabled",
"visibility",
@@ -14,6 +15,7 @@ const FIELDS = [
"post_weekly_summary",
"post_milestones",
"timezone",
+ "now_playing_mode",
"display_name",
"bio",
];
@@ -70,10 +72,12 @@ async function previewWeekly() {
function fill(values) {
for (const name of FIELDS) {
+ if (RADIO_GROUPS.includes(name)) {
+ form.querySelector(`input[name=${name}][value="${values[name]}"]`).checked = true;
+ continue;
+ }
const field = form.elements[name];
- if (name === "visibility") {
- form.querySelector(`input[name=visibility][value="${values.visibility}"]`).checked = true;
- } else if (field.type === "checkbox") {
+ if (field.type === "checkbox") {
field.checked = Boolean(values[name]);
} else {
field.value = values[name] ?? "";
@@ -150,6 +154,7 @@ async function save(event) {
post_weekly_summary: form.elements.post_weekly_summary.checked,
post_milestones: form.elements.post_milestones.checked,
timezone: form.elements.timezone.value.trim() || "UTC",
+ now_playing_mode: form.querySelector("input[name=now_playing_mode]:checked").value,
display_name: form.elements.display_name.value.trim() || null,
bio: form.elements.bio.value.trim() || null,
};
diff --git a/frontend/sharing.html b/frontend/sharing.html
index 96ac78e..65383f8 100644
--- a/frontend/sharing.html
+++ b/frontend/sharing.html
@@ -83,6 +83,22 @@
See your posts
+
+