mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
added recording progress bars
This commit is contained in:
parent
f4b890f163
commit
e9a5bb699e
@ -1,6 +1,5 @@
|
|||||||
using MediaBrowser.Controller.Dto;
|
using MediaBrowser.Controller.Dto;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.Audio;
|
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
@ -23,7 +23,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class BaseItem
|
/// Class BaseItem
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseItem : IHasProviderIds, IBaseItem, IHasImages, IHasUserData
|
public abstract class BaseItem : IHasProviderIds, ILibraryItem, IHasImages, IHasUserData
|
||||||
{
|
{
|
||||||
protected BaseItem()
|
protected BaseItem()
|
||||||
{
|
{
|
||||||
@ -504,28 +504,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <value>The people.</value>
|
/// <value>The people.</value>
|
||||||
public List<PersonInfo> People { get; set; }
|
public List<PersonInfo> People { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override this if you need to combine/collapse person information
|
|
||||||
/// </summary>
|
|
||||||
/// <value>All people.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public virtual IEnumerable<PersonInfo> AllPeople
|
|
||||||
{
|
|
||||||
get { return People; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public virtual IEnumerable<string> AllStudios
|
|
||||||
{
|
|
||||||
get { return Studios; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public virtual IEnumerable<string> AllGenres
|
|
||||||
{
|
|
||||||
get { return Genres; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the studios.
|
/// Gets or sets the studios.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -5,7 +5,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interface ILibraryItem
|
/// Interface ILibraryItem
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBaseItem
|
public interface ILibraryItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name.
|
/// Gets the name.
|
@ -122,48 +122,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||||||
return base.GetUserDataKey();
|
return base.GetUserDataKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override this if you need to combine/collapse person information
|
|
||||||
/// </summary>
|
|
||||||
/// <value>All people.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public override IEnumerable<PersonInfo> AllPeople
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (People == null) return Series != null ? Series.People : People;
|
|
||||||
return Series != null && Series.People != null ? People.Concat(Series.People) : base.AllPeople;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets all genres.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>All genres.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public override IEnumerable<string> AllGenres
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (Genres == null) return Series != null ? Series.Genres : Genres;
|
|
||||||
return Series != null && Series.Genres != null ? Genres.Concat(Series.Genres) : base.AllGenres;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets all studios.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>All studios.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public override IEnumerable<string> AllStudios
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (Studios == null) return Series != null ? Series.Studios : Studios;
|
|
||||||
return Series != null && Series.Studios != null ? Studios.Concat(Series.Studios) : base.AllStudios;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Our rating comes from our series
|
/// Our rating comes from our series
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<Compile Include="Entities\IHasTrailers.cs" />
|
<Compile Include="Entities\IHasTrailers.cs" />
|
||||||
<Compile Include="Entities\IHasUserData.cs" />
|
<Compile Include="Entities\IHasUserData.cs" />
|
||||||
<Compile Include="Entities\IItemByName.cs" />
|
<Compile Include="Entities\IItemByName.cs" />
|
||||||
<Compile Include="Entities\IBaseItem.cs" />
|
<Compile Include="Entities\ILibraryItem.cs" />
|
||||||
<Compile Include="Entities\ImageSourceInfo.cs" />
|
<Compile Include="Entities\ImageSourceInfo.cs" />
|
||||||
<Compile Include="Entities\LinkedChild.cs" />
|
<Compile Include="Entities\LinkedChild.cs" />
|
||||||
<Compile Include="Entities\MusicVideo.cs" />
|
<Compile Include="Entities\MusicVideo.cs" />
|
||||||
|
@ -108,6 +108,12 @@ namespace MediaBrowser.Model.LiveTv
|
|||||||
/// <value>The name of the status.</value>
|
/// <value>The name of the status.</value>
|
||||||
public string StatusName { get; set; }
|
public string StatusName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the completion percentage.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The completion percentage.</value>
|
||||||
|
public double? CompletionPercentage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Genre of the program.
|
/// Genre of the program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -231,6 +231,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (info.Status == RecordingStatus.InProgress)
|
||||||
|
{
|
||||||
|
var now = DateTime.UtcNow.Ticks;
|
||||||
|
var start = info.StartDate.Ticks;
|
||||||
|
var end = info.EndDate.Ticks;
|
||||||
|
|
||||||
|
var pct = now - start;
|
||||||
|
pct /= end;
|
||||||
|
pct *= 100;
|
||||||
|
dto.CompletionPercentage = pct;
|
||||||
|
}
|
||||||
|
|
||||||
var imageTag = GetImageTag(recording);
|
var imageTag = GetImageTag(recording);
|
||||||
|
|
||||||
if (imageTag.HasValue)
|
if (imageTag.HasValue)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user