aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BasePluginFolder.cs
blob: bf8040a9fe74fc53f5dd23940a9f15bdf4090058 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using MediaBrowser.Common.Extensions;
using System;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Controller.Entities
{
    /// <summary>
    /// Plugins derive from and export this class to create a folder that will appear in the root along
    /// with all the other actual physical folders in the system.
    /// </summary>
    public abstract class BasePluginFolder : Folder, ICollectionFolder, IByReferenceItem
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>The id.</value>
        public override Guid Id
        {
            get
            {
                // This doesn't get populated through the normal resolving process
                if (base.Id == Guid.Empty)
                {
                    base.Id = (Path ?? Name).GetMBId(GetType());
                }
                return base.Id;
            }
            set
            {
                base.Id = value;
            }
        }        
        
        /// <summary>
        /// Gets or sets the type of the location.
        /// </summary>
        /// <value>The type of the location.</value>
        public override LocationType LocationType
        {
            get
            {
                return LocationType.Virtual;
            }
        }


        /// <summary>
        /// We don't resolve normally so need to fill this in
        /// </summary>
        public override string DisplayMediaType
        {
            get
            {
                return "CollectionFolder"; // Plug-in folders are collection folders
            }
            set
            {
                base.DisplayMediaType = value;
            }
        }

    }
}