commit
03648936dc
|
@ -573,11 +573,9 @@ namespace MediaBrowser.Api.Images
|
||||||
|
|
||||||
var outputFormats = GetOutputFormats(request, imageInfo, cropwhitespace, supportedImageEnhancers);
|
var outputFormats = GetOutputFormats(request, imageInfo, cropwhitespace, supportedImageEnhancers);
|
||||||
|
|
||||||
var cacheGuid = new Guid(_imageProcessor.GetImageCacheTag(item, imageInfo, supportedImageEnhancers));
|
|
||||||
|
|
||||||
TimeSpan? cacheDuration = null;
|
TimeSpan? cacheDuration = null;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.Tag) && cacheGuid == new Guid(request.Tag))
|
if (!string.IsNullOrEmpty(request.Tag))
|
||||||
{
|
{
|
||||||
cacheDuration = TimeSpan.FromDays(365);
|
cacheDuration = TimeSpan.FromDays(365);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Api.Library
|
namespace MediaBrowser.Api.Library
|
||||||
{
|
{
|
||||||
|
|
|
@ -1589,6 +1589,10 @@ namespace MediaBrowser.Api.Playback
|
||||||
videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
|
videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (i == 29)
|
||||||
|
{
|
||||||
|
request.Tag = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,12 +154,20 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||||
|
|
||||||
using (state)
|
using (state)
|
||||||
{
|
{
|
||||||
|
TimeSpan? cacheDuration = null;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(request.Tag))
|
||||||
|
{
|
||||||
|
cacheDuration = TimeSpan.FromDays(365);
|
||||||
|
}
|
||||||
|
|
||||||
return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
|
return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
|
||||||
{
|
{
|
||||||
ResponseHeaders = responseHeaders,
|
ResponseHeaders = responseHeaders,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
IsHeadRequest = isHeadRequest,
|
IsHeadRequest = isHeadRequest,
|
||||||
Path = state.MediaPath
|
Path = state.MediaPath,
|
||||||
|
CacheDuration = cacheDuration
|
||||||
|
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
public string Params { get; set; }
|
public string Params { get; set; }
|
||||||
public string PlaySessionId { get; set; }
|
public string PlaySessionId { get; set; }
|
||||||
public string LiveStreamId { get; set; }
|
public string LiveStreamId { get; set; }
|
||||||
|
public string Tag { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VideoStreamRequest : StreamRequest
|
public class VideoStreamRequest : StreamRequest
|
||||||
|
|
|
@ -214,6 +214,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
dto.AlbumCount = counts.AlbumCount;
|
dto.AlbumCount = counts.AlbumCount;
|
||||||
dto.SongCount = counts.SongCount;
|
dto.SongCount = counts.SongCount;
|
||||||
dto.GameCount = counts.GameCount;
|
dto.GameCount = counts.GameCount;
|
||||||
|
dto.ArtistCount = counts.ArtistCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Configuration
|
|
||||||
{
|
|
||||||
public class LibraryOptions
|
|
||||||
{
|
|
||||||
public bool EnableAudioArchiveFiles { get; set; }
|
|
||||||
public bool EnableVideoArchiveFiles { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -67,6 +67,31 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return CreateResolveArgs(directoryService, true).FileSystemChildren;
|
return CreateResolveArgs(directoryService, true).FileSystemChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Guid> _childrenIds = null;
|
||||||
|
private readonly object _childIdsLock = new object();
|
||||||
|
protected override IEnumerable<BaseItem> LoadChildren()
|
||||||
|
{
|
||||||
|
lock (_childIdsLock)
|
||||||
|
{
|
||||||
|
if (_childrenIds == null || _childrenIds.Count == 0)
|
||||||
|
{
|
||||||
|
var list = base.LoadChildren().ToList();
|
||||||
|
_childrenIds = list.Select(i => i.Id).ToList();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetCachedChildren()
|
||||||
|
{
|
||||||
|
lock (_childIdsLock)
|
||||||
|
{
|
||||||
|
_childrenIds = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool _requiresRefresh;
|
private bool _requiresRefresh;
|
||||||
public override bool RequiresRefresh()
|
public override bool RequiresRefresh()
|
||||||
{
|
{
|
||||||
|
@ -89,6 +114,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh()
|
public override bool BeforeMetadataRefresh()
|
||||||
{
|
{
|
||||||
|
ResetCachedChildren();
|
||||||
|
|
||||||
var changed = base.BeforeMetadataRefresh() || _requiresRefresh;
|
var changed = base.BeforeMetadataRefresh() || _requiresRefresh;
|
||||||
_requiresRefresh = false;
|
_requiresRefresh = false;
|
||||||
return changed;
|
return changed;
|
||||||
|
@ -96,6 +123,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService, bool setPhysicalLocations)
|
private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService, bool setPhysicalLocations)
|
||||||
{
|
{
|
||||||
|
ResetCachedChildren();
|
||||||
|
|
||||||
var path = ContainingFolderPath;
|
var path = ContainingFolderPath;
|
||||||
|
|
||||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths, directoryService)
|
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths, directoryService)
|
||||||
|
|
|
@ -5,9 +5,11 @@ using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Controller.Channels;
|
using MediaBrowser.Controller.Channels;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities.Audio
|
namespace MediaBrowser.Controller.Entities.Audio
|
||||||
|
@ -266,6 +268,11 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
Size = i.Size
|
Size = i.Size
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (info.Protocol == MediaProtocol.File)
|
||||||
|
{
|
||||||
|
info.ETag = i.DateModified.Ticks.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N");
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(info.Container))
|
if (string.IsNullOrEmpty(info.Container))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual)
|
if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual)
|
||||||
|
|
|
@ -10,6 +10,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
using MoreLinq;
|
using MoreLinq;
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual IEnumerable<BaseItem> LoadChildren()
|
protected virtual IEnumerable<BaseItem> LoadChildren()
|
||||||
{
|
{
|
||||||
//Logger.Debug("Loading children from {0} {1}", Id, Path);
|
//Logger.Debug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
|
||||||
//just load our children from the repo - the library will be validated and maintained in other processes
|
//just load our children from the repo - the library will be validated and maintained in other processes
|
||||||
return GetCachedChildren();
|
return GetCachedChildren();
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,11 +62,18 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
return UnratedItem.Movie;
|
return UnratedItem.Movie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||||
|
{
|
||||||
|
if (IsLegacyBoxSet)
|
||||||
|
{
|
||||||
|
return base.LoadChildren();
|
||||||
|
}
|
||||||
|
return new List<BaseItem>();
|
||||||
|
}
|
||||||
|
|
||||||
protected override IEnumerable<BaseItem> LoadChildren()
|
protected override IEnumerable<BaseItem> LoadChildren()
|
||||||
{
|
{
|
||||||
var first = LinkedChildren.FirstOrDefault();
|
if (IsLegacyBoxSet)
|
||||||
|
|
||||||
if (first != null && first.Type == LinkedChildType.Shortcut)
|
|
||||||
{
|
{
|
||||||
return base.LoadChildren();
|
return base.LoadChildren();
|
||||||
}
|
}
|
||||||
|
@ -88,9 +95,24 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
protected override bool SupportsShortcutChildren
|
protected override bool SupportsShortcutChildren
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
{
|
||||||
|
if (IsLegacyBoxSet)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
private bool IsLegacyBoxSet
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsAuthorizedToDelete(User user)
|
public override bool IsAuthorizedToDelete(User user)
|
||||||
|
|
|
@ -16,6 +16,31 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UserRootFolder : Folder
|
public class UserRootFolder : Folder
|
||||||
{
|
{
|
||||||
|
private List<Guid> _childrenIds = null;
|
||||||
|
private readonly object _childIdsLock = new object();
|
||||||
|
//protected override IEnumerable<BaseItem> LoadChildren()
|
||||||
|
//{
|
||||||
|
// lock (_childIdsLock)
|
||||||
|
// {
|
||||||
|
// if (_childrenIds == null)
|
||||||
|
// {
|
||||||
|
// var list = base.LoadChildren().ToList();
|
||||||
|
// _childrenIds = list.Select(i => i.Id).ToList();
|
||||||
|
// return list;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
private void ResetCachedChildren()
|
||||||
|
{
|
||||||
|
lock (_childIdsLock)
|
||||||
|
{
|
||||||
|
_childrenIds = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
protected override async Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (query.Recursive)
|
if (query.Recursive)
|
||||||
|
@ -69,6 +94,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public override bool BeforeMetadataRefresh()
|
public override bool BeforeMetadataRefresh()
|
||||||
{
|
{
|
||||||
|
ResetCachedChildren();
|
||||||
|
|
||||||
var hasChanges = base.BeforeMetadataRefresh();
|
var hasChanges = base.BeforeMetadataRefresh();
|
||||||
|
|
||||||
if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals("default", Name, StringComparison.OrdinalIgnoreCase))
|
||||||
|
@ -82,6 +109,8 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
protected override async Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
|
ResetCachedChildren();
|
||||||
|
|
||||||
await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)
|
await base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ using System.Runtime.Serialization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Controller.Channels;
|
using MediaBrowser.Controller.Channels;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
|
@ -611,6 +612,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
SupportsDirectStream = i.VideoType == VideoType.VideoFile
|
SupportsDirectStream = i.VideoType == VideoType.VideoFile
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (info.Protocol == MediaProtocol.File)
|
||||||
|
{
|
||||||
|
info.ETag = i.DateModified.Ticks.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N");
|
||||||
|
}
|
||||||
|
|
||||||
if (i.IsShortcut)
|
if (i.IsShortcut)
|
||||||
{
|
{
|
||||||
info.Path = i.ShortcutPath;
|
info.Path = i.ShortcutPath;
|
||||||
|
|
|
@ -12,6 +12,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Library
|
namespace MediaBrowser.Controller.Library
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Library
|
namespace MediaBrowser.Controller.Library
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,7 +98,6 @@
|
||||||
<Compile Include="Collections\CollectionCreationOptions.cs" />
|
<Compile Include="Collections\CollectionCreationOptions.cs" />
|
||||||
<Compile Include="Collections\CollectionEvents.cs" />
|
<Compile Include="Collections\CollectionEvents.cs" />
|
||||||
<Compile Include="Collections\ICollectionManager.cs" />
|
<Compile Include="Collections\ICollectionManager.cs" />
|
||||||
<Compile Include="Configuration\LibraryOptions.cs" />
|
|
||||||
<Compile Include="Connect\ConnectSupporterSummary.cs" />
|
<Compile Include="Connect\ConnectSupporterSummary.cs" />
|
||||||
<Compile Include="Connect\IConnectManager.cs" />
|
<Compile Include="Connect\IConnectManager.cs" />
|
||||||
<Compile Include="Connect\UserLinkResult.cs" />
|
<Compile Include="Connect\UserLinkResult.cs" />
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using MediaBrowser.Controller.Providers;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Playlists
|
namespace MediaBrowser.Controller.Playlists
|
||||||
{
|
{
|
||||||
|
@ -69,6 +70,11 @@ namespace MediaBrowser.Controller.Playlists
|
||||||
return GetPlayableItems(user).Result;
|
return GetPlayableItems(user).Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||||
|
{
|
||||||
|
return new List<BaseItem>();
|
||||||
|
}
|
||||||
|
|
||||||
public override IEnumerable<BaseItem> GetRecursiveChildren(User user, InternalItemsQuery query)
|
public override IEnumerable<BaseItem> GetRecursiveChildren(User user, InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var items = GetPlayableItems(user).Result;
|
var items = GetPlayableItems(user).Result;
|
||||||
|
|
|
@ -205,6 +205,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
|
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
|
||||||
<Link>Configuration\ImageSavingConvention.cs</Link>
|
<Link>Configuration\ImageSavingConvention.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Configuration\LibraryOptions.cs">
|
||||||
|
<Link>Configuration\LibraryOptions.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
|
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
|
||||||
<Link>Configuration\MetadataConfiguration.cs</Link>
|
<Link>Configuration\MetadataConfiguration.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -177,6 +177,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
|
<Compile Include="..\MediaBrowser.Model\Configuration\ImageSavingConvention.cs">
|
||||||
<Link>Configuration\ImageSavingConvention.cs</Link>
|
<Link>Configuration\ImageSavingConvention.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Configuration\LibraryOptions.cs">
|
||||||
|
<Link>Configuration\LibraryOptions.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
|
<Compile Include="..\MediaBrowser.Model\Configuration\MetadataConfiguration.cs">
|
||||||
<Link>Configuration\MetadataConfiguration.cs</Link>
|
<Link>Configuration\MetadataConfiguration.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
7
MediaBrowser.Model/Configuration/LibraryOptions.cs
Normal file
7
MediaBrowser.Model/Configuration/LibraryOptions.cs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
namespace MediaBrowser.Model.Configuration
|
||||||
|
{
|
||||||
|
public class LibraryOptions
|
||||||
|
{
|
||||||
|
public bool EnableArchiveMediaFiles { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -252,6 +252,8 @@ namespace MediaBrowser.Model.Dlna
|
||||||
list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty));
|
list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty));
|
||||||
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower()));
|
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower()));
|
||||||
|
|
||||||
|
list.Add(new NameValuePair("Tag", item.MediaSource.ETag ?? string.Empty));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -837,6 +837,7 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The album count.</value>
|
/// <value>The album count.</value>
|
||||||
public int? AlbumCount { get; set; }
|
public int? AlbumCount { get; set; }
|
||||||
|
public int? ArtistCount { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the music video count.
|
/// Gets or sets the music video count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The game count.</value>
|
/// <value>The game count.</value>
|
||||||
public int GameCount { get; set; }
|
public int GameCount { get; set; }
|
||||||
|
public int ArtistCount { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the game system count.
|
/// Gets or sets the game system count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace MediaBrowser.Model.Dto
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string ETag { get; set; }
|
||||||
public long? RunTimeTicks { get; set; }
|
public long? RunTimeTicks { get; set; }
|
||||||
public bool ReadAtNativeFramerate { get; set; }
|
public bool ReadAtNativeFramerate { get; set; }
|
||||||
public bool SupportsTranscoding { get; set; }
|
public bool SupportsTranscoding { get; set; }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Entities
|
namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
|
@ -25,6 +26,8 @@ namespace MediaBrowser.Model.Entities
|
||||||
/// <value>The type of the collection.</value>
|
/// <value>The type of the collection.</value>
|
||||||
public string CollectionType { get; set; }
|
public string CollectionType { get; set; }
|
||||||
|
|
||||||
|
public LibraryOptions LibraryOptions { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="VirtualFolderInfo"/> class.
|
/// Initializes a new instance of the <see cref="VirtualFolderInfo"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -95,6 +95,7 @@
|
||||||
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
|
<Compile Include="Configuration\CinemaModeConfiguration.cs" />
|
||||||
<Compile Include="Configuration\EncodingOptions.cs" />
|
<Compile Include="Configuration\EncodingOptions.cs" />
|
||||||
<Compile Include="Configuration\FanartOptions.cs" />
|
<Compile Include="Configuration\FanartOptions.cs" />
|
||||||
|
<Compile Include="Configuration\LibraryOptions.cs" />
|
||||||
<Compile Include="Configuration\MetadataConfiguration.cs" />
|
<Compile Include="Configuration\MetadataConfiguration.cs" />
|
||||||
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
|
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
|
||||||
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
|
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
|
||||||
|
|
|
@ -408,12 +408,19 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||||
|
|
||||||
private void SetItemByNameInfo(BaseItem item, BaseItemDto dto, List<BaseItem> taggedItems, User user = null)
|
private void SetItemByNameInfo(BaseItem item, BaseItemDto dto, List<BaseItem> taggedItems, User user = null)
|
||||||
{
|
{
|
||||||
if (item is MusicArtist || item is MusicGenre)
|
if (item is MusicArtist)
|
||||||
{
|
{
|
||||||
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||||
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
|
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
|
||||||
dto.SongCount = taggedItems.Count(i => i is Audio);
|
dto.SongCount = taggedItems.Count(i => i is Audio);
|
||||||
}
|
}
|
||||||
|
else if (item is MusicGenre)
|
||||||
|
{
|
||||||
|
dto.ArtistCount = taggedItems.Count(i => i is MusicArtist);
|
||||||
|
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||||
|
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
|
||||||
|
dto.SongCount = taggedItems.Count(i => i is Audio);
|
||||||
|
}
|
||||||
else if (item is GameGenre)
|
else if (item is GameGenre)
|
||||||
{
|
{
|
||||||
dto.GameCount = taggedItems.Count(i => i is Game);
|
dto.GameCount = taggedItems.Count(i => i is Game);
|
||||||
|
@ -422,6 +429,7 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||||
{
|
{
|
||||||
// This populates them all and covers Genre, Person, Studio, Year
|
// This populates them all and covers Genre, Person, Studio, Year
|
||||||
|
|
||||||
|
dto.ArtistCount = taggedItems.Count(i => i is MusicArtist);
|
||||||
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||||
dto.EpisodeCount = taggedItems.Count(i => i is Episode);
|
dto.EpisodeCount = taggedItems.Count(i => i is Episode);
|
||||||
dto.GameCount = taggedItems.Count(i => i is Game);
|
dto.GameCount = taggedItems.Count(i => i is Game);
|
||||||
|
|
|
@ -259,6 +259,11 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||||
// File may have been deleted
|
// File may have been deleted
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
Logger.Debug("No write permission for: {0}.", path);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
catch (IOException)
|
catch (IOException)
|
||||||
{
|
{
|
||||||
//the file is unavailable because it is:
|
//the file is unavailable because it is:
|
||||||
|
|
|
@ -1223,7 +1223,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
.Select(dir => GetVirtualFolderInfo(dir, topLibraryFolders));
|
.Select(dir => GetVirtualFolderInfo(dir, topLibraryFolders));
|
||||||
}
|
}
|
||||||
|
|
||||||
private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> collectionFolders)
|
private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> allCollectionFolders)
|
||||||
{
|
{
|
||||||
var info = new VirtualFolderInfo
|
var info = new VirtualFolderInfo
|
||||||
{
|
{
|
||||||
|
@ -1237,7 +1237,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
CollectionType = GetCollectionType(dir)
|
CollectionType = GetCollectionType(dir)
|
||||||
};
|
};
|
||||||
|
|
||||||
var libraryFolder = collectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
|
var libraryFolder = allCollectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
if (libraryFolder != null && libraryFolder.HasImage(ImageType.Primary))
|
if (libraryFolder != null && libraryFolder.HasImage(ImageType.Primary))
|
||||||
{
|
{
|
||||||
|
@ -1249,6 +1249,12 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
info.ItemId = libraryFolder.Id.ToString("N");
|
info.ItemId = libraryFolder.Id.ToString("N");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var collectionFolder = libraryFolder as CollectionFolder;
|
||||||
|
if (collectionFolder != null)
|
||||||
|
{
|
||||||
|
info.LibraryOptions = collectionFolder.GetLibraryOptions();
|
||||||
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2426,13 +2432,13 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
options.AudioFileExtensions.Remove(".m3u");
|
options.AudioFileExtensions.Remove(".m3u");
|
||||||
options.AudioFileExtensions.Remove(".wpl");
|
options.AudioFileExtensions.Remove(".wpl");
|
||||||
|
|
||||||
if (!libraryOptions.EnableAudioArchiveFiles)
|
if (!libraryOptions.EnableArchiveMediaFiles)
|
||||||
{
|
{
|
||||||
options.AudioFileExtensions.Remove(".rar");
|
options.AudioFileExtensions.Remove(".rar");
|
||||||
options.AudioFileExtensions.Remove(".zip");
|
options.AudioFileExtensions.Remove(".zip");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!libraryOptions.EnableVideoArchiveFiles)
|
if (!libraryOptions.EnableArchiveMediaFiles)
|
||||||
{
|
{
|
||||||
options.VideoFileExtensions.Remove(".rar");
|
options.VideoFileExtensions.Remove(".rar");
|
||||||
options.VideoFileExtensions.Remove(".zip");
|
options.VideoFileExtensions.Remove(".zip");
|
||||||
|
|
|
@ -11,6 +11,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ using CommonIO;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Power;
|
using MediaBrowser.Controller.Power;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
|
|
|
@ -3975,7 +3975,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
AlbumArtistStartsWithOrGreater = query.AlbumArtistStartsWithOrGreater,
|
AlbumArtistStartsWithOrGreater = query.AlbumArtistStartsWithOrGreater,
|
||||||
Tags = query.Tags,
|
Tags = query.Tags,
|
||||||
OfficialRatings = query.OfficialRatings,
|
OfficialRatings = query.OfficialRatings,
|
||||||
Genres = query.GenreIds,
|
GenreIds = query.GenreIds,
|
||||||
|
Genres = query.Genres,
|
||||||
Years = query.Years
|
Years = query.Years
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4128,6 +4129,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
{
|
{
|
||||||
counts.AlbumCount = value;
|
counts.AlbumCount = value;
|
||||||
}
|
}
|
||||||
|
else if (string.Equals(typeName, typeof(MusicArtist).FullName, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
counts.ArtistCount = value;
|
||||||
|
}
|
||||||
else if (string.Equals(typeName, typeof(Audio).FullName, StringComparison.OrdinalIgnoreCase))
|
else if (string.Equals(typeName, typeof(Audio).FullName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
counts.SongCount = value;
|
counts.SongCount = value;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user