aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/ICollectionFolder.cs
blob: f4544f173e5ef8c3403378f92f60859c4a0e3207 (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
using System;
using System.Collections.Generic;
using System.Linq;

namespace MediaBrowser.Controller.Entities
{
    /// <summary>
    /// This is just a marker interface to denote top level folders
    /// </summary>
    public interface ICollectionFolder
    {
        string CollectionType { get; }
        string Path { get; }
        string Name { get; }
        Guid Id { get; }
        IEnumerable<string> PhysicalLocations { get; }
    }

    public interface ISupportsUserSpecificView
    {
        bool EnableUserSpecificView { get; }
    }

    public static class CollectionFolderExtensions
    {
        public static string GetViewType(this ICollectionFolder folder, User user)
        {
            if (user.Configuration.PlainFolderViews.Contains(folder.Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
            {
                return null;
            }

            return folder.CollectionType;
        }
    }
}