aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs154
-rw-r--r--MediaBrowser.Server.Implementations/Library/PathExtensions.cs37
-rw-r--r--MediaBrowser.Server.Implementations/Library/ResolverHelper.cs34
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs18
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs17
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserManager.cs15
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs2
14 files changed, 254 insertions, 49 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 63ced8559..dfddae24d 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -17,7 +17,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Naming.Audio;
using MediaBrowser.Naming.Common;
-using MediaBrowser.Naming.IO;
using MediaBrowser.Naming.Video;
using MediaBrowser.Server.Implementations.Library.Resolvers.TV;
using MediaBrowser.Server.Implementations.Library.Validators;
@@ -485,12 +484,36 @@ namespace MediaBrowser.Server.Implementations.Library
if (item != null)
{
- ResolverHelper.SetInitialItemValues(item, args, _fileSystem);
+ ResolverHelper.SetInitialItemValues(item, args, _fileSystem, this);
}
return item;
}
+ public Guid GetNewItemId(string key, Type type)
+ {
+ if (string.IsNullOrWhiteSpace(key))
+ {
+ throw new ArgumentNullException("key");
+ }
+ if (type == null)
+ {
+ throw new ArgumentNullException("type");
+ }
+
+ if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath))
+ {
+ // Try to normalize paths located underneath program-data in an attempt to make them more portable
+ key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length)
+ .TrimStart(new[] { '/', '\\' })
+ .Replace("/", "\\");
+ }
+
+ key = type.FullName + key.ToLower();
+
+ return key.GetMD5();
+ }
+
public IEnumerable<BaseItem> ReplaceVideosWithPrimaryVersions(IEnumerable<BaseItem> items)
{
var dict = new Dictionary<Guid, BaseItem>();
@@ -651,7 +674,7 @@ namespace MediaBrowser.Server.Implementations.Library
Directory.CreateDirectory(rootFolderPath);
- var rootFolder = GetItemById(rootFolderPath.GetMBId(typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(new DirectoryInfo(rootFolderPath));
+ var rootFolder = GetItemById(GetNewItemId(rootFolderPath, typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(new DirectoryInfo(rootFolderPath));
// Add in the plug-in folders
foreach (var child in PluginFolderCreators)
@@ -662,7 +685,14 @@ namespace MediaBrowser.Server.Implementations.Library
{
if (folder.Id == Guid.Empty)
{
- folder.Id = (folder.Path ?? folder.GetType().Name).GetMBId(folder.GetType());
+ if (string.IsNullOrWhiteSpace(folder.Path))
+ {
+ folder.Id = GetNewItemId(folder.GetType().Name, folder.GetType());
+ }
+ else
+ {
+ folder.Id = GetNewItemId(folder.Path, folder.GetType());
+ }
}
folder = GetItemById(folder.Id) as BasePluginFolder ?? folder;
@@ -685,7 +715,7 @@ namespace MediaBrowser.Server.Implementations.Library
Directory.CreateDirectory(userRootPath);
- _userRootFolder = GetItemById(userRootPath.GetMBId(typeof(UserRootFolder))) as UserRootFolder ??
+ _userRootFolder = GetItemById(GetNewItemId(userRootPath, typeof(UserRootFolder))) as UserRootFolder ??
(UserRootFolder)ResolvePath(new DirectoryInfo(userRootPath));
}
@@ -801,7 +831,7 @@ namespace MediaBrowser.Server.Implementations.Library
Path.Combine(path, validFilename) :
Path.Combine(path, subFolderPrefix, validFilename);
- var id = fullPath.GetMBId(type);
+ var id = GetNewItemId(fullPath, type);
BaseItem obj;
@@ -1513,7 +1543,7 @@ namespace MediaBrowser.Server.Implementations.Library
path = Path.Combine(path, _fileSystem.GetValidFilename(type));
- var id = (path + "_namedview_" + name).GetMBId(typeof(UserView));
+ var id = GetNewItemId(path + "_namedview_" + name, typeof(UserView));
var item = GetItemById(id) as UserView;
@@ -1578,7 +1608,7 @@ namespace MediaBrowser.Server.Implementations.Library
throw new ArgumentNullException("viewType");
}
- var id = ("7_namedview_" + name + user.Id.ToString("N") + parentId).GetMBId(typeof(UserView));
+ var id = GetNewItemId("7_namedview_" + name + user.Id.ToString("N") + parentId, typeof(UserView));
var path = BaseItem.GetInternalMetadataPathForId(id);
@@ -1706,5 +1736,113 @@ namespace MediaBrowser.Server.Implementations.Library
return new List<FileSystemInfo>();
}
+
+ public IEnumerable<Trailer> FindTrailers(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
+ {
+ var files = fileSystemChildren.OfType<DirectoryInfo>()
+ .Where(i => string.Equals(i.Name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase))
+ .SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
+ .ToList();
+
+ var extraTypes = new List<ExtraType> { ExtraType.Trailer };
+ var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
+ .Select(i => i.Key)
+ .ToList();
+
+ files.AddRange(fileSystemChildren.OfType<FileInfo>()
+ .Where(i =>
+ {
+ var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
+
+ if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
+ {
+ return false;
+ }
+
+ return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
+ }));
+
+ return ResolvePaths<Trailer>(files, directoryService, null).Select(video =>
+ {
+ // Try to retrieve it from the db. If we don't find it, use the resolved version
+ var dbItem = GetItemById(video.Id) as Trailer;
+
+ if (dbItem != null)
+ {
+ video = dbItem;
+ }
+
+ if (video != null)
+ {
+ video.ExtraType = ExtraType.Trailer;
+ }
+
+ return video;
+
+ // Sort them so that the list can be easily compared for changes
+ }).OrderBy(i => i.Path).ToList();
+ }
+
+ public IEnumerable<Video> FindExtras(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
+ {
+ var files = fileSystemChildren.OfType<DirectoryInfo>()
+ .Where(i => string.Equals(i.Name, "extras", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "specials", StringComparison.OrdinalIgnoreCase))
+ .SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
+ .ToList();
+
+ var extraTypes = new List<ExtraType> { ExtraType.BehindTheScenes, ExtraType.DeletedScene, ExtraType.Interview, ExtraType.Sample, ExtraType.Scene, ExtraType.Clip };
+ var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
+ .Select(i => i.Key)
+ .ToList();
+
+ files.AddRange(fileSystemChildren.OfType<FileInfo>()
+ .Where(i =>
+ {
+ var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
+
+ if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
+ {
+ return false;
+ }
+
+ return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
+ }));
+
+ return ResolvePaths<Video>(files, directoryService, null).Select(video =>
+ {
+ // Try to retrieve it from the db. If we don't find it, use the resolved version
+ var dbItem = GetItemById(video.Id) as Video;
+
+ if (dbItem != null)
+ {
+ video = dbItem;
+ }
+
+ if (video != null)
+ {
+ SetExtraTypeFromFilename(video);
+ }
+
+ return video;
+
+ // Sort them so that the list can be easily compared for changes
+ }).OrderBy(i => i.Path).ToList();
+ }
+
+ private void SetExtraTypeFromFilename(Video item)
+ {
+ var name = System.IO.Path.GetFileNameWithoutExtension(item.Path) ?? string.Empty;
+
+ foreach (var suffix in BaseItem.ExtraSuffixes)
+ {
+ if (name.EndsWith(suffix.Key, StringComparison.OrdinalIgnoreCase))
+ {
+ item.ExtraType = suffix.Value;
+ return;
+ }
+ }
+
+ item.ExtraType = ExtraType.Clip;
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/PathExtensions.cs b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
new file mode 100644
index 000000000..00bd65125
--- /dev/null
+++ b/MediaBrowser.Server.Implementations/Library/PathExtensions.cs
@@ -0,0 +1,37 @@
+using System;
+
+namespace MediaBrowser.Server.Implementations.Library
+{
+ public static class PathExtensions
+ {
+ /// <summary>
+ /// Gets the attribute value.
+ /// </summary>
+ /// <param name="str">The STR.</param>
+ /// <param name="attrib">The attrib.</param>
+ /// <returns>System.String.</returns>
+ /// <exception cref="System.ArgumentNullException">attrib</exception>
+ public static string GetAttributeValue(this string str, string attrib)
+ {
+ if (string.IsNullOrEmpty(str))
+ {
+ throw new ArgumentNullException("str");
+ }
+
+ if (string.IsNullOrEmpty(attrib))
+ {
+ throw new ArgumentNullException("attrib");
+ }
+
+ string srch = "[" + attrib + "=";
+ int start = str.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
+ if (start > -1)
+ {
+ start += srch.Length;
+ int end = str.IndexOf(']', start);
+ return str.Substring(start, end - start);
+ }
+ return null;
+ }
+ }
+}
diff --git a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
index b9fbd6f8c..d071fd232 100644
--- a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
+++ b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Common.IO;
+using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using System;
@@ -20,7 +19,7 @@ namespace MediaBrowser.Server.Implementations.Library
/// <param name="item">The item.</param>
/// <param name="args">The args.</param>
/// <param name="fileSystem">The file system.</param>
- public static void SetInitialItemValues(BaseItem item, ItemResolveArgs args, IFileSystem fileSystem)
+ public static void SetInitialItemValues(BaseItem item, ItemResolveArgs args, IFileSystem fileSystem, ILibraryManager libraryManager)
{
// If the resolver didn't specify this
if (string.IsNullOrEmpty(item.Path))
@@ -34,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.Library
item.Parent = args.Parent;
}
- item.Id = item.Path.GetMBId(item.GetType());
+ item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());
// If the resolver didn't specify this
if (string.IsNullOrEmpty(item.DisplayMediaType))
@@ -56,43 +55,40 @@ namespace MediaBrowser.Server.Implementations.Library
/// Ensures the name.
/// </summary>
/// <param name="item">The item.</param>
+ /// <param name="args">The arguments.</param>
private static void EnsureName(BaseItem item, ItemResolveArgs args)
{
// If the subclass didn't supply a name, add it here
if (string.IsNullOrEmpty(item.Name) && !string.IsNullOrEmpty(item.Path))
{
//we use our resolve args name here to get the name of the containg folder, not actual video file
- item.Name = GetMbName(args.FileInfo.Name, (args.FileInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory);
+ item.Name = GetDisplayName(args.FileInfo.Name, (args.FileInfo.Attributes & FileAttributes.Directory) == FileAttributes.Directory);
}
}
/// <summary>
- /// The MB name regex
- /// </summary>
- private static readonly Regex MbNameRegex = new Regex(@"(\[.*?\])", RegexOptions.Compiled);
-
- /// <summary>
- /// Strip out attribute items and return just the name we will use for items
+ /// Gets the display name.
/// </summary>
- /// <param name="path">Assumed to be a file or directory path</param>
+ /// <param name="path">The path.</param>
/// <param name="isDirectory">if set to <c>true</c> [is directory].</param>
- /// <returns>The cleaned name</returns>
- private static string GetMbName(string path, bool isDirectory)
+ /// <returns>System.String.</returns>
+ private static string GetDisplayName(string path, bool isDirectory)
{
//first just get the file or directory name
var fn = isDirectory ? Path.GetFileName(path) : Path.GetFileNameWithoutExtension(path);
- //now - strip out anything inside brackets
- fn = StripBrackets(fn);
-
return fn;
}
- private static string StripBrackets(string inputString)
+ /// <summary>
+ /// The MB name regex
+ /// </summary>
+ private static readonly Regex MbNameRegex = new Regex(@"(\[.*?\])", RegexOptions.Compiled);
+
+ internal static string StripBrackets(string inputString)
{
var output = MbNameRegex.Replace(inputString, string.Empty).Trim();
return Regex.Replace(output, @"\s+", " ");
}
-
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
index 1b4903641..35519b932 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
@@ -1,10 +1,9 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Naming.Audio;
using MediaBrowser.Naming.Common;
-using MediaBrowser.Naming.Video;
using System;
+using System.IO;
namespace MediaBrowser.Server.Implementations.Library.Resolvers
{
@@ -29,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
/// <returns>`0.</returns>
protected override T Resolve(ItemResolveArgs args)
{
- return ResolveVideo<T>(args);
+ return ResolveVideo<T>(args, true);
}
/// <summary>
@@ -37,8 +36,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
/// </summary>
/// <typeparam name="TVideoType">The type of the T video type.</typeparam>
/// <param name="args">The args.</param>
+ /// <param name="parseName">if set to <c>true</c> [parse name].</param>
/// <returns>``0.</returns>
- protected TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args)
+ protected TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName)
where TVideoType : Video, new()
{
// If the path is a file check for a matching extensions
@@ -69,10 +69,18 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
IsInMixedFolder = true,
IsPlaceHolder = videoInfo.IsStub,
IsShortcut = isShortcut,
- Name = videoInfo.Name,
ProductionYear = videoInfo.Year
};
+ if (parseName)
+ {
+ video.Name = videoInfo.Name;
+ }
+ else
+ {
+ video.Name = Path.GetFileNameWithoutExtension(path);
+ }
+
if (videoInfo.IsStub)
{
if (string.Equals(videoInfo.StubType, "dvd", StringComparison.OrdinalIgnoreCase))
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs
index 1416bd04e..7f9b16d95 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs
@@ -40,7 +40,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
if (filename.IndexOf("[boxset]", StringComparison.OrdinalIgnoreCase) != -1 || args.ContainsFileSystemEntryByName("collection.xml"))
{
- return new BoxSet { Path = args.Path };
+ return new BoxSet
+ {
+ Path = args.Path,
+ Name = ResolverHelper.StripBrackets(Path.GetFileName(args.Path))
+ };
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index a2da9ff77..c928c5e65 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -8,13 +8,12 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Naming.Common;
+using MediaBrowser.Naming.Video;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using MediaBrowser.Naming.Audio;
-using MediaBrowser.Naming.Common;
-using MediaBrowser.Naming.Video;
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
{
@@ -116,14 +115,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
// Find movies that are mixed in the same folder
if (string.Equals(collectionType, CollectionType.Trailers, StringComparison.OrdinalIgnoreCase))
{
- return ResolveVideo<Trailer>(args);
+ return ResolveVideo<Trailer>(args, true);
}
Video item = null;
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
{
- item = ResolveVideo<MusicVideo>(args);
+ item = ResolveVideo<MusicVideo>(args, true);
}
// To find a movie file, the collection type must be movies or boxsets
@@ -131,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) ||
string.Equals(collectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase))
{
- item = ResolveVideo<Movie>(args);
+ item = ResolveVideo<Movie>(args, true);
}
if (item != null)
@@ -180,8 +179,10 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
/// <param name="fileSystemEntries">The file system entries.</param>
/// <param name="directoryService">The directory service.</param>
/// <param name="supportMultiFileItems">if set to <c>true</c> [support multi file items].</param>
+ /// <param name="supportsMultipleSources">if set to <c>true</c> [supports multiple sources].</param>
+ /// <param name="collectionType">Type of the collection.</param>
/// <returns>Movie.</returns>
- private T FindMovie<T>(string path, Folder parent, List<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources, string collectionType)
+ private T FindMovie<T>(string path, Folder parent, IEnumerable<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, bool supportMultiFileItems, bool supportsMultipleSources, string collectionType)
where T : Video, new()
{
var movies = new List<T>();
@@ -231,7 +232,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
CollectionType = collectionType
};
- var item = ResolveVideo<T>(childArgs);
+ var item = ResolveVideo<T>(childArgs, true);
if (item != null)
{
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
index 7eff53ce1..a95739f22 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
@@ -28,7 +28,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
if (filename.IndexOf("[playlist]", StringComparison.OrdinalIgnoreCase) != -1)
{
- return new Playlist { Path = args.Path };
+ return new Playlist
+ {
+ Path = args.Path,
+ Name = ResolverHelper.StripBrackets(Path.GetFileName(args.Path))
+ };
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
index 30eaf3198..52a95a300 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
@@ -81,7 +81,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
if (IsSeriesFolder(args.Path, isTvShowsFolder, args.FileSystemChildren, args.DirectoryService, _fileSystem, _logger, _libraryManager))
{
- return new Series();
+ return new Series
+ {
+ Path = args.Path,
+ Name = ResolverHelper.StripBrackets(Path.GetFileName(args.Path))
+ };
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs
index 54c584d47..ed45e890b 100644
--- a/MediaBrowser.Server.Implementations/Library/UserManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs
@@ -17,6 +17,7 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users;
using System;
@@ -327,7 +328,10 @@ namespace MediaBrowser.Server.Implementations.Library
try
{
- _dtoServiceFactory().AttachPrimaryImageAspectRatio(dto, user);
+ _dtoServiceFactory().AttachPrimaryImageAspectRatio(dto, user, new List<ItemFields>
+ {
+ ItemFields.PrimaryImageAspectRatio
+ });
}
catch (Exception ex)
{
@@ -765,5 +769,14 @@ namespace MediaBrowser.Server.Implementations.Library
public DateTime ExpirationDate { get; set; }
}
+ public UserPolicy GetUserPolicy(string userId)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Task UpdateUserPolicy(string userId, UserPolicy userPolicy)
+ {
+ throw new NotImplementedException();
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs
index 575ffec14..60116ac61 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
- return _libraryManager.ValidateArtists(cancellationToken, progress);
+ return ((LibraryManager)_libraryManager).ValidateArtists(cancellationToken, progress);
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs
index 097e94216..ae6c863a7 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
- return _libraryManager.ValidateGameGenres(cancellationToken, progress);
+ return ((LibraryManager)_libraryManager).ValidateGameGenres(cancellationToken, progress);
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs
index d7add8574..f1d0ef370 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs
@@ -29,7 +29,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
- return _libraryManager.ValidateGenres(cancellationToken, progress);
+ return ((LibraryManager)_libraryManager).ValidateGenres(cancellationToken, progress);
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs
index da378228a..280dd90f4 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
- return _libraryManager.ValidateMusicGenres(cancellationToken, progress);
+ return ((LibraryManager)_libraryManager).ValidateMusicGenres(cancellationToken, progress);
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs
index a3a8b8678..0f998b070 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
- return _libraryManager.ValidateStudios(cancellationToken, progress);
+ return ((LibraryManager)_libraryManager).ValidateStudios(cancellationToken, progress);
}
}
}