mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
Initial check-in
This commit is contained in:
12
MediaBrowser.Model/Entities/Audio.cs
Normal file
12
MediaBrowser.Model/Entities/Audio.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class Audio : BaseItem
|
||||
{
|
||||
}
|
||||
}
|
||||
64
MediaBrowser.Model/Entities/BaseItem.cs
Normal file
64
MediaBrowser.Model/Entities/BaseItem.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public abstract class BaseItem
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string SortName { get; set; }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTime DateCreated { get; set; }
|
||||
public DateTime DateModified { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Folder Parent { get; set; }
|
||||
|
||||
public string PrimaryImagePath { get; set; }
|
||||
public string LogoImagePath { get; set; }
|
||||
public string ArtImagePath { get; set; }
|
||||
public string ThumbnailImagePath { get; set; }
|
||||
public string BannerImagePath { get; set; }
|
||||
|
||||
public IEnumerable<string> BackdropImagePaths { get; set; }
|
||||
|
||||
public string OfficialRating { get; set; }
|
||||
|
||||
public string CustomRating { get; set; }
|
||||
public string CustomPin { get; set; }
|
||||
|
||||
public string Overview { get; set; }
|
||||
public string Tagline { get; set; }
|
||||
|
||||
public IEnumerable<Person> People { get; set; }
|
||||
|
||||
public IEnumerable<string> Studios { get; set; }
|
||||
|
||||
public IEnumerable<string> Genres { get; set; }
|
||||
|
||||
public string DisplayMediaType { get; set; }
|
||||
|
||||
public float? UserRating { get; set; }
|
||||
public TimeSpan? RunTime { get; set; }
|
||||
|
||||
public string AspectRatio { get; set; }
|
||||
public int? ProductionYear { get; set; }
|
||||
|
||||
public IEnumerable<Video> LocalTrailers { get; set; }
|
||||
|
||||
public string TrailerUrl { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
96
MediaBrowser.Model/Entities/Folder.cs
Normal file
96
MediaBrowser.Model/Entities/Folder.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class Folder : BaseItem
|
||||
{
|
||||
public bool IsRoot { get; set; }
|
||||
|
||||
public bool IsVirtualFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return Parent != null && Parent.IsRoot;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public BaseItem[] Children { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IEnumerable<Folder> FolderChildren { get { return Children.OfType<Folder>(); } }
|
||||
|
||||
public Folder GetFolderByName(string name)
|
||||
{
|
||||
return FolderChildren.FirstOrDefault(f => System.IO.Path.GetFileName(f.Path).Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds an item by ID, recursively
|
||||
/// </summary>
|
||||
public BaseItem FindById(Guid id)
|
||||
{
|
||||
if (Id == id)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
foreach (BaseItem item in Children)
|
||||
{
|
||||
if (item.Id == id)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Folder folder in FolderChildren)
|
||||
{
|
||||
BaseItem item = folder.FindById(id);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds an item by path, recursively
|
||||
/// </summary>
|
||||
public BaseItem FindByPath(string path)
|
||||
{
|
||||
if (Path.Equals(path, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
foreach (BaseItem item in Children)
|
||||
{
|
||||
if (item.Path.Equals(path, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Folder folder in FolderChildren)
|
||||
{
|
||||
BaseItem item = folder.FindByPath(path);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
MediaBrowser.Model/Entities/Person.cs
Normal file
22
MediaBrowser.Model/Entities/Person.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class Person
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public PersonType PersonType { get; set; }
|
||||
}
|
||||
|
||||
public enum PersonType
|
||||
{
|
||||
Actor = 1,
|
||||
Director = 2,
|
||||
Writer = 3
|
||||
}
|
||||
}
|
||||
12
MediaBrowser.Model/Entities/PlaybackStatus.cs
Normal file
12
MediaBrowser.Model/Entities/PlaybackStatus.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class PlaybackStatus
|
||||
{
|
||||
}
|
||||
}
|
||||
42
MediaBrowser.Model/Entities/Video.cs
Normal file
42
MediaBrowser.Model/Entities/Video.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
public class Video : BaseItem
|
||||
{
|
||||
public VideoType VideoType { get; set; }
|
||||
|
||||
private IEnumerable<string> _Subtitles = new string[] { };
|
||||
public IEnumerable<string> Subtitles { get { return _Subtitles; } set { _Subtitles = value; } }
|
||||
|
||||
private IEnumerable<AudioStream> _AudioStreams = new AudioStream[] { };
|
||||
public IEnumerable<AudioStream> AudioStreams { get { return _AudioStreams; } set { _AudioStreams = value; } }
|
||||
|
||||
public int Height { get; set; }
|
||||
public int Width { get; set; }
|
||||
public string ScanType { get; set; }
|
||||
public string FrameRate { get; set; }
|
||||
public int VideoBitRate { get; set; }
|
||||
public string VideoCodec { get; set; }
|
||||
}
|
||||
|
||||
public class AudioStream
|
||||
{
|
||||
public string AudioFormat { get; set; }
|
||||
public string AudioProfile { get; set; }
|
||||
public string Language { get; set; }
|
||||
public int BitRate { get; set; }
|
||||
public int Channels { get; set; }
|
||||
}
|
||||
|
||||
public enum VideoType
|
||||
{
|
||||
VideoFile = 1,
|
||||
DVD = 2,
|
||||
BluRay = 3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user