-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advanced Settings: Make background art blur and opacity configurable; display background art per item #197
base: develop
Are you sure you want to change the base?
Changes from all commits
e8bddc7
b0ed69b
e647605
88bc85b
52223b0
2022790
7425de2
e494920
5fa7451
2f48464
085c22a
1490451
85273d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import preplayutils | ||
|
||
from lib.util import T | ||
from lib.windows.home import MOVE_SET | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this used anywhere. |
||
|
||
|
||
class EpisodeReloadTask(backgroundthread.Task): | ||
|
@@ -646,7 +647,7 @@ def updateProperties(self): | |
|
||
self.setProperty( | ||
'background', | ||
(self.show_ or self.season.show()).art.asTranscodedImageURL(self.width, self.height, blur=128, opacity=60, background=colors.noAlpha.Background) | ||
util.backgroundFromArt((self.show_ or self.season.show()).art, width=self.width, height=self.height) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can just drop the width and height here (and for the rest). We can change it in the util in the unlikely event we need to change this globally, and in the even more unlikely event we need to change it on a per screen basis, we can just add it at that time. |
||
) | ||
self.setProperty('season.thumb', self.season.thumb.asTranscodedImageURL(*self.POSTER_DIM)) | ||
self.setProperty('show.title', showTitle) | ||
|
@@ -670,7 +671,7 @@ def updateItems(self, item=None): | |
|
||
def setItemInfo(self, video, mli): | ||
# video.reload(checkFiles=1) | ||
mli.setProperty('background', video.art.asTranscodedImageURL(self.width, self.height, blur=128, opacity=60, background=colors.noAlpha.Background)) | ||
mli.setProperty('background', util.backgroundFromArt(video.art, width=self.width, height=self.height)) | ||
mli.setProperty('title', video.title) | ||
mli.setProperty('show.title', video.grandparentTitle or (self.show_.title if self.show_ else '')) | ||
mli.setProperty('duration', util.durationToText(video.duration.asInt())) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -494,6 +494,14 @@ def onAction(self, action): | |
self.setBoolProperty('dragging', self.dragging) | ||
|
||
if action.getId() in MOVE_SET: | ||
if util.advancedSettings.dynamicBackgrounds: | ||
mli = self.showPanelControl.getSelectedItem() | ||
if mli and mli.dataSource: | ||
self.setProperty( | ||
'background', util.backgroundFromArt(mli.dataSource.art, width=self.width, | ||
height=self.height) | ||
) | ||
|
||
controlID = self.getFocusId() | ||
if controlID == self.POSTERS_PANEL_ID or controlID == self.SCROLLBAR_ID: | ||
self.updateKey() | ||
|
@@ -1229,13 +1237,21 @@ def updateItem(self, mli=None): | |
backgroundthread.BGThreader.moveToFront(task) | ||
break | ||
|
||
def setBackground(self, items): | ||
def setBackground(self, items, position, randomize=True): | ||
if self.backgroundSet: | ||
return | ||
self.backgroundSet = True | ||
|
||
item = random.choice(items) | ||
self.setProperty('background', item.art.asTranscodedImageURL(self.width, self.height, blur=128, opacity=60, background=colors.noAlpha.Background)) | ||
if randomize: | ||
item = random.choice(items) | ||
self.setProperty('background', util.backgroundFromArt(item.art, width=self.width, height=self.height)) | ||
else: | ||
# we want the first item of the first chunk | ||
if position is not 0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move this check to the caller and remove the position argument from this function. |
||
return | ||
|
||
self.setProperty('background', util.backgroundFromArt(items[0].art, | ||
width=self.width, height=self.height)) | ||
self.backgroundSet = True | ||
|
||
def fill(self): | ||
if self.chunkMode: | ||
|
@@ -1429,7 +1445,7 @@ def fillPhotos(self): | |
return | ||
|
||
photo = random.choice(photos) | ||
self.setProperty('background', photo.art.asTranscodedImageURL(self.width, self.height, blur=128, opacity=60, background=colors.noAlpha.Background)) | ||
self.setProperty('background', util.backgroundFromArt(photo.art, width=self.width, height=self.height)) | ||
thumbDim = TYPE_KEYS.get(self.section.type, TYPE_KEYS['movie'])['thumb_dim'] | ||
fallback = 'script.plex/thumb_fallbacks/{0}.png'.format(TYPE_KEYS.get(self.section.type, TYPE_KEYS['movie'])['fallback']) | ||
|
||
|
@@ -1507,7 +1523,8 @@ def _chunkCallback(self, items, start): | |
if self.chunkMode and not self.chunkMode.posIsValid(start): | ||
return | ||
pos = start | ||
self.setBackground(items) | ||
self.setBackground(items, pos, randomize=not util.advancedSettings.dynamicBackgrounds) | ||
|
||
thumbDim = TYPE_KEYS.get(self.section.type, TYPE_KEYS['movie'])['thumb_dim'] | ||
artDim = TYPE_KEYS.get(self.section.type, TYPE_KEYS['movie']).get('art_dim', (256, 256)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put the width and height values into global values and use those here.