a simple web player for subsonic tinysub.devins.page
subsonic navidrome javascript
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: cover art for favicon

also replace entire website title with artist - song when playing

intergrav 3bea8268 3c02afe2

+21 -1
+21 -1
src/js/player.js
··· 9 9 10 10 ui.trackTitle.textContent = song.title || STRINGS.UNKNOWN_TRACK; 11 11 ui.trackArtist.textContent = song.artist || STRINGS.UNKNOWN_ARTIST; 12 - document.title = `${song.title || STRINGS.UNKNOWN_TRACK} • tinysub`; 12 + document.title = `${song.artist || STRINGS.UNKNOWN_ARTIST} - ${song.title || STRINGS.UNKNOWN_TRACK}`; 13 + { 14 + const faviconLink = document.querySelector('link[rel="icon"]'); 15 + if (song?.coverArt && faviconLink) { 16 + faviconLink.href = state.api.getCoverArtUrl( 17 + song.coverArt, 18 + state.settings.artNowPlaying, 19 + ); 20 + faviconLink.type = "image/jpeg"; 21 + } else if (faviconLink) { 22 + faviconLink.href = ICONS.TINYSUB; 23 + faviconLink.type = "image/svg+xml"; 24 + } 25 + } 13 26 if (song.coverArt) { 14 27 loadCachedImage(ui.coverArt, song.coverArt, "artNowPlaying"); 15 28 } else { ··· 122 135 ui.trackTitle.textContent = STRINGS.NO_TRACK_PLAYING; 123 136 ui.trackArtist.textContent = ""; 124 137 document.title = "tinysub"; 138 + { 139 + const faviconLink = document.querySelector('link[rel="icon"]'); 140 + if (faviconLink) { 141 + faviconLink.href = ICONS.TINYSUB; 142 + faviconLink.type = "image/svg+xml"; 143 + } 144 + } 125 145 clearLyrics(); 126 146 ui.coverArt.src = ICONS.TINYSUB; 127 147 ui.coverArt.srcset = "";