From a84bee544aba62e93e28cb95ccb1599b23ebbe7a Mon Sep 17 00:00:00 2001 From: fishbigger Date: Fri, 4 Nov 2022 22:43:25 +0000 Subject: [PATCH] Added ability to favorite item from video playback --- CONTRIBUTORS.md | 1 + src/controllers/playback/video/index.html | 6 ++++++ src/controllers/playback/video/index.js | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0f2420a648..7edfaaed62 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -62,6 +62,7 @@ - [Pier-Luc Ducharme](https://github.com/pl-ducharme) - [Anantharaju S](https://github.com/Anantharajus) - [Merlin Sievers](https://github.com/dann-merlin) + - [Fishbigger](https://github.com/fishbigger) # Emby Contributors diff --git a/src/controllers/playback/video/index.html b/src/controllers/playback/video/index.html index ca49f872c9..d046360053 100644 --- a/src/controllers/playback/video/index.html +++ b/src/controllers/playback/video/index.html @@ -69,6 +69,12 @@
+ + diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 3574b5847e..a3e91a21b7 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -17,6 +17,7 @@ import keyboardnavigation from '../../../scripts/keyboardNavigation'; import '../../../styles/scrollstyles.scss'; import '../../../elements/emby-slider/emby-slider'; import '../../../elements/emby-button/paper-icon-button-light'; +import '../../../elements/emby-ratingbutton/emby-ratingbutton'; import '../../../styles/videoosd.scss'; import ServerConnections from '../../../components/ServerConnections'; import shell from '../../../scripts/shell'; @@ -133,6 +134,17 @@ export default function (view) { programStartDateMs = 0; programEndDateMs = 0; } + + // Set currently playing item for favorite button + const btnUserRating = view.querySelector('.btnUserRating'); + + if (itemHelper.canRate(currentItem)) { + btnUserRating.classList.remove('hide'); + btnUserRating.setItem(currentItem); + } else { + btnUserRating.classList.add('hide'); + btnUserRating.setItem(null); + } } function getDisplayTimeWithoutAmPm(date, showSeconds) {