removed implicit typing from the model project
This commit is contained in:
parent
bb031f553b
commit
e653b41000
|
@ -75,14 +75,14 @@ namespace MediaBrowser.Model.Configuration
|
||||||
|
|
||||||
public bool IsEnabled(string type)
|
public bool IsEnabled(string type)
|
||||||
{
|
{
|
||||||
var opt = GetOptions(type);
|
NotificationOption opt = GetOptions(type);
|
||||||
|
|
||||||
return opt != null && opt.Enabled;
|
return opt != null && opt.Enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsServiceEnabled(string service, string notificationType)
|
public bool IsServiceEnabled(string service, string notificationType)
|
||||||
{
|
{
|
||||||
var opt = GetOptions(notificationType);
|
NotificationOption opt = GetOptions(notificationType);
|
||||||
|
|
||||||
return opt == null ||
|
return opt == null ||
|
||||||
!opt.DisabledServices.Contains(service, StringComparer.OrdinalIgnoreCase);
|
!opt.DisabledServices.Contains(service, StringComparer.OrdinalIgnoreCase);
|
||||||
|
@ -90,7 +90,7 @@ namespace MediaBrowser.Model.Configuration
|
||||||
|
|
||||||
public bool IsEnabledToMonitorUser(string type, string userId)
|
public bool IsEnabledToMonitorUser(string type, string userId)
|
||||||
{
|
{
|
||||||
var opt = GetOptions(type);
|
NotificationOption opt = GetOptions(type);
|
||||||
|
|
||||||
return opt != null && opt.Enabled &&
|
return opt != null && opt.Enabled &&
|
||||||
!opt.DisabledMonitorUsers.Contains(userId, StringComparer.OrdinalIgnoreCase);
|
!opt.DisabledMonitorUsers.Contains(userId, StringComparer.OrdinalIgnoreCase);
|
||||||
|
@ -98,7 +98,7 @@ namespace MediaBrowser.Model.Configuration
|
||||||
|
|
||||||
public bool IsEnabledToSendToUser(string type, string userId, UserConfiguration userConfig)
|
public bool IsEnabledToSendToUser(string type, string userId, UserConfiguration userConfig)
|
||||||
{
|
{
|
||||||
var opt = GetOptions(type);
|
NotificationOption opt = GetOptions(type);
|
||||||
|
|
||||||
if (opt != null && opt.Enabled)
|
if (opt != null && opt.Enabled)
|
||||||
{
|
{
|
||||||
|
|
|
@ -271,7 +271,7 @@ namespace MediaBrowser.Model.Configuration
|
||||||
|
|
||||||
EnableRealtimeMonitor = true;
|
EnableRealtimeMonitor = true;
|
||||||
|
|
||||||
var options = new List<MetadataOptions>
|
List<MetadataOptions> options = new List<MetadataOptions>
|
||||||
{
|
{
|
||||||
new MetadataOptions(1, 1280) {ItemType = "Book"},
|
new MetadataOptions(1, 1280) {ItemType = "Book"},
|
||||||
new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"},
|
new MetadataOptions(1, 1280) {ItemType = "MusicAlbum"},
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
public bool ContainsCodec(string codec)
|
public bool ContainsCodec(string codec)
|
||||||
{
|
{
|
||||||
var codecs = GetCodecs();
|
List<string> codecs = GetCodecs();
|
||||||
|
|
||||||
return codecs.Count == 0 || codecs.Contains(codec, StringComparer.OrdinalIgnoreCase);
|
return codecs.Count == 0 || codecs.Contains(codec, StringComparer.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return !condition.IsRequired;
|
return !condition.IsRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
var expected = condition.Value;
|
string expected = condition.Value;
|
||||||
|
|
||||||
switch (condition.Condition)
|
switch (condition.Condition)
|
||||||
{
|
{
|
||||||
|
@ -186,7 +186,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return !condition.IsRequired;
|
return !condition.IsRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
|
TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
|
||||||
|
|
||||||
switch (condition.Condition)
|
switch (condition.Condition)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,30 +17,30 @@ namespace MediaBrowser.Model.Dlna
|
||||||
int? width,
|
int? width,
|
||||||
int? height)
|
int? height)
|
||||||
{
|
{
|
||||||
var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
|
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
|
||||||
|
|
||||||
// 0 = native, 1 = transcoded
|
// 0 = native, 1 = transcoded
|
||||||
const string orgCi = ";DLNA.ORG_CI=0";
|
const string orgCi = ";DLNA.ORG_CI=0";
|
||||||
|
|
||||||
var flagValue = DlnaFlags.StreamingTransferMode |
|
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||||
DlnaFlags.BackgroundTransferMode |
|
DlnaFlags.BackgroundTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||||
FlagsToString(flagValue));
|
FlagsToString(flagValue));
|
||||||
|
|
||||||
var mediaProfile = _profile.GetImageMediaProfile(container,
|
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(orgPn))
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
{
|
{
|
||||||
orgPn = GetImageOrgPnValue(container, width, height);
|
orgPn = GetImageOrgPnValue(container, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
||||||
|
|
||||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,12 @@ namespace MediaBrowser.Model.Dlna
|
||||||
TranscodeSeekInfo transcodeSeekInfo)
|
TranscodeSeekInfo transcodeSeekInfo)
|
||||||
{
|
{
|
||||||
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
|
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
|
||||||
var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
|
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
|
||||||
|
|
||||||
// 0 = native, 1 = transcoded
|
// 0 = native, 1 = transcoded
|
||||||
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||||
|
|
||||||
var flagValue = DlnaFlags.StreamingTransferMode |
|
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||||
DlnaFlags.BackgroundTransferMode |
|
DlnaFlags.BackgroundTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
|
@ -73,22 +73,22 @@ namespace MediaBrowser.Model.Dlna
|
||||||
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||||
FlagsToString(flagValue));
|
FlagsToString(flagValue));
|
||||||
|
|
||||||
var mediaProfile = _profile.GetAudioMediaProfile(container,
|
ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container,
|
||||||
audioCodec,
|
audioCodec,
|
||||||
audioChannels,
|
audioChannels,
|
||||||
audioBitrate);
|
audioBitrate);
|
||||||
|
|
||||||
var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(orgPn))
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
{
|
{
|
||||||
orgPn = GetAudioOrgPnValue(container, audioBitrate, audioSampleRate, audioChannels);
|
orgPn = GetAudioOrgPnValue(container, audioBitrate, audioSampleRate, audioChannels);
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
||||||
|
|
||||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||||
}
|
}
|
||||||
|
@ -118,12 +118,12 @@ namespace MediaBrowser.Model.Dlna
|
||||||
TranscodeSeekInfo transcodeSeekInfo)
|
TranscodeSeekInfo transcodeSeekInfo)
|
||||||
{
|
{
|
||||||
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
|
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
|
||||||
var orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
|
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
|
||||||
|
|
||||||
// 0 = native, 1 = transcoded
|
// 0 = native, 1 = transcoded
|
||||||
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||||
|
|
||||||
var flagValue = DlnaFlags.StreamingTransferMode |
|
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||||
DlnaFlags.BackgroundTransferMode |
|
DlnaFlags.BackgroundTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
|
@ -136,10 +136,10 @@ namespace MediaBrowser.Model.Dlna
|
||||||
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||||
FlagsToString(flagValue));
|
FlagsToString(flagValue));
|
||||||
|
|
||||||
var mediaProfile = _profile.GetVideoMediaProfile(container,
|
ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container,
|
||||||
audioCodec,
|
audioCodec,
|
||||||
videoCodec,
|
videoCodec,
|
||||||
audioBitrate,
|
audioBitrate,
|
||||||
|
@ -154,7 +154,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
packetLength,
|
packetLength,
|
||||||
timestamp);
|
timestamp);
|
||||||
|
|
||||||
var orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(orgPn))
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
{
|
{
|
||||||
|
@ -165,14 +165,14 @@ namespace MediaBrowser.Model.Dlna
|
||||||
orgPn = (orgPn ?? string.Empty).Split(',').FirstOrDefault();
|
orgPn = (orgPn ?? string.Empty).Split(',').FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
|
||||||
|
|
||||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetImageOrgPnValue(string container, int? width, int? height)
|
private string GetImageOrgPnValue(string container, int? width, int? height)
|
||||||
{
|
{
|
||||||
var format = new MediaFormatProfileResolver()
|
MediaFormatProfile? format = new MediaFormatProfileResolver()
|
||||||
.ResolveImageFormat(container,
|
.ResolveImageFormat(container,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
@ -182,7 +182,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
private string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels)
|
private string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels)
|
||||||
{
|
{
|
||||||
var format = new MediaFormatProfileResolver()
|
MediaFormatProfile? format = new MediaFormatProfileResolver()
|
||||||
.ResolveAudioFormat(container,
|
.ResolveAudioFormat(container,
|
||||||
audioBitrate,
|
audioBitrate,
|
||||||
audioSampleRate,
|
audioSampleRate,
|
||||||
|
|
|
@ -174,19 +174,19 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var containers = i.GetContainers().ToList();
|
List<string> containers = i.GetContainers().ToList();
|
||||||
if (containers.Count > 0 && !containers.Contains(container))
|
if (containers.Count > 0 && !containers.Contains(container))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var audioCodecs = i.GetAudioCodecs().ToList();
|
List<string> audioCodecs = i.GetAudioCodecs().ToList();
|
||||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new ConditionProcessor();
|
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||||
return i.Conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c,
|
return i.Conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c,
|
||||||
audioChannels,
|
audioChannels,
|
||||||
audioBitrate));
|
audioBitrate));
|
||||||
|
@ -204,13 +204,13 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var containers = i.GetContainers().ToList();
|
List<string> containers = i.GetContainers().ToList();
|
||||||
if (containers.Count > 0 && !containers.Contains(container))
|
if (containers.Count > 0 && !containers.Contains(container))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new ConditionProcessor();
|
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||||
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
||||||
width,
|
width,
|
||||||
height));
|
height));
|
||||||
|
@ -241,25 +241,25 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var containers = i.GetContainers().ToList();
|
List<string> containers = i.GetContainers().ToList();
|
||||||
if (containers.Count > 0 && !containers.Contains(container))
|
if (containers.Count > 0 && !containers.Contains(container))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var audioCodecs = i.GetAudioCodecs().ToList();
|
List<string> audioCodecs = i.GetAudioCodecs().ToList();
|
||||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var videoCodecs = i.GetVideoCodecs().ToList();
|
List<string> videoCodecs = i.GetVideoCodecs().ToList();
|
||||||
if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty))
|
if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new ConditionProcessor();
|
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||||
return i.Conditions.All(c => conditionProcessor.IsVideoConditionSatisfied(c,
|
return i.Conditions.All(c => conditionProcessor.IsVideoConditionSatisfied(c,
|
||||||
audioBitrate,
|
audioBitrate,
|
||||||
audioChannels,
|
audioChannels,
|
||||||
|
@ -286,13 +286,13 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var containers = i.GetContainers().ToList();
|
List<string> containers = i.GetContainers().ToList();
|
||||||
if (containers.Count > 0 && !containers.Contains(container))
|
if (containers.Count > 0 && !containers.Contains(container))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new ConditionProcessor();
|
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||||
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
||||||
width,
|
width,
|
||||||
height));
|
height));
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
{
|
{
|
||||||
if (hasKnownRuntime)
|
if (hasKnownRuntime)
|
||||||
{
|
{
|
||||||
var orgOp = string.Empty;
|
string orgOp = string.Empty;
|
||||||
|
|
||||||
// Time-based seeking currently only possible when transcoding
|
// Time-based seeking currently only possible when transcoding
|
||||||
orgOp += isDirectStream ? "0" : "1";
|
orgOp += isDirectStream ? "0" : "1";
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
public static string GetImageOrgOpValue()
|
public static string GetImageOrgOpValue()
|
||||||
{
|
{
|
||||||
var orgOp = string.Empty;
|
string orgOp = string.Empty;
|
||||||
|
|
||||||
// Time-based seeking currently only possible when transcoding
|
// Time-based seeking currently only possible when transcoding
|
||||||
orgOp += "0";
|
orgOp += "0";
|
||||||
|
|
|
@ -10,13 +10,13 @@ namespace MediaBrowser.Model.Dlna
|
||||||
{
|
{
|
||||||
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
|
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
|
||||||
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
|
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
|
||||||
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var val = ResolveVideo3GPFormat(videoCodec, audioCodec);
|
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
|
||||||
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
private IEnumerable<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
|
private IEnumerable<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
|
||||||
{
|
{
|
||||||
var suffix = "";
|
string suffix = "";
|
||||||
|
|
||||||
switch (timestampType)
|
switch (timestampType)
|
||||||
{
|
{
|
||||||
|
@ -74,7 +74,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var resolution = "S";
|
string resolution = "S";
|
||||||
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
|
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
|
||||||
{
|
{
|
||||||
resolution = "H";
|
resolution = "H";
|
||||||
|
@ -82,7 +82,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var list = new List<MediaFormatProfile>();
|
List<MediaFormatProfile> list = new List<MediaFormatProfile>();
|
||||||
|
|
||||||
list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
|
list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
|
||||||
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
|
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
/// <returns>ImageSize.</returns>
|
/// <returns>ImageSize.</returns>
|
||||||
public static ImageSize Scale(ImageSize size, double scaleFactor)
|
public static ImageSize Scale(ImageSize size, double scaleFactor)
|
||||||
{
|
{
|
||||||
var newWidth = size.Width * scaleFactor;
|
double newWidth = size.Width * scaleFactor;
|
||||||
|
|
||||||
return Resize(size.Width, size.Height, newWidth, null, null, null);
|
return Resize(size.Width, size.Height, newWidth, null, null, null);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
/// <returns>System.Double.</returns>
|
/// <returns>System.Double.</returns>
|
||||||
private static double GetNewWidth(double currentHeight, double currentWidth, double newHeight)
|
private static double GetNewWidth(double currentHeight, double currentWidth, double newHeight)
|
||||||
{
|
{
|
||||||
var scaleFactor = newHeight;
|
double scaleFactor = newHeight;
|
||||||
scaleFactor /= currentHeight;
|
scaleFactor /= currentHeight;
|
||||||
scaleFactor *= currentWidth;
|
scaleFactor *= currentWidth;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
/// <returns>System.Double.</returns>
|
/// <returns>System.Double.</returns>
|
||||||
private static double GetNewHeight(double currentHeight, double currentWidth, double newWidth)
|
private static double GetNewHeight(double currentHeight, double currentWidth, double newWidth)
|
||||||
{
|
{
|
||||||
var scaleFactor = newWidth;
|
double scaleFactor = newWidth;
|
||||||
scaleFactor /= currentWidth;
|
scaleFactor /= currentWidth;
|
||||||
scaleFactor *= currentHeight;
|
scaleFactor *= currentHeight;
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,9 @@ namespace MediaBrowser.Model.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void IncreaseImageSize()
|
public void IncreaseImageSize()
|
||||||
{
|
{
|
||||||
var newWidth = PrimaryImageWidth / ImageScale;
|
double newWidth = PrimaryImageWidth / ImageScale;
|
||||||
|
|
||||||
var size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth, null, null, null);
|
ImageSize size = DrawingUtils.Resize(PrimaryImageWidth, PrimaryImageHeight, newWidth, null, null, null);
|
||||||
|
|
||||||
PrimaryImageWidth = Convert.ToInt32(size.Width);
|
PrimaryImageWidth = Convert.ToInt32(size.Width);
|
||||||
PrimaryImageHeight = Convert.ToInt32(size.Height);
|
PrimaryImageHeight = Convert.ToInt32(size.Height);
|
||||||
|
@ -116,7 +116,7 @@ namespace MediaBrowser.Model.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void DecreaseImageSize()
|
public void DecreaseImageSize()
|
||||||
{
|
{
|
||||||
var size = DrawingUtils.Scale(PrimaryImageWidth, PrimaryImageHeight, ImageScale);
|
ImageSize size = DrawingUtils.Scale(PrimaryImageWidth, PrimaryImageHeight, ImageScale);
|
||||||
|
|
||||||
PrimaryImageWidth = Convert.ToInt32(size.Width);
|
PrimaryImageWidth = Convert.ToInt32(size.Width);
|
||||||
PrimaryImageHeight = Convert.ToInt32(size.Height);
|
PrimaryImageHeight = Convert.ToInt32(size.Height);
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace MediaBrowser.Model.Web
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException("value");
|
||||||
}
|
}
|
||||||
|
|
||||||
var paramValue = string.Join(",", value.ToArray());
|
string paramValue = string.Join(",", value.ToArray());
|
||||||
|
|
||||||
Add(name, paramValue);
|
Add(name, paramValue);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ namespace MediaBrowser.Model.Web
|
||||||
throw new ArgumentNullException("value");
|
throw new ArgumentNullException("value");
|
||||||
}
|
}
|
||||||
|
|
||||||
var paramValue = string.Join(delimiter, value.ToArray());
|
string paramValue = string.Join(delimiter, value.ToArray());
|
||||||
|
|
||||||
Add(name, paramValue);
|
Add(name, paramValue);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ namespace MediaBrowser.Model.Web
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string GetQueryString()
|
public string GetQueryString()
|
||||||
{
|
{
|
||||||
var queryParams = this.Select(i => string.Format("{0}={1}", i.Key, GetEncodedValue(i.Value))).ToArray();
|
string[] queryParams = this.Select(i => string.Format("{0}={1}", i.Key, GetEncodedValue(i.Value))).ToArray();
|
||||||
|
|
||||||
return string.Join("&", queryParams);
|
return string.Join("&", queryParams);
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ namespace MediaBrowser.Model.Web
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public string GetUrl(string prefix)
|
public string GetUrl(string prefix)
|
||||||
{
|
{
|
||||||
var query = GetQueryString();
|
string query = GetQueryString();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(query))
|
if (string.IsNullOrEmpty(query))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user