mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 20:00:44 +03:00
fix(web): Uniform random distribution during shuffle (#19902)
feat: better random distribution
This commit is contained in:
@@ -82,11 +82,6 @@ export class DayGroup {
|
||||
return this.viewerAssets[0]?.asset;
|
||||
}
|
||||
|
||||
getRandomAsset() {
|
||||
const random = Math.floor(Math.random() * this.viewerAssets.length);
|
||||
return this.viewerAssets[random];
|
||||
}
|
||||
|
||||
*assetsIterator(options: { startAsset?: TimelineAsset; direction?: Direction } = {}) {
|
||||
const isEarlier = (options?.direction ?? 'earlier') === 'earlier';
|
||||
let assetIndex = options?.startAsset
|
||||
|
||||
Reference in New Issue
Block a user