diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 20:33:05 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-20 20:33:05 -0500 |
| commit | 767cdc1f6f6a63ce997fc9476911e2c361f9d402 (patch) | |
| tree | 49add55976f895441167c66cfa95e5c7688d18ce /MediaBrowser.Controller/Entities/Trailer.cs | |
| parent | 845554722efaed872948a9e0f7202e3ef52f1b6e (diff) | |
Pushing missing changes
Diffstat (limited to 'MediaBrowser.Controller/Entities/Trailer.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Trailer.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs new file mode 100644 index 0000000000..ed20d05b04 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -0,0 +1,51 @@ +using System.Runtime.Serialization; + +namespace MediaBrowser.Controller.Entities +{ + /// <summary> + /// Class Trailer + /// </summary> + public class Trailer : Video + { + /// <summary> + /// Gets a value indicating whether this instance is local trailer. + /// </summary> + /// <value><c>true</c> if this instance is local trailer; otherwise, <c>false</c>.</value> + [IgnoreDataMember] + public bool IsLocalTrailer + { + get + { + // Local trailers are not part of children + return Parent == null; + } + } + + /// <summary> + /// Should be overridden to return the proper folder where metadata lives + /// </summary> + /// <value>The meta location.</value> + [IgnoreDataMember] + public override string MetaLocation + { + get + { + if (!IsLocalTrailer) + { + return System.IO.Path.GetDirectoryName(Path); + } + + return base.MetaLocation; + } + } + + /// <summary> + /// Needed because the resolver stops at the trailer folder and we find the video inside. + /// </summary> + /// <value><c>true</c> if [use parent path to create resolve args]; otherwise, <c>false</c>.</value> + protected override bool UseParentPathToCreateResolveArgs + { + get { return !IsLocalTrailer; } + } + } +} |
