// Copyright (c) Arlo Godfrey. All Rights Reserved. // Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms. // See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information. using System.Collections.Generic; using StrixMusic.Sdk.AppModels; using StrixMusic.Sdk.CoreModels; namespace StrixMusic.Sdk.AdapterModels { /// /// A concrete class that merges multiple . /// public class MergedRecentlyPlayed : MergedPlayableCollectionGroupBase, IRecentlyPlayed { /// /// Initializes a new instance of the class. /// public MergedRecentlyPlayed(IEnumerable sources, MergedCollectionConfig config) : base(sources, config) { } /// IReadOnlyList IMerged.Sources => StoredSources; /// public override bool Equals(ICoreRecentlyPlayed? other) => other?.Name == Name; /// public override bool Equals(object? obj) => ReferenceEquals(this, obj) || (obj is ICoreRecentlyPlayed other && Equals(other)); /// public override int GetHashCode() => PreferredSource.GetHashCode(); } }