···8080 pending = pending.filter((a) => a.kind === AssetKind.VIDEO);
8181 }
82828383+ // Apply limit (preserves natural DB order for asset selection)
8484+ if (options.limit > 0) {
8585+ pending = pending.slice(0, options.limit);
8686+ }
8787+8388 // Sort: photos first, then videos; within each group by size ascending.
8489 // This keeps fast-to-export photos together and large videos at the end.
8590 pending.sort((a, b) => {
8691 if (a.kind !== b.kind) return a.kind - b.kind; // PHOTO=0 before VIDEO=1
8792 return (a.originalFileSize ?? 0) - (b.originalFileSize ?? 0);
8893 });
8989-9090- // Apply limit
9191- if (options.limit > 0) {
9292- pending = pending.slice(0, options.limit);
9393- }
94949595 if (pending.length === 0) {
9696 log("\n Nothing to back up — all assets are current.\n");