mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-26 02:27:06 +01:00
Merge remote-tracking branch 'upstream/master' into external-id-type
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.ApiClient
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Branding
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -37,7 +38,7 @@ namespace MediaBrowser.Model.Channels
|
||||
public ChannelMediaContentType[] ContentTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the maximum number of records the channel allows retrieving at a time
|
||||
/// Represents the maximum number of records the channel allows retrieving at a time.
|
||||
/// </summary>
|
||||
public int? MaxPageSize { get; set; }
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Channels
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -9,12 +10,15 @@ namespace MediaBrowser.Model.Channels
|
||||
public class ChannelQuery
|
||||
{
|
||||
/// <summary>
|
||||
/// Fields to return within the items, in addition to basic information
|
||||
/// Fields to return within the items, in addition to basic information.
|
||||
/// </summary>
|
||||
/// <value>The fields.</value>
|
||||
public ItemFields[] Fields { get; set; }
|
||||
|
||||
public bool? EnableImages { get; set; }
|
||||
|
||||
public int? ImageTypeLimit { get; set; }
|
||||
|
||||
public ImageType[] EnableImageTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -30,7 +34,7 @@ namespace MediaBrowser.Model.Channels
|
||||
public int? StartIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of items to return
|
||||
/// The maximum number of items to return.
|
||||
/// </summary>
|
||||
/// <value>The limit.</value>
|
||||
public int? Limit { get; set; }
|
||||
@@ -48,7 +52,9 @@ namespace MediaBrowser.Model.Channels
|
||||
/// </summary>
|
||||
/// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
|
||||
public bool? IsFavorite { get; set; }
|
||||
|
||||
public bool? IsRecordingsFolder { get; set; }
|
||||
|
||||
public bool RefreshLatestChannelItems { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Jellyfin.Data.Enums;
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -11,7 +12,15 @@ namespace MediaBrowser.Model.Configuration
|
||||
public class BaseApplicationConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// The number of days we should retain log files
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
||||
/// </summary>
|
||||
public BaseApplicationConfiguration()
|
||||
{
|
||||
LogFileRetentionDays = 3;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days we should retain log files.
|
||||
/// </summary>
|
||||
/// <value>The log file retention days.</value>
|
||||
public int LogFileRetentionDays { get; set; }
|
||||
@@ -29,29 +38,21 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string CachePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last known version that was ran using the configuration.
|
||||
/// Gets or sets the last known version that was ran using the configuration.
|
||||
/// </summary>
|
||||
/// <value>The version from previous run.</value>
|
||||
[XmlIgnore]
|
||||
public Version PreviousVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stringified PreviousVersion to be stored/loaded,
|
||||
/// because System.Version itself isn't xml-serializable
|
||||
/// Gets or sets the stringified PreviousVersion to be stored/loaded,
|
||||
/// because System.Version itself isn't xml-serializable.
|
||||
/// </summary>
|
||||
/// <value>String value of PreviousVersion</value>
|
||||
/// <value>String value of PreviousVersion.</value>
|
||||
public string PreviousVersionStr
|
||||
{
|
||||
get => PreviousVersion?.ToString();
|
||||
set => PreviousVersion = Version.Parse(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
||||
/// </summary>
|
||||
public BaseApplicationConfiguration()
|
||||
{
|
||||
LogFileRetentionDays = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public enum DynamicDayOfWeek
|
||||
{
|
||||
Sunday = 0,
|
||||
Monday = 1,
|
||||
Tuesday = 2,
|
||||
Wednesday = 3,
|
||||
Thursday = 4,
|
||||
Friday = 5,
|
||||
Saturday = 6,
|
||||
Everyday = 7,
|
||||
Weekday = 8,
|
||||
Weekend = 9
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
@@ -5,10 +6,15 @@ namespace MediaBrowser.Model.Configuration
|
||||
public class EncodingOptions
|
||||
{
|
||||
public int EncodingThreadCount { get; set; }
|
||||
|
||||
public string TranscodingTempPath { get; set; }
|
||||
|
||||
public double DownMixAudioBoost { get; set; }
|
||||
|
||||
public bool EnableThrottling { get; set; }
|
||||
|
||||
public int ThrottleDelaySeconds { get; set; }
|
||||
|
||||
public string HardwareAccelerationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -20,12 +26,23 @@ namespace MediaBrowser.Model.Configuration
|
||||
/// The current FFmpeg path being used by the system and displayed on the transcode page.
|
||||
/// </summary>
|
||||
public string EncoderAppPathDisplay { get; set; }
|
||||
|
||||
public string VaapiDevice { get; set; }
|
||||
|
||||
public int H264Crf { get; set; }
|
||||
|
||||
public int H265Crf { get; set; }
|
||||
|
||||
public string EncoderPreset { get; set; }
|
||||
|
||||
public string DeinterlaceMethod { get; set; }
|
||||
|
||||
public bool EnableDecodingColorDepth10Hevc { get; set; }
|
||||
|
||||
public bool EnableDecodingColorDepth10Vp9 { get; set; }
|
||||
|
||||
public bool EnableHardwareEncoding { get; set; }
|
||||
|
||||
public bool EnableSubtitleExtraction { get; set; }
|
||||
|
||||
public string[] HardwareDecodingCodecs { get; set; }
|
||||
@@ -41,6 +58,8 @@ namespace MediaBrowser.Model.Configuration
|
||||
H264Crf = 23;
|
||||
H265Crf = 28;
|
||||
DeinterlaceMethod = "yadif";
|
||||
EnableDecodingColorDepth10Hevc = true;
|
||||
EnableDecodingColorDepth10Vp9 = true;
|
||||
EnableHardwareEncoding = true;
|
||||
EnableSubtitleExtraction = true;
|
||||
HardwareDecodingCodecs = new string[] { "h264", "vc1" };
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -9,17 +10,27 @@ namespace MediaBrowser.Model.Configuration
|
||||
public class LibraryOptions
|
||||
{
|
||||
public bool EnablePhotos { get; set; }
|
||||
|
||||
public bool EnableRealtimeMonitor { get; set; }
|
||||
|
||||
public bool EnableChapterImageExtraction { get; set; }
|
||||
|
||||
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
|
||||
|
||||
public bool DownloadImagesInAdvance { get; set; }
|
||||
|
||||
public MediaPathInfo[] PathInfos { get; set; }
|
||||
|
||||
public bool SaveLocalMetadata { get; set; }
|
||||
|
||||
public bool EnableInternetProviders { get; set; }
|
||||
|
||||
public bool ImportMissingEpisodes { get; set; }
|
||||
|
||||
public bool EnableAutomaticSeriesGrouping { get; set; }
|
||||
|
||||
public bool EnableEmbeddedTitles { get; set; }
|
||||
|
||||
public bool EnableEmbeddedEpisodeInfos { get; set; }
|
||||
|
||||
public int AutomaticRefreshIntervalDays { get; set; }
|
||||
@@ -37,17 +48,25 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string MetadataCountryCode { get; set; }
|
||||
|
||||
public string SeasonZeroDisplayName { get; set; }
|
||||
|
||||
public string[] MetadataSavers { get; set; }
|
||||
|
||||
public string[] DisabledLocalMetadataReaders { get; set; }
|
||||
|
||||
public string[] LocalMetadataReaderOrder { get; set; }
|
||||
|
||||
public string[] DisabledSubtitleFetchers { get; set; }
|
||||
|
||||
public string[] SubtitleFetcherOrder { get; set; }
|
||||
|
||||
public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; }
|
||||
|
||||
public bool SkipSubtitlesIfAudioTrackMatches { get; set; }
|
||||
|
||||
public string[] SubtitleDownloadLanguages { get; set; }
|
||||
|
||||
public bool RequirePerfectSubtitleMatch { get; set; }
|
||||
|
||||
public bool SaveSubtitlesWithMedia { get; set; }
|
||||
|
||||
public TypeOptions[] TypeOptions { get; set; }
|
||||
@@ -88,17 +107,22 @@ namespace MediaBrowser.Model.Configuration
|
||||
public class MediaPathInfo
|
||||
{
|
||||
public string Path { get; set; }
|
||||
|
||||
public string NetworkPath { get; set; }
|
||||
}
|
||||
|
||||
public class TypeOptions
|
||||
{
|
||||
public string Type { get; set; }
|
||||
|
||||
public string[] MetadataFetchers { get; set; }
|
||||
|
||||
public string[] MetadataFetcherOrder { get; set; }
|
||||
|
||||
public string[] ImageFetchers { get; set; }
|
||||
|
||||
public string[] ImageFetcherOrder { get; set; }
|
||||
|
||||
public ImageOption[] ImageOptions { get; set; }
|
||||
|
||||
public ImageOption GetImageOptions(ImageType type)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -12,12 +13,15 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string ItemType { get; set; }
|
||||
|
||||
public string[] DisabledMetadataSavers { get; set; }
|
||||
|
||||
public string[] LocalMetadataReaderOrder { get; set; }
|
||||
|
||||
public string[] DisabledMetadataFetchers { get; set; }
|
||||
|
||||
public string[] MetadataFetcherOrder { get; set; }
|
||||
|
||||
public string[] DisabledImageFetchers { get; set; }
|
||||
|
||||
public string[] ImageFetcherOrder { get; set; }
|
||||
|
||||
public MetadataOptions()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum MetadataPluginType
|
||||
/// Enum MetadataPluginType.
|
||||
/// </summary>
|
||||
public enum MetadataPluginType
|
||||
{
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
@@ -110,19 +113,19 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string MetadataCountryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Characters to be replaced with a ' ' in strings to create a sort name
|
||||
/// Characters to be replaced with a ' ' in strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort replace characters.</value>
|
||||
public string[] SortReplaceCharacters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Characters to be removed from strings to create a sort name
|
||||
/// Characters to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove characters.</value>
|
||||
public string[] SortRemoveCharacters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Words to be removed from strings to create a sort name
|
||||
/// Words to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove words.</value>
|
||||
public string[] SortRemoveWords { get; set; }
|
||||
@@ -228,6 +231,8 @@ namespace MediaBrowser.Model.Configuration
|
||||
|
||||
public string[] CodecsUsed { get; set; }
|
||||
|
||||
public List<RepositoryInfo> PluginRepositories { get; set; }
|
||||
|
||||
public bool IgnoreVirtualInterfaces { get; set; }
|
||||
|
||||
public bool EnableExternalContentInSuggestions { get; set; }
|
||||
@@ -240,11 +245,13 @@ namespace MediaBrowser.Model.Configuration
|
||||
public bool EnableNewOmdbSupport { get; set; }
|
||||
|
||||
public string[] RemoteIPFilter { get; set; }
|
||||
|
||||
public bool IsRemoteIPFilterBlacklist { get; set; }
|
||||
|
||||
public int ImageExtractionTimeoutMs { get; set; }
|
||||
|
||||
public PathSubstitution[] PathSubstitutions { get; set; }
|
||||
|
||||
public bool EnableSimpleArtistDetection { get; set; }
|
||||
|
||||
public string[] UninstalledPlugins { get; set; }
|
||||
@@ -313,24 +320,24 @@ namespace MediaBrowser.Model.Configuration
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "MusicVideo",
|
||||
DisabledMetadataFetchers = new [] { "The Open Movie Database" },
|
||||
DisabledImageFetchers = new [] { "The Open Movie Database" }
|
||||
DisabledMetadataFetchers = new[] { "The Open Movie Database" },
|
||||
DisabledImageFetchers = new[] { "The Open Movie Database" }
|
||||
},
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "Series",
|
||||
DisabledMetadataFetchers = new [] { "TheMovieDb" },
|
||||
DisabledImageFetchers = new [] { "TheMovieDb" }
|
||||
DisabledMetadataFetchers = new[] { "TheMovieDb" },
|
||||
DisabledImageFetchers = new[] { "TheMovieDb" }
|
||||
},
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "MusicAlbum",
|
||||
DisabledMetadataFetchers = new [] { "TheAudioDB" }
|
||||
DisabledMetadataFetchers = new[] { "TheAudioDB" }
|
||||
},
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "MusicArtist",
|
||||
DisabledMetadataFetchers = new [] { "TheAudioDB" }
|
||||
DisabledMetadataFetchers = new[] { "TheAudioDB" }
|
||||
},
|
||||
new MetadataOptions
|
||||
{
|
||||
@@ -339,13 +346,13 @@ namespace MediaBrowser.Model.Configuration
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "Season",
|
||||
DisabledMetadataFetchers = new [] { "TheMovieDb" },
|
||||
DisabledMetadataFetchers = new[] { "TheMovieDb" },
|
||||
},
|
||||
new MetadataOptions
|
||||
{
|
||||
ItemType = "Episode",
|
||||
DisabledMetadataFetchers = new [] { "The Open Movie Database", "TheMovieDb" },
|
||||
DisabledImageFetchers = new [] { "The Open Movie Database", "TheMovieDb" }
|
||||
DisabledMetadataFetchers = new[] { "The Open Movie Database", "TheMovieDb" },
|
||||
DisabledImageFetchers = new[] { "The Open Movie Database", "TheMovieDb" }
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -354,6 +361,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
public class PathSubstitution
|
||||
{
|
||||
public string From { get; set; }
|
||||
|
||||
public string To { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public enum SubtitlePlaybackMode
|
||||
{
|
||||
Default = 0,
|
||||
Always = 1,
|
||||
OnlyForced = 2,
|
||||
None = 3,
|
||||
Smart = 4
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public enum UnratedItem
|
||||
{
|
||||
Movie,
|
||||
Trailer,
|
||||
Series,
|
||||
Music,
|
||||
Book,
|
||||
LiveTvChannel,
|
||||
LiveTvProgram,
|
||||
ChannelContent,
|
||||
Other
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using Jellyfin.Data.Enums;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UserConfiguration
|
||||
/// Class UserConfiguration.
|
||||
/// </summary>
|
||||
public class UserConfiguration
|
||||
{
|
||||
@@ -32,6 +34,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string[] GroupedFolders { get; set; }
|
||||
|
||||
public SubtitlePlaybackMode SubtitleMode { get; set; }
|
||||
|
||||
public bool DisplayCollectionsView { get; set; }
|
||||
|
||||
public bool EnableLocalPassword { get; set; }
|
||||
@@ -39,12 +42,15 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string[] OrderedViews { get; set; }
|
||||
|
||||
public string[] LatestItemsExcludes { get; set; }
|
||||
|
||||
public string[] MyMediaExcludes { get; set; }
|
||||
|
||||
public bool HidePlayedInLatest { get; set; }
|
||||
|
||||
public bool RememberAudioSelections { get; set; }
|
||||
|
||||
public bool RememberSubtitleSelections { get; set; }
|
||||
|
||||
public bool EnableNextEpisodeAutoPlay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
@@ -9,6 +10,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
public string ReleaseDateFormat { get; set; }
|
||||
|
||||
public bool SaveImagePathsInNfo { get; set; }
|
||||
|
||||
public bool EnablePathSubstitution { get; set; }
|
||||
|
||||
public bool EnableExtraThumbsDuplication { get; set; }
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Cryptography
|
||||
|
||||
IEnumerable<string> GetSupportedHashMethods();
|
||||
|
||||
byte[] ComputeHash(string HashMethod, byte[] bytes, byte[] salt);
|
||||
byte[] ComputeHash(string hashMethod, byte[] bytes, byte[] salt);
|
||||
|
||||
byte[] ComputeHashWithDefaultMethod(byte[] bytes, byte[] salt);
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public class ContentUploadHistory
|
||||
{
|
||||
public string DeviceId { get; set; }
|
||||
public LocalFileInfo[] FilesUploaded { get; set; }
|
||||
|
||||
public ContentUploadHistory()
|
||||
{
|
||||
FilesUploaded = new LocalFileInfo[] { };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -4,6 +4,6 @@ namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public class DeviceOptions
|
||||
{
|
||||
public string CustomName { get; set; }
|
||||
public string? CustomName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public class LocalFileInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Album { get; set; }
|
||||
public string MimeType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -19,12 +20,17 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
public bool EnableDirectPlay { get; set; }
|
||||
|
||||
public bool EnableDirectStream { get; set; }
|
||||
|
||||
public bool ForceDirectPlay { get; set; }
|
||||
|
||||
public bool ForceDirectStream { get; set; }
|
||||
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
public MediaSourceInfo[] MediaSources { get; set; }
|
||||
|
||||
public DeviceProfile Profile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -41,7 +47,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public int? MaxAudioChannels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The application's configured quality setting
|
||||
/// The application's configured quality setting.
|
||||
/// </summary>
|
||||
public long? MaxBitrate { get; set; }
|
||||
|
||||
@@ -79,6 +85,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return Profile.MaxStaticMusicBitrate;
|
||||
}
|
||||
|
||||
return Profile.MaxStaticBitrate;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? height,
|
||||
int? videoBitDepth,
|
||||
int? videoBitrate,
|
||||
string videoProfile,
|
||||
string? videoProfile,
|
||||
double? videoLevel,
|
||||
float? videoFramerate,
|
||||
int? packetLength,
|
||||
@@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? refFrames,
|
||||
int? numVideoStreams,
|
||||
int? numAudioStreams,
|
||||
string videoCodecTag,
|
||||
string? videoCodecTag,
|
||||
bool? isAvc)
|
||||
{
|
||||
switch (condition.Property)
|
||||
@@ -103,7 +103,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? audioBitrate,
|
||||
int? audioSampleRate,
|
||||
int? audioBitDepth,
|
||||
string audioProfile,
|
||||
string? audioProfile,
|
||||
bool? isSecondaryTrack)
|
||||
{
|
||||
switch (condition.Property)
|
||||
@@ -154,7 +154,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsConditionSatisfied(ProfileCondition condition, string currentValue)
|
||||
private static bool IsConditionSatisfied(ProfileCondition condition, string? currentValue)
|
||||
{
|
||||
if (string.IsNullOrEmpty(currentValue))
|
||||
{
|
||||
@@ -201,34 +201,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsConditionSatisfied(ProfileCondition condition, float currentValue)
|
||||
{
|
||||
if (currentValue <= 0)
|
||||
{
|
||||
// If the value is unknown, it satisfies if not marked as required
|
||||
return !condition.IsRequired;
|
||||
}
|
||||
|
||||
if (float.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var expected))
|
||||
{
|
||||
switch (condition.Condition)
|
||||
{
|
||||
case ProfileConditionType.Equals:
|
||||
return currentValue.Equals(expected);
|
||||
case ProfileConditionType.GreaterThanEqual:
|
||||
return currentValue >= expected;
|
||||
case ProfileConditionType.LessThanEqual:
|
||||
return currentValue <= expected;
|
||||
case ProfileConditionType.NotEquals:
|
||||
return !currentValue.Equals(expected);
|
||||
default:
|
||||
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
|
||||
{
|
||||
if (!currentValue.HasValue)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -10,6 +11,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
[XmlAttribute("type")]
|
||||
public DlnaProfileType Type { get; set; }
|
||||
|
||||
public ProfileCondition[] Conditions { get; set; }
|
||||
|
||||
[XmlAttribute("container")]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -32,7 +33,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", DlnaMaps.FlagsToString(flagValue));
|
||||
string dlnaflags = string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
";DLNA.ORG_FLAGS={0}",
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
|
||||
width,
|
||||
@@ -75,11 +79,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
//if (isDirectStream)
|
||||
// if (isDirectStream)
|
||||
//{
|
||||
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
||||
//}
|
||||
//else if (runtimeTicks.HasValue)
|
||||
// else if (runtimeTicks.HasValue)
|
||||
//{
|
||||
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
||||
//}
|
||||
@@ -144,11 +148,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
//if (isDirectStream)
|
||||
// if (isDirectStream)
|
||||
//{
|
||||
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
||||
//}
|
||||
//else if (runtimeTicks.HasValue)
|
||||
// else if (runtimeTicks.HasValue)
|
||||
//{
|
||||
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
||||
//}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -26,16 +27,25 @@ namespace MediaBrowser.Model.Dlna
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
public string FriendlyName { get; set; }
|
||||
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
public string ManufacturerUrl { get; set; }
|
||||
|
||||
public string ModelName { get; set; }
|
||||
|
||||
public string ModelDescription { get; set; }
|
||||
|
||||
public string ModelNumber { get; set; }
|
||||
|
||||
public string ModelUrl { get; set; }
|
||||
|
||||
public string SerialNumber { get; set; }
|
||||
|
||||
public bool EnableAlbumArtInDidl { get; set; }
|
||||
|
||||
public bool EnableSingleAlbumArtLimit { get; set; }
|
||||
|
||||
public bool EnableSingleSubtitleLimit { get; set; }
|
||||
|
||||
public string SupportedMediaTypes { get; set; }
|
||||
@@ -45,15 +55,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
public string AlbumArtPn { get; set; }
|
||||
|
||||
public int MaxAlbumArtWidth { get; set; }
|
||||
|
||||
public int MaxAlbumArtHeight { get; set; }
|
||||
|
||||
public int? MaxIconWidth { get; set; }
|
||||
|
||||
public int? MaxIconHeight { get; set; }
|
||||
|
||||
public long? MaxStreamingBitrate { get; set; }
|
||||
|
||||
public long? MaxStaticBitrate { get; set; }
|
||||
|
||||
public int? MusicStreamingTranscodingBitrate { get; set; }
|
||||
|
||||
public int? MaxStaticMusicBitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -64,10 +78,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
public string ProtocolInfo { get; set; }
|
||||
|
||||
public int TimelineOffsetSeconds { get; set; }
|
||||
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
@@ -87,6 +104,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public ContainerProfile[] ContainerProfiles { get; set; }
|
||||
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
@@ -168,6 +186,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -208,6 +227,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -253,6 +273,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -317,6 +338,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
@@ -5,7 +6,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
public interface ITranscoderSupport
|
||||
{
|
||||
bool CanEncodeToAudioCodec(string codec);
|
||||
|
||||
bool CanEncodeToSubtitleCodec(string codec);
|
||||
|
||||
bool CanExtractSubtitles(string codec);
|
||||
}
|
||||
|
||||
@@ -15,10 +18,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanEncodeToSubtitleCodec(string codec)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanExtractSubtitles(string codec)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -21,28 +22,35 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
|
||||
}
|
||||
|
||||
if (string.Equals(container, "avi", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.AVI };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mkv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mpeg2ps", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(container, "ts", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mpeg1video", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mpeg2ts", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(container, "mpegts", StringComparison.OrdinalIgnoreCase) ||
|
||||
@@ -53,26 +61,32 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
if (string.Equals(container, "flv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.FLV };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "wtv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.WTV };
|
||||
}
|
||||
|
||||
if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
|
||||
return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
|
||||
}
|
||||
|
||||
if (string.Equals(container, "ogv", StringComparison.OrdinalIgnoreCase) || string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.OGV };
|
||||
}
|
||||
|
||||
return new MediaFormatProfile[] { };
|
||||
return Array.Empty<MediaFormatProfile>();
|
||||
}
|
||||
|
||||
private MediaFormatProfile[] ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
|
||||
{
|
||||
string suffix = "";
|
||||
string suffix = string.Empty;
|
||||
|
||||
switch (timestampType)
|
||||
{
|
||||
@@ -92,22 +106,27 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var list = new List<MediaFormatProfile>();
|
||||
|
||||
list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
|
||||
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
|
||||
list.Add(ValueOf("MPEG_TS_SD_KO" + suffix));
|
||||
var list = new List<MediaFormatProfile>
|
||||
{
|
||||
ValueOf("MPEG_TS_SD_NA" + suffix),
|
||||
ValueOf("MPEG_TS_SD_EU" + suffix),
|
||||
ValueOf("MPEG_TS_SD_KO" + suffix)
|
||||
};
|
||||
|
||||
if ((timestampType == TransportStreamTimestamp.Valid) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
list.Add(MediaFormatProfile.MPEG_TS_JP_T);
|
||||
}
|
||||
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -115,6 +134,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
|
||||
}
|
||||
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
|
||||
}
|
||||
|
||||
@@ -129,14 +149,20 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(audioCodec) ||
|
||||
string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
|
||||
}
|
||||
}
|
||||
else if (string.Equals(videoCodec, "vc1", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -146,26 +172,38 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
|
||||
}
|
||||
|
||||
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
suffix = string.Equals(suffix, "_ISO", StringComparison.OrdinalIgnoreCase) ? suffix : "_T";
|
||||
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
|
||||
}
|
||||
|
||||
}
|
||||
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "mp2", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
|
||||
}
|
||||
}
|
||||
|
||||
return new MediaFormatProfile[] { };
|
||||
@@ -181,27 +219,36 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_MP4_LPCM;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(audioCodec) ||
|
||||
string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_MP4_MP_SD_AC3;
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3;
|
||||
}
|
||||
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 720) && (height.Value <= 576))
|
||||
{
|
||||
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_MP4_MP_SD_AAC_MULT5;
|
||||
}
|
||||
}
|
||||
else if ((width.Value <= 1280) && (height.Value <= 720))
|
||||
{
|
||||
if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_MP4_MP_HD_720p_AAC;
|
||||
}
|
||||
}
|
||||
else if ((width.Value <= 1920) && (height.Value <= 1080))
|
||||
{
|
||||
@@ -218,7 +265,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (width.HasValue && height.HasValue && width.Value <= 720 && height.Value <= 576)
|
||||
{
|
||||
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.MPEG4_P2_MP4_ASP_AAC;
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase) || string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.MPEG4_P2_MP4_NDSD;
|
||||
@@ -242,15 +292,22 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.AVC_3GPP_BL_QCIF15_AAC;
|
||||
}
|
||||
}
|
||||
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AAC;
|
||||
}
|
||||
|
||||
if (string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AMR;
|
||||
}
|
||||
}
|
||||
else if (string.Equals(videoCodec, "h263", StringComparison.OrdinalIgnoreCase) && string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -274,6 +331,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.WMVMED_FULL;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.WMVMED_PRO;
|
||||
}
|
||||
}
|
||||
@@ -282,6 +340,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.WMVHIGH_FULL;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.WMVHIGH_PRO;
|
||||
}
|
||||
|
||||
@@ -290,11 +349,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 720) && (height.Value <= 576))
|
||||
{
|
||||
return MediaFormatProfile.VC1_ASF_AP_L1_WMA;
|
||||
}
|
||||
|
||||
if ((width.Value <= 1280) && (height.Value <= 720))
|
||||
{
|
||||
return MediaFormatProfile.VC1_ASF_AP_L2_WMA;
|
||||
}
|
||||
|
||||
if ((width.Value <= 1920) && (height.Value <= 1080))
|
||||
{
|
||||
return MediaFormatProfile.VC1_ASF_AP_L3_WMA;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -308,27 +375,41 @@ namespace MediaBrowser.Model.Dlna
|
||||
public MediaFormatProfile? ResolveAudioFormat(string container, int? bitrate, int? frequency, int? channels)
|
||||
{
|
||||
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResolveAudioASFFormat(bitrate);
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mp3", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.MP3;
|
||||
}
|
||||
|
||||
if (string.Equals(container, "lpcm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResolveAudioLPCMFormat(frequency, channels);
|
||||
}
|
||||
|
||||
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(container, "aac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResolveAudioMP4Format(bitrate);
|
||||
}
|
||||
|
||||
if (string.Equals(container, "adts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResolveAudioADTSFormat(bitrate);
|
||||
}
|
||||
|
||||
if (string.Equals(container, "flac", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.FLAC;
|
||||
}
|
||||
|
||||
if (string.Equals(container, "oga", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.OGG;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -339,6 +420,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.WMA_BASE;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.WMA_FULL;
|
||||
}
|
||||
|
||||
@@ -350,14 +432,17 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.LPCM16_44_MONO;
|
||||
}
|
||||
|
||||
if (frequency.Value == 44100 && channels.Value == 2)
|
||||
{
|
||||
return MediaFormatProfile.LPCM16_44_STEREO;
|
||||
}
|
||||
|
||||
if (frequency.Value == 48000 && channels.Value == 1)
|
||||
{
|
||||
return MediaFormatProfile.LPCM16_48_MONO;
|
||||
}
|
||||
|
||||
if (frequency.Value == 48000 && channels.Value == 2)
|
||||
{
|
||||
return MediaFormatProfile.LPCM16_48_STEREO;
|
||||
@@ -375,6 +460,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.AAC_ISO_320;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.AAC_ISO;
|
||||
}
|
||||
|
||||
@@ -384,6 +470,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return MediaFormatProfile.AAC_ADTS_320;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.AAC_ADTS;
|
||||
}
|
||||
|
||||
@@ -394,13 +481,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
return ResolveImageJPGFormat(width, height);
|
||||
|
||||
if (string.Equals(container, "png", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ResolveImagePNGFormat(width, height);
|
||||
}
|
||||
|
||||
if (string.Equals(container, "gif", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.GIF_LRG;
|
||||
}
|
||||
|
||||
if (string.Equals(container, "raw", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return MediaFormatProfile.RAW;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -410,10 +503,14 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 160) && (height.Value <= 160))
|
||||
{
|
||||
return MediaFormatProfile.JPEG_TN;
|
||||
}
|
||||
|
||||
if ((width.Value <= 640) && (height.Value <= 480))
|
||||
{
|
||||
return MediaFormatProfile.JPEG_SM;
|
||||
}
|
||||
|
||||
if ((width.Value <= 1024) && (height.Value <= 768))
|
||||
{
|
||||
@@ -431,7 +528,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 160) && (height.Value <= 160))
|
||||
{
|
||||
return MediaFormatProfile.PNG_TN;
|
||||
}
|
||||
}
|
||||
|
||||
return MediaFormatProfile.PNG_LRG;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Xml.Serialization;
|
||||
@@ -6,6 +7,24 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class ProfileCondition
|
||||
{
|
||||
public ProfileCondition()
|
||||
{
|
||||
IsRequired = true;
|
||||
}
|
||||
|
||||
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value)
|
||||
: this(condition, property, value, false)
|
||||
{
|
||||
}
|
||||
|
||||
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired)
|
||||
{
|
||||
Condition = condition;
|
||||
Property = property;
|
||||
Value = value;
|
||||
IsRequired = isRequired;
|
||||
}
|
||||
|
||||
[XmlAttribute("condition")]
|
||||
public ProfileConditionType Condition { get; set; }
|
||||
|
||||
@@ -17,24 +36,5 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
[XmlAttribute("isRequired")]
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
public ProfileCondition()
|
||||
{
|
||||
IsRequired = true;
|
||||
}
|
||||
|
||||
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value)
|
||||
: this(condition, property, value, false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired)
|
||||
{
|
||||
Condition = condition;
|
||||
Property = property;
|
||||
Value = value;
|
||||
IsRequired = isRequired;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public class ResolutionConfiguration
|
||||
{
|
||||
public int MaxWidth { get; set; }
|
||||
|
||||
public int MaxBitrate { get; set; }
|
||||
|
||||
public ResolutionConfiguration(int maxWidth, int maxBitrate)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -17,7 +18,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
new ResolutionConfiguration(3840, 35000000)
|
||||
};
|
||||
|
||||
public static ResolutionOptions Normalize(int? inputBitrate,
|
||||
public static ResolutionOptions Normalize(
|
||||
int? inputBitrate,
|
||||
int? unused1,
|
||||
int? unused2,
|
||||
int outputBitrate,
|
||||
@@ -83,6 +85,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return .5;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public class ResolutionOptions
|
||||
{
|
||||
public int? MaxWidth { get; set; }
|
||||
|
||||
public int? MaxHeight { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
@@ -28,7 +30,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public ResponseProfile()
|
||||
{
|
||||
Conditions = new ProfileCondition[] { };
|
||||
Conditions = Array.Empty<ProfileCondition>();
|
||||
}
|
||||
|
||||
public string[] GetContainers()
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public SearchCriteria(string search)
|
||||
{
|
||||
if (string.IsNullOrEmpty(search))
|
||||
if (search.Length == 0)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(search));
|
||||
throw new ArgumentException("String can't be empty.", nameof(search));
|
||||
}
|
||||
|
||||
SearchType = SearchType.Unknown;
|
||||
@@ -48,11 +48,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (subFactors.Length == 3)
|
||||
{
|
||||
|
||||
if (string.Equals("upnp:class", subFactors[0], StringComparison.OrdinalIgnoreCase) &&
|
||||
(string.Equals("=", subFactors[1]) || string.Equals("derivedfrom", subFactors[1], StringComparison.OrdinalIgnoreCase)))
|
||||
(string.Equals("=", subFactors[1], StringComparison.Ordinal) || string.Equals("derivedfrom", subFactors[1], StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
if (string.Equals("\"object.item.imageItem\"", subFactors[2]) || string.Equals("\"object.item.imageItem.photo\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals("\"object.item.imageItem\"", subFactors[2], StringComparison.Ordinal) || string.Equals("\"object.item.imageItem.photo\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
SearchType = SearchType.Image;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public SortCriteria(string value)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -108,7 +109,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}).ThenBy(i =>
|
||||
{
|
||||
switch (i.PlayMethod)
|
||||
@@ -120,7 +120,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
}).ThenBy(i =>
|
||||
{
|
||||
switch (i.MediaSource.Protocol)
|
||||
@@ -130,7 +129,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
}).ThenBy(i =>
|
||||
{
|
||||
if (maxBitrate > 0)
|
||||
@@ -142,7 +140,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}).ThenBy(streams.IndexOf);
|
||||
}
|
||||
|
||||
@@ -339,6 +336,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
transcodeReasons.Add(transcodeReason.Value);
|
||||
}
|
||||
|
||||
all = false;
|
||||
break;
|
||||
}
|
||||
@@ -386,7 +384,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
audioCodecProfiles.Add(i);
|
||||
}
|
||||
|
||||
if (audioCodecProfiles.Count >= 1) break;
|
||||
if (audioCodecProfiles.Count >= 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var audioTranscodingConditions = new List<ProfileCondition>();
|
||||
@@ -629,10 +630,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
playlistItem.MinSegments = transcodingProfile.MinSegments;
|
||||
}
|
||||
|
||||
if (transcodingProfile.SegmentLength > 0)
|
||||
{
|
||||
playlistItem.SegmentLength = transcodingProfile.SegmentLength;
|
||||
}
|
||||
|
||||
playlistItem.SubProtocol = transcodingProfile.Protocol;
|
||||
|
||||
if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels)
|
||||
@@ -779,7 +782,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (!ConditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
//LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
|
||||
// LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
|
||||
applyConditions = false;
|
||||
break;
|
||||
}
|
||||
@@ -823,7 +826,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (!ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio))
|
||||
{
|
||||
//LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
|
||||
// LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
|
||||
applyConditions = false;
|
||||
break;
|
||||
}
|
||||
@@ -949,6 +952,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return (PlayMethod.DirectPlay, new List<TranscodeReason>());
|
||||
}
|
||||
|
||||
if (options.ForceDirectStream)
|
||||
{
|
||||
return (PlayMethod.DirectStream, new List<TranscodeReason>());
|
||||
@@ -1044,7 +1048,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
if (!ConditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
//LogConditionFailure(profile, "VideoCodecProfile.ApplyConditions", applyCondition, mediaSource);
|
||||
// LogConditionFailure(profile, "VideoCodecProfile.ApplyConditions", applyCondition, mediaSource);
|
||||
applyConditions = false;
|
||||
break;
|
||||
}
|
||||
@@ -1090,7 +1094,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
if (!ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio))
|
||||
{
|
||||
//LogConditionFailure(profile, "VideoAudioCodecProfile.ApplyConditions", applyCondition, mediaSource);
|
||||
// LogConditionFailure(profile, "VideoAudioCodecProfile.ApplyConditions", applyCondition, mediaSource);
|
||||
applyConditions = false;
|
||||
break;
|
||||
}
|
||||
@@ -1263,6 +1267,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1365,14 +1370,17 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
throw new ArgumentException("ItemId is required");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(options.DeviceId))
|
||||
{
|
||||
throw new ArgumentException("DeviceId is required");
|
||||
}
|
||||
|
||||
if (options.Profile == null)
|
||||
{
|
||||
throw new ArgumentException("Profile is required");
|
||||
}
|
||||
|
||||
if (options.MediaSources == null)
|
||||
{
|
||||
throw new ArgumentException("MediaSources is required");
|
||||
@@ -1420,6 +1428,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.AudioBitrate = Math.Max(num, item.AudioBitrate ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.AudioChannels:
|
||||
@@ -1454,6 +1463,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "audiochannels", Math.Max(num, item.GetTargetAudioChannels(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.IsAvc:
|
||||
@@ -1474,6 +1484,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.RequireAvc = true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.IsAnamorphic:
|
||||
@@ -1494,6 +1505,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.RequireNonAnamorphic = true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.IsInterlaced:
|
||||
@@ -1524,6 +1536,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "deinterlace", "true");
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.AudioProfile:
|
||||
@@ -1569,6 +1582,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "maxrefframes", Math.Max(num, item.GetTargetRefFrames(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.VideoBitDepth:
|
||||
@@ -1603,6 +1617,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "videobitdepth", Math.Max(num, item.GetTargetVideoBitDepth(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.VideoProfile:
|
||||
@@ -1625,6 +1640,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "profile", string.Join(",", values));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.Height:
|
||||
@@ -1649,6 +1665,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.MaxHeight = Math.Max(num, item.MaxHeight ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.VideoBitrate:
|
||||
@@ -1673,6 +1690,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.VideoBitrate = Math.Max(num, item.VideoBitrate ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.VideoFramerate:
|
||||
@@ -1697,6 +1715,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.MaxFramerate = Math.Max(num, item.MaxFramerate ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.VideoLevel:
|
||||
@@ -1721,6 +1740,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.SetOption(qualifier, "level", Math.Max(num, item.GetTargetVideoLevel(qualifier) ?? num).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ProfileConditionValue.Width:
|
||||
@@ -1745,8 +1765,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
item.MaxWidth = Math.Max(num, item.MaxWidth ?? num);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -68,6 +69,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public Guid ItemId { get; set; }
|
||||
|
||||
public PlayMethod PlayMethod { get; set; }
|
||||
|
||||
public EncodingContext Context { get; set; }
|
||||
|
||||
public DlnaProfileType MediaType { get; set; }
|
||||
@@ -79,15 +81,23 @@ namespace MediaBrowser.Model.Dlna
|
||||
public long StartPositionTicks { get; set; }
|
||||
|
||||
public int? SegmentLength { get; set; }
|
||||
|
||||
public int? MinSegments { get; set; }
|
||||
|
||||
public bool BreakOnNonKeyFrames { get; set; }
|
||||
|
||||
public bool RequireAvc { get; set; }
|
||||
|
||||
public bool RequireNonAnamorphic { get; set; }
|
||||
|
||||
public bool CopyTimestamps { get; set; }
|
||||
|
||||
public bool EnableMpegtsM2TsMode { get; set; }
|
||||
|
||||
public bool EnableSubtitlesInManifest { get; set; }
|
||||
|
||||
public string[] AudioCodecs { get; set; }
|
||||
|
||||
public string[] VideoCodecs { get; set; }
|
||||
|
||||
public int? AudioStreamIndex { get; set; }
|
||||
@@ -95,6 +105,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public int? SubtitleStreamIndex { get; set; }
|
||||
|
||||
public int? TranscodingMaxAudioChannels { get; set; }
|
||||
|
||||
public int? GlobalMaxAudioChannels { get; set; }
|
||||
|
||||
public int? AudioBitrate { get; set; }
|
||||
@@ -102,12 +113,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
public int? VideoBitrate { get; set; }
|
||||
|
||||
public int? MaxWidth { get; set; }
|
||||
|
||||
public int? MaxHeight { get; set; }
|
||||
|
||||
public float? MaxFramerate { get; set; }
|
||||
|
||||
public DeviceProfile DeviceProfile { get; set; }
|
||||
|
||||
public string DeviceProfileId { get; set; }
|
||||
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
public long? RunTimeTicks { get; set; }
|
||||
@@ -119,10 +133,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
public MediaSourceInfo MediaSource { get; set; }
|
||||
|
||||
public string[] SubtitleCodecs { get; set; }
|
||||
|
||||
public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; }
|
||||
|
||||
public string SubtitleFormat { get; set; }
|
||||
|
||||
public string PlaySessionId { get; set; }
|
||||
|
||||
public TranscodeReason[] TranscodeReasons { get; set; }
|
||||
|
||||
public Dictionary<string, string> StreamOptions { get; private set; }
|
||||
@@ -159,11 +176,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.Equals(pair.Name, "SubtitleStreamIndex", StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(pair.Value, "-1", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -464,7 +483,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the audio stream that will be used
|
||||
/// Returns the audio stream that will be used.
|
||||
/// </summary>
|
||||
public MediaStream TargetAudioStream
|
||||
{
|
||||
@@ -480,7 +499,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the video stream that will be used
|
||||
/// Returns the video stream that will be used.
|
||||
/// </summary>
|
||||
public MediaStream TargetVideoStream
|
||||
{
|
||||
@@ -496,7 +515,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetAudioSampleRate
|
||||
{
|
||||
@@ -508,7 +527,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetAudioBitDepth
|
||||
{
|
||||
@@ -531,7 +550,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetVideoBitDepth
|
||||
{
|
||||
@@ -578,7 +597,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public float? TargetFramerate
|
||||
{
|
||||
@@ -592,7 +611,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public double? TargetVideoLevel
|
||||
{
|
||||
@@ -679,7 +698,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetPacketLength
|
||||
{
|
||||
@@ -693,7 +712,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// Predicts the audio sample rate that will be in the output stream.
|
||||
/// </summary>
|
||||
public string TargetVideoProfile
|
||||
{
|
||||
@@ -731,7 +750,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio bitrate that will be in the output stream
|
||||
/// Predicts the audio bitrate that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetAudioBitrate
|
||||
{
|
||||
@@ -745,7 +764,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio channels that will be in the output stream
|
||||
/// Predicts the audio channels that will be in the output stream.
|
||||
/// </summary>
|
||||
public int? TargetAudioChannels
|
||||
{
|
||||
@@ -786,7 +805,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio codec that will be in the output stream
|
||||
/// Predicts the audio codec that will be in the output stream.
|
||||
/// </summary>
|
||||
public string[] TargetAudioCodec
|
||||
{
|
||||
@@ -839,7 +858,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio channels that will be in the output stream
|
||||
/// Predicts the audio channels that will be in the output stream.
|
||||
/// </summary>
|
||||
public long? TargetSize
|
||||
{
|
||||
@@ -992,6 +1011,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue);
|
||||
}
|
||||
|
||||
return GetMediaStreamCount(MediaStreamType.Video, 1);
|
||||
}
|
||||
}
|
||||
@@ -1004,6 +1024,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue);
|
||||
}
|
||||
|
||||
return GetMediaStreamCount(MediaStreamType.Audio, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,22 +5,22 @@ namespace MediaBrowser.Model.Dlna
|
||||
public enum SubtitleDeliveryMethod
|
||||
{
|
||||
/// <summary>
|
||||
/// The encode
|
||||
/// The encode.
|
||||
/// </summary>
|
||||
Encode = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The embed
|
||||
/// The embed.
|
||||
/// </summary>
|
||||
Embed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The external
|
||||
/// The external.
|
||||
/// </summary>
|
||||
External = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The HLS
|
||||
/// The HLS.
|
||||
/// </summary>
|
||||
Hls = 3
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
@@ -5,13 +6,21 @@ namespace MediaBrowser.Model.Dlna
|
||||
public class SubtitleStreamInfo
|
||||
{
|
||||
public string Url { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool IsForced { get; set; }
|
||||
|
||||
public string Format { get; set; }
|
||||
|
||||
public string DisplayTitle { get; set; }
|
||||
|
||||
public int Index { get; set; }
|
||||
|
||||
public SubtitleDeliveryMethod DeliveryMethod { get; set; }
|
||||
|
||||
public bool IsExternalUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -9,8 +10,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
public class UpnpDeviceInfo
|
||||
{
|
||||
public Uri Location { get; set; }
|
||||
|
||||
public Dictionary<string, string> Headers { get; set; }
|
||||
|
||||
public IPAddress LocalIpAddress { get; set; }
|
||||
|
||||
public int LocalPort { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public class VideoOptions : AudioOptions
|
||||
{
|
||||
public int? AudioStreamIndex { get; set; }
|
||||
|
||||
public int? SubtitleStreamIndex { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.Xml.Serialization;
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace MediaBrowser.Model.Drawing
|
||||
/// <param name="maxWidth">A max fixed width, if desired.</param>
|
||||
/// <param name="maxHeight">A max fixed height, if desired.</param>
|
||||
/// <returns>A new size object.</returns>
|
||||
public static ImageDimensions Resize(ImageDimensions size,
|
||||
public static ImageDimensions Resize(
|
||||
ImageDimensions size,
|
||||
int width,
|
||||
int height,
|
||||
int maxWidth,
|
||||
@@ -62,7 +63,7 @@ namespace MediaBrowser.Model.Drawing
|
||||
/// <param name="currentHeight">Height of the current.</param>
|
||||
/// <param name="currentWidth">Width of the current.</param>
|
||||
/// <param name="newHeight">The new height.</param>
|
||||
/// <returns>the new width</returns>
|
||||
/// <returns>The new width.</returns>
|
||||
private static int GetNewWidth(int currentHeight, int currentWidth, int newHeight)
|
||||
=> Convert.ToInt32((double)newHeight / currentHeight * currentWidth);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -61,17 +62,23 @@ namespace MediaBrowser.Model.Dto
|
||||
public DateTime? DateCreated { get; set; }
|
||||
|
||||
public DateTime? DateLastMediaAdded { get; set; }
|
||||
|
||||
public string ExtraType { get; set; }
|
||||
|
||||
public int? AirsBeforeSeasonNumber { get; set; }
|
||||
|
||||
public int? AirsAfterSeasonNumber { get; set; }
|
||||
|
||||
public int? AirsBeforeEpisodeNumber { get; set; }
|
||||
|
||||
public bool? CanDelete { get; set; }
|
||||
|
||||
public bool? CanDownload { get; set; }
|
||||
|
||||
public bool? HasSubtitles { get; set; }
|
||||
|
||||
public string PreferredMetadataLanguage { get; set; }
|
||||
|
||||
public string PreferredMetadataCountryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -86,6 +93,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The name of the sort.</value>
|
||||
public string SortName { get; set; }
|
||||
|
||||
public string ForcedSortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -145,6 +153,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The channel identifier.</value>
|
||||
public Guid ChannelId { get; set; }
|
||||
|
||||
public string ChannelName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -212,6 +221,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The number.</value>
|
||||
public string Number { get; set; }
|
||||
|
||||
public string ChannelNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -307,7 +317,7 @@ namespace MediaBrowser.Model.Dto
|
||||
public int? LocalTrailerCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User data for this item based on the user it's being requested for
|
||||
/// User data for this item based on the user it's being requested for.
|
||||
/// </summary>
|
||||
/// <value>The user data.</value>
|
||||
public UserItemDataDto UserData { get; set; }
|
||||
@@ -466,6 +476,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The part count.</value>
|
||||
public int? PartCount { get; set; }
|
||||
|
||||
public int? MediaSourceCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -510,6 +521,13 @@ namespace MediaBrowser.Model.Dto
|
||||
/// <value>The series thumb image tag.</value>
|
||||
public string SeriesThumbImageTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the blurhashes for the image tags.
|
||||
/// Maps image type to dictionary mapping image tag to blurhash value.
|
||||
/// </summary>
|
||||
/// <value>The blurhashes.</value>
|
||||
public Dictionary<ImageType, Dictionary<string, string>> ImageBlurHashes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the series studio.
|
||||
/// </summary>
|
||||
@@ -574,7 +592,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// Gets or sets the locked fields.
|
||||
/// </summary>
|
||||
/// <value>The locked fields.</value>
|
||||
public MetadataFields[] LockedFields { get; set; }
|
||||
public MetadataField[] LockedFields { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the trailer count.
|
||||
@@ -591,6 +609,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The series count.</value>
|
||||
public int? SeriesCount { get; set; }
|
||||
|
||||
public int? ProgramCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the episode count.
|
||||
@@ -607,6 +626,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The album count.</value>
|
||||
public int? AlbumCount { get; set; }
|
||||
|
||||
public int? ArtistCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the music video count.
|
||||
@@ -621,18 +641,31 @@ namespace MediaBrowser.Model.Dto
|
||||
public bool? LockData { get; set; }
|
||||
|
||||
public int? Width { get; set; }
|
||||
|
||||
public int? Height { get; set; }
|
||||
|
||||
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? ImageOrientation { 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; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#nullable disable
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
@@ -37,6 +40,12 @@ namespace MediaBrowser.Model.Dto
|
||||
/// <value>The primary image tag.</value>
|
||||
public string PrimaryImageTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image blurhash.
|
||||
/// </summary>
|
||||
/// <value>The primary image blurhash.</value>
|
||||
public Dictionary<ImageType, Dictionary<string, string>> ImageBlurHashes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance has primary image.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
@@ -20,9 +21,9 @@ namespace MediaBrowser.Model.Dto
|
||||
public int? ImageIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The image tag
|
||||
/// Gets or sets the image tag.
|
||||
/// </summary>
|
||||
public string ImageTag;
|
||||
public string ImageTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path.
|
||||
@@ -30,6 +31,12 @@ namespace MediaBrowser.Model.Dto
|
||||
/// <value>The path.</value>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the blurhash.
|
||||
/// </summary>
|
||||
/// <value>The blurhash.</value>
|
||||
public string BlurHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
@@ -8,6 +9,14 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
public class ImageOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImageOptions" /> class.
|
||||
/// </summary>
|
||||
public ImageOptions()
|
||||
{
|
||||
EnableImageEnhancers = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the image.
|
||||
/// </summary>
|
||||
@@ -52,7 +61,7 @@ namespace MediaBrowser.Model.Dto
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image tag.
|
||||
/// If set this will result in strong, unconditional response caching
|
||||
/// If set this will result in strong, unconditional response caching.
|
||||
/// </summary>
|
||||
/// <value>The hash.</value>
|
||||
public string Tag { get; set; }
|
||||
@@ -98,13 +107,5 @@ namespace MediaBrowser.Model.Dto
|
||||
/// </summary>
|
||||
/// <value>The color of the background.</value>
|
||||
public string BackgroundColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImageOptions" /> class.
|
||||
/// </summary>
|
||||
public ImageOptions()
|
||||
{
|
||||
EnableImageEnhancers = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// Class ItemIndex.
|
||||
/// </summary>
|
||||
public class ItemIndex
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the item count.
|
||||
/// </summary>
|
||||
/// <value>The item count.</value>
|
||||
public int ItemCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -12,39 +13,56 @@ namespace MediaBrowser.Model.Dto
|
||||
public class MediaSourceInfo
|
||||
{
|
||||
public MediaProtocol Protocol { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public string EncoderPath { get; set; }
|
||||
|
||||
public MediaProtocol? EncoderProtocol { get; set; }
|
||||
|
||||
public MediaSourceType Type { get; set; }
|
||||
|
||||
public string Container { get; set; }
|
||||
|
||||
public long? Size { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Differentiate internet url vs local network
|
||||
/// Differentiate internet url vs local network.
|
||||
/// </summary>
|
||||
public bool IsRemote { get; set; }
|
||||
|
||||
public string ETag { get; set; }
|
||||
|
||||
public long? RunTimeTicks { get; set; }
|
||||
|
||||
public bool ReadAtNativeFramerate { get; set; }
|
||||
|
||||
public bool IgnoreDts { get; set; }
|
||||
|
||||
public bool IgnoreIndex { get; set; }
|
||||
|
||||
public bool GenPtsInput { get; set; }
|
||||
|
||||
public bool SupportsTranscoding { get; set; }
|
||||
|
||||
public bool SupportsDirectStream { get; set; }
|
||||
|
||||
public bool SupportsDirectPlay { get; set; }
|
||||
|
||||
public bool IsInfiniteStream { get; set; }
|
||||
|
||||
public bool RequiresOpening { get; set; }
|
||||
|
||||
public string OpenToken { get; set; }
|
||||
|
||||
public bool RequiresClosing { get; set; }
|
||||
|
||||
public string LiveStreamId { get; set; }
|
||||
|
||||
public int? BufferMs { get; set; }
|
||||
|
||||
public bool RequiresLooping { get; set; }
|
||||
@@ -66,10 +84,13 @@ namespace MediaBrowser.Model.Dto
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
public TransportStreamTimestamp? Timestamp { get; set; }
|
||||
|
||||
public Dictionary<string, string> RequiredHttpHeaders { get; set; }
|
||||
|
||||
public string TranscodingUrl { get; set; }
|
||||
|
||||
public string TranscodingSubProtocol { get; set; }
|
||||
|
||||
public string TranscodingContainer { get; set; }
|
||||
|
||||
public int? AnalyzeDurationMs { get; set; }
|
||||
@@ -117,6 +138,7 @@ namespace MediaBrowser.Model.Dto
|
||||
public TranscodeReason[] TranscodeReasons { get; set; }
|
||||
|
||||
public int? DefaultAudioStreamIndex { get; set; }
|
||||
|
||||
public int? DefaultSubtitleStreamIndex { get; set; }
|
||||
|
||||
public MediaStream GetDefaultAudioStream(int? defaultIndex)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -10,11 +11,15 @@ namespace MediaBrowser.Model.Dto
|
||||
public class MetadataEditorInfo
|
||||
{
|
||||
public ParentalRating[] ParentalRatingOptions { get; set; }
|
||||
|
||||
public CountryInfo[] Countries { get; set; }
|
||||
|
||||
public CultureDto[] Cultures { get; set; }
|
||||
|
||||
public ExternalIdInfo[] ExternalIdInfos { get; set; }
|
||||
|
||||
public string ContentType { get; set; }
|
||||
|
||||
public NameValuePair[] ContentTypeOptions { get; set; }
|
||||
|
||||
public MetadataEditorInfo()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -22,6 +23,7 @@ namespace MediaBrowser.Model.Dto
|
||||
public class NameGuidPair
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
@@ -6,7 +7,6 @@ namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
public NameValuePair()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public NameValuePair(string name, string value)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PublicUserDto. Its goal is to show only public information about a user
|
||||
/// </summary>
|
||||
public class PublicUserDto : IItemDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image tag.
|
||||
/// </summary>
|
||||
/// <value>The primary image tag.</value>
|
||||
public string PrimaryImageTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has password.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
|
||||
public bool HasPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has configured password.
|
||||
/// Note that in this case this method should not be here, but it is necessary when changing password at the
|
||||
/// first login.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
|
||||
public bool HasConfiguredPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image aspect ratio.
|
||||
/// </summary>
|
||||
/// <value>The primary image aspect ratio.</value>
|
||||
public double? PrimaryImageAspectRatio { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return Name ?? base.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using System;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Users;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
@@ -103,7 +104,7 @@ namespace MediaBrowser.Model.Entities
|
||||
public bool ShowSidebar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the client
|
||||
/// Gets or sets the client.
|
||||
/// </summary>
|
||||
public string Client { get; set; }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods.
|
||||
/// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repetition by using extension methods.
|
||||
/// </summary>
|
||||
public interface IHasProviderIds
|
||||
{
|
||||
|
||||
@@ -63,6 +63,11 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <summary>
|
||||
/// The box rear.
|
||||
/// </summary>
|
||||
BoxRear = 11
|
||||
BoxRear = 11,
|
||||
|
||||
/// <summary>
|
||||
/// The user profile image.
|
||||
/// </summary>
|
||||
Profile = 12
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,29 @@ using System;
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Class LibraryUpdateInfo
|
||||
/// Class LibraryUpdateInfo.
|
||||
/// </summary>
|
||||
public class LibraryUpdateInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
|
||||
/// </summary>
|
||||
public LibraryUpdateInfo()
|
||||
{
|
||||
FoldersAddedTo = Array.Empty<string>();
|
||||
FoldersRemovedFrom = Array.Empty<string>();
|
||||
ItemsAdded = Array.Empty<string>();
|
||||
ItemsRemoved = Array.Empty<string>();
|
||||
ItemsUpdated = Array.Empty<string>();
|
||||
CollectionFolders = Array.Empty<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the folders added to.
|
||||
/// </summary>
|
||||
/// <value>The folders added to.</value>
|
||||
public string[] FoldersAddedTo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the folders removed from.
|
||||
/// </summary>
|
||||
@@ -41,18 +55,5 @@ namespace MediaBrowser.Model.Entities
|
||||
public string[] CollectionFolders { get; set; }
|
||||
|
||||
public bool IsEmpty => FoldersAddedTo.Length == 0 && FoldersRemovedFrom.Length == 0 && ItemsAdded.Length == 0 && ItemsRemoved.Length == 0 && ItemsUpdated.Length == 0 && CollectionFolders.Length == 0;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
|
||||
/// </summary>
|
||||
public LibraryUpdateInfo()
|
||||
{
|
||||
FoldersAddedTo = Array.Empty<string>();
|
||||
FoldersRemovedFrom = Array.Empty<string>();
|
||||
ItemsAdded = Array.Empty<string>();
|
||||
ItemsRemoved = Array.Empty<string>();
|
||||
ItemsUpdated = Array.Empty<string>();
|
||||
CollectionFolders = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -12,7 +13,7 @@ using MediaBrowser.Model.MediaInfo;
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MediaStream
|
||||
/// Class MediaStream.
|
||||
/// </summary>
|
||||
public class MediaStream
|
||||
{
|
||||
@@ -113,7 +114,7 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
if (Type == MediaStreamType.Audio)
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(Title))
|
||||
// if (!string.IsNullOrEmpty(Title))
|
||||
//{
|
||||
// return AddLanguageIfNeeded(Title);
|
||||
//}
|
||||
@@ -124,6 +125,7 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
attributes.Add(StringHelper.FirstToUpper(Language));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
attributes.Add(AudioCodec.GetFriendlyName(Codec));
|
||||
@@ -141,6 +143,7 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
attributes.Add(Channels.Value.ToString(CultureInfo.InvariantCulture) + " ch");
|
||||
}
|
||||
|
||||
if (IsDefault)
|
||||
{
|
||||
attributes.Add("Default");
|
||||
@@ -207,7 +210,6 @@ namespace MediaBrowser.Model.Entities
|
||||
|
||||
if (Type == MediaStreamType.Video)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -227,30 +229,37 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
return "4K";
|
||||
}
|
||||
|
||||
if (width >= 2500)
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "1440i";
|
||||
}
|
||||
|
||||
return "1440p";
|
||||
}
|
||||
|
||||
if (width >= 1900 || height >= 1000)
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "1080i";
|
||||
}
|
||||
|
||||
return "1080p";
|
||||
}
|
||||
|
||||
if (width >= 1260 || height >= 700)
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "720i";
|
||||
}
|
||||
|
||||
return "720p";
|
||||
}
|
||||
|
||||
if (width >= 700 || height >= 440)
|
||||
{
|
||||
|
||||
@@ -258,11 +267,13 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
return "480i";
|
||||
}
|
||||
|
||||
return "480p";
|
||||
}
|
||||
|
||||
return "SD";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -410,7 +421,10 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Type != MediaStreamType.Subtitle) return false;
|
||||
if (Type != MediaStreamType.Subtitle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Codec) && !IsExternal)
|
||||
{
|
||||
@@ -448,6 +462,7 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Equals(fromCodec, "ssa", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
@@ -458,6 +473,7 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Equals(toCodec, "ssa", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
@@ -5,6 +6,7 @@ namespace MediaBrowser.Model.Entities
|
||||
public class MediaUrl
|
||||
{
|
||||
public string Url { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <summary>
|
||||
/// Enum MetadataFields.
|
||||
/// </summary>
|
||||
public enum MetadataFields
|
||||
public enum MetadataField
|
||||
{
|
||||
/// <summary>
|
||||
/// The cast.
|
||||
|
||||
@@ -3,28 +3,28 @@
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum MetadataProviders
|
||||
/// Enum MetadataProviders.
|
||||
/// </summary>
|
||||
public enum MetadataProviders
|
||||
public enum MetadataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// The imdb
|
||||
/// The imdb.
|
||||
/// </summary>
|
||||
Imdb = 2,
|
||||
/// <summary>
|
||||
/// The TMDB
|
||||
/// The TMDB.
|
||||
/// </summary>
|
||||
Tmdb = 3,
|
||||
/// <summary>
|
||||
/// The TVDB
|
||||
/// The TVDB.
|
||||
/// </summary>
|
||||
Tvdb = 4,
|
||||
/// <summary>
|
||||
/// The tvcom
|
||||
/// The tvcom.
|
||||
/// </summary>
|
||||
Tvcom = 5,
|
||||
/// <summary>
|
||||
/// Tmdb Collection Id
|
||||
/// Tmdb Collection Id.
|
||||
/// </summary>
|
||||
TmdbCollection = 7,
|
||||
MusicBrainzAlbum = 8,
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -7,34 +8,33 @@ namespace MediaBrowser.Model.Entities
|
||||
public class PackageReviewInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The package id (database key) for this review
|
||||
/// Gets or sets the package id (database key) for this review.
|
||||
/// </summary>
|
||||
public int id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rating value
|
||||
/// Gets or sets the rating value.
|
||||
/// </summary>
|
||||
public int rating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this review recommends this item
|
||||
/// Gets or sets whether or not this review recommends this item.
|
||||
/// </summary>
|
||||
public bool recommend { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A short description of the review
|
||||
/// Gets or sets a short description of the review.
|
||||
/// </summary>
|
||||
public string title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A full review
|
||||
/// Gets or sets the full review.
|
||||
/// </summary>
|
||||
public string review { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time of review
|
||||
/// Gets or sets the time of review.
|
||||
/// </summary>
|
||||
public DateTime timestamp { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,23 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Class ParentalRating
|
||||
/// Class ParentalRating.
|
||||
/// </summary>
|
||||
public class ParentalRating
|
||||
{
|
||||
public ParentalRating()
|
||||
{
|
||||
}
|
||||
|
||||
public ParentalRating(string name, int value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
@@ -18,16 +29,5 @@ namespace MediaBrowser.Model.Entities
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
public int Value { get; set; }
|
||||
|
||||
public ParentalRating()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ParentalRating(string name, int value)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <param name="instance">The instance.</param>
|
||||
/// <param name="provider">The provider.</param>
|
||||
/// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns>
|
||||
public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider)
|
||||
public static bool HasProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
||||
{
|
||||
return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString()));
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <param name="instance">The instance.</param>
|
||||
/// <param name="provider">The provider.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
|
||||
public static string? GetProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
||||
{
|
||||
return instance.GetProviderId(provider.ToString());
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <param name="instance">The instance.</param>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string GetProviderId(this IHasProviderIds instance, string name)
|
||||
public static string? GetProviderId(this IHasProviderIds instance, string name)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <param name="instance">The instance.</param>
|
||||
/// <param name="provider">The provider.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value)
|
||||
public static void SetProviderId(this IHasProviderIds instance, MetadataProvider provider, string value)
|
||||
{
|
||||
instance.SetProviderId(provider.ToString(), value);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -6,7 +7,7 @@ using MediaBrowser.Model.Configuration;
|
||||
namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to hold information about a user's list of configured virtual folders
|
||||
/// Used to hold information about a user's list of configured virtual folders.
|
||||
/// </summary>
|
||||
public class VirtualFolderInfo
|
||||
{
|
||||
@@ -51,6 +52,7 @@ namespace MediaBrowser.Model.Entities
|
||||
public string PrimaryImageItemId { get; set; }
|
||||
|
||||
public double? RefreshProgress { get; set; }
|
||||
|
||||
public string RefreshStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,12 +22,5 @@ namespace MediaBrowser.Model.Events
|
||||
{
|
||||
Argument = arg;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GenericEventArgs{T}"/> class.
|
||||
/// </summary>
|
||||
public GenericEventArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
MediaBrowser.Model/Extensions/ListHelper.cs
Normal file
29
MediaBrowser.Model/Extensions/ListHelper.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
// TODO: @bond remove
|
||||
public static class ListHelper
|
||||
{
|
||||
public static bool ContainsIgnoreCase(string[] list, string value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ namespace MediaBrowser.Model.Extensions
|
||||
/// <returns>The string with the first character as uppercase.</returns>
|
||||
public static string FirstToUpper(string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str))
|
||||
if (str.Length == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
return str;
|
||||
}
|
||||
|
||||
if (char.IsUpper(str[0]))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
namespace MediaBrowser.Model.Globalization
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Globalization
|
||||
@@ -11,6 +12,7 @@ namespace MediaBrowser.Model.Globalization
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,39 @@
|
||||
namespace MediaBrowser.Model.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Class FileSystemEntryInfo
|
||||
/// Class FileSystemEntryInfo.
|
||||
/// </summary>
|
||||
public class FileSystemEntryInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// Initializes a new instance of the <see cref="FileSystemEntryInfo" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">The filename.</param>
|
||||
/// <param name="path">The file path.</param>
|
||||
/// <param name="type">The file type.</param>
|
||||
public FileSystemEntryInfo(string name, string path, FileSystemEntryType type)
|
||||
{
|
||||
Name = name;
|
||||
Path = path;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path.
|
||||
/// Gets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
public string Path { get; set; }
|
||||
public string Path { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// Gets the type.
|
||||
/// </summary>
|
||||
/// <value>The type.</value>
|
||||
public FileSystemEntryType Type { get; set; }
|
||||
public FileSystemEntryType Type { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace MediaBrowser.Model.IO
|
||||
/// <param name="isoPath">The iso path.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>IsoMount.</returns>
|
||||
/// <exception cref="ArgumentNullException">isoPath</exception>
|
||||
/// <exception cref="IOException">Unable to create mount.</exception>
|
||||
Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace MediaBrowser.Model.IO
|
||||
public interface IIsoMount : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the iso path.
|
||||
/// Gets the iso path.
|
||||
/// </summary>
|
||||
/// <value>The iso path.</value>
|
||||
string IsoPath { get; }
|
||||
|
||||
@@ -9,6 +9,12 @@ namespace MediaBrowser.Model.IO
|
||||
{
|
||||
public interface IIsoMounter
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Mounts the specified iso path.
|
||||
/// </summary>
|
||||
@@ -25,11 +31,5 @@ namespace MediaBrowser.Model.IO
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
|
||||
bool CanMount(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace MediaBrowser.Model.IO
|
||||
Task CopyToAsync(Stream source, Stream destination, int bufferSize, int emptyReadLimit, CancellationToken cancellationToken);
|
||||
|
||||
Task<int> CopyToAsync(Stream source, Stream destination, CancellationToken cancellationToken);
|
||||
|
||||
Task CopyToAsync(Stream source, Stream destination, long copyLength, CancellationToken cancellationToken);
|
||||
|
||||
Task CopyUntilCancelled(Stream source, Stream target, int bufferSize, CancellationToken cancellationToken);
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.IO;
|
||||
namespace MediaBrowser.Model.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IZipClient
|
||||
/// Interface IZipClient.
|
||||
/// </summary>
|
||||
public interface IZipClient
|
||||
{
|
||||
|
||||
@@ -6,6 +6,12 @@ namespace MediaBrowser.Model.Library
|
||||
{
|
||||
public class UserViewQuery
|
||||
{
|
||||
public UserViewQuery()
|
||||
{
|
||||
IncludeExternalContent = true;
|
||||
PresetViews = Array.Empty<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user identifier.
|
||||
/// </summary>
|
||||
@@ -25,11 +31,5 @@ namespace MediaBrowser.Model.Library
|
||||
public bool IncludeHidden { get; set; }
|
||||
|
||||
public string[] PresetViews { get; set; }
|
||||
|
||||
public UserViewQuery()
|
||||
{
|
||||
IncludeExternalContent = true;
|
||||
PresetViews = Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
@@ -123,6 +124,7 @@ namespace MediaBrowser.Model.LiveTv
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value>
|
||||
public bool IsPostPaddingRequired { get; set; }
|
||||
|
||||
public KeepUntil KeepUntil { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user