Auto-tune channels can now carry per-content-source rotation weights (weighted
round-robin, e.g. 3x Show A / 1x Show B) and query corrections (exclude /
add-untagged), supplied at bulk-create time via an optional
`sources: [{sourceId, weight, excluded}]` on each AutoTunedChannelRequest.
Design (Option A, reuse #70): when a source is customized the channel is backed
by a system-owned MultiCollection of per-source SmartCollections carrying the
weights, with PlaybackOrder.WeightedShuffle -- the exact path
WeightedShuffleCollectionEnumerator already consumes. All-default weights keep
the #69 single-SmartCollection fair-share shape.
- Discriminators: TV -> live show_title:"X" (episodes carry no parent-show id in
the index); movies -> stable id:{mediaItemId}.
- Materialization is axis-dependent: TV materializes every base show individually
(un-weighted shows keep per-show fair-share) + a live remainder at weight 1;
MovieGenre materializes only touched movies + one count-weighted remainder.
- Remainder = (base) AND NOT (materialized union excluded) -- a partition.
- New nullable OwnedByChannelId on SmartCollection + MultiCollection
(dual-provider migration); owned rows are hidden from the collection lists and
cascade-cleaned on channel delete.
Tests: AutoTuneAxisMap query/partition units; DB-backed weighted-path handler
tests (TV materialize-all, movie count-remainder, exclusion, no-customization
fallback); delete-cleanup. Docs: decisions.md, domain-model.md, api-conventions.md;
OpenAPI trio regenerated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
1.0 KiB
C#
24 lines
1.0 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace ErsatzTV.Core.Domain;
|
|
|
|
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix")]
|
|
public class MultiCollection : IVersionedAggregate
|
|
{
|
|
public int Id { get; set; }
|
|
public int Version { get; set; }
|
|
public string Name { get; set; }
|
|
public List<Collection> Collections { get; set; }
|
|
public List<SmartCollection> SmartCollections { get; set; }
|
|
public List<MultiCollectionItem> MultiCollectionItems { get; set; }
|
|
public List<MultiCollectionSmartItem> MultiCollectionSmartItems { get; set; }
|
|
|
|
/// <summary>
|
|
/// When non-null, this multi collection is a system-owned artifact created for an auto-tune weighted
|
|
/// channel (#425): its members are the per-content-source SmartCollections that carry the rotation
|
|
/// weights. Hidden from the user-facing collection lists and deleted when the channel is deleted.
|
|
/// Null for every user-created multi collection.
|
|
/// </summary>
|
|
public int? OwnedByChannelId { get; set; }
|
|
}
|