diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 4b81ec2..ac2f3bb 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19594,6 +19594,12 @@ style.textContent = css ` white-space: nowrap; overflow: hidden; } + .viewProgress { + background: #e5a00d; + height: 3px; + bottom: 0; + position: absolute; + } .toViewEpisode { position: relative; height: 28px; @@ -20774,6 +20780,12 @@ class PlexMeetsHomeAssistant extends HTMLElement { toViewElem.innerHTML = (data.leafCount - data.viewedLeafCount).toString(); interactiveArea.appendChild(toViewElem); } + if (data.viewOffset > 0 && data.duration > 0) { + const toViewElem = document.createElement('div'); + toViewElem.className = 'viewProgress'; + toViewElem.style.width = `${(data.viewOffset / data.duration) * 100}%`; + interactiveArea.appendChild(toViewElem); + } interactiveArea.className = 'interactiveArea'; if (this.playController && this.playController.isPlaySupported(data)) { interactiveArea.append(playButton); diff --git a/src/modules/style.ts b/src/modules/style.ts index 859079f..f1bad08 100644 --- a/src/modules/style.ts +++ b/src/modules/style.ts @@ -188,6 +188,12 @@ style.textContent = css` white-space: nowrap; overflow: hidden; } + .viewProgress { + background: #e5a00d; + height: 3px; + bottom: 0; + position: absolute; + } .toViewEpisode { position: relative; height: 28px; diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 869fa3c..6a656a9 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -1171,6 +1171,13 @@ class PlexMeetsHomeAssistant extends HTMLElement { interactiveArea.appendChild(toViewElem); } + if (data.viewOffset > 0 && data.duration > 0) { + const toViewElem = document.createElement('div'); + toViewElem.className = 'viewProgress'; + toViewElem.style.width = `${(data.viewOffset / data.duration) * 100}%`; + interactiveArea.appendChild(toViewElem); + } + interactiveArea.className = 'interactiveArea'; if (this.playController && this.playController.isPlaySupported(data)) { interactiveArea.append(playButton);