// 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 sealed class MergedSearchHistory : MergedPlayableCollectionGroupBase, ISearchHistory { /// /// Initializes a new instance of the class. /// public MergedSearchHistory(IEnumerable searchHistories, MergedCollectionConfig config) : base(searchHistories, config) { } /// IReadOnlyList IMerged.Sources => StoredSources; /// public override bool Equals(ICoreSearchHistory? other) { // Search history should always be merged together. return true; } /// public override bool Equals(object? obj) => ReferenceEquals(this, obj) || (obj is ICoreSearchHistory other && Equals(other)); /// public override int GetHashCode() => PreferredSource.GetHashCode(); } }