Without this the weight is only reachable by editing the database, so the enumerator has nothing to distribute by. Weight is threaded through create and update (all four handler branches: add and update, plain and smart) and defaults to 1, so it is optional on the wire and /api/v1 stays additive under the freeze. It is returned on the read path too, which is load-bearing rather than symmetry: the update replaces the item list, so a client that GETs, edits a name, and PUTs back would silently reset every weight to the default if the GET didn't carry it. Weight edits ride the existing MultiCollection Version token, so If-Match/412 concurrency needs no new design. Regenerated v1.json + v1.d.ts + endpoint-index via update-openapi.sh and generate:api (never hand-edited). The spec picks up weight on both request and response models and WeightedShuffle in the PlaybackOrder enum; weight is emitted optional. Refs #70 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
483 B
C#
18 lines
483 B
C#
using ErsatzTV.Core;
|
|
using ErsatzTV.Core.Domain;
|
|
|
|
namespace ErsatzTV.Application.MediaCollections;
|
|
|
|
public record UpdateMultiCollectionItem(
|
|
int? CollectionId,
|
|
int? SmartCollectionId,
|
|
bool ScheduleAsGroup,
|
|
PlaybackOrder PlaybackOrder,
|
|
int Weight = 1);
|
|
|
|
public record UpdateMultiCollection(
|
|
int MultiCollectionId,
|
|
string Name,
|
|
List<UpdateMultiCollectionItem> Items,
|
|
Option<Seq<int>> ExpectedVersions = default) : IRequest<Either<BaseError, Unit>>;
|