aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/IHasTrailers.cs
blob: 3bdb9b64aa0778d2214ca03fbacc423cfbfa9797 (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
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Controller.Entities
{
    public interface IHasTrailers : IHasProviderIds
    {
        /// <summary>
        /// Gets or sets the remote trailers.
        /// </summary>
        /// <value>The remote trailers.</value>
        MediaUrl[] RemoteTrailers { get; set; }

        /// <summary>
        /// Gets or sets the local trailer ids.
        /// </summary>
        /// <value>The local trailer ids.</value>
        Guid[] LocalTrailerIds { get; set; }
        Guid[] RemoteTrailerIds { get; set; }
        Guid Id { get; set; }
    }

    public static class HasTrailerExtensions
    {
        /// <summary>
        /// Gets the trailer ids.
        /// </summary>
        /// <returns>List&lt;Guid&gt;.</returns>
        public static List<Guid> GetTrailerIds(this IHasTrailers item)
        {
            var list = item.LocalTrailerIds.ToList();
            list.AddRange(item.RemoteTrailerIds);
            return list;
        }

    }
}