aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs3
-rw-r--r--MediaBrowser.Controller/Authentication/IPasswordResetProvider.cs3
-rw-r--r--MediaBrowser.Controller/Channels/ChannelItemInfo.cs11
-rw-r--r--MediaBrowser.Controller/Collections/CollectionCreationOptions.cs1
-rw-r--r--MediaBrowser.Controller/Drawing/ImageHelper.cs1
-rw-r--r--MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs7
-rw-r--r--MediaBrowser.Controller/Dto/DtoOptions.cs6
-rw-r--r--MediaBrowser.Controller/Entities/AggregateFolder.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicArtist.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicGenre.cs2
-rw-r--r--MediaBrowser.Controller/Entities/AudioBook.cs2
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs16
-rw-r--r--MediaBrowser.Controller/Entities/CollectionFolder.cs3
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs21
-rw-r--r--MediaBrowser.Controller/Entities/Genre.cs2
-rw-r--r--MediaBrowser.Controller/Entities/IHasMediaSources.cs2
-rw-r--r--MediaBrowser.Controller/Entities/IHasProgramAttributes.cs8
-rw-r--r--MediaBrowser.Controller/Entities/IHasSeries.cs3
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs103
-rw-r--r--MediaBrowser.Controller/Entities/LinkedChild.cs3
-rw-r--r--MediaBrowser.Controller/Entities/PeopleHelper.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Person.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Photo.cs11
-rw-r--r--MediaBrowser.Controller/Entities/Share.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Studio.cs2
-rw-r--r--MediaBrowser.Controller/Entities/TV/Episode.cs6
-rw-r--r--MediaBrowser.Controller/Entities/TV/Season.cs1
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs2
-rw-r--r--MediaBrowser.Controller/Entities/UserItemData.cs1
-rw-r--r--MediaBrowser.Controller/Entities/UserViewBuilder.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Video.cs10
-rw-r--r--MediaBrowser.Controller/Entities/Year.cs1
-rw-r--r--MediaBrowser.Controller/IO/FileData.cs3
-rw-r--r--MediaBrowser.Controller/Library/DeleteOptions.cs1
-rw-r--r--MediaBrowser.Controller/Library/ILiveStream.cs5
-rw-r--r--MediaBrowser.Controller/Library/ItemResolveArgs.cs2
-rw-r--r--MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs9
-rw-r--r--MediaBrowser.Controller/Library/Profiler.cs1
-rw-r--r--MediaBrowser.Controller/Library/TVUtils.cs1
-rw-r--r--MediaBrowser.Controller/LiveTv/ChannelInfo.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/ITunerHost.cs1
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvConflictException.cs1
-rw-r--r--MediaBrowser.Controller/LiveTv/ProgramInfo.cs1
-rw-r--r--MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs1
-rw-r--r--MediaBrowser.Controller/LiveTv/TimerInfo.cs7
-rw-r--r--MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs3
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs288
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs8
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs10
-rw-r--r--MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs17
-rw-r--r--MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs4
-rw-r--r--MediaBrowser.Controller/Net/AuthenticatedAttribute.cs3
-rw-r--r--MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs2
-rw-r--r--MediaBrowser.Controller/Net/StaticResultOptions.cs5
-rw-r--r--MediaBrowser.Controller/Providers/ImageRefreshOptions.cs2
-rw-r--r--MediaBrowser.Controller/Providers/MetadataResult.cs1
-rw-r--r--MediaBrowser.Controller/Resolvers/IItemResolver.cs1
-rw-r--r--MediaBrowser.Controller/Security/AuthenticationInfo.cs1
-rw-r--r--MediaBrowser.Controller/Session/AuthenticationRequest.cs8
-rw-r--r--MediaBrowser.Controller/Session/SessionInfo.cs5
-rw-r--r--MediaBrowser.Controller/Subtitles/SubtitleResponse.cs3
-rw-r--r--MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs12
-rw-r--r--MediaBrowser.Controller/Sync/SyncedFileInfo.cs1
-rw-r--r--MediaBrowser.Controller/SyncPlay/GroupInfo.cs1
67 files changed, 608 insertions, 48 deletions
diff --git a/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs b/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs
index c0324a3841..b10233c71c 100644
--- a/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs
+++ b/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs
@@ -7,7 +7,9 @@ namespace MediaBrowser.Controller.Authentication
public interface IAuthenticationProvider
{
string Name { get; }
+
bool IsEnabled { get; }
+
Task<ProviderAuthenticationResult> Authenticate(string username, string password);
bool HasPassword(User user);
Task ChangePassword(User user, string newPassword);
@@ -28,6 +30,7 @@ namespace MediaBrowser.Controller.Authentication
public class ProviderAuthenticationResult
{
public string Username { get; set; }
+
public string DisplayName { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Authentication/IPasswordResetProvider.cs b/MediaBrowser.Controller/Authentication/IPasswordResetProvider.cs
index d9b814f694..693df80ac2 100644
--- a/MediaBrowser.Controller/Authentication/IPasswordResetProvider.cs
+++ b/MediaBrowser.Controller/Authentication/IPasswordResetProvider.cs
@@ -8,7 +8,9 @@ namespace MediaBrowser.Controller.Authentication
public interface IPasswordResetProvider
{
string Name { get; }
+
bool IsEnabled { get; }
+
Task<ForgotPasswordResult> StartForgotPasswordProcess(User user, bool isInNetwork);
Task<PinRedeemResult> RedeemPasswordResetPin(string pin);
}
@@ -16,6 +18,7 @@ namespace MediaBrowser.Controller.Authentication
public class PasswordPinCreationResult
{
public string PinFile { get; set; }
+
public DateTime ExpirationDate { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
index aff68883b8..00d4d9cb3e 100644
--- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
+++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs
@@ -24,7 +24,9 @@ namespace MediaBrowser.Controller.Channels
public string Overview { get; set; }
public List<string> Genres { get; set; }
+
public List<string> Studios { get; set; }
+
public List<string> Tags { get; set; }
public List<PersonInfo> People { get; set; }
@@ -34,26 +36,33 @@ namespace MediaBrowser.Controller.Channels
public long? RunTimeTicks { get; set; }
public string ImageUrl { get; set; }
+
public string OriginalTitle { get; set; }
public ChannelMediaType MediaType { get; set; }
+
public ChannelFolderType FolderType { get; set; }
public ChannelMediaContentType ContentType { get; set; }
+
public ExtraType ExtraType { get; set; }
+
public List<TrailerType> TrailerTypes { get; set; }
public Dictionary<string, string> ProviderIds { get; set; }
public DateTime? PremiereDate { get; set; }
+
public int? ProductionYear { get; set; }
public DateTime? DateCreated { get; set; }
public DateTime? StartDate { get; set; }
+
public DateTime? EndDate { get; set; }
public int? IndexNumber { get; set; }
+
public int? ParentIndexNumber { get; set; }
public List<MediaSourceInfo> MediaSources { get; set; }
@@ -63,7 +72,9 @@ namespace MediaBrowser.Controller.Channels
public List<string> Artists { get; set; }
public List<string> AlbumArtists { get; set; }
+
public bool IsLiveStream { get; set; }
+
public string Etag { get; set; }
public ChannelItemInfo()
diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
index 51fe4ce290..1e7549d2bc 100644
--- a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
+++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs
@@ -15,6 +15,7 @@ namespace MediaBrowser.Controller.Collections
public Dictionary<string, string> ProviderIds { get; set; }
public string[] ItemIdList { get; set; }
+
public Guid[] UserIds { get; set; }
public CollectionCreationOptions()
diff --git a/MediaBrowser.Controller/Drawing/ImageHelper.cs b/MediaBrowser.Controller/Drawing/ImageHelper.cs
index c87a248b58..e1273fe7f3 100644
--- a/MediaBrowser.Controller/Drawing/ImageHelper.cs
+++ b/MediaBrowser.Controller/Drawing/ImageHelper.cs
@@ -16,6 +16,7 @@ namespace MediaBrowser.Controller.Drawing
return newSize;
}
+
return GetSizeEstimate(options);
}
diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
index 870e0278e4..31d2c1bd49 100644
--- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
+++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
@@ -15,6 +15,7 @@ namespace MediaBrowser.Controller.Drawing
}
public Guid ItemId { get; set; }
+
public BaseItem Item { get; set; }
public ItemImageInfo Image { get; set; }
@@ -38,12 +39,15 @@ namespace MediaBrowser.Controller.Drawing
public bool AddPlayedIndicator { get; set; }
public int? UnplayedCount { get; set; }
+
public int? Blur { get; set; }
public double PercentPlayed { get; set; }
public string BackgroundColor { get; set; }
+
public string ForegroundLayer { get; set; }
+
public bool RequiresAutoOrientation { get; set; }
private bool HasDefaultOptions(string originalImagePath)
@@ -73,14 +77,17 @@ namespace MediaBrowser.Controller.Drawing
{
return false;
}
+
if (Height.HasValue && !sizeValue.Height.Equals(Height.Value))
{
return false;
}
+
if (MaxWidth.HasValue && sizeValue.Width > MaxWidth.Value)
{
return false;
}
+
if (MaxHeight.HasValue && sizeValue.Height > MaxHeight.Value)
{
return false;
diff --git a/MediaBrowser.Controller/Dto/DtoOptions.cs b/MediaBrowser.Controller/Dto/DtoOptions.cs
index cdaf95f5ce..cf301f1e44 100644
--- a/MediaBrowser.Controller/Dto/DtoOptions.cs
+++ b/MediaBrowser.Controller/Dto/DtoOptions.cs
@@ -14,11 +14,17 @@ namespace MediaBrowser.Controller.Dto
};
public ItemFields[] Fields { get; set; }
+
public ImageType[] ImageTypes { get; set; }
+
public int ImageTypeLimit { get; set; }
+
public bool EnableImages { get; set; }
+
public bool AddProgramRecordingInfo { get; set; }
+
public bool EnableUserData { get; set; }
+
public bool AddCurrentProgram { get; set; }
public DtoOptions()
diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs
index 67858b8446..e1c800e619 100644
--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs
+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs
@@ -195,6 +195,7 @@ namespace MediaBrowser.Controller.Entities
return child;
}
}
+
return null;
}
}
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs
index b3e241a15a..98f802b5d5 100644
--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs
+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs
@@ -93,6 +93,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey;
}
+
songKey += Name;
if (!string.IsNullOrEmpty(Album))
@@ -117,6 +118,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
return UnratedItem.Music;
}
+
return base.GetBlockUnratedType();
}
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index e563f398b8..5a1ddeecef 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -56,6 +56,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
return LibraryManager.GetArtist(name, options);
}
+
return null;
}
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
index 56c3c38dcd..ea5c41caa4 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
@@ -135,6 +135,7 @@ namespace MediaBrowser.Controller.Entities.Audio
list.Add("Artist-" + (item.Name ?? string.Empty).RemoveDiacritics());
return list;
}
+
public override string CreatePresentationUniqueKey()
{
return "Artist-" + (Name ?? string.Empty).RemoveDiacritics();
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
index 49a4cbae26..4f6aa07767 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
@@ -18,6 +18,7 @@ namespace MediaBrowser.Controller.Entities.Audio
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list;
}
+
public override string CreatePresentationUniqueKey()
{
return GetUserDataKeys()[0];
@@ -94,6 +95,7 @@ namespace MediaBrowser.Controller.Entities.Audio
Logger.LogDebug("{0} path has changed from {1} to {2}", GetType().Name, Path, newPath);
return true;
}
+
return base.RequiresRefresh();
}
diff --git a/MediaBrowser.Controller/Entities/AudioBook.cs b/MediaBrowser.Controller/Entities/AudioBook.cs
index 4adaf4c6e6..11ff8a2573 100644
--- a/MediaBrowser.Controller/Entities/AudioBook.cs
+++ b/MediaBrowser.Controller/Entities/AudioBook.cs
@@ -24,10 +24,12 @@ namespace MediaBrowser.Controller.Entities
{
return SeriesName;
}
+
public string FindSeriesName()
{
return SeriesName;
}
+
public string FindSeriesPresentationUniqueKey()
{
return SeriesPresentationUniqueKey;
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index ecbb83d076..d76409afc8 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -108,6 +108,7 @@ namespace MediaBrowser.Controller.Entities
public string PreferredMetadataLanguage { get; set; }
public long? Size { get; set; }
+
public string Container { get; set; }
[JsonIgnore]
@@ -448,6 +449,7 @@ namespace MediaBrowser.Controller.Entities
// hack alert
return true;
}
+
if (SourceType == SourceType.Channel)
{
// hack alert
@@ -559,15 +561,25 @@ namespace MediaBrowser.Controller.Entities
/// The logger.
/// </summary>
public static ILoggerFactory LoggerFactory { get; set; }
+
public static ILogger<BaseItem> Logger { get; set; }
+
public static ILibraryManager LibraryManager { get; set; }
+
public static IServerConfigurationManager ConfigurationManager { get; set; }
+
public static IProviderManager ProviderManager { get; set; }
+
public static ILocalizationManager LocalizationManager { get; set; }
+
public static IItemRepository ItemRepository { get; set; }
+
public static IFileSystem FileSystem { get; set; }
+
public static IUserDataManager UserDataManager { get; set; }
+
public static IChannelManager ChannelManager { get; set; }
+
public static IMediaSourceManager MediaSourceManager { get; set; }
/// <summary>
@@ -644,8 +656,10 @@ namespace MediaBrowser.Controller.Entities
_sortName = CreateSortName();
}
}
+
return _sortName;
}
+
set => _sortName = value;
}
@@ -814,6 +828,7 @@ namespace MediaBrowser.Controller.Entities
return item;
}
}
+
return null;
}
@@ -837,6 +852,7 @@ namespace MediaBrowser.Controller.Entities
{
return null;
}
+
return LibraryManager.GetItemById(id);
}
}
diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs
index 35a6cef955..5c02bd2b54 100644
--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs
+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs
@@ -23,7 +23,9 @@ namespace MediaBrowser.Controller.Entities
public class CollectionFolder : Folder, ICollectionFolder
{
public static IXmlSerializer XmlSerializer { get; set; }
+
public static IJsonSerializer JsonSerializer { get; set; }
+
public static IServerApplicationHost ApplicationHost { get; set; }
public CollectionFolder()
@@ -155,6 +157,7 @@ namespace MediaBrowser.Controller.Entities
}
public string[] PhysicalLocationsList { get; set; }
+
public Guid[] PhysicalFolderIds { get; set; }
protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService)
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 34e5d78e7a..d4fa8f9b30 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -126,10 +126,12 @@ namespace MediaBrowser.Controller.Entities
{
return false;
}
+
if (this is UserView)
{
return false;
}
+
return true;
}
@@ -156,6 +158,7 @@ namespace MediaBrowser.Controller.Entities
{
item.DateCreated = DateTime.UtcNow;
}
+
if (item.DateModified == DateTime.MinValue)
{
item.DateModified = DateTime.UtcNow;
@@ -501,6 +504,7 @@ namespace MediaBrowser.Controller.Entities
{
await series.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
}
+
await container.RefreshAllMetadata(refreshOptions, progress, cancellationToken).ConfigureAwait(false);
}
@@ -939,6 +943,7 @@ namespace MediaBrowser.Controller.Entities
{
items = items.Where(i => string.Compare(query.NameStartsWithOrGreater, i.SortName, StringComparison.CurrentCultureIgnoreCase) < 1);
}
+
if (!string.IsNullOrEmpty(query.NameStartsWith))
{
items = items.Where(i => i.SortName.StartsWith(query.NameStartsWith, StringComparison.OrdinalIgnoreCase));
@@ -989,18 +994,22 @@ namespace MediaBrowser.Controller.Entities
{
return false;
}
+
if (queryParent is Series)
{
return false;
}
+
if (queryParent is Season)
{
return false;
}
+
if (queryParent is MusicAlbum)
{
return false;
}
+
if (queryParent is MusicArtist)
{
return false;
@@ -1030,22 +1039,27 @@ namespace MediaBrowser.Controller.Entities
{
return false;
}
+
if (request.IsFavoriteOrLiked.HasValue)
{
return false;
}
+
if (request.IsLiked.HasValue)
{
return false;
}
+
if (request.IsPlayed.HasValue)
{
return false;
}
+
if (request.IsResumable.HasValue)
{
return false;
}
+
if (request.IsFolder.HasValue)
{
return false;
@@ -1391,6 +1405,7 @@ namespace MediaBrowser.Controller.Entities
list.Add(child);
}
}
+
return list;
}
@@ -1413,6 +1428,7 @@ namespace MediaBrowser.Controller.Entities
return true;
}
}
+
return false;
}
@@ -1665,22 +1681,27 @@ namespace MediaBrowser.Controller.Entities
{
return false;
}
+
if (this is UserView)
{
return false;
}
+
if (this is UserRootFolder)
{
return false;
}
+
if (this is Channel)
{
return false;
}
+
if (SourceType != SourceType.Library)
{
return false;
}
+
var iItemByName = this as IItemByName;
if (iItemByName != null)
{
diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs
index 852cf46846..437def532e 100644
--- a/MediaBrowser.Controller/Entities/Genre.cs
+++ b/MediaBrowser.Controller/Entities/Genre.cs
@@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Entities
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list;
}
+
public override string CreatePresentationUniqueKey()
{
return GetUserDataKeys()[0];
@@ -92,6 +93,7 @@ namespace MediaBrowser.Controller.Entities
Logger.LogDebug("{0} path has changed from {1} to {2}", GetType().Name, Path, newPath);
return true;
}
+
return base.RequiresRefresh();
}
diff --git a/MediaBrowser.Controller/Entities/IHasMediaSources.cs b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
index 4635b90629..213c0a7946 100644
--- a/MediaBrowser.Controller/Entities/IHasMediaSources.cs
+++ b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
@@ -13,7 +13,9 @@ namespace MediaBrowser.Controller.Entities
List<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution);
List<MediaStream> GetMediaStreams();
Guid Id { get; set; }
+
long? RunTimeTicks { get; set; }
+
string Path { get; }
}
}
diff --git a/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs
index 777b408287..fd1c19c977 100644
--- a/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs
+++ b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs
@@ -5,13 +5,21 @@ namespace MediaBrowser.Controller.Entities
public interface IHasProgramAttributes
{
bool IsMovie { get; set; }
+
bool IsSports { get; }
+
bool IsNews { get; }
+
bool IsKids { get; }
+
bool IsRepeat { get; set; }
+
bool IsSeries { get; set; }
+
ProgramAudio? Audio { get; set; }
+
string EpisodeTitle { get; set; }
+
string ServiceName { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Entities/IHasSeries.cs b/MediaBrowser.Controller/Entities/IHasSeries.cs
index 7da53f730a..475a2ab856 100644
--- a/MediaBrowser.Controller/Entities/IHasSeries.cs
+++ b/MediaBrowser.Controller/Entities/IHasSeries.cs
@@ -9,11 +9,14 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <value>The name of the series.</value>
string SeriesName { get; set; }
+
string FindSeriesName();
string FindSeriesSortName();
Guid SeriesId { get; set; }
+
Guid FindSeriesId();
string SeriesPresentationUniqueKey { get; set; }
+
string FindSeriesPresentationUniqueKey();
}
}
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index 496bee857e..466cda67cb 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -21,100 +21,167 @@ namespace MediaBrowser.Controller.Entities
public BaseItem SimilarTo { get; set; }
public bool? IsFolder { get; set; }
+
public bool? IsFavorite { get; set; }
+
public bool? IsFavoriteOrLiked { get; set; }
+
public bool? IsLiked { get; set; }
+
public bool? IsPlayed { get; set; }
+
public bool? IsResumable { get; set; }
+
public bool? IncludeItemsByName { get; set; }
public string[] MediaTypes { get; set; }
+
public string[] IncludeItemTypes { get; set; }
+
public string[] ExcludeItemTypes { get; set; }
+
public string[] ExcludeTags { get; set; }
+
public string[] ExcludeInheritedTags { get; set; }
+
public string[] Genres { get; set; }
public bool? IsSpecialSeason { get; set; }
+
public bool? IsMissing { get; set; }
+
public bool? IsUnaired { get; set; }
+
public bool? CollapseBoxSetItems { get; set; }
public string NameStartsWithOrGreater { get; set; }
+
public string NameStartsWith { get; set; }
+
public string NameLessThan { get; set; }
+
public string NameContains { get; set; }
+
public string MinSortName { get; set; }
public string PresentationUniqueKey { get; set; }
+
public string Path { get; set; }
+
public string Name { get; set; }
public string Person { get; set; }
+
public Guid[] PersonIds { get; set; }
+
public Guid[] ItemIds { get; set; }
+
public Guid[] ExcludeItemIds { get; set; }
+
public string AdjacentTo { get; set; }
+
public string[] PersonTypes { get; set; }
public bool? Is3D { get; set; }
+
public bool? IsHD { get; set; }
+
public bool? IsLocked { get; set; }
+
public bool? IsPlaceHolder { get; set; }
public bool? HasImdbId { get; set; }
+
public bool? HasOverview { get; set; }
+
public bool? HasTmdbId { get; set; }
+
public bool? HasOfficialRating { get; set; }
+
public bool? HasTvdbId { get; set; }
+
public bool? HasThemeSong { get; set; }
+
public bool? HasThemeVideo { get; set; }
+
public bool? HasSubtitles { get; set; }
+
public bool? HasSpecialFeature { get; set; }
+
public bool? HasTrailer { get; set; }
+
public bool? HasParentalRating { get; set; }
public Guid[] StudioIds { get; set; }
+
public Guid[] GenreIds { get; set; }
+
public ImageType[] ImageTypes { get; set; }
+
public VideoType[] VideoTypes { get; set; }
+
public UnratedItem[] BlockUnratedItems { get; set; }
+
public int[] Years { get; set; }
+
public string[] Tags { get; set; }
+
public string[] OfficialRatings { get; set; }
public DateTime? MinPremiereDate { get; set; }
+
public DateTime? MaxPremiereDate { get; set; }
+
public DateTime? MinStartDate { get; set; }
+
public DateTime? MaxStartDate { get; set; }
+
public DateTime? MinEndDate { get; set; }
+
public DateTime? MaxEndDate { get; set; }
+
public bool? IsAiring { get; set; }
public bool? IsMovie { get; set; }
+
public bool? IsSports { get; set; }
+
public bool? IsKids { get; set; }
+
public bool? IsNews { get; set; }
+
public bool? IsSeries { get; set; }
+
public int? MinIndexNumber { get; set; }
+
public int? AiredDuringSeason { get; set; }
+
public double? MinCriticRating { get; set; }
+
public double? MinCommunityRating { get; set; }
public Guid[] ChannelIds { get; set; }
public int? ParentIndexNumber { get; set; }
+
public int? ParentIndexNumberNotEquals { get; set; }
+
public int? IndexNumber { get; set; }
+
public int? MinParentalRating { get; set; }
+
public int? MaxParentalRating { get; set; }
public bool? HasDeadParentId { get; set; }
+
public bool? IsVirtualItem { get; set; }
public Guid ParentId { get; set; }
+
public string ParentType { get; set; }
+
public Guid[] AncestorIds { get; set; }
+
public Guid[] TopParentIds { get; set; }
public BaseItem Parent
@@ -135,41 +202,65 @@ namespace MediaBrowser.Controller.Entities
}
public string[] PresetViews { get; set; }
+
public TrailerType[] TrailerTypes { get; set; }
+
public SourceType[] SourceTypes { get; set; }
public SeriesStatus[] SeriesStatuses { get; set; }
+
public string ExternalSeriesId { get; set; }
+
public string ExternalId { get; set; }
public Guid[] AlbumIds { get; set; }
+
public Guid[] ArtistIds { get; set; }
+
public Guid[] ExcludeArtistIds { get; set; }
+
public string AncestorWithPresentationUniqueKey { get; set; }
+
public string SeriesPresentationUniqueKey { get; set; }
public bool GroupByPresentationUniqueKey { get; set; }
+
public bool GroupBySeriesPresentationUniqueKey { get; set; }
+
public bool EnableTotalRecordCount { get; set; }
+
public bool ForceDirect { get; set; }
+
public Dictionary<string, string> ExcludeProviderIds { get; set; }
+
public bool EnableGroupByMetadataKey { get; set; }
+
public bool? HasChapterImages { get; set; }
public IReadOnlyList<(string, SortOrder)> OrderBy { get; set; }
public DateTime? MinDateCreated { get; set; }
+
public DateTime? MinDateLastSaved { get; set; }
+
public DateTime? MinDateLastSavedForUser { get; set; }
public DtoOptions DtoOptions { get; set; }
+
public int MinSimilarityScore { get; set; }
+
public string HasNoAudioTrackWithLanguage { get; set; }
+
public string HasNoInternalSubtitleTrackWithLanguage { get; set; }
+
public string HasNoExternalSubtitleTrackWithLanguage { get; set; }
+
public string HasNoSubtitleTrackWithLanguage { get; set; }
+
public bool? IsDeadArtist { get; set; }
+
public bool? IsDeadStudio { get; set; }
+
public bool? IsDeadPerson { get; set; }
public InternalItemsQuery()
@@ -240,17 +331,29 @@ namespace MediaBrowser.Controller.Entities
}
public Dictionary<string, string> HasAnyProviderId { get; set; }
+
public Guid[] AlbumArtistIds { get; set; }
+
public Guid[] BoxSetLibraryFolders { get; set; }
+
public Guid[] ContributingArtistIds { get; set; }
+
public bool? HasAired { get; set; }
+
public bool? HasOwnerId { get; set; }
+
public bool? Is4K { get; set; }
+
public int? MaxHeight { get; set; }
+
public int? MaxWidth { get; set; }
+
public int? MinHeight { get; set; }
+
public int? MinWidth { get; set; }
+
public string SearchTerm { get; set; }
+
public string SeriesTimerId { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Entities/LinkedChild.cs b/MediaBrowser.Controller/Entities/LinkedChild.cs
index fbce74aab4..65753a26ec 100644
--- a/MediaBrowser.Controller/Entities/LinkedChild.cs
+++ b/MediaBrowser.Controller/Entities/LinkedChild.cs
@@ -9,7 +9,9 @@ namespace MediaBrowser.Controller.Entities
public class LinkedChild
{
public string Path { get; set; }
+
public LinkedChildType Type { get; set; }
+
public string LibraryItemId { get; set; }
[JsonIgnore]
@@ -63,6 +65,7 @@ namespace MediaBrowser.Controller.Entities
{
return _fileSystem.AreEqual(x.Path, y.Path);
}
+
return false;
}
diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs
index 2fb613768d..c394957593 100644
--- a/MediaBrowser.Controller/Entities/PeopleHelper.cs
+++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs
@@ -113,6 +113,7 @@ namespace MediaBrowser.Controller.Entities
return true;
}
}
+
return false;
}
}
diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs
index 69bd7659cc..331d17fc80 100644
--- a/MediaBrowser.Controller/Entities/Person.cs
+++ b/MediaBrowser.Controller/Entities/Person.cs
@@ -19,6 +19,7 @@ namespace MediaBrowser.Controller.Entities
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list;
}
+
public override string CreatePresentationUniqueKey()
{
return GetUserDataKeys()[0];
@@ -114,6 +115,7 @@ namespace MediaBrowser.Controller.Entities
Logger.LogDebug("{0} path has changed from {1} to {2}", GetType().Name, Path, newPath);
return true;
}
+
return base.RequiresRefresh();
}
diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.cs
index 5ebc9f16ad..82d0826c5a 100644
--- a/MediaBrowser.Controller/Entities/Photo.cs
+++ b/MediaBrowser.Controller/Entities/Photo.cs
@@ -29,6 +29,7 @@ namespace MediaBrowser.Controller.Entities
return photoAlbum;
}
}
+
return null;
}
}
@@ -68,17 +69,27 @@ namespace MediaBrowser.Controller.Entities
}
public string CameraMake { get; set; }
+
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; }
public double? Latitude { get; set; }
+
public double? Longitude { get; set; }
+
public double? Altitude { get; set; }
+
public int? IsoSpeedRating { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Entities/Share.cs b/MediaBrowser.Controller/Entities/Share.cs
index c17789ccc6..a51f2b4523 100644
--- a/MediaBrowser.Controller/Entities/Share.cs
+++ b/MediaBrowser.Controller/Entities/Share.cs
@@ -8,6 +8,7 @@ namespace MediaBrowser.Controller.Entities
public class Share
{
public string UserId { get; set; }
+
public bool CanEdit { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs
index f81b6f194f..1f64de6a41 100644
--- a/MediaBrowser.Controller/Entities/Studio.cs
+++ b/MediaBrowser.Controller/Entities/Studio.cs
@@ -18,6 +18,7 @@ namespace MediaBrowser.Controller.Entities
list.Insert(0, GetType().Name + "-" + (Name ?? string.Empty).RemoveDiacritics());
return list;
}
+
public override string CreatePresentationUniqueKey()
{
return GetUserDataKeys()[0];
@@ -93,6 +94,7 @@ namespace MediaBrowser.Controller.Entities
Logger.LogDebug("{0} path has changed from {1} to {2}", GetType().Name, Path, newPath);
return true;
}
+
return base.RequiresRefresh();
}
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index 82e7d49fb9..9a5f9097d7 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -34,7 +34,9 @@ namespace MediaBrowser.Controller.Entities.TV
/// </summary>
/// <value>The aired season.</value>
public int? AirsBeforeSeasonNumber { get; set; }
+
public int? AirsAfterSeasonNumber { get; set; }
+
public int? AirsBeforeEpisodeNumber { get; set; }
/// <summary>
@@ -94,6 +96,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
take--;
}
+
list.InsertRange(0, seriesUserDataKeys.Take(take).Select(i => i + ParentIndexNumber.Value.ToString("000") + IndexNumber.Value.ToString("000")));
}
@@ -114,6 +117,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
seriesId = FindSeriesId();
}
+
return !seriesId.Equals(Guid.Empty) ? (LibraryManager.GetItemById(seriesId) as Series) : null;
}
}
@@ -128,6 +132,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
seasonId = FindSeasonId();
}
+
return !seasonId.Equals(Guid.Empty) ? (LibraryManager.GetItemById(seasonId) as Season) : null;
}
}
@@ -160,6 +165,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
return "Season " + ParentIndexNumber.Value.ToString(CultureInfo.InvariantCulture);
}
+
return "Season Unknown";
}
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index 9f0658776b..2aba1d03d8 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -81,6 +81,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
seriesId = FindSeriesId();
}
+
return seriesId == Guid.Empty ? null : (LibraryManager.GetItemById(seriesId) as Series);
}
}
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index 9263a156af..45daa8a539 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -30,6 +30,7 @@ namespace MediaBrowser.Controller.Entities.TV
}
public DayOfWeek[] AirDays { get; set; }
+
public string AirTime { get; set; }
[JsonIgnore]
@@ -150,6 +151,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
query.IncludeItemTypes = new[] { typeof(Episode).Name };
}
+
query.IsVirtualItem = false;
query.Limit = 0;
var totalRecordCount = LibraryManager.GetCount(query);
diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs
index 81f4850a53..3298fa2d33 100644
--- a/MediaBrowser.Controller/Entities/UserItemData.cs
+++ b/MediaBrowser.Controller/Entities/UserItemData.cs
@@ -105,6 +105,7 @@ namespace MediaBrowser.Controller.Entities
return null;
}
+
set
{
if (value.HasValue)
diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs
index dbfef07776..061e6001c9 100644
--- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs
+++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs
@@ -960,6 +960,7 @@ namespace MediaBrowser.Controller.Entities
.OfType<Folder>()
.Where(UserView.IsEligibleForGrouping);
}
+
return _libraryManager.GetUserRootFolder()
.GetChildren(user, true)
.OfType<Folder>()
@@ -978,6 +979,7 @@ namespace MediaBrowser.Controller.Entities
return folder != null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
}).ToArray();
}
+
return GetMediaFolders(user)
.Where(i =>
{
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs
index 4efeede193..b7d7e8e1a3 100644
--- a/MediaBrowser.Controller/Entities/Video.cs
+++ b/MediaBrowser.Controller/Entities/Video.cs
@@ -28,7 +28,9 @@ namespace MediaBrowser.Controller.Entities
public string PrimaryVersionId { get; set; }
public string[] AdditionalParts { get; set; }
+
public string[] LocalAlternateVersions { get; set; }
+
public LinkedChild[] LinkedAlternateVersions { get; set; }
[JsonIgnore]
@@ -52,15 +54,18 @@ namespace MediaBrowser.Controller.Entities
{
return false;
}
+
if (extraType.Value == Model.Entities.ExtraType.ThemeVideo)
{
return false;
}
+
if (extraType.Value == Model.Entities.ExtraType.Trailer)
{
return false;
}
}
+
return true;
}
}
@@ -196,6 +201,7 @@ namespace MediaBrowser.Controller.Entities
return video.MediaSourceCount;
}
}
+
return LinkedAlternateVersions.Length + LocalAlternateVersions.Length + 1;
}
}
@@ -390,11 +396,13 @@ namespace MediaBrowser.Controller.Entities
AdditionalParts = newVideo.AdditionalParts;
updateType |= ItemUpdateType.MetadataImport;
}
+
if (!LocalAlternateVersions.SequenceEqual(newVideo.LocalAlternateVersions, StringComparer.Ordinal))
{
LocalAlternateVersions = newVideo.LocalAlternateVersions;
updateType |= ItemUpdateType.MetadataImport;
}
+
if (VideoType != newVideo.VideoType)
{
VideoType = newVideo.VideoType;
@@ -416,6 +424,7 @@ namespace MediaBrowser.Controller.Entities
.Select(i => i.FullName)
.ToArray();
}
+
if (videoType == VideoType.BluRay)
{
return FileSystem.GetFiles(rootPath, new[] { ".m2ts" }, false, true)
@@ -425,6 +434,7 @@ namespace MediaBrowser.Controller.Entities
.Select(i => i.FullName)
.ToArray();
}
+
return Array.Empty<string>();
}
diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs
index c961da6437..c88498640b 100644
--- a/MediaBrowser.Controller/Entities/Year.cs
+++ b/MediaBrowser.Controller/Entities/Year.cs
@@ -103,6 +103,7 @@ namespace MediaBrowser.Controller.Entities
Logger.LogDebug("{0} path has changed from {1} to {2}", GetType().Name, Path, newPath);
return true;
}
+
return base.RequiresRefresh();
}
diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs
index aa73738155..e655f50eb7 100644
--- a/MediaBrowser.Controller/IO/FileData.cs
+++ b/MediaBrowser.Controller/IO/FileData.cs
@@ -20,6 +20,7 @@ namespace MediaBrowser.Controller.IO
{
dict[file.FullName] = file;
}
+
return dict;
}
@@ -49,6 +50,7 @@ namespace MediaBrowser.Controller.IO
{
throw new ArgumentNullException(nameof(path));
}
+
if (args == null)
{
throw new ArgumentNullException(nameof(args));
@@ -116,6 +118,7 @@ namespace MediaBrowser.Controller.IO
returnResult[index] = value;
index++;
}
+
return returnResult;
}
}
diff --git a/MediaBrowser.Controller/Library/DeleteOptions.cs b/MediaBrowser.Controller/Library/DeleteOptions.cs
index 751b904816..2944d82592 100644
--- a/MediaBrowser.Controller/Library/DeleteOptions.cs
+++ b/MediaBrowser.Controller/Library/DeleteOptions.cs
@@ -3,6 +3,7 @@ namespace MediaBrowser.Controller.Library
public class DeleteOptions
{
public bool DeleteFileLocation { get; set; }
+
public bool DeleteFromExternalProvider { get; set; }
public DeleteOptions()
diff --git a/MediaBrowser.Controller/Library/ILiveStream.cs b/MediaBrowser.Controller/Library/ILiveStream.cs
index 734932f17c..7c9a9b20e0 100644
--- a/MediaBrowser.Controller/Library/ILiveStream.cs
+++ b/MediaBrowser.Controller/Library/ILiveStream.cs
@@ -9,10 +9,15 @@ namespace MediaBrowser.Controller.Library
Task Open(CancellationToken openCancellationToken);
Task Close();
int ConsumerCount { get; set; }
+
string OriginalStreamId { get; set; }
+
string TunerHostId { get; }
+
bool EnableStreamSharing { get; }
+
MediaSourceInfo MediaSource { get; set; }
+
string UniqueId { get; }
}
}
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
index 7c1463862b..92473eaa18 100644
--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs
+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs
@@ -129,6 +129,7 @@ namespace MediaBrowser.Controller.Library
return item != null;
}
+
return false;
}
@@ -256,6 +257,7 @@ namespace MediaBrowser.Controller.Library
if (args.Path == null && Path == null) return true;
return args.Path != null && BaseItem.FileSystem.AreEqual(args.Path, Path);
}
+
return false;
}
diff --git a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
index abe1294849..08cfea3c31 100644
--- a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
+++ b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs
@@ -13,18 +13,27 @@ namespace MediaBrowser.Controller.Library
public class PlaybackProgressEventArgs : EventArgs
{
public List<User> Users { get; set; }
+
public long? PlaybackPositionTicks { get; set; }
+
public BaseItem Item { get; set; }
+
public BaseItemDto MediaInfo { get; set; }
+
public string MediaSourceId { get; set; }
+
public bool IsPaused { get; set; }
+
public bool IsAutomated { get; set; }
public string DeviceId { get; set; }
+
public string DeviceName { get; set; }
+
public string ClientName { get; set; }
public string PlaySessionId { get; set; }
+
public SessionInfo Session { get; set; }
public PlaybackProgressEventArgs()
diff --git a/MediaBrowser.Controller/Library/Profiler.cs b/MediaBrowser.Controller/Library/Profiler.cs
index a566de3388..f9808a4f44 100644
--- a/MediaBrowser.Controller/Library/Profiler.cs
+++ b/MediaBrowser.Controller/Library/Profiler.cs
@@ -67,6 +67,7 @@ namespace MediaBrowser.Controller.Library
message = string.Format("{0} took {1} seconds.",
_name, ((float)_stopwatch.ElapsedMilliseconds / 1000).ToString("#0.000"));
}
+
_logger.LogInformation(message);
}
}
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs
index ebdcfbdb36..fc9b3f1c6e 100644
--- a/MediaBrowser.Controller/Library/TVUtils.cs
+++ b/MediaBrowser.Controller/Library/TVUtils.cs
@@ -40,6 +40,7 @@ namespace MediaBrowser.Controller.Library
return new DayOfWeek[] { };
}
+
return null;
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
index 1b7095c7bf..67d0df4fdc 100644
--- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
@@ -67,8 +67,11 @@ namespace MediaBrowser.Controller.LiveTv
public bool? IsFavorite { get; set; }
public bool? IsHD { get; set; }
+
public string AudioCodec { get; set; }
+
public string VideoCodec { get; set; }
+
public string[] Tags { get; set; }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index aa24d5ab8e..f619b011bf 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -286,8 +286,11 @@ namespace MediaBrowser.Controller.LiveTv
public class ActiveRecordingInfo
{
public string Id { get; set; }
+
public string Path { get; set; }
+
public TimerInfo Timer { get; set; }
+
public CancellationTokenSource CancellationTokenSource { get; set; }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
index 240ba8c239..3679e4f78f 100644
--- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs
+++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
@@ -50,6 +50,7 @@ namespace MediaBrowser.Controller.LiveTv
get;
}
}
+
public interface IConfigurableTunerHost
{
/// <summary>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvConflictException.cs b/MediaBrowser.Controller/LiveTv/LiveTvConflictException.cs
index 92b8ee67ca..0e09d1aeba 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvConflictException.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvConflictException.cs
@@ -10,6 +10,7 @@ namespace MediaBrowser.Controller.LiveTv
public LiveTvConflictException()
{
}
+
public LiveTvConflictException(string message)
: base(message)
{
diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
index b847140f50..d06a15323a 100644
--- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
@@ -199,6 +199,7 @@ namespace MediaBrowser.Controller.LiveTv
public string Etag { get; set; }
public Dictionary<string, string> ProviderIds { get; set; }
+
public Dictionary<string, string> SeriesProviderIds { get; set; }
public ProgramInfo()
diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs
index 4fbd496c5d..6e7acaae39 100644
--- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs
@@ -57,6 +57,7 @@ namespace MediaBrowser.Controller.LiveTv
public bool RecordAnyChannel { get; set; }
public int KeepUpTo { get; set; }
+
public KeepUntil KeepUntil { get; set; }
public bool SkipEpisodesInLibrary { get; set; }
diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs
index 46774b2b7a..df98bb6af8 100644
--- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs
@@ -18,7 +18,9 @@ namespace MediaBrowser.Controller.LiveTv
}
public Dictionary<string, string> ProviderIds { get; set; }
+
public Dictionary<string, string> SeriesProviderIds { get; set; }
+
public string[] Tags { get; set; }
/// <summary>
@@ -146,10 +148,15 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsRepeat { get; set; }
public string HomePageUrl { get; set; }
+
public float? CommunityRating { get; set; }
+
public string OfficialRating { get; set; }
+
public string[] Genres { get; set; }
+
public string RecordingPath { get; set; }
+
public KeepUntil KeepUntil { get; set; }
}
}
diff --git a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs b/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs
index cb02da6352..df3f55c26c 100644
--- a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs
+++ b/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs
@@ -3,8 +3,11 @@ namespace MediaBrowser.Controller.LiveTv
public class TunerChannelMapping
{
public string Name { get; set; }
+
public string ProviderChannelName { get; set; }
+
public string ProviderChannelId { get; set; }
+
public string Id { get; set; }
}
}
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 680d92c2d7..8da714858a 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -74,7 +74,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{"omx", hwEncoder + "_omx"},
{hwEncoder + "_v4l2m2m", hwEncoder + "_v4l2m2m"},
{"mediacodec", hwEncoder + "_mediacodec"},
- {"vaapi", hwEncoder + "_vaapi"}
+ {"vaapi", hwEncoder + "_vaapi"},
+ {"videotoolbox", hwEncoder + "_videotoolbox"}
};
if (!string.IsNullOrEmpty(hwType)
@@ -104,7 +105,8 @@ namespace MediaBrowser.Controller.MediaEncoding
return false;
}
- return true;
+ return _mediaEncoder.SupportsHwaccel("vaapi");
+
}
/// <summary>
@@ -445,31 +447,41 @@ namespace MediaBrowser.Controller.MediaEncoding
public string GetInputArgument(EncodingJobInfo state, EncodingOptions encodingOptions)
{
var arg = new StringBuilder();
+ var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, encodingOptions) ?? string.Empty;
+ var outputVideoCodec = GetVideoEncoder(state, encodingOptions) ?? string.Empty;
+ bool isVaapiDecoder = videoDecoder.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1;
+ bool isVaapiEncoder = outputVideoCodec.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1;
+ bool isQsvDecoder = videoDecoder.IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1;
+ bool isQsvEncoder = outputVideoCodec.IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1;
if (state.IsVideoRequest
&& string.Equals(encodingOptions.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase))
{
- arg.Append("-hwaccel vaapi -hwaccel_output_format vaapi")
- .Append(" -vaapi_device ")
- .Append(encodingOptions.VaapiDevice)
- .Append(' ');
+ if (isVaapiDecoder)
+ {
+ arg.Append("-hwaccel_output_format vaapi ")
+ .Append("-vaapi_device ")
+ .Append(encodingOptions.VaapiDevice)
+ .Append(" ");
+ }
+ else if (!isVaapiDecoder && isVaapiEncoder)
+ {
+ arg.Append("-vaapi_device ")
+ .Append(encodingOptions.VaapiDevice)
+ .Append(" ");
+ }
}
if (state.IsVideoRequest
&& string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
{
- var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, encodingOptions);
- var outputVideoCodec = GetVideoEncoder(state, encodingOptions);
-
var hasTextSubs = state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
if (!hasTextSubs)
{
- // While using QSV encoder
- if ((outputVideoCodec ?? string.Empty).IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1)
+ if (isQsvEncoder)
{
- // While using QSV decoder
- if ((videoDecoder ?? string.Empty).IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1)
+ if (isQsvDecoder)
{
arg.Append("-hwaccel qsv ");
}
@@ -527,6 +539,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|| codec.IndexOf("hevc", StringComparison.OrdinalIgnoreCase) != -1;
}
+ // TODO This is auto inserted into the mpegts mux so it might not be needed
+ // https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmp4toannexb
public string GetBitStreamArgs(MediaStream stream)
{
if (IsH264(stream))
@@ -551,8 +565,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if (string.Equals(videoCodec, "libvpx", StringComparison.OrdinalIgnoreCase))
{
- // With vpx when crf is used, b:v becomes a max rate
- // https://trac.ffmpeg.org/wiki/vpxEncodingGuide.
+ // When crf is used with vpx, b:v becomes a max rate
+ // https://trac.ffmpeg.org/wiki/Encode/VP9
return string.Format(
CultureInfo.InvariantCulture,
" -maxrate:v {0} -bufsize:v {1} -b:v {0}",
@@ -1525,8 +1539,9 @@ namespace MediaBrowser.Controller.MediaEncoding
EncodingOptions options,
string outputVideoCodec)
{
- var outputSizeParam = string.Empty;
+ outputVideoCodec ??= string.Empty;
+ var outputSizeParam = string.Empty;
var request = state.BaseRequest;
// Add resolution params, if specified
@@ -1569,16 +1584,14 @@ namespace MediaBrowser.Controller.MediaEncoding
}
var videoSizeParam = string.Empty;
- var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, options);
+ var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, options) ?? string.Empty;
// Setup subtitle scaling
if (state.VideoStream != null && state.VideoStream.Width.HasValue && state.VideoStream.Height.HasValue)
{
- // force_original_aspect_ratio=decrease
- // Enable decreasing output video width or height if necessary to keep the original aspect ratio
videoSizeParam = string.Format(
CultureInfo.InvariantCulture,
- "scale={0}:{1}:force_original_aspect_ratio=decrease",
+ "scale={0}:{1}",
state.VideoStream.Width.Value,
state.VideoStream.Height.Value);
@@ -1591,8 +1604,10 @@ namespace MediaBrowser.Controller.MediaEncoding
// For VAAPI and CUVID decoder
// these encoders cannot automatically adjust the size of graphical subtitles to fit the output video,
// thus needs to be manually adjusted.
- if ((IsVaapiSupported(state) && string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase))
- || (videoDecoder ?? string.Empty).IndexOf("cuvid", StringComparison.OrdinalIgnoreCase) != -1)
+ if (videoDecoder.IndexOf("cuvid", StringComparison.OrdinalIgnoreCase) != -1
+ || (IsVaapiSupported(state) && string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)
+ && (videoDecoder.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1
+ || outputVideoCodec.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1)))
{
var videoStream = state.VideoStream;
var inputWidth = videoStream?.Width;
@@ -1603,7 +1618,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
videoSizeParam = string.Format(
CultureInfo.InvariantCulture,
- "scale={0}:{1}:force_original_aspect_ratio=decrease",
+ "scale={0}:{1}",
width.Value,
height.Value);
}
@@ -1634,7 +1649,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
// If we're hardware VAAPI decoding and software encoding, download frames from the decoder first
- else if (IsVaapiSupported(state) && string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)
+ else if (IsVaapiSupported(state) && videoDecoder.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1
&& string.Equals(outputVideoCodec, "libx264", StringComparison.OrdinalIgnoreCase))
{
/*
@@ -1652,7 +1667,7 @@ namespace MediaBrowser.Controller.MediaEncoding
For software decoding and hardware encoding option, frames must be hwuploaded into hardware
with fixed frame size.
*/
- if (!string.IsNullOrEmpty(videoDecoder) && videoDecoder.Contains("qsv", StringComparison.OrdinalIgnoreCase))
+ if (videoDecoder.IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1)
{
retStr = " -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}][sub]overlay_qsv=x=(W-w)/2:y=(H-h)/2{3}\"";
}
@@ -1684,6 +1699,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return (null, null);
}
+
if (!videoHeight.HasValue && !requestedHeight.HasValue)
{
return (null, null);
@@ -1975,7 +1991,7 @@ namespace MediaBrowser.Controller.MediaEncoding
var videoStream = state.VideoStream;
var filters = new List<string>();
- var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, options);
+ var videoDecoder = GetHardwareAcceleratedVideoDecoder(state, options) ?? string.Empty;
var inputWidth = videoStream?.Width;
var inputHeight = videoStream?.Height;
var threeDFormat = state.MediaSource.Video3DFormat;
@@ -2000,7 +2016,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
// If we're hardware VAAPI decoding and software encoding, download frames from the decoder first
- else if (IsVaapiSupported(state) && string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)
+ else if (videoDecoder.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1
&& string.Equals(outputVideoCodec, "libx264", StringComparison.OrdinalIgnoreCase))
{
var codec = videoStream.Codec.ToLowerInvariant();
@@ -2509,16 +2525,17 @@ namespace MediaBrowser.Controller.MediaEncoding
/// </summary>
protected string GetHardwareAcceleratedVideoDecoder(EncodingJobInfo state, EncodingOptions encodingOptions)
{
+ var videoType = state.MediaSource.VideoType ?? VideoType.VideoFile;
+ var videoStream = state.VideoStream;
+ var isColorDepth10 = !string.IsNullOrEmpty(videoStream.Profile) && (videoStream.Profile.Contains("Main 10", StringComparison.OrdinalIgnoreCase)
+ || videoStream.Profile.Contains("High 10", StringComparison.OrdinalIgnoreCase));
+
+
if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
return null;
}
- return GetHardwareAcceleratedVideoDecoder(state.MediaSource.VideoType ?? VideoType.VideoFile, state.VideoStream, encodingOptions);
- }
-
- public string GetHardwareAcceleratedVideoDecoder(VideoType videoType, MediaStream videoStream, EncodingOptions encodingOptions)
- {
// Only use alternative encoders for video files.
// When using concat with folder rips, if the mfx session fails to initialize, ffmpeg will be stuck retrying and will not exit gracefully
// Since transcoding of folder rips is expiremental anyway, it's not worth adding additional variables such as this.
@@ -2531,6 +2548,14 @@ namespace MediaBrowser.Controller.MediaEncoding
&& !string.IsNullOrEmpty(videoStream.Codec)
&& !string.IsNullOrEmpty(encodingOptions.HardwareAccelerationType))
{
+ // Only hevc and vp9 formats have 10-bit hardware decoder support now.
+ if (isColorDepth10 && !(string.Equals(videoStream.Codec, "hevc", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(videoStream.Codec, "h265", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(videoStream.Codec, "vp9", StringComparison.OrdinalIgnoreCase)))
+ {
+ return null;
+ }
+
if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
{
switch (videoStream.Codec.ToLowerInvariant())
@@ -2545,28 +2570,46 @@ namespace MediaBrowser.Controller.MediaEncoding
encodingOptions.HardwareDecodingCodecs = Array.Empty<string>();
return null;
}
+
return "-c:v h264_qsv";
}
+
break;
case "hevc":
case "h265":
if (_mediaEncoder.SupportsDecoder("hevc_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase))
{
- // return "-c:v hevc_qsv -load_plugin hevc_hw ";
- return "-c:v hevc_qsv";
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : "-c:v hevc_qsv";
}
+
break;
case "mpeg2video":
if (_mediaEncoder.SupportsDecoder("mpeg2_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg2_qsv";
}
+
break;
case "vc1":
if (_mediaEncoder.SupportsDecoder("vc1_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
{
return "-c:v vc1_qsv";
}
+
+ break;
+ case "vp8":
+ if (_mediaEncoder.SupportsDecoder("vp8_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("vp8", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v vp8_qsv";
+ }
+ break;
+ case "vp9":
+ if (_mediaEncoder.SupportsDecoder("vp9_qsv") && encodingOptions.HardwareDecodingCodecs.Contains("vp9", StringComparer.OrdinalIgnoreCase))
+ {
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : "-c:v vp9_qsv";
+ }
break;
}
}
@@ -2578,39 +2621,59 @@ namespace MediaBrowser.Controller.MediaEncoding
case "h264":
if (_mediaEncoder.SupportsDecoder("h264_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
{
- // cuvid decoder does not support 10-bit input
+ // cuvid decoder does not support 10-bit input.
if ((videoStream.BitDepth ?? 8) > 8)
{
encodingOptions.HardwareDecodingCodecs = Array.Empty<string>();
return null;
}
+
return "-c:v h264_cuvid";
}
+
break;
case "hevc":
case "h265":
if (_mediaEncoder.SupportsDecoder("hevc_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase))
{
- return "-c:v hevc_cuvid";
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : "-c:v hevc_cuvid";
}
+
break;
case "mpeg2video":
if (_mediaEncoder.SupportsDecoder("mpeg2_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg2_cuvid";
}
+
break;
case "vc1":
if (_mediaEncoder.SupportsDecoder("vc1_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
{
return "-c:v vc1_cuvid";
}
+
break;
case "mpeg4":
if (_mediaEncoder.SupportsDecoder("mpeg4_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg4_cuvid";
}
+
+ break;
+ case "vp8":
+ if (_mediaEncoder.SupportsDecoder("vp8_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("vp8", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v vp8_cuvid";
+ }
+ break;
+ case "vp9":
+ if (_mediaEncoder.SupportsDecoder("vp9_cuvid") && encodingOptions.HardwareDecodingCodecs.Contains("vp9", StringComparer.OrdinalIgnoreCase))
+ {
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : "-c:v vp9_cuvid";
+ }
break;
}
}
@@ -2624,37 +2687,45 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return "-c:v h264_mediacodec";
}
+
break;
case "hevc":
case "h265":
if (_mediaEncoder.SupportsDecoder("hevc_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("hevc", StringComparer.OrdinalIgnoreCase))
{
- return "-c:v hevc_mediacodec";
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : "-c:v hevc_mediacodec";
}
+
break;
case "mpeg2video":
if (_mediaEncoder.SupportsDecoder("mpeg2_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg2_mediacodec";
}
+
break;
case "mpeg4":
if (_mediaEncoder.SupportsDecoder("mpeg4_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg4_mediacodec";
}
+
break;
case "vp8":
if (_mediaEncoder.SupportsDecoder("vp8_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("vp8", StringComparer.OrdinalIgnoreCase))
{
return "-c:v vp8_mediacodec";
}
+
break;
case "vp9":
if (_mediaEncoder.SupportsDecoder("vp9_mediacodec") && encodingOptions.HardwareDecodingCodecs.Contains("vp9", StringComparer.OrdinalIgnoreCase))
{
- return "-c:v vp9_mediacodec";
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : "-c:v vp9_mediacodec";
}
+
break;
}
}
@@ -2668,50 +2739,175 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return "-c:v h264_mmal";
}
+
break;
case "mpeg2video":
if (_mediaEncoder.SupportsDecoder("mpeg2_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg2_mmal";
}
+
break;
case "mpeg4":
if (_mediaEncoder.SupportsDecoder("mpeg4_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase))
{
return "-c:v mpeg4_mmal";
}
+
break;
case "vc1":
if (_mediaEncoder.SupportsDecoder("vc1_mmal") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
{
return "-c:v vc1_mmal";
}
+
break;
}
}
else if (string.Equals(encodingOptions.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase))
{
- if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+ switch (videoStream.Codec.ToLowerInvariant())
{
- if (Environment.OSVersion.Version.Major > 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor > 1))
- return "-hwaccel d3d11va";
- else
- return "-hwaccel dxva2";
+ case "avc":
+ case "h264":
+ return GetHwaccelType(state, encodingOptions, "h264");
+ case "hevc":
+ case "h265":
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : GetHwaccelType(state, encodingOptions, "hevc");
+ case "mpeg2video":
+ return GetHwaccelType(state, encodingOptions, "mpeg2video");
+ case "vc1":
+ return GetHwaccelType(state, encodingOptions, "vc1");
+ case "mpeg4":
+ return GetHwaccelType(state, encodingOptions, "mpeg4");
+ case "vp9":
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : GetHwaccelType(state, encodingOptions, "vp9");
}
- else
+ }
+ else if (string.Equals(encodingOptions.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase))
+ {
+ switch (videoStream.Codec.ToLowerInvariant())
{
- return "-hwaccel vaapi";
+ case "avc":
+ case "h264":
+ return GetHwaccelType(state, encodingOptions, "h264");
+ case "hevc":
+ case "h265":
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : GetHwaccelType(state, encodingOptions, "hevc");
+ case "mpeg2video":
+ return GetHwaccelType(state, encodingOptions, "mpeg2video");
+ case "vc1":
+ return GetHwaccelType(state, encodingOptions, "vc1");
+ case "vp8":
+ return GetHwaccelType(state, encodingOptions, "vp8");
+ case "vp9":
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : GetHwaccelType(state, encodingOptions, "vp9");
+ }
+ }
+ else if (string.Equals(encodingOptions.HardwareAccelerationType, "videotoolbox", StringComparison.OrdinalIgnoreCase))
+ {
+ switch (videoStream.Codec.ToLowerInvariant())
+ {
+ case "avc":
+ case "h264":
+ if (_mediaEncoder.SupportsDecoder("h264_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v h264_opencl";
+ }
+ break;
+ case "hevc":
+ case "h265":
+ if (_mediaEncoder.SupportsDecoder("hevc_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
+ {
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Hevc) ? null : "-c:v hevc_opencl";
+ }
+ break;
+ case "mpeg2video":
+ if (_mediaEncoder.SupportsDecoder("mpeg2_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v mpeg2_opencl";
+ }
+ break;
+ case "mpeg4":
+ if (_mediaEncoder.SupportsDecoder("mpeg4_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v mpeg4_opencl";
+ }
+ break;
+ case "vc1":
+ if (_mediaEncoder.SupportsDecoder("vc1_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v vc1_opencl";
+ }
+ break;
+ case "vp8":
+ if (_mediaEncoder.SupportsDecoder("vp8_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
+ {
+ return "-c:v vp8_opencl";
+ }
+ break;
+ case "vp9":
+ if (_mediaEncoder.SupportsDecoder("vp9_opencl") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
+ {
+ return (isColorDepth10 &&
+ !encodingOptions.EnableDecodingColorDepth10Vp9) ? null : "-c:v vp9_opencl";
+ }
+ break;
}
}
}
+ var whichCodec = videoStream.Codec.ToLowerInvariant();
+ switch (whichCodec)
+ {
+ case "avc":
+ whichCodec = "h264";
+ break;
+ case "h265":
+ whichCodec = "hevc";
+ break;
+ }
+
// Avoid a second attempt if no hardware acceleration is being used
- encodingOptions.HardwareDecodingCodecs = Array.Empty<string>();
+ encodingOptions.HardwareDecodingCodecs = encodingOptions.HardwareDecodingCodecs.Where(val => val != whichCodec).ToArray();
// leave blank so ffmpeg will decide
return null;
}
+ /// <summary>
+ /// Gets a hwaccel type to use as a hardware decoder(dxva/vaapi) depending on the system
+ /// </summary>
+ public string GetHwaccelType(EncodingJobInfo state, EncodingOptions options, string videoCodec)
+ {
+ var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
+ var isWindows8orLater = Environment.OSVersion.Version.Major > 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor > 1);
+ var isDxvaSupported = _mediaEncoder.SupportsHwaccel("dxva2") || _mediaEncoder.SupportsHwaccel("d3d11va");
+
+ if ((isDxvaSupported || IsVaapiSupported(state)) && options.HardwareDecodingCodecs.Contains(videoCodec, StringComparer.OrdinalIgnoreCase))
+ {
+ if (!isWindows)
+ {
+ return "-hwaccel vaapi";
+ }
+ else if (isWindows8orLater)
+ {
+ return "-hwaccel d3d11va";
+ }
+ else
+ {
+ return "-hwaccel dxva2";
+ }
+ }
+
+ return null;
+ }
+
public string GetSubtitleEmbedArguments(EncodingJobInfo state)
{
if (state.SubtitleStream == null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 32973619d4..b971b7c4bf 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -127,13 +127,19 @@ namespace MediaBrowser.Controller.MediaEncoding
public string AlbumCoverPath { get; set; }
public string InputAudioSync { get; set; }
+
public string InputVideoSync { get; set; }
+
public TransportStreamTimestamp InputTimestamp { get; set; }
public MediaStream AudioStream { get; set; }
+
public string[] SupportedAudioCodecs { get; set; }
+
public string[] SupportedVideoCodecs { get; set; }
+
public string InputContainer { get; set; }
+
public IsoType? IsoType { get; set; }
public BaseEncodingJobOptions BaseRequest { get; set; }
@@ -293,6 +299,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
public bool IsVideoRequest { get; set; }
+
public TranscodingJobType TranscodingType { get; set; }
public EncodingJobInfo(TranscodingJobType jobType)
@@ -672,6 +679,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
public IProgress<double> Progress { get; set; }
+
public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate)
{
Progress.Report(percentComplete.Value);
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
index addc88174f..8f6fcb9ab1 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
@@ -9,9 +9,11 @@ namespace MediaBrowser.Controller.MediaEncoding
public class EncodingJobOptions : BaseEncodingJobOptions
{
public string OutputDirectory { get; set; }
+
public string ItemId { get; set; }
public string TempDirectory { get; set; }
+
public bool ReadInputAtNativeFramerate { get; set; }
/// <summary>
@@ -47,6 +49,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
SubtitleStreamIndex = info.SubtitleStreamIndex;
}
+
StreamOptions = info.StreamOptions;
}
}
@@ -81,7 +84,9 @@ namespace MediaBrowser.Controller.MediaEncoding
public bool EnableAutoStreamCopy { get; set; }
public bool AllowVideoStreamCopy { get; set; }
+
public bool AllowAudioStreamCopy { get; set; }
+
public bool BreakOnNonKeyFrames { get; set; }
/// <summary>
@@ -197,10 +202,15 @@ namespace MediaBrowser.Controller.MediaEncoding
[ApiMember(Name = "MaxVideoBitDepth", Description = "Optional.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public int? MaxVideoBitDepth { get; set; }
+
public bool RequireAvc { get; set; }
+
public bool DeInterlace { get; set; }
+
public bool RequireNonAnamorphic { get; set; }
+
public int? TranscodingMaxAudioChannels { get; set; }
+
public int? CpuCoreLimit { get; set; }
public string LiveStreamId { get; set; }
diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
index e33c4ad0be..f60e702393 100644
--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
@@ -27,13 +27,27 @@ namespace MediaBrowser.Controller.MediaEncoding
string EncoderPath { get; }
/// <summary>
- /// Supportses the decoder.
+ /// Whether given encoder codec is supported.
+ /// </summary>
+ /// <param name="encoder">The encoder.</param>
+ /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
+ bool SupportsEncoder(string encoder);
+
+ /// <summary>
+ /// Whether given decoder codec is supported.
/// </summary>
/// <param name="decoder">The decoder.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool SupportsDecoder(string decoder);
/// <summary>
+ /// Whether given hardware acceleration type is supported.
+ /// </summary>
+ /// <param name="hwaccel">The hwaccel.</param>
+ /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
+ bool SupportsHwaccel(string hwaccel);
+
+ /// <summary>
/// Extracts the audio image.
/// </summary>
/// <param name="path">The path.</param>
@@ -98,7 +112,6 @@ namespace MediaBrowser.Controller.MediaEncoding
void SetFFmpegPath();
void UpdateEncoderPath(string path, string pathType);
- bool SupportsEncoder(string encoder);
IEnumerable<string> GetPrimaryPlaylistVobFiles(string path, IIsoMount isoMount, uint? titleNumber);
}
diff --git a/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs b/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs
index b78ef0b806..39a47792ae 100644
--- a/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs
+++ b/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs
@@ -8,9 +8,13 @@ namespace MediaBrowser.Controller.MediaEncoding
public class MediaInfoRequest
{
public MediaSourceInfo MediaSource { get; set; }
+
public bool ExtractChapters { get; set; }
+
public DlnaProfileType MediaType { get; set; }
+
public IIsoMount MountedIso { get; set; }
+
public string[] PlayableStreamFileNames { get; set; }
public MediaInfoRequest()
diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
index 29fb81e32a..ba3c715b88 100644
--- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
+++ b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs
@@ -58,8 +58,11 @@ namespace MediaBrowser.Controller.Net
public interface IAuthenticationAttributes
{
bool EscapeParentalControl { get; }
+
bool AllowBeforeStartupWizard { get; }
+
bool AllowLocal { get; }
+
bool AllowLocalOnly { get; }
string[] GetRoles();
diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
index 9e262d31ed..a54f6d57b5 100644
--- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
+++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
@@ -254,7 +254,9 @@ namespace MediaBrowser.Controller.Net
public class WebSocketListenerState
{
public DateTime DateLastSendUtc { get; set; }
+
public long InitialDelayMs { get; set; }
+
public long IntervalMs { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Net/StaticResultOptions.cs b/MediaBrowser.Controller/Net/StaticResultOptions.cs
index 071beaed19..85772e0368 100644
--- a/MediaBrowser.Controller/Net/StaticResultOptions.cs
+++ b/MediaBrowser.Controller/Net/StaticResultOptions.cs
@@ -8,8 +8,11 @@ namespace MediaBrowser.Controller.Net
public class StaticResultOptions
{
public string ContentType { get; set; }
+
public TimeSpan? CacheDuration { get; set; }
+
public DateTime? DateLastModified { get; set; }
+
public Func<Task<Stream>> ContentFactory { get; set; }
public bool IsHeadRequest { get; set; }
@@ -17,9 +20,11 @@ namespace MediaBrowser.Controller.Net
public IDictionary<string, string> ResponseHeaders { get; set; }
public Action OnComplete { get; set; }
+
public Action OnError { get; set; }
public string Path { get; set; }
+
public long? ContentLength { get; set; }
public FileShare FileShare { get; set; }
diff --git a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
index aac41369c3..3f8c409f5c 100644
--- a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
+++ b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs
@@ -7,11 +7,13 @@ namespace MediaBrowser.Controller.Providers
public class ImageRefreshOptions
{
public MetadataRefreshMode ImageRefreshMode { get; set; }
+
public IDirectoryService DirectoryService { get; private set; }
public bool ReplaceAllImages { get; set; }
public ImageType[] ReplaceImages { get; set; }
+
public bool IsAutomated { get; set; }
public ImageRefreshOptions(IDirectoryService directoryService)
diff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.cs
index 83efed2a14..270ea24449 100644
--- a/MediaBrowser.Controller/Providers/MetadataResult.cs
+++ b/MediaBrowser.Controller/Providers/MetadataResult.cs
@@ -48,6 +48,7 @@ namespace MediaBrowser.Controller.Providers
{
People = new List<PersonInfo>();
}
+
People.Clear();
}
diff --git a/MediaBrowser.Controller/Resolvers/IItemResolver.cs b/MediaBrowser.Controller/Resolvers/IItemResolver.cs
index 2e82b51f1e..a73937b3e3 100644
--- a/MediaBrowser.Controller/Resolvers/IItemResolver.cs
+++ b/MediaBrowser.Controller/Resolvers/IItemResolver.cs
@@ -35,6 +35,7 @@ namespace MediaBrowser.Controller.Resolvers
public class MultiItemResolverResult
{
public List<BaseItem> Items { get; set; }
+
public List<FileSystemMetadata> ExtraFiles { get; set; }
public MultiItemResolverResult()
diff --git a/MediaBrowser.Controller/Security/AuthenticationInfo.cs b/MediaBrowser.Controller/Security/AuthenticationInfo.cs
index 8282135884..1d0b959b73 100644
--- a/MediaBrowser.Controller/Security/AuthenticationInfo.cs
+++ b/MediaBrowser.Controller/Security/AuthenticationInfo.cs
@@ -65,6 +65,7 @@ namespace MediaBrowser.Controller.Security
public DateTime? DateRevoked { get; set; }
public DateTime DateLastActivity { get; set; }
+
public string UserName { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Session/AuthenticationRequest.cs b/MediaBrowser.Controller/Session/AuthenticationRequest.cs
index a28f47a9c6..685ca3bddc 100644
--- a/MediaBrowser.Controller/Session/AuthenticationRequest.cs
+++ b/MediaBrowser.Controller/Session/AuthenticationRequest.cs
@@ -5,13 +5,21 @@ namespace MediaBrowser.Controller.Session
public class AuthenticationRequest
{
public string Username { get; set; }
+
public Guid UserId { get; set; }
+
public string Password { get; set; }
+
public string PasswordSha1 { get; set; }
+
public string App { get; set; }
+
public string AppVersion { get; set; }
+
public string DeviceId { get; set; }
+
public string DeviceName { get; set; }
+
public string RemoteEndPoint { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs
index 2ba7c9fec0..36bc11be4f 100644
--- a/MediaBrowser.Controller/Session/SessionInfo.cs
+++ b/MediaBrowser.Controller/Session/SessionInfo.cs
@@ -61,6 +61,7 @@ namespace MediaBrowser.Controller.Session
{
return Array.Empty<string>();
}
+
return Capabilities.PlayableMediaTypes;
}
}
@@ -154,6 +155,7 @@ namespace MediaBrowser.Controller.Session
return true;
}
}
+
if (controllers.Length > 0)
{
return false;
@@ -255,6 +257,7 @@ namespace MediaBrowser.Controller.Session
return true;
}
}
+
return false;
}
@@ -292,6 +295,7 @@ namespace MediaBrowser.Controller.Session
{
return;
}
+
if (progressInfo.IsPaused)
{
return;
@@ -334,6 +338,7 @@ namespace MediaBrowser.Controller.Session
_progressTimer.Dispose();
_progressTimer = null;
}
+
_lastProgressInfo = null;
}
}
diff --git a/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs b/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs
index b8ba35a5fe..ad6025927c 100644
--- a/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs
+++ b/MediaBrowser.Controller/Subtitles/SubtitleResponse.cs
@@ -5,8 +5,11 @@ namespace MediaBrowser.Controller.Subtitles
public class SubtitleResponse
{
public string Language { get; set; }
+
public string Format { get; set; }
+
public bool IsForced { get; set; }
+
public Stream Stream { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs
index 61dc72258e..a202723b99 100644
--- a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs
+++ b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs
@@ -8,23 +8,35 @@ namespace MediaBrowser.Controller.Subtitles
public class SubtitleSearchRequest : IHasProviderIds
{
public string Language { get; set; }
+
public string TwoLetterISOLanguageName { get; set; }
public VideoContentType ContentType { get; set; }
public string MediaPath { get; set; }
+
public string SeriesName { get; set; }
+
public string Name { get; set; }
+
public int? IndexNumber { get; set; }
+
public int? IndexNumberEnd { get; set; }
+
public int? ParentIndexNumber { get; set; }
+
public int? ProductionYear { get; set; }
+
public long? RuntimeTicks { get; set; }
+
public bool IsPerfectMatch { get; set; }
+
public Dictionary<string, string> ProviderIds { get; set; }
public bool SearchAllProviders { get; set; }
+
public string[] DisabledSubtitleFetchers { get; set; }
+
public string[] SubtitleFetcherOrder { get; set; }
public SubtitleSearchRequest()
diff --git a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs
index 2ff40addb0..687a46d78f 100644
--- a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs
+++ b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs
@@ -10,6 +10,7 @@ namespace MediaBrowser.Controller.Sync
/// </summary>
/// <value>The path.</value>
public string Path { get; set; }
+
public string[] PathParts { get; set; }
/// <summary>
/// Gets or sets the protocol.
diff --git a/MediaBrowser.Controller/SyncPlay/GroupInfo.cs b/MediaBrowser.Controller/SyncPlay/GroupInfo.cs
index ef8df7d027..d0fac1efa3 100644
--- a/MediaBrowser.Controller/SyncPlay/GroupInfo.cs
+++ b/MediaBrowser.Controller/SyncPlay/GroupInfo.cs
@@ -122,6 +122,7 @@ namespace MediaBrowser.Controller.SyncPlay
{
max = Math.Max(max, session.Ping);
}
+
return max;
}