aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.Database/Jellyfin.Database.Implementations/MatchCriteria/HasMediaStreamType.cs
blob: c1f6ab16a9db4d36a824b52fb3ae8eecf9d159e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter

using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities;

namespace Jellyfin.Database.Implementations.MatchCriteria;

/// <summary>
/// Matches folders containing descendants with a specific media stream type and language.
/// </summary>
/// <param name="StreamType">The type of media stream to match (Audio, Subtitle, etc.).</param>
/// <param name="Language">List of languages to match.</param>
/// <param name="IsExternal">If not null, filters by internal (false) or external (true) streams. Only applicable to subtitles.</param>
public sealed record HasMediaStreamType(
    MediaStreamTypeEntity StreamType,
    IReadOnlyCollection<string> Language,
    bool? IsExternal = null) : FolderMatchCriteria
{
    /// <summary>
    /// Initializes a new instance of the <see cref="HasMediaStreamType"/> class.
    /// </summary>
    /// <param name="StreamType">The type of media stream to match (Audio, Subtitle, etc.).</param>
    /// <param name="Language">The language to match.</param>
    /// <param name="IsExternal">If not null, filters by internal (false) or external (true) streams. Only applicable to subtitles.</param>
    public HasMediaStreamType(
        MediaStreamTypeEntity StreamType,
        string Language,
        bool? IsExternal = null) : this(StreamType, [Language], IsExternal)
    {
    }
}