diff --git a/Cargo.lock b/Cargo.lock index e96771a..f38904a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1835,7 +1835,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "furumusic" -version = "0.9.5" +version = "0.9.6" dependencies = [ "anyhow", "async-stream", diff --git a/templates/base.html b/templates/base.html index 5028260..b3dab6d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,6 +3,7 @@ + {% block title %}{{ t.site_name }}{% endblock title %} {% block head_extra %}{% endblock head_extra %} diff --git a/templates/player/scripts.html b/templates/player/scripts.html index b24656a..4f0203c 100644 --- a/templates/player/scripts.html +++ b/templates/player/scripts.html @@ -735,6 +735,7 @@ document.addEventListener('alpine:init', () => { _remoteStateReceivedAt: 0, _remoteStateTimer: null, _prefetchedQueueKey: null, + _baseDocumentTitle: '', _hasInitialShareLink() { const params = new URLSearchParams(window.location.search); @@ -744,6 +745,10 @@ document.addEventListener('alpine:init', () => { init() { audio.volume = this.volume; + this._baseDocumentTitle = document.title.replace(/^▶\s*/, ''); + Alpine.effect(() => { + document.title = `${this.isPlaying ? '▶ ' : ''}${this._baseDocumentTitle}`; + }); audio.addEventListener('timeupdate', () => { this.currentTime = audio.currentTime;