update character escaping
This commit is contained in:
parent
0e9cd51f9c
commit
635c8d50a3
|
@ -1108,7 +1108,11 @@ namespace Emby.Server.Implementations.Channels
|
||||||
{
|
{
|
||||||
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
||||||
{
|
{
|
||||||
return _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath);
|
var cachedResult = _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath);
|
||||||
|
if (cachedResult != null)
|
||||||
|
{
|
||||||
|
return cachedResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1131,7 +1135,11 @@ namespace Emby.Server.Implementations.Channels
|
||||||
{
|
{
|
||||||
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
||||||
{
|
{
|
||||||
return _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath);
|
var cachedResult = _jsonSerializer.DeserializeFromFile<ChannelItemResult>(cachePath);
|
||||||
|
if (cachedResult != null)
|
||||||
|
{
|
||||||
|
return cachedResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1162,6 +1170,11 @@ namespace Emby.Server.Implementations.Channels
|
||||||
|
|
||||||
var result = await channel.GetChannelItems(query, cancellationToken).ConfigureAwait(false);
|
var result = await channel.GetChannelItems(query, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Channel returned a null result from GetChannelItems");
|
||||||
|
}
|
||||||
|
|
||||||
if (!startIndex.HasValue && !limit.HasValue)
|
if (!startIndex.HasValue && !limit.HasValue)
|
||||||
{
|
{
|
||||||
CacheResponse(result, cachePath);
|
CacheResponse(result, cachePath);
|
||||||
|
|
|
@ -57,9 +57,14 @@ namespace Emby.Server.Implementations.Security
|
||||||
_updateRecords.AddOrUpdate(key, value, (k, v) => value);
|
_updateRecords.AddOrUpdate(key, value, (k, v) => value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Guid GetKey(string featureId)
|
||||||
|
{
|
||||||
|
return new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId)));
|
||||||
|
}
|
||||||
|
|
||||||
public void AddRegCheck(string featureId)
|
public void AddRegCheck(string featureId)
|
||||||
{
|
{
|
||||||
var key = new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId)));
|
var key = GetKey(featureId);
|
||||||
var value = DateTime.UtcNow;
|
var value = DateTime.UtcNow;
|
||||||
|
|
||||||
SetUpdateRecord(key, value);
|
SetUpdateRecord(key, value);
|
||||||
|
@ -68,7 +73,7 @@ namespace Emby.Server.Implementations.Security
|
||||||
|
|
||||||
public void RemoveRegCheck(string featureId)
|
public void RemoveRegCheck(string featureId)
|
||||||
{
|
{
|
||||||
var key = new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId)));
|
var key = GetKey(featureId);
|
||||||
DateTime val;
|
DateTime val;
|
||||||
|
|
||||||
_updateRecords.TryRemove(key, out val);
|
_updateRecords.TryRemove(key, out val);
|
||||||
|
@ -78,8 +83,9 @@ namespace Emby.Server.Implementations.Security
|
||||||
|
|
||||||
public DateTime LastChecked(string featureId)
|
public DateTime LastChecked(string featureId)
|
||||||
{
|
{
|
||||||
|
var key = GetKey(featureId);
|
||||||
DateTime last;
|
DateTime last;
|
||||||
_updateRecords.TryGetValue(new Guid(_cryptographyProvider.ComputeMD5(Encoding.Unicode.GetBytes(featureId))), out last);
|
_updateRecords.TryGetValue(key, out last);
|
||||||
|
|
||||||
// guard agains people just putting a large number in the file
|
// guard agains people just putting a large number in the file
|
||||||
return last < DateTime.UtcNow ? last : DateTime.MinValue;
|
return last < DateTime.UtcNow ? last : DateTime.MinValue;
|
||||||
|
|
|
@ -1221,9 +1221,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
// https://ffmpeg.org/ffmpeg-filters.html#Notes-on-filtergraph-escaping
|
// https://ffmpeg.org/ffmpeg-filters.html#Notes-on-filtergraph-escaping
|
||||||
// We need to double escape
|
// We need to double escape
|
||||||
|
|
||||||
var escapeChars = new[] {':', '\'', ','};
|
return path.Replace('\\', '/').Replace(":", "\\:").Replace("'", "'\\\\\\''");
|
||||||
|
|
||||||
return path.Replace('\\', '/').Replace(":/", "\\:/").Replace("'", "'\\\\\\''");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -976,7 +976,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
if (item.Bitrate.Value > maxBitrate.Value)
|
if (item.Bitrate.Value > maxBitrate.Value)
|
||||||
{
|
{
|
||||||
_logger.Info("Bitrate exceeds DirectPlay limit");
|
_logger.Info("Bitrate exceeds DirectPlay limit: media bitrate: {0}, max bitrate: {1}", item.Bitrate.Value.ToString(CultureInfo.InvariantCulture), maxBitrate.Value.ToString(CultureInfo.InvariantCulture));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,32 @@ namespace MediaBrowser.ServerApplication
|
||||||
|
|
||||||
info.FFMpegFilename = "ffmpeg.exe";
|
info.FFMpegFilename = "ffmpeg.exe";
|
||||||
info.FFProbeFilename = "ffprobe.exe";
|
info.FFProbeFilename = "ffprobe.exe";
|
||||||
info.Version = "0";
|
info.Version = "20160410";
|
||||||
|
info.ArchiveType = "7z";
|
||||||
|
info.DownloadUrls = GetDownloadUrls();
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string[] GetDownloadUrls()
|
||||||
|
{
|
||||||
|
switch (EnvironmentInfo.SystemArchitecture)
|
||||||
|
{
|
||||||
|
case Architecture.X64:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
"https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win64.7z"
|
||||||
|
};
|
||||||
|
case Architecture.X86:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
"https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win32.7z"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new string[] { };
|
||||||
|
}
|
||||||
|
|
||||||
protected override void RestartInternal()
|
protected override void RestartInternal()
|
||||||
{
|
{
|
||||||
MainStartup.Restart();
|
MainStartup.Restart();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user