update photo resolving

This commit is contained in:
Luke Pulverenti 2015-05-01 14:37:01 -04:00
parent 8ae0822e13
commit 9f4407028b
3 changed files with 27 additions and 17 deletions

View File

@ -768,8 +768,11 @@ namespace MediaBrowser.Dlna.PlayTo
await _device.SetAvTransport(newItem.StreamUrl, GetDlnaHeaders(newItem), newItem.Didl).ConfigureAwait(false);
if (newItem.StreamInfo.IsDirectStream)
if (newItem.StreamInfo.IsDirectStream && newPosition > 0)
{
// This is rather arbitrary, but give the player time to start playing
await Task.Delay(2000).ConfigureAwait(false);
await _device.Seek(TimeSpan.FromTicks(newPosition)).ConfigureAwait(false);
}
}

View File

@ -38,13 +38,19 @@ namespace MediaBrowser.Providers.Manager
{
var hasChanges = false;
var images = providers.OfType<ILocalImageFileProvider>()
.SelectMany(i => i.GetImages(item, directoryService))
var localImageProviders = providers.OfType<ILocalImageFileProvider>()
.ToList();
if (MergeImages(item, images))
if (localImageProviders.Count > 0 || !(item is Photo))
{
hasChanges = true;
var images = localImageProviders
.SelectMany(i => i.GetImages(item, directoryService))
.ToList();
if (MergeImages(item, images))
{
hasChanges = true;
}
}
return hasChanges;

View File

@ -9,18 +9,19 @@ using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Photos
{
//public class PhotoAlbumImageProvider : BaseDynamicImageProvider<PhotoAlbum>
//{
// public PhotoAlbumImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) : base(fileSystem, providerManager, applicationPaths, imageProcessor)
// {
// }
public class PhotoAlbumImageProvider : BaseDynamicImageProvider<PhotoAlbum>
{
public PhotoAlbumImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor)
: base(fileSystem, providerManager, applicationPaths, imageProcessor)
{
}
// protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item)
// {
// var photoAlbum = (PhotoAlbum)item;
// var items = GetFinalItems(photoAlbum.Children.ToList());
protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item)
{
var photoAlbum = (PhotoAlbum)item;
var items = GetFinalItems(photoAlbum.Children.ToList());
// return Task.FromResult(items);
// }
//}
return Task.FromResult(items);
}
}
}