aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/GameSystem.cs
blob: 63f830d256819dcddb02e6b23e3fe78e39612f88 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users;

namespace MediaBrowser.Controller.Entities
{
    /// <summary>
    /// Class GameSystem
    /// </summary>
    public class GameSystem : Folder, IHasLookupInfo<GameSystemInfo>
    {
        /// <summary>
        /// Return the id that should be used to key display prefs for this item.
        /// Default is based on the type for everything except actual generic folders.
        /// </summary>
        /// <value>The display prefs id.</value>
        [IgnoreDataMember]
        public override Guid DisplayPreferencesId => Id;

        [IgnoreDataMember]
        public override bool SupportsPlayedStatus => false;

        [IgnoreDataMember]
        public override bool SupportsInheritedParentImages => false;

        public override double GetDefaultPrimaryImageAspectRatio()
        {
            double value = 16;
            value /= 9;

            return value;
        }

        /// <summary>
        /// Gets or sets the game system.
        /// </summary>
        /// <value>The game system.</value>
        public string GameSystemName { get; set; }

        public override List<string> GetUserDataKeys()
        {
            var list = base.GetUserDataKeys();

            if (!string.IsNullOrEmpty(GameSystemName))
            {
                list.Insert(0, "GameSystem-" + GameSystemName);
            }
            return list;
        }

        protected override bool GetBlockUnratedValue(UserPolicy config)
        {
            // Don't block. Determine by game
            return false;
        }

        public override UnratedItem GetBlockUnratedType()
        {
            return UnratedItem.Game;
        }

        public GameSystemInfo GetLookupInfo()
        {
            var id = GetItemLookupInfo<GameSystemInfo>();

            id.Path = Path;

            return id;
        }

        [IgnoreDataMember]
        public override bool SupportsPeople => false;
    }
}