using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities
{
///
/// Class Trailer
///
public class Trailer : Video
{
///
/// Gets a value indicating whether this instance is local trailer.
///
/// true if this instance is local trailer; otherwise, false.
[IgnoreDataMember]
public bool IsLocalTrailer
{
get
{
// Local trailers are not part of children
return Parent == null;
}
}
///
/// Should be overridden to return the proper folder where metadata lives
///
/// The meta location.
[IgnoreDataMember]
public override string MetaLocation
{
get
{
if (!IsLocalTrailer)
{
return System.IO.Path.GetDirectoryName(Path);
}
return base.MetaLocation;
}
}
///
/// Needed because the resolver stops at the trailer folder and we find the video inside.
///
/// true if [use parent path to create resolve args]; otherwise, false.
protected override bool UseParentPathToCreateResolveArgs
{
get { return !IsLocalTrailer; }
}
}
}