renamed video backdrops to theme videos
This commit is contained in:
parent
f28d76cf1e
commit
7534ecc396
|
@ -337,11 +337,11 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class GetVideoBackdrops
|
||||
/// Class GetThemeVideos
|
||||
/// </summary>
|
||||
[Route("/Users/{UserId}/Items/{Id}/VideoBackdrops", "GET")]
|
||||
[Route("/Users/{UserId}/Items/{Id}/ThemeVideos", "GET")]
|
||||
[Api(Description = "Gets video backdrops for an item")]
|
||||
public class GetVideoBackdrops : IReturn<VideoBackdropsResult>
|
||||
public class GetThemeVideos : IReturn<ThemeVideosResult>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the user id.
|
||||
|
@ -491,7 +491,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetVideoBackdrops request)
|
||||
public object Get(GetThemeVideos request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -502,9 +502,9 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
var dtoBuilder = new DtoBuilder(Logger, _libraryManager, _userDataRepository);
|
||||
|
||||
var items = item.VideoBackdrops.Select(i => dtoBuilder.GetBaseItemDto(i, user, fields)).AsParallel().Select(t => t.Result).ToArray();
|
||||
var items = item.ThemeVideos.Select(i => dtoBuilder.GetBaseItemDto(i, user, fields)).AsParallel().Select(t => t.Result).ToArray();
|
||||
|
||||
var result = new VideoBackdropsResult
|
||||
var result = new ThemeVideosResult
|
||||
{
|
||||
Items = items,
|
||||
TotalRecordCount = items.Length,
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// </summary>
|
||||
public const string TrailerFolderName = "trailers";
|
||||
public const string ThemeSongsFolderName = "theme-music";
|
||||
public const string VideoBackdropsFolderName = "backdrops";
|
||||
public const string ThemeVideosFolderName = "backdrops";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
|
@ -703,24 +703,24 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
}
|
||||
|
||||
private List<Video> _videoBackdrops;
|
||||
private bool _videoBackdropsInitialized;
|
||||
private object _videoBackdropsSyncLock = new object();
|
||||
private List<Video> _themeVideos;
|
||||
private bool _themeVideosInitialized;
|
||||
private object _themeVideosSyncLock = new object();
|
||||
[IgnoreDataMember]
|
||||
public List<Video> VideoBackdrops
|
||||
public List<Video> ThemeVideos
|
||||
{
|
||||
get
|
||||
{
|
||||
LazyInitializer.EnsureInitialized(ref _videoBackdrops, ref _videoBackdropsInitialized, ref _videoBackdropsSyncLock, LoadVideoBackdrops);
|
||||
return _videoBackdrops;
|
||||
LazyInitializer.EnsureInitialized(ref _themeVideos, ref _themeVideosInitialized, ref _themeVideosSyncLock, LoadThemeVideos);
|
||||
return _themeVideos;
|
||||
}
|
||||
private set
|
||||
{
|
||||
_videoBackdrops = value;
|
||||
_themeVideos = value;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
_videoBackdropsInitialized = false;
|
||||
_themeVideosInitialized = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// Loads the video backdrops.
|
||||
/// </summary>
|
||||
/// <returns>List{Video}.</returns>
|
||||
private List<Video> LoadVideoBackdrops()
|
||||
private List<Video> LoadThemeVideos()
|
||||
{
|
||||
ItemResolveArgs resolveArgs;
|
||||
|
||||
|
@ -864,7 +864,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
return new List<Video>();
|
||||
}
|
||||
|
||||
var folder = resolveArgs.GetFileSystemEntryByName(VideoBackdropsFolderName);
|
||||
var folder = resolveArgs.GetFileSystemEntryByName(ThemeVideosFolderName);
|
||||
|
||||
// Path doesn't exist. No biggie
|
||||
if (folder == null)
|
||||
|
@ -918,7 +918,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
// Lazy load these again
|
||||
LocalTrailers = null;
|
||||
ThemeSongs = null;
|
||||
VideoBackdrops = null;
|
||||
ThemeVideos = null;
|
||||
|
||||
// Refresh for the item
|
||||
var itemRefreshTask = ProviderManager.ExecuteMetadataProviders(this, cancellationToken, forceRefresh, allowSlowProviders);
|
||||
|
@ -930,7 +930,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
var themeSongTasks = ThemeSongs.Select(i => i.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders));
|
||||
|
||||
var videoBackdropTasks = VideoBackdrops.Select(i => i.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders));
|
||||
var videoBackdropTasks = ThemeVideos.Select(i => i.RefreshMetadata(cancellationToken, forceSave, forceRefresh, allowSlowProviders));
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Querying
|
|||
public string OwnerId { get; set; }
|
||||
}
|
||||
|
||||
public class VideoBackdropsResult : ItemsResult
|
||||
public class ThemeVideosResult : ItemsResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the owner id.
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
{
|
||||
var parentFolderName = Path.GetFileName(Path.GetDirectoryName(args.Path));
|
||||
|
||||
if (string.Equals(parentFolderName, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase) || string.Equals(parentFolderName, BaseItem.VideoBackdropsFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(parentFolderName, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase) || string.Equals(parentFolderName, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
return true;
|
||||
}
|
||||
|
||||
if (string.Equals(filename, BaseItem.VideoBackdropsFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(filename, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -275,12 +275,12 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
var specialFeatures = items.OfType<Movie>().SelectMany(i => i.SpecialFeatures).ToList();
|
||||
var localTrailers = items.SelectMany(i => i.LocalTrailers).ToList();
|
||||
var themeSongs = items.SelectMany(i => i.ThemeSongs).ToList();
|
||||
var videoBackdrops = items.SelectMany(i => i.VideoBackdrops).ToList();
|
||||
var themeVideos = items.SelectMany(i => i.ThemeVideos).ToList();
|
||||
|
||||
items.AddRange(specialFeatures);
|
||||
items.AddRange(localTrailers);
|
||||
items.AddRange(themeSongs);
|
||||
items.AddRange(videoBackdrops);
|
||||
items.AddRange(themeVideos);
|
||||
|
||||
// Need to use DistinctBy Id because there could be multiple instances with the same id
|
||||
// due to sharing the default library
|
||||
|
@ -343,7 +343,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
LibraryItemsCache.AddOrUpdate(subItem.Id, subItem, delegate { return copy; });
|
||||
}
|
||||
|
||||
foreach (var subItem in item.VideoBackdrops)
|
||||
foreach (var subItem in item.ThemeVideos)
|
||||
{
|
||||
// Prevent access to foreach variable in closure
|
||||
var copy = subItem;
|
||||
|
|
|
@ -99,13 +99,13 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
|||
var allItems = _libraryManager.RootFolder.RecursiveChildren.ToList();
|
||||
|
||||
var localTrailers = allItems.SelectMany(i => i.LocalTrailers);
|
||||
var videoBackdrops = allItems.SelectMany(i => i.VideoBackdrops);
|
||||
var themeVideos = allItems.SelectMany(i => i.ThemeVideos);
|
||||
|
||||
var videos = allItems.OfType<Video>().ToList();
|
||||
|
||||
var items = videos;
|
||||
items.AddRange(localTrailers);
|
||||
items.AddRange(videoBackdrops);
|
||||
items.AddRange(themeVideos);
|
||||
items.AddRange(videos.OfType<Movie>().SelectMany(i => i.SpecialFeatures).ToList());
|
||||
|
||||
items = items.Where(i =>
|
||||
|
|
|
@ -1733,7 +1733,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
});
|
||||
};
|
||||
|
||||
self.getVideoBackdrops = function (userId, itemId) {
|
||||
self.getThemeVideos = function (userId, itemId) {
|
||||
|
||||
if (!userId) {
|
||||
throw new Error("null userId");
|
||||
|
@ -1742,7 +1742,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
throw new Error("null itemId");
|
||||
}
|
||||
|
||||
var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/VideoBackdrops");
|
||||
var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/ThemeVideos");
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.87" targetFramework="net45" />
|
||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.88" targetFramework="net45" />
|
||||
<package id="ServiceStack.Common" version="3.9.43" targetFramework="net45" />
|
||||
<package id="ServiceStack.Text" version="3.9.43" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user