Merge pull request #4923 from Yenof/master

Randomize backdrop images in screensaver
This commit is contained in:
Bill Thornton 2023-11-27 16:36:42 -05:00 committed by GitHub
commit 35e197826d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import 'material-design-icons-iconfont';
import '../../elements/emby-button/paper-icon-button-light';
import ServerConnections from '../ServerConnections';
import screenfull from 'screenfull';
import { randomInt } from '../../utils/number.ts';
/**
* Name of transition event.
@ -71,7 +72,8 @@ function getBackdropImageUrl(item, options, apiClient) {
}
if (item.BackdropImageTags?.length) {
options.tag = item.BackdropImageTags[0];
options.index = randomInt(0, item.BackdropImageTags.length - 1);
options.tag = item.BackdropImageTags[options.index];
return apiClient.getScaledImageUrl(item.Id, options);
}

View file

@ -18,7 +18,7 @@ class BackdropScreensaver {
SortBy: 'Random',
Recursive: true,
Fields: 'Taglines',
ImageTypeLimit: 1,
ImageTypeLimit: 10,
StartIndex: 0,
Limit: 200
};