From 730351dcd19540afff89355a2014cd9793fe07bf Mon Sep 17 00:00:00 2001
From: NEETzsche <neetzsche@tutanota.com>
Date: Wed, 15 Nov 2023 01:13:46 -0700
Subject: Accommodate scrobble URLs when present

---
 src/components/status/status.vue | 57 +++++++++++++++++++++++++++++-----------
 1 file changed, 42 insertions(+), 15 deletions(-)

(limited to 'src/components/status/status.vue')

diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index d66de562..eb10a0b0 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -249,22 +249,49 @@
                 </button>
               </span>
             </div>
-            <div class="status-rich-presence" v-if="scrobblePresent">
-              <FAIcon
-                class="fa-scale-110 fa-old-padding"
-                icon="music"
-              />
-              {{ scrobble.artist }} — {{ scrobble.title }}
-              <FAIcon
-                class="fa-scale-110 fa-old-padding"
-                icon="play"
-              />
-              <span class="status-rich-presence-time">
-                <Timeago
-                  template-key="time.in_past"
-                  :time="scrobble.created_at"
-                  :auto-update="60"
+            <div
+              v-if="scrobblePresent"
+              class="status-rich-presence"
+            >
+              <a
+                v-if="scrobble.externalLink"
+                :href="scrobble.externalLink"
+                target="_blank"
+              >
+                <img
+                  :src="faviconUrl"
+                  class="status-rich-presence-favicon"
+                />
+                {{ scrobble.artist }} — {{ scrobble.title }}
+                <FAIcon
+                  class="fa-scale-110 fa-old-padding"
+                  icon="play"
                 />
+                <span class="status-rich-presence-time">
+                  <Timeago
+                    template-key="time.in_past"
+                    :time="scrobble.created_at"
+                    :auto-update="60"
+                  />
+                </span>
+              </a>
+              <span v-if="!scrobble.externalLink">
+                <FAIcon
+                  class="fa-scale-110 fa-old-padding"
+                  icon="music"
+                />
+                {{ scrobble.artist }} — {{ scrobble.title }}
+                <FAIcon
+                  class="fa-scale-110 fa-old-padding"
+                  icon="play"
+                />
+                <span class="status-rich-presence-time">
+                  <Timeago
+                    template-key="time.in_past"
+                    :time="scrobble.created_at"
+                    :auto-update="60"
+                  />
+                </span>
               </span>
             </div>
             <div
-- 
cgit v1.2.3-70-g09d2

