2016-03-27 21:11:27 +00:00
|
|
|
|
using MediaBrowser.Model.Drawing;
|
2016-10-25 19:02:04 +00:00
|
|
|
|
using MediaBrowser.Model.Serialization;
|
2014-02-13 05:11:54 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
{
|
2016-10-08 05:57:38 +00:00
|
|
|
|
public class Photo : BaseItem
|
2014-02-13 05:11:54 +00:00
|
|
|
|
{
|
2014-08-30 14:26:29 +00:00
|
|
|
|
[IgnoreDataMember]
|
2014-08-29 04:06:30 +00:00
|
|
|
|
public override bool SupportsLocalMetadata
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-30 14:26:29 +00:00
|
|
|
|
[IgnoreDataMember]
|
2014-02-13 05:11:54 +00:00
|
|
|
|
public override string MediaType
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Model.Entities.MediaType.Photo;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-08-28 01:27:46 +00:00
|
|
|
|
|
2014-08-29 04:06:30 +00:00
|
|
|
|
[IgnoreDataMember]
|
|
|
|
|
public override Folder LatestItemsIndexContainer
|
2014-08-30 14:26:29 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2016-10-11 06:46:59 +00:00
|
|
|
|
return AlbumEntity;
|
2014-08-30 14:26:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[IgnoreDataMember]
|
2016-10-11 06:46:59 +00:00
|
|
|
|
public PhotoAlbum AlbumEntity
|
2014-08-29 04:06:30 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2017-08-24 19:52:19 +00:00
|
|
|
|
var parents = GetParents();
|
|
|
|
|
foreach (var parent in parents)
|
|
|
|
|
{
|
|
|
|
|
var photoAlbum = parent as PhotoAlbum;
|
|
|
|
|
if (photoAlbum != null)
|
|
|
|
|
{
|
|
|
|
|
return photoAlbum;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
2014-08-29 04:06:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-24 16:46:17 +00:00
|
|
|
|
[IgnoreDataMember]
|
2016-08-13 05:49:00 +00:00
|
|
|
|
public override bool EnableRefreshOnDateModifiedChange
|
2016-07-24 16:46:17 +00:00
|
|
|
|
{
|
|
|
|
|
get { return true; }
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-11 05:37:07 +00:00
|
|
|
|
public override bool CanDownload()
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-22 20:33:01 +00:00
|
|
|
|
public override double? GetDefaultPrimaryImageAspectRatio()
|
|
|
|
|
{
|
|
|
|
|
if (Width.HasValue && Height.HasValue)
|
|
|
|
|
{
|
|
|
|
|
double width = Width.Value;
|
|
|
|
|
double height = Height.Value;
|
|
|
|
|
|
|
|
|
|
if (Orientation.HasValue)
|
|
|
|
|
{
|
|
|
|
|
switch (Orientation.Value)
|
|
|
|
|
{
|
|
|
|
|
case ImageOrientation.LeftBottom:
|
|
|
|
|
case ImageOrientation.LeftTop:
|
|
|
|
|
case ImageOrientation.RightBottom:
|
|
|
|
|
case ImageOrientation.RightTop:
|
|
|
|
|
var temp = height;
|
|
|
|
|
height = width;
|
|
|
|
|
width = temp;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
width /= Height.Value;
|
|
|
|
|
return width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.GetDefaultPrimaryImageAspectRatio();
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-28 01:27:46 +00:00
|
|
|
|
public int? Width { get; set; }
|
|
|
|
|
public int? Height { get; set; }
|
2014-08-29 00:49:25 +00:00
|
|
|
|
public string CameraMake { get; set; }
|
2014-08-28 01:27:46 +00:00
|
|
|
|
public string CameraModel { get; set; }
|
|
|
|
|
public string Software { get; set; }
|
|
|
|
|
public double? ExposureTime { get; set; }
|
|
|
|
|
public double? FocalLength { get; set; }
|
|
|
|
|
public ImageOrientation? Orientation { get; set; }
|
|
|
|
|
public double? Aperture { get; set; }
|
|
|
|
|
public double? ShutterSpeed { get; set; }
|
2014-08-29 04:06:30 +00:00
|
|
|
|
|
2014-08-30 14:26:29 +00:00
|
|
|
|
public double? Latitude { get; set; }
|
|
|
|
|
public double? Longitude { get; set; }
|
|
|
|
|
public double? Altitude { get; set; }
|
|
|
|
|
public int? IsoSpeedRating { get; set; }
|
2014-02-13 05:11:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|