restore polymer changes

pull/702/head
Luke Pulverenti 9 years ago
parent 6ed2a85f45
commit ec5619e0f9

@ -422,7 +422,7 @@ namespace Emby.Drawing
{ {
throw; throw;
} }
_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path); //_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path);
CheckDisposed(); CheckDisposed();

@ -1,10 +1,10 @@
using System.Runtime.Serialization; using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.TV; using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
@ -14,8 +14,6 @@ namespace MediaBrowser.Controller.Entities
public string ViewType { get; set; } public string ViewType { get; set; }
public Guid ParentId { get; set; } public Guid ParentId { get; set; }
public Guid? UserId { get; set; }
public static ITVSeriesManager TVSeriesManager; public static ITVSeriesManager TVSeriesManager;
public static IPlaylistManager PlaylistManager; public static IPlaylistManager PlaylistManager;

@ -1769,7 +1769,7 @@ namespace MediaBrowser.Server.Implementations.Dto
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path); //_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
return; return;
} }

@ -1773,8 +1773,7 @@ namespace MediaBrowser.Server.Implementations.Library
DateCreated = DateTime.UtcNow, DateCreated = DateTime.UtcNow,
Name = name, Name = name,
ViewType = viewType, ViewType = viewType,
ForcedSortName = sortName, ForcedSortName = sortName
UserId = user.Id
}; };
if (!string.IsNullOrWhiteSpace(parentId)) if (!string.IsNullOrWhiteSpace(parentId))

@ -116,9 +116,9 @@ namespace MediaBrowser.Server.Implementations.Photos
return parts.GetMD5().ToString("N"); return parts.GetMD5().ToString("N");
} }
protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText) protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
{ {
return CreateCollage(primaryItem, items, outputPath, 640, 360, drawText, primaryItem.Name); return CreateCollage(primaryItem, items, outputPath, 640, 360);
} }
protected virtual IEnumerable<string> GetStripCollageImagePaths(IHasImages primaryItem, IEnumerable<BaseItem> items) protected virtual IEnumerable<string> GetStripCollageImagePaths(IHasImages primaryItem, IEnumerable<BaseItem> items)
@ -130,20 +130,20 @@ namespace MediaBrowser.Server.Implementations.Photos
protected Task<bool> CreatePosterCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath) protected Task<bool> CreatePosterCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
{ {
return CreateCollage(primaryItem, items, outputPath, 400, 600, true, primaryItem.Name); return CreateCollage(primaryItem, items, outputPath, 400, 600);
} }
protected Task<bool> CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText) protected Task<bool> CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
{ {
return CreateCollage(primaryItem, items, outputPath, 600, 600, drawText, primaryItem.Name); return CreateCollage(primaryItem, items, outputPath, 600, 600);
} }
protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text) protected Task<bool> CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height)
{ {
return CreateCollage(primaryItem, items, outputPath, width, height, drawText, text); return CreateCollage(primaryItem, items, outputPath, width, height);
} }
private Task<bool> CreateCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text) private Task<bool> CreateCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height)
{ {
Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
@ -152,7 +152,6 @@ namespace MediaBrowser.Server.Implementations.Photos
Height = height, Height = height,
Width = width, Width = width,
OutputPath = outputPath, OutputPath = outputPath,
Text = drawText ? text : null,
InputPaths = GetStripCollageImagePaths(primaryItem, items).ToArray() InputPaths = GetStripCollageImagePaths(primaryItem, items).ToArray()
}; };
@ -181,22 +180,20 @@ namespace MediaBrowser.Server.Implementations.Photos
return false; return false;
} }
var drawText = !(item is UserView) && !(item is ICollectionFolder);
if (imageType == ImageType.Thumb) if (imageType == ImageType.Thumb)
{ {
return await CreateThumbCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false); return await CreateThumbCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
} }
if (imageType == ImageType.Primary) if (imageType == ImageType.Primary)
{ {
if (item is UserView) if (item is UserView)
{ {
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false); return await CreateSquareCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
} }
if (item is PhotoAlbum || item is Playlist) if (item is PhotoAlbum || item is Playlist)
{ {
return await CreateSquareCollage(item, itemsWithImages, outputPath, drawText).ConfigureAwait(false); return await CreateSquareCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
} }
return await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false); return await CreatePosterCollage(item, itemsWithImages, outputPath).ConfigureAwait(false);
} }

@ -105,7 +105,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
return false; return false;
} }
return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540, false, item.Name).ConfigureAwait(false); return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false);
} }
return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false); return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false);

@ -61,7 +61,6 @@ namespace MediaBrowser.Server.Implementations.UserViews
{ {
var userItemsResult = await view.GetItems(new InternalItemsQuery var userItemsResult = await view.GetItems(new InternalItemsQuery
{ {
User = view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null,
CollapseBoxSetItems = false CollapseBoxSetItems = false
}); });
@ -73,7 +72,6 @@ namespace MediaBrowser.Server.Implementations.UserViews
var result = await view.GetItems(new InternalItemsQuery var result = await view.GetItems(new InternalItemsQuery
{ {
User = view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null,
CollapseBoxSetItems = false, CollapseBoxSetItems = false,
Recursive = recursive, Recursive = recursive,
ExcludeItemTypes = new[] { "UserView", "CollectionFolder", "Playlist" } ExcludeItemTypes = new[] { "UserView", "CollectionFolder", "Playlist" }
@ -138,38 +136,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
var view = item as UserView; var view = item as UserView;
if (view != null) if (view != null)
{ {
var supported = new[] return (IsUsingCollectionStrip(view));
{
SpecialFolder.TvFavoriteEpisodes,
SpecialFolder.TvFavoriteSeries,
SpecialFolder.TvGenres,
SpecialFolder.TvLatest,
SpecialFolder.TvNextUp,
SpecialFolder.TvResume,
SpecialFolder.TvShowSeries,
SpecialFolder.MovieCollections,
SpecialFolder.MovieFavorites,
SpecialFolder.MovieGenres,
SpecialFolder.MovieLatest,
SpecialFolder.MovieMovies,
SpecialFolder.MovieResume,
SpecialFolder.MusicArtists,
SpecialFolder.MusicAlbumArtists,
SpecialFolder.MusicAlbums,
SpecialFolder.MusicGenres,
SpecialFolder.MusicLatest,
SpecialFolder.MusicPlaylists,
SpecialFolder.MusicSongs,
SpecialFolder.MusicFavorites,
SpecialFolder.MusicFavoriteArtists,
SpecialFolder.MusicFavoriteAlbums,
SpecialFolder.MusicFavoriteSongs
};
return (IsUsingCollectionStrip(view) || supported.Contains(view.ViewType, StringComparer.OrdinalIgnoreCase));
} }
return false; return false;
@ -207,7 +174,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
return false; return false;
} }
return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540, false, item.Name).ConfigureAwait(false); return await CreateThumbCollage(item, itemsWithImages, outputPath, 960, 540).ConfigureAwait(false);
} }
return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false); return await base.CreateImage(item, itemsWithImages, outputPath, imageType, imageIndex).ConfigureAwait(false);

Loading…
Cancel
Save