mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
add playback of in-progress recordings
This commit is contained in:
@@ -134,15 +134,5 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<BaseItemDto> GetChannelFolder(string userId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the channel item.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="destinationPath">The destination path.</param>
|
||||
/// <param name="progress">The progress.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task DownloadChannelItem(BaseItem item, string destinationPath, IProgress<double> progress, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool IsPhysicalRoot
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanDelete()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsAddingToPlaylist
|
||||
{
|
||||
get { return LocationType == LocationType.FileSystem && RunTimeTicks.HasValue; }
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
||||
@@ -37,6 +37,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
protected BaseItem()
|
||||
{
|
||||
ThemeSongIds = new List<Guid>();
|
||||
ThemeVideoIds = new List<Guid>();
|
||||
Keywords = new List<string>();
|
||||
Tags = new List<string>();
|
||||
Genres = new List<string>();
|
||||
@@ -45,6 +47,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
LockedFields = new List<MetadataFields>();
|
||||
ImageInfos = new List<ItemImageInfo>();
|
||||
InheritedTags = new List<string>();
|
||||
ProductionLocations = new List<string>();
|
||||
}
|
||||
|
||||
public static readonly char[] SlugReplaceChars = { '?', '/', '&' };
|
||||
@@ -65,6 +68,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
public static string ThemeSongFilename = "theme";
|
||||
public static string ThemeVideosFolderName = "backdrops";
|
||||
|
||||
public List<Guid> ThemeSongIds { get; set; }
|
||||
public List<Guid> ThemeVideoIds { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public string PreferredMetadataCountryCode { get; set; }
|
||||
[IgnoreDataMember]
|
||||
@@ -876,6 +882,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public List<string> Tags { get; set; }
|
||||
|
||||
public List<string> Keywords { get; set; }
|
||||
public List<string> ProductionLocations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the home page URL.
|
||||
@@ -991,7 +998,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Loads the theme songs.
|
||||
/// </summary>
|
||||
/// <returns>List{Audio.Audio}.</returns>
|
||||
private IEnumerable<Audio.Audio> LoadThemeSongs(List<FileSystemMetadata> fileSystemChildren, IDirectoryService directoryService)
|
||||
private static IEnumerable<Audio.Audio> LoadThemeSongs(List<FileSystemMetadata> fileSystemChildren, IDirectoryService directoryService)
|
||||
{
|
||||
var files = fileSystemChildren.Where(i => i.IsDirectory)
|
||||
.Where(i => string.Equals(i.Name, ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
@@ -1027,7 +1034,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Loads the video backdrops.
|
||||
/// </summary>
|
||||
/// <returns>List{Video}.</returns>
|
||||
private IEnumerable<Video> LoadThemeVideos(IEnumerable<FileSystemMetadata> fileSystemChildren, IDirectoryService directoryService)
|
||||
private static IEnumerable<Video> LoadThemeVideos(IEnumerable<FileSystemMetadata> fileSystemChildren, IDirectoryService directoryService)
|
||||
{
|
||||
var files = fileSystemChildren.Where(i => i.IsDirectory)
|
||||
.Where(i => string.Equals(i.Name, ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
@@ -1113,6 +1120,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual bool SupportsThemeMedia
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes owned items such as trailers, theme videos, special features, etc.
|
||||
/// Returns true or false indicating if changes were found.
|
||||
@@ -1131,14 +1144,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (LocationType == LocationType.FileSystem && GetParent() != null)
|
||||
{
|
||||
var hasThemeMedia = this as IHasThemeMedia;
|
||||
if (hasThemeMedia != null)
|
||||
if (SupportsThemeMedia)
|
||||
{
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
themeSongsChanged = await RefreshThemeSongs(hasThemeMedia, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
themeSongsChanged = await RefreshThemeSongs(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
themeVideosChanged = await RefreshThemeVideos(hasThemeMedia, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
themeVideosChanged = await RefreshThemeVideos(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1176,7 +1188,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return itemsChanged;
|
||||
}
|
||||
|
||||
private async Task<bool> RefreshThemeVideos(IHasThemeMedia item, MetadataRefreshOptions options, IEnumerable<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
private static async Task<bool> RefreshThemeVideos(BaseItem item, MetadataRefreshOptions options, IEnumerable<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
var newThemeVideos = LoadThemeVideos(fileSystemChildren, options.DirectoryService).ToList();
|
||||
|
||||
@@ -1207,7 +1219,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Refreshes the theme songs.
|
||||
/// </summary>
|
||||
private async Task<bool> RefreshThemeSongs(IHasThemeMedia item, MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
private static async Task<bool> RefreshThemeSongs(BaseItem item, MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
var newThemeSongs = LoadThemeSongs(fileSystemChildren, options.DirectoryService).ToList();
|
||||
var newThemeSongIds = newThemeSongs.Select(i => i.Id).ToList();
|
||||
|
||||
@@ -22,13 +22,18 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Class Folder
|
||||
/// </summary>
|
||||
public class Folder : BaseItem, IHasThemeMedia
|
||||
public class Folder : BaseItem
|
||||
{
|
||||
public static IUserManager UserManager { get; set; }
|
||||
public static IUserViewManager UserViewManager { get; set; }
|
||||
|
||||
public List<Guid> ThemeSongIds { get; set; }
|
||||
public List<Guid> ThemeVideoIds { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is root.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
|
||||
public bool IsRoot { get; set; }
|
||||
|
||||
public virtual List<LinkedChild> LinkedChildren { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public DateTime? DateLastMediaAdded { get; set; }
|
||||
@@ -36,9 +41,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
public Folder()
|
||||
{
|
||||
LinkedChildren = new List<LinkedChild>();
|
||||
}
|
||||
|
||||
ThemeSongIds = new List<Guid>();
|
||||
ThemeVideoIds = new List<Guid>();
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsThemeMedia
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
@@ -47,6 +55,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual bool IsPhysicalRoot
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is folder.
|
||||
/// </summary>
|
||||
@@ -117,19 +131,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is physical root.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is physical root; otherwise, <c>false</c>.</value>
|
||||
public bool IsPhysicalRoot { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is root.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
|
||||
public bool IsRoot { get; set; }
|
||||
|
||||
public virtual List<LinkedChild> LinkedChildren { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
protected virtual bool SupportsShortcutChildren
|
||||
{
|
||||
@@ -178,8 +179,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
item.SetParent(null);
|
||||
}
|
||||
|
||||
#region Indexing
|
||||
|
||||
/// <summary>
|
||||
/// Returns the valid set of index by options for this folder type.
|
||||
/// Override or extend to modify.
|
||||
@@ -207,8 +206,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
get { return GetIndexByOptions(); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual children.
|
||||
/// </summary>
|
||||
|
||||
@@ -8,11 +8,8 @@ using System.Runtime.Serialization;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class Game : BaseItem, IHasTrailers, IHasThemeMedia, IHasScreenshots, ISupportsPlaceHolders, IHasLookupInfo<GameInfo>
|
||||
public class Game : BaseItem, IHasTrailers, IHasScreenshots, ISupportsPlaceHolders, IHasLookupInfo<GameInfo>
|
||||
{
|
||||
public List<Guid> ThemeSongIds { get; set; }
|
||||
public List<Guid> ThemeVideoIds { get; set; }
|
||||
|
||||
public Game()
|
||||
{
|
||||
MultiPartGameFiles = new List<string>();
|
||||
@@ -39,6 +36,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsThemeMedia
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the remote trailers.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IHasThemeMedia
|
||||
/// </summary>
|
||||
public interface IHasThemeMedia
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the theme song ids.
|
||||
/// </summary>
|
||||
/// <value>The theme song ids.</value>
|
||||
List<Guid> ThemeSongIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the theme video ids.
|
||||
/// </summary>
|
||||
/// <value>The theme video ids.</value>
|
||||
List<Guid> ThemeVideoIds { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -165,6 +165,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case ItemFields.ProductionLocations:
|
||||
case ItemFields.Keywords:
|
||||
case ItemFields.Taglines:
|
||||
case ItemFields.ShortOverview:
|
||||
|
||||
@@ -15,21 +15,16 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
/// <summary>
|
||||
/// Class Movie
|
||||
/// </summary>
|
||||
public class Movie : Video, IHasCriticRating, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasThemeMedia, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
|
||||
public class Movie : Video, IHasCriticRating, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
|
||||
{
|
||||
public List<Guid> SpecialFeatureIds { get; set; }
|
||||
|
||||
public List<Guid> ThemeSongIds { get; set; }
|
||||
public List<Guid> ThemeVideoIds { get; set; }
|
||||
|
||||
public Movie()
|
||||
{
|
||||
SpecialFeatureIds = new List<Guid>();
|
||||
RemoteTrailers = new List<MediaUrl>();
|
||||
LocalTrailerIds = new List<Guid>();
|
||||
RemoteTrailerIds = new List<Guid>();
|
||||
ThemeSongIds = new List<Guid>();
|
||||
ThemeVideoIds = new List<Guid>();
|
||||
Taglines = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
@@ -154,8 +154,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
|
||||
|
||||
var id = Guid.NewGuid().ToString("N");
|
||||
|
||||
var items = GetEpisodes(user).Where(filter);
|
||||
|
||||
var result = PostFilterAndSort(items, query, false, false);
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
public class UserView : Folder
|
||||
{
|
||||
public string ViewType { get; set; }
|
||||
public Guid ParentId { get; set; }
|
||||
public Guid DisplayParentId { get; set; }
|
||||
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
@@ -1497,13 +1497,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var filterValue = query.HasThemeSong.Value;
|
||||
|
||||
var themeCount = 0;
|
||||
var iHasThemeMedia = item as IHasThemeMedia;
|
||||
|
||||
if (iHasThemeMedia != null)
|
||||
{
|
||||
themeCount = iHasThemeMedia.ThemeSongIds.Count;
|
||||
}
|
||||
var themeCount = item.ThemeSongIds.Count;
|
||||
var ok = filterValue ? themeCount > 0 : themeCount == 0;
|
||||
|
||||
if (!ok)
|
||||
@@ -1516,13 +1510,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var filterValue = query.HasThemeVideo.Value;
|
||||
|
||||
var themeCount = 0;
|
||||
var iHasThemeMedia = item as IHasThemeMedia;
|
||||
|
||||
if (iHasThemeMedia != null)
|
||||
{
|
||||
themeCount = iHasThemeMedia.ThemeVideoIds.Count;
|
||||
}
|
||||
var themeCount = item.ThemeVideoIds.Count;
|
||||
var ok = filterValue ? themeCount > 0 : themeCount == 0;
|
||||
|
||||
if (!ok)
|
||||
|
||||
@@ -63,6 +63,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsThemeMedia
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public int? TotalBitrate { get; set; }
|
||||
public ExtraType? ExtraType { get; set; }
|
||||
|
||||
@@ -164,7 +170,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsAddingToPlaylist
|
||||
{
|
||||
get { return LocationType == LocationType.FileSystem && RunTimeTicks.HasValue; }
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
||||
@@ -301,18 +301,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// <summary>
|
||||
/// Gets the recording media sources.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<IEnumerable<MediaSourceInfo>>.</returns>
|
||||
Task<IEnumerable<MediaSourceInfo>> GetRecordingMediaSources(string id, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<MediaSourceInfo>> GetRecordingMediaSources(IHasMediaSources item, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel media sources.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task<IEnumerable<MediaSourceInfo>>.</returns>
|
||||
Task<IEnumerable<MediaSourceInfo>> GetChannelMediaSources(string id, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<MediaSourceInfo>> GetChannelMediaSources(IHasMediaSources item, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the information to recording dto.
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
bool CanDelete(User user);
|
||||
|
||||
string SeriesTimerId { get; set; }
|
||||
string TimerId { get; set; }
|
||||
RecordingStatus Status { get; set; }
|
||||
DateTime? EndDate { get; set; }
|
||||
DateTime DateLastSaved { get; set; }
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
[IgnoreDataMember]
|
||||
public bool IsSeries { get; set; }
|
||||
public string SeriesTimerId { get; set; }
|
||||
public string TimerId { get; set; }
|
||||
[IgnoreDataMember]
|
||||
public DateTime StartDate { get; set; }
|
||||
public RecordingStatus Status { get; set; }
|
||||
@@ -112,7 +113,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
|
||||
public override bool CanDelete()
|
||||
{
|
||||
return true;
|
||||
return Status == RecordingStatus.Completed;
|
||||
}
|
||||
|
||||
public override bool IsAuthorizedToDelete(User user)
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
[IgnoreDataMember]
|
||||
public bool IsSeries { get; set; }
|
||||
public string SeriesTimerId { get; set; }
|
||||
public string TimerId { get; set; }
|
||||
[IgnoreDataMember]
|
||||
public DateTime StartDate { get; set; }
|
||||
public RecordingStatus Status { get; set; }
|
||||
@@ -111,7 +112,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
|
||||
public override bool CanDelete()
|
||||
{
|
||||
return true;
|
||||
return Status == RecordingStatus.Completed;
|
||||
}
|
||||
|
||||
public override bool IsAuthorizedToDelete(User user)
|
||||
|
||||
@@ -149,7 +149,6 @@
|
||||
<Compile Include="Entities\IHasShortOverview.cs" />
|
||||
<Compile Include="Entities\IHasSpecialFeatures.cs" />
|
||||
<Compile Include="Entities\IHasStartDate.cs" />
|
||||
<Compile Include="Entities\IHasThemeMedia.cs" />
|
||||
<Compile Include="Entities\IHasTrailers.cs" />
|
||||
<Compile Include="Entities\IHasUserData.cs" />
|
||||
<Compile Include="Entities\IHiddenFromDisplay.cs" />
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
var person = item as Person;
|
||||
if (person != null)
|
||||
{
|
||||
person.PlaceOfBirth = val;
|
||||
person.ProductionLocations = new List<string> { val };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,7 +790,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
{
|
||||
string readerName = reader.Name;
|
||||
string providerIdValue;
|
||||
if (_validProviderIds.TryGetValue(readerName, out providerIdValue))
|
||||
|
||||
Reference in New Issue
Block a user