You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Entities/Photo.cs

98 lines
2.5 KiB

#nullable disable
#pragma warning disable CS1591
using System.Text.Json.Serialization;
using MediaBrowser.Model.Drawing;
6 years ago
namespace MediaBrowser.Controller.Entities
{
public class Photo : BaseItem
{
[JsonIgnore]
public override bool SupportsLocalMetadata => false;
6 years ago
[JsonIgnore]
public override string MediaType => Model.Entities.MediaType.Photo;
6 years ago
[JsonIgnore]
public override Folder LatestItemsIndexContainer => AlbumEntity;
6 years ago
[JsonIgnore]
6 years ago
public PhotoAlbum AlbumEntity
{
get
{
var parents = GetParents();
foreach (var parent in parents)
{
if (parent is PhotoAlbum photoAlbum)
6 years ago
{
return photoAlbum;
}
}
6 years ago
return null;
}
}
public override bool CanDownload()
{
return true;
}
public override double GetDefaultPrimaryImageAspectRatio()
{
6 years ago
// REVIEW: @bond
if (Width != 0 && Height != 0)
6 years ago
{
double width = Width;
double height = Height;
6 years ago
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;
}
}
return width / height;
6 years ago
}
return base.GetDefaultPrimaryImageAspectRatio();
}
public string CameraMake { get; set; }
6 years ago
public string CameraModel { get; set; }
6 years ago
public string Software { get; set; }
6 years ago
public double? ExposureTime { get; set; }
6 years ago
public double? FocalLength { get; set; }
6 years ago
public ImageOrientation? Orientation { get; set; }
6 years ago
public double? Aperture { get; set; }
6 years ago
public double? ShutterSpeed { get; set; }
public double? Latitude { get; set; }
6 years ago
public double? Longitude { get; set; }
6 years ago
public double? Altitude { get; set; }
6 years ago
public int? IsoSpeedRating { get; set; }
}
}