mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
update channel db
This commit is contained in:
@@ -1153,6 +1153,23 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
public int? GetParentalRatingValue()
|
||||
{
|
||||
var rating = CustomRating;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(rating))
|
||||
{
|
||||
rating = OfficialRating;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(rating))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return LocalizationManager.GetRatingLevel(rating);
|
||||
}
|
||||
|
||||
public int? GetInheritedParentalRatingValue()
|
||||
{
|
||||
var rating = CustomRatingForComparison;
|
||||
|
||||
|
||||
@@ -468,34 +468,25 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
BaseItem currentChild;
|
||||
|
||||
if (currentChildren.TryGetValue(child.Id, out currentChild))
|
||||
if (currentChildren.TryGetValue(child.Id, out currentChild) && IsValidFromResolver(currentChild, child))
|
||||
{
|
||||
if (IsValidFromResolver(currentChild, child))
|
||||
var currentChildLocationType = currentChild.LocationType;
|
||||
if (currentChildLocationType != LocationType.Remote &&
|
||||
currentChildLocationType != LocationType.Virtual)
|
||||
{
|
||||
var currentChildLocationType = currentChild.LocationType;
|
||||
if (currentChildLocationType != LocationType.Remote &&
|
||||
currentChildLocationType != LocationType.Virtual)
|
||||
{
|
||||
currentChild.DateModified = child.DateModified;
|
||||
}
|
||||
currentChild.DateModified = child.DateModified;
|
||||
}
|
||||
|
||||
await UpdateIsOffline(currentChild, false).ConfigureAwait(false);
|
||||
validChildren.Add(currentChild);
|
||||
}
|
||||
else
|
||||
{
|
||||
child.SetParent(this);
|
||||
newItems.Add(child);
|
||||
validChildren.Add(child);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Brand new item - needs to be added
|
||||
child.SetParent(this);
|
||||
newItems.Add(child);
|
||||
validChildren.Add(child);
|
||||
await UpdateIsOffline(currentChild, false).ConfigureAwait(false);
|
||||
validChildren.Add(currentChild);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Brand new item - needs to be added
|
||||
child.SetParent(this);
|
||||
newItems.Add(child);
|
||||
validChildren.Add(child);
|
||||
}
|
||||
|
||||
// If any items were added or removed....
|
||||
@@ -531,6 +522,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
foreach (var item in actualRemovals)
|
||||
{
|
||||
Logger.Debug("Removed item: " + item.Path);
|
||||
|
||||
item.SetParent(null);
|
||||
item.IsOffline = false;
|
||||
await LibraryManager.DeleteItem(item, new DeleteOptions { DeleteFileLocation = false }).ConfigureAwait(false);
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
@@ -105,7 +106,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
CollectionType.Photos,
|
||||
CollectionType.Playlists,
|
||||
CollectionType.BoxSets,
|
||||
CollectionType.MusicVideos
|
||||
CollectionType.MusicVideos,
|
||||
CollectionType.Games,
|
||||
CollectionType.Music
|
||||
};
|
||||
|
||||
var collectionFolder = folder as ICollectionFolder;
|
||||
@@ -136,6 +139,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
return standaloneTypes.Contains(collectionFolder.CollectionType ?? string.Empty);
|
||||
}
|
||||
|
||||
public static bool IsEligibleForEnhancedView(string viewType)
|
||||
{
|
||||
var types = new[] { CollectionType.Movies, CollectionType.TvShows, CollectionType.Music };
|
||||
|
||||
return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsPeople
|
||||
{
|
||||
|
||||
@@ -120,26 +120,22 @@ namespace MediaBrowser.Controller.Entities
|
||||
return await GetLiveTvView(queryParent, user, query).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
case CollectionType.Photos:
|
||||
case CollectionType.Books:
|
||||
case CollectionType.HomeVideos:
|
||||
case CollectionType.Games:
|
||||
case CollectionType.MusicVideos:
|
||||
return GetResult(queryParent.GetChildren(user, true), queryParent, query);
|
||||
|
||||
case CollectionType.Folders:
|
||||
return GetResult(user.RootFolder.GetChildren(user, true), queryParent, query);
|
||||
|
||||
case CollectionType.Games:
|
||||
return await GetGameView(user, queryParent, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.Playlists:
|
||||
return await GetPlaylistsView(queryParent, user, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.BoxSets:
|
||||
return await GetBoxsetView(queryParent, user, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.Photos:
|
||||
return await GetPhotosView(queryParent, user, query).ConfigureAwait(false);
|
||||
|
||||
case CollectionType.TvShows:
|
||||
return await GetTvView(queryParent, user, query).ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user