rename live tv page

This commit is contained in:
Luke Pulverenti 2015-08-02 19:56:21 -04:00
parent 2a93de8e11
commit ec64da2a3b
2 changed files with 23 additions and 33 deletions

View File

@ -189,21 +189,7 @@ namespace Emby.Drawing
dateModified = tuple.Item2; dateModified = tuple.Item2;
} }
ImageSize originalImageSize; var originalImageSize = GetImageSize(originalImagePath, dateModified, true);
try
{
originalImageSize = GetImageSize(originalImagePath, dateModified);
}
catch
{
// This is an arbitrary default, but don't fail the whole process over this
originalImageSize = new ImageSize
{
Width = 100,
Height = 100
};
}
// Determine the output size based on incoming parameters // Determine the output size based on incoming parameters
var newSize = DrawingUtils.Resize(originalImageSize, options.Width, options.Height, options.MaxWidth, options.MaxHeight); var newSize = DrawingUtils.Resize(originalImageSize, options.Width, options.Height, options.MaxWidth, options.MaxHeight);
@ -377,12 +363,12 @@ namespace Emby.Drawing
/// <returns>ImageSize.</returns> /// <returns>ImageSize.</returns>
public ImageSize GetImageSize(string path) public ImageSize GetImageSize(string path)
{ {
return GetImageSize(path, File.GetLastWriteTimeUtc(path)); return GetImageSize(path, File.GetLastWriteTimeUtc(path), false);
} }
public ImageSize GetImageSize(ItemImageInfo info) public ImageSize GetImageSize(ItemImageInfo info)
{ {
return GetImageSize(info.Path, info.DateModified); return GetImageSize(info.Path, info.DateModified, false);
} }
/// <summary> /// <summary>
@ -390,9 +376,10 @@ namespace Emby.Drawing
/// </summary> /// </summary>
/// <param name="path">The path.</param> /// <param name="path">The path.</param>
/// <param name="imageDateModified">The image date modified.</param> /// <param name="imageDateModified">The image date modified.</param>
/// <param name="allowSlowMethod">if set to <c>true</c> [allow slow method].</param>
/// <returns>ImageSize.</returns> /// <returns>ImageSize.</returns>
/// <exception cref="System.ArgumentNullException">path</exception> /// <exception cref="System.ArgumentNullException">path</exception>
private ImageSize GetImageSize(string path, DateTime imageDateModified) private ImageSize GetImageSize(string path, DateTime imageDateModified, bool allowSlowMethod)
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
@ -407,7 +394,7 @@ namespace Emby.Drawing
if (!_cachedImagedSizes.TryGetValue(cacheHash, out size)) if (!_cachedImagedSizes.TryGetValue(cacheHash, out size))
{ {
size = GetImageSizeInternal(path); size = GetImageSizeInternal(path, allowSlowMethod);
_cachedImagedSizes.AddOrUpdate(cacheHash, size, (keyName, oldValue) => size); _cachedImagedSizes.AddOrUpdate(cacheHash, size, (keyName, oldValue) => size);
} }
@ -419,25 +406,28 @@ namespace Emby.Drawing
/// Gets the image size internal. /// Gets the image size internal.
/// </summary> /// </summary>
/// <param name="path">The path.</param> /// <param name="path">The path.</param>
/// <param name="allowSlowMethod">if set to <c>true</c> [allow slow method].</param>
/// <returns>ImageSize.</returns> /// <returns>ImageSize.</returns>
private ImageSize GetImageSizeInternal(string path) private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod)
{ {
ImageSize size; ImageSize size;
size = ImageHeader.GetDimensions(path, _logger, _fileSystem); try
//try {
//{ size = ImageHeader.GetDimensions(path, _logger, _fileSystem);
// size = ImageHeader.GetDimensions(path, _logger, _fileSystem); }
//} catch
//catch {
//{ if (!allowSlowMethod)
// return; {
// //_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path); throw;
}
_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path);
// //CheckDisposed(); CheckDisposed();
// //size = _imageEncoder.GetImageSize(path); size = _imageEncoder.GetImageSize(path);
//} }
StartSaveImageSizeTimer(); StartSaveImageSizeTimer();

View File

@ -1729,7 +1729,7 @@
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jquery.mobile-1.4.5.min.css"> <Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jquery.mobile-1.4.5.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\livetvsuggested.html"> <Content Include="dashboard-ui\livetv.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\apiclient\md5.js"> <Content Include="dashboard-ui\apiclient\md5.js">