[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

add chunk array function

FoxxMD (Mar 27, 2026, 4:08 PM UTC) dda06a08 eca64d68

+14
+14
src/core/DataUtils.ts
··· 7 7 import chalk from 'chalk'; 8 8 import clone from "clone"; 9 9 import ConsoleFormatter from "jsondiffpatch/formatters/console"; 10 + import assert from "node:assert"; 10 11 11 12 const console = new ConsoleFormatter(); 12 13 ··· 85 86 return Array.from(Array(size), (v,k) => gen(k)); 86 87 } 87 88 89 + /** Return an array in chunks 90 + * 91 + * https://stackoverflow.com/a/8495740/1469797 92 + */ 93 + export const chunkArray = <T>(chunkSize: number, arr: T[]): T[][] => { 94 + assert(chunkSize !== 0, 'chunkSize cannot be 0'); 95 + const chunks: T[][] = []; 96 + for (let i = 0; i < arr.length; i += chunkSize) { 97 + const chunk = arr.slice(i, i + chunkSize); 98 + chunks.push(chunk); 99 + } 100 + return chunks; 101 + }