From dd6ea5b3326e491073c430c5118681d209347350 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2024 15:30:35 +0100 Subject: [PATCH] Add music site url option to personal profile --- daemon_post_profile.py | 23 +++++++++ daemon_utils.py | 5 +- music.py | 104 +++++++++++++++++++++++++++++++++++++++ pgp.py | 10 ++++ translations/ar.json | 3 +- translations/bn.json | 3 +- translations/ca.json | 3 +- translations/cy.json | 3 +- translations/de.json | 3 +- translations/el.json | 3 +- translations/en.json | 3 +- translations/es.json | 3 +- translations/fa.json | 3 +- translations/fi.json | 3 +- translations/fr.json | 3 +- translations/ga.json | 3 +- translations/he.json | 3 +- translations/hi.json | 3 +- translations/it.json | 3 +- translations/ja.json | 3 +- translations/ko.json | 3 +- translations/ku.json | 3 +- translations/nl.json | 3 +- translations/oc.json | 3 +- translations/pl.json | 3 +- translations/pt.json | 3 +- translations/ru.json | 3 +- translations/sw.json | 3 +- translations/tr.json | 3 +- translations/uk.json | 3 +- translations/yi.json | 3 +- translations/zh.json | 3 +- webapp_person_options.py | 8 ++- webapp_profile.py | 30 ++++++++--- 34 files changed, 228 insertions(+), 36 deletions(-) create mode 100644 music.py diff --git a/daemon_post_profile.py b/daemon_post_profile.py index 1b1e4b19b..faf1eccb2 100644 --- a/daemon_post_profile.py +++ b/daemon_post_profile.py @@ -83,6 +83,8 @@ from pronouns import get_pronouns from pronouns import set_pronouns from discord import get_discord from discord import set_discord +from music import get_music_site_url +from music import set_music_site_url from youtube import get_youtube from youtube import set_youtube from pixelfed import get_pixelfed @@ -2007,6 +2009,23 @@ def _profile_post_youtube(actor_json: {}, fields: {}, return actor_changed +def _profile_post_music_site_url(actor_json: {}, fields: {}, + actor_changed: bool) -> bool: + """ HTTP POST change music site url address + """ + current_music = get_music_site_url(actor_json) + if fields.get('musicSiteUrl'): + if fields['musicSiteUrl'] != current_music: + set_music_site_url(actor_json, + fields['musicSiteUrl']) + actor_changed = True + else: + if current_music: + set_music_site_url(actor_json, '') + actor_changed = True + return actor_changed + + def _profile_post_discord(actor_json: {}, fields: {}, actor_changed: bool) -> bool: """ HTTP POST change discord channel address @@ -2937,6 +2956,10 @@ def profile_edit(self, calling_domain: str, cookie: str, _profile_post_youtube(actor_json, fields, actor_changed) + actor_changed = \ + _profile_post_music_site_url(actor_json, fields, + actor_changed) + actor_changed = \ _profile_post_peertube(actor_json, fields, actor_changed) diff --git a/daemon_utils.py b/daemon_utils.py index d56fc23f4..eb248e6ee 100644 --- a/daemon_utils.py +++ b/daemon_utils.py @@ -46,6 +46,7 @@ from donate import get_website from donate import get_gemini_link from pronouns import get_pronouns from discord import get_discord +from music import get_music_site_url from youtube import get_youtube from pixelfed import get_pixelfed from peertube import get_peertube @@ -662,6 +663,7 @@ def show_person_options(self, calling_domain: str, path: str, pronouns = None pixelfed = None discord = None + music_site_url = None youtube = None peertube = None xmpp_address = None @@ -695,6 +697,7 @@ def show_person_options(self, calling_domain: str, path: str, pronouns = get_pronouns(actor_json) pixelfed = get_pixelfed(actor_json) discord = get_discord(actor_json) + music_site_url = get_music_site_url(actor_json) youtube = get_youtube(actor_json) peertube = get_peertube(actor_json) xmpp_address = get_xmpp_address(actor_json) @@ -771,7 +774,7 @@ def show_person_options(self, calling_domain: str, path: str, repo_url, self.server.sites_unavailable, youtube, peertube, pixelfed, - discord) + discord, music_site_url) if msg: msg = msg.encode('utf-8') msglen = len(msg) diff --git a/music.py b/music.py new file mode 100644 index 000000000..4c3d80a3d --- /dev/null +++ b/music.py @@ -0,0 +1,104 @@ +__filename__ = "music.py" +__author__ = "Bob Mottram" +__license__ = "AGPL3+" +__version__ = "1.5.0" +__maintainer__ = "Bob Mottram" +__email__ = "bob@libreserver.org" +__status__ = "Production" +__module_group__ = "Profile Metadata" + + +from utils import get_attachment_property_value +from utils import remove_html +from utils import string_contains +from utils import resembles_url + +music_fieldnames = ('music') +music_sites = ('bandcamp.com', 'soundcloud.com') + + +def get_music_site_url(actor_json: {}) -> str: + """Returns music site url for the given actor + """ + if not actor_json.get('attachment'): + return '' + if not isinstance(actor_json['attachment'], list): + return '' + for property_value in actor_json['attachment']: + if not property_value.get('type'): + continue + if not isinstance(property_value['type'], str): + continue + if not property_value['type'].endswith('PropertyValue'): + continue + prop_value_name, _ = \ + get_attachment_property_value(property_value) + if not prop_value_name: + continue + music_text = remove_html(property_value[prop_value_name]) + if not string_contains(music_text, music_sites): + continue + if not resembles_url(music_text): + continue + return music_text + return '' + + +def set_music_site_url(actor_json: {}, music_site_url: str) -> None: + """Sets music site url for the given actor + """ + music_site_url = remove_html(music_site_url) + if not resembles_url(music_site_url): + return + + if not actor_json.get('attachment'): + actor_json['attachment'] = [] + + # remove any existing value + property_found = None + for property_value in actor_json['attachment']: + name_value = None + if property_value.get('name'): + name_value = property_value['name'].lower() + elif property_value.get('schema:name'): + name_value = property_value['schema:name'].lower() + if not name_value: + continue + if not property_value.get('type'): + continue + if not string_contains(name_value, music_fieldnames): + continue + property_found = property_value + break + + if property_found: + actor_json['attachment'].remove(property_found) + + for property_value in actor_json['attachment']: + name_value = None + if property_value.get('name'): + name_value = property_value['name'] + elif property_value.get('schema:name'): + name_value = property_value['schema:name'] + if not name_value: + continue + if not property_value.get('type'): + continue + name_value = name_value.lower() + if not string_contains(name_value, music_fieldnames): + continue + if not property_value['type'].endswith('PropertyValue'): + continue + prop_value_name, _ = \ + get_attachment_property_value(property_value) + if not prop_value_name: + continue + property_value[prop_value_name] = remove_html(music_site_url) + return + + new_music = { + "type": "PropertyValue", + "name": "Music", + "value": remove_html(music_site_url) + } + actor_json['attachment'].append(new_music) diff --git a/pgp.py b/pgp.py index 7b2481616..9fcac1dc1 100644 --- a/pgp.py +++ b/pgp.py @@ -29,6 +29,7 @@ from session import post_json from pronouns import get_pronouns from pixelfed import get_pixelfed from discord import get_discord +from music import get_music_site_url from youtube import get_youtube from peertube import get_peertube from xmpp import get_xmpp_address @@ -753,6 +754,10 @@ def actor_to_vcard(actor: {}, domain: str) -> str: pixelfed = get_pixelfed(actor) if pixelfed: vcard_str += 'SOCIALPROFILE;SERVICE-TYPE=Pixelfed:' + pixelfed + '\n' + music_site_url = get_music_site_url(actor) + if music_site_url: + vcard_str += \ + 'SOCIALPROFILE;SERVICE-TYPE=Music:' + music_site_url + '\n' youtube = get_youtube(actor) if youtube: vcard_str += 'SOCIALPROFILE;SERVICE-TYPE=YouTube:' + youtube + '\n' @@ -846,6 +851,11 @@ def actor_to_vcard_xml(actor: {}, domain: str) -> str: vcard_str += ' ' + \ 'youtube' + \ '' + youtube + '\n' + music_site_url = get_music_site_url(actor) + if music_site_url: + vcard_str += ' ' + \ + 'music' + \ + '' + music_site_url + '\n' peertube = get_peertube(actor) if peertube: vcard_str += ' ' + \ diff --git a/translations/ar.json b/translations/ar.json index 7ecae810d..60b2172bc 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "لا تظهر المشاركات التي تمت مشاهدتها بالفعل", "Watermark image": "صورة العلامة المائية", "Apply a watermark to uploaded images": "إضافة علامة مائية على الصور التي تم تحميلها", - "Pronouns": "الضمائر" + "Pronouns": "الضمائر", + "Music": "موسيقى" } diff --git a/translations/bn.json b/translations/bn.json index 6d86d3599..24a596f58 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "ইতিমধ্যে দেখা পোস্ট দেখাবেন না", "Watermark image": "ওয়াটারমার্ক ইমেজ", "Apply a watermark to uploaded images": "আপলোড করা ছবিগুলিতে একটি জলছাপ প্রয়োগ করুন", - "Pronouns": "সর্বনাম" + "Pronouns": "সর্বনাম", + "Music": "সঙ্গীত" } diff --git a/translations/ca.json b/translations/ca.json index 4b730b398..0421ee041 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "No mostris les publicacions ja vistes", "Watermark image": "Imatge de filigrana", "Apply a watermark to uploaded images": "Apliqueu una marca d'aigua a les imatges penjades", - "Pronouns": "Els pronoms" + "Pronouns": "Els pronoms", + "Music": "Música" } diff --git a/translations/cy.json b/translations/cy.json index 3fcdc8fc8..ced5e6778 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Peidiwch â dangos postiadau a welwyd eisoes", "Watermark image": "Delwedd dyfrnod", "Apply a watermark to uploaded images": "Cymhwyso dyfrnod i ddelweddau sydd wedi'u llwytho i fyny", - "Pronouns": "Rhagenwau" + "Pronouns": "Rhagenwau", + "Music": "Cerddoriaeth" } diff --git a/translations/de.json b/translations/de.json index 12fe63f2c..c375658c7 100644 --- a/translations/de.json +++ b/translations/de.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Bereits gesehene Beiträge nicht anzeigen", "Watermark image": "Wasserzeichenbild", "Apply a watermark to uploaded images": "Hochgeladenen Bildern ein Wasserzeichen hinzufügen", - "Pronouns": "Pronomen" + "Pronouns": "Pronomen", + "Music": "Musik" } diff --git a/translations/el.json b/translations/el.json index 7c8543aee..0cc959de0 100644 --- a/translations/el.json +++ b/translations/el.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Να μην εμφανίζονται οι αναρτήσεις που έχετε ήδη δει", "Watermark image": "Εικόνα υδατογραφήματος", "Apply a watermark to uploaded images": "Εφαρμόστε ένα υδατογράφημα στις μεταφορτωμένες εικόνες", - "Pronouns": "Αντωνυμίες" + "Pronouns": "Αντωνυμίες", + "Music": "Μουσική" } diff --git a/translations/en.json b/translations/en.json index 6bc90e5a0..a7a71d750 100644 --- a/translations/en.json +++ b/translations/en.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Don't show already seen posts", "Watermark image": "Watermark image", "Apply a watermark to uploaded images": "Apply a watermark to uploaded images", - "Pronouns": "Pronouns" + "Pronouns": "Pronouns", + "Music": "Music" } diff --git a/translations/es.json b/translations/es.json index fb043730f..102c8aa9b 100644 --- a/translations/es.json +++ b/translations/es.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "No mostrar publicaciones ya vistas", "Watermark image": "Imagen de marca de agua", "Apply a watermark to uploaded images": "Aplicar una marca de agua a las imágenes cargadas", - "Pronouns": "Pronombres" + "Pronouns": "Pronombres", + "Music": "Música" } diff --git a/translations/fa.json b/translations/fa.json index cc764cc6e..53acd8217 100644 --- a/translations/fa.json +++ b/translations/fa.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "پست های قبلا دیده شده را نشان ندهید", "Watermark image": "تصویر واترمارک", "Apply a watermark to uploaded images": "اعمال واترمارک روی تصاویر آپلود شده", - "Pronouns": "ضمایر" + "Pronouns": "ضمایر", + "Music": "موسیقی" } diff --git a/translations/fi.json b/translations/fi.json index f54fcec57..0e292d82d 100644 --- a/translations/fi.json +++ b/translations/fi.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Älä näytä jo nähtyjä viestejä", "Watermark image": "Vesileiman kuva", "Apply a watermark to uploaded images": "Lisää ladattuihin kuviin vesileima", - "Pronouns": "Pronominit" + "Pronouns": "Pronominit", + "Music": "Musiikki" } diff --git a/translations/fr.json b/translations/fr.json index 97b9d0592..715cd77f6 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Ne pas afficher les messages déjà vus", "Watermark image": "Image en filigrane", "Apply a watermark to uploaded images": "Appliquer un filigrane aux images téléchargées", - "Pronouns": "Pronoms" + "Pronouns": "Pronoms", + "Music": "Musique" } diff --git a/translations/ga.json b/translations/ga.json index 402cf2be3..4bcd57368 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Ná taispeáin postálacha atá feicthe cheana féin", "Watermark image": "Íomhá comhartha uisce", "Apply a watermark to uploaded images": "Cuir comhartha uisce i bhfeidhm ar íomhánna uaslódáilte", - "Pronouns": "Forainmneacha" + "Pronouns": "Forainmneacha", + "Music": "Ceol" } diff --git a/translations/he.json b/translations/he.json index fbfd7d239..043d85c88 100644 --- a/translations/he.json +++ b/translations/he.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "אל תראה פוסטים שכבר נראו", "Watermark image": "תמונת סימן מים", "Apply a watermark to uploaded images": "החל סימן מים על תמונות שהועלו", - "Pronouns": "כינויים" + "Pronouns": "כינויים", + "Music": "מוּסִיקָה" } diff --git a/translations/hi.json b/translations/hi.json index a1d44693f..ba26149b4 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "पहले से देखी गई पोस्ट न दिखाएं", "Watermark image": "वॉटरमार्क छवि", "Apply a watermark to uploaded images": "अपलोड की गई छवियों पर वॉटरमार्क लागू करें", - "Pronouns": "सर्वनाम" + "Pronouns": "सर्वनाम", + "Music": "संगीत" } diff --git a/translations/it.json b/translations/it.json index d253ecb5a..99daa9961 100644 --- a/translations/it.json +++ b/translations/it.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Non mostrare i post già visti", "Watermark image": "Immagine filigrana", "Apply a watermark to uploaded images": "Applicare una filigrana alle immagini caricate", - "Pronouns": "Pronomi" + "Pronouns": "Pronomi", + "Music": "Musica" } diff --git a/translations/ja.json b/translations/ja.json index 233ac3491..2faeb375e 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "すでに閲覧した投稿を表示しない", "Watermark image": "透かし画像", "Apply a watermark to uploaded images": "アップロードした画像に透かしを適用する", - "Pronouns": "代名詞" + "Pronouns": "代名詞", + "Music": "音楽" } diff --git a/translations/ko.json b/translations/ko.json index 91694e996..59d8f50ef 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "이미 본 게시물을 표시하지 않음", "Watermark image": "워터마크 이미지", "Apply a watermark to uploaded images": "업로드한 이미지에 워터마크를 적용합니다", - "Pronouns": "대명사" + "Pronouns": "대명사", + "Music": "음악" } diff --git a/translations/ku.json b/translations/ku.json index 318fd8700..6103affe6 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Mesajên ku berê hatine dîtin nîşan nedin", "Watermark image": "Wêneyê Watermark", "Apply a watermark to uploaded images": "Li ser wêneyên barkirî ava nîşanek bicîh bikin", - "Pronouns": "Cînavk" + "Pronouns": "Cînavk", + "Music": "Mûzîk" } diff --git a/translations/nl.json b/translations/nl.json index 58c6cef20..9df0b1d46 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Toon geen reeds bekeken berichten", "Watermark image": "Watermerk afbeelding", "Apply a watermark to uploaded images": "Een watermerk toepassen op geüploade afbeeldingen", - "Pronouns": "Voornaamwoorden" + "Pronouns": "Voornaamwoorden", + "Music": "Muziek" } diff --git a/translations/oc.json b/translations/oc.json index b6a6de6ad..8cadbb41f 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -693,5 +693,6 @@ "Don't show already seen posts": "Don't show already seen posts", "Watermark image": "Watermark image", "Apply a watermark to uploaded images": "Apply a watermark to uploaded images", - "Pronouns": "Pronouns" + "Pronouns": "Pronouns", + "Music": "Music" } diff --git a/translations/pl.json b/translations/pl.json index d223700a5..04e8f9115 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Nie pokazuj już wyświetlonych postów", "Watermark image": "Obraz znaku wodnego", "Apply a watermark to uploaded images": "Zastosuj znak wodny do przesłanych obrazów", - "Pronouns": "Zaimki" + "Pronouns": "Zaimki", + "Music": "Muzyka" } diff --git a/translations/pt.json b/translations/pt.json index 84d935ec9..ce3805e58 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Não mostrar posts já vistos", "Watermark image": "Imagem de marca de água", "Apply a watermark to uploaded images": "Aplicar uma marca de água nas imagens enviadas", - "Pronouns": "Pronomes" + "Pronouns": "Pronomes", + "Music": "Música" } diff --git a/translations/ru.json b/translations/ru.json index 2ea0c6f5e..6445e7431 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Не показывать уже просмотренные публикации", "Watermark image": "Изображение водяного знака", "Apply a watermark to uploaded images": "Накладывать водяной знак на загружаемые изображения", - "Pronouns": "Местоимения" + "Pronouns": "Местоимения", + "Music": "Музыка" } diff --git a/translations/sw.json b/translations/sw.json index f76b4bd0f..d13fa0d4a 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Usionyeshe machapisho ambayo tayari yameonekana", "Watermark image": "Picha ya watermark", "Apply a watermark to uploaded images": "Tumia watermark kwa picha zilizopakiwa", - "Pronouns": "Viwakilishi" + "Pronouns": "Viwakilishi", + "Music": "Muziki" } diff --git a/translations/tr.json b/translations/tr.json index ea0ec9409..bb8238e5b 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Daha önce görülen gönderileri gösterme", "Watermark image": "Filigran resmi", "Apply a watermark to uploaded images": "Yüklenen görsellere filigran uygulayın", - "Pronouns": "Zamirler" + "Pronouns": "Zamirler", + "Music": "Müzik" } diff --git a/translations/uk.json b/translations/uk.json index 91ad01a1f..6cb33964c 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "Не показувати вже переглянуті публікації", "Watermark image": "Зображення водяного знака", "Apply a watermark to uploaded images": "Застосування водяного знака до завантажених зображень", - "Pronouns": "Займенники" + "Pronouns": "Займенники", + "Music": "музика" } diff --git a/translations/yi.json b/translations/yi.json index 57e105746..9e7c5db75 100644 --- a/translations/yi.json +++ b/translations/yi.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "צי ניט ווייַזן שוין געזען אַרטיקלען", "Watermark image": "וואָטערמאַרק בילד", "Apply a watermark to uploaded images": "צולייגן אַ וואָטערמאַרק צו ופּלאָאַדעד בילדער", - "Pronouns": "פּראָנאָונס" + "Pronouns": "פּראָנאָונס", + "Music": "מוזיק" } diff --git a/translations/zh.json b/translations/zh.json index 855925d72..9eb52b061 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -697,5 +697,6 @@ "Don't show already seen posts": "不显示已经看过的帖子", "Watermark image": "水印图像", "Apply a watermark to uploaded images": "将水印应用于上传的图像", - "Pronouns": "代词" + "Pronouns": "代词", + "Music": "音乐" } diff --git a/webapp_person_options.py b/webapp_person_options.py index 740953795..96f688421 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -173,7 +173,8 @@ def html_person_options(default_timeline: str, sites_unavailable: [], youtube: str, peertube: str, pixelfed: str, - discord: str) -> str: + discord: str, + music_site_url: str) -> str: """Show options for a person: view/follow/block/report """ options_link_str = '' @@ -448,6 +449,11 @@ def html_person_options(default_timeline: str, '

Discord' + \ ': ' + \ discord + '

\n' + if music_site_url: + options_str += \ + '

' + translate['Music'] + \ + ': ' + \ + music_site_url + '

\n' if youtube: options_str += \ '

YouTube' + \ diff --git a/webapp_profile.py b/webapp_profile.py index 7dc1d4bc5..b24bae8b3 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -69,6 +69,7 @@ from donate import get_gemini_link from pronouns import get_pronouns from pixelfed import get_pixelfed from discord import get_discord +from music import get_music_site_url from youtube import get_youtube from peertube import get_peertube from xmpp import get_xmpp_address @@ -331,6 +332,7 @@ def html_profile_after_search(authorized: bool, pronouns = get_pronouns(profile_json) discord = get_discord(profile_json) + music_site_url = get_music_site_url(profile_json) youtube = get_youtube(profile_json) peertube = get_peertube(profile_json) pixelfed = get_pixelfed(profile_json) @@ -459,7 +461,7 @@ def html_profile_after_search(authorized: bool, person_url, no_of_books, birth_date, youtube, peertube, pixelfed, - discord) + discord, music_site_url) domain_full = get_full_domain(domain, port) @@ -831,7 +833,8 @@ def _get_profile_header_after_search(base_dir: str, youtube: str, peertube: str, pixelfed: str, - discord: str) -> str: + discord: str, + music_site_url: str) -> str: """The header of a searched for handle, containing background image and avatar """ @@ -956,6 +959,9 @@ def _get_profile_header_after_search(base_dir: str, if discord: html_str += '

Discord: ' + \ discord + '

\n' + if music_site_url: + html_str += '

' + translate['Music'] + ': ' + music_site_url + '

\n' if repo_url: html_str += '

💻 ' + \ repo_url + '

\n' @@ -1124,6 +1130,7 @@ def html_profile(signing_priv_key_pem: str, pronouns = get_pronouns(profile_json) pixelfed = get_pixelfed(profile_json) discord = get_discord(profile_json) + music_site_url = get_music_site_url(profile_json) youtube = get_youtube(profile_json) peertube = get_peertube(profile_json) xmpp_address = get_xmpp_address(profile_json) @@ -1135,7 +1142,8 @@ def html_profile(signing_priv_key_pem: str, verified_site_checkmark = '✔' premium = is_premium_account(base_dir, nickname, domain) if donate_url or website_url or repo_url or pronouns or discord or \ - youtube or peertube or pixelfed or xmpp_address or matrix_address or \ + music_site_url or youtube or peertube or pixelfed or \ + xmpp_address or matrix_address or \ ssb_address or tox_address or briar_address or cwtch_address or \ pgp_pub_key or enigma_pub_key or pgp_fingerprint or email_address: donate_section = '
\n' @@ -1209,6 +1217,11 @@ def html_profile(signing_priv_key_pem: str, donate_section += \ '

Discord: ' + discord + '

\n' + if music_site_url: + donate_section += \ + '

' + translate['Music'] + ': ' + \ + music_site_url + '

\n' if youtube: donate_section += \ '

YouTube: