mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
update live stream management
This commit is contained in:
@@ -115,6 +115,22 @@ namespace MediaBrowser.Controller.Entities
|
||||
[IgnoreDataMember]
|
||||
public bool IsInMixedFolder { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
protected virtual bool SupportsIsInMixedFolderDetection
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool DetectIsInMixedFolder()
|
||||
{
|
||||
if (SupportsIsInMixedFolderDetection)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return IsInMixedFolder;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual bool SupportsRemoteImageDownloading
|
||||
{
|
||||
@@ -1116,7 +1132,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var hasThemeMedia = this as IHasThemeMedia;
|
||||
if (hasThemeMedia != null)
|
||||
{
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
themeSongsChanged = await RefreshThemeSongs(hasThemeMedia, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -1266,7 +1282,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var current = this;
|
||||
|
||||
return current.IsInMixedFolder == newItem.IsInMixedFolder;
|
||||
if (!SupportsIsInMixedFolderDetection)
|
||||
{
|
||||
if (current.IsInMixedFolder != newItem.IsInMixedFolder)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AfterMetadataRefresh()
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public override IEnumerable<string> GetDeletePaths()
|
||||
{
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
return new[] { System.IO.Path.GetDirectoryName(Path) };
|
||||
}
|
||||
|
||||
@@ -150,11 +150,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsLocalMetadata { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is in mixed folder.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
|
||||
bool IsInMixedFolder { get; }
|
||||
bool DetectIsInMixedFolder();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is locked.
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
|
||||
// Must have a parent to have special features
|
||||
// In other words, it must be part of the Parent/Child tree
|
||||
if (LocationType == LocationType.FileSystem && GetParent() != null && !IsInMixedFolder)
|
||||
if (LocationType == LocationType.FileSystem && GetParent() != null && !DetectIsInMixedFolder())
|
||||
{
|
||||
var specialFeaturesChanged = await RefreshSpecialFeatures(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
{
|
||||
var info = GetItemLookupInfo<MovieInfo>();
|
||||
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
info.Name = System.IO.Path.GetFileName(ContainingFolderPath);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
else
|
||||
{
|
||||
// Try to get the year from the folder name
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
|
||||
|
||||
|
||||
@@ -37,6 +37,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
protected override bool SupportsIsInMixedFolderDetection
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override UnratedItem GetBlockUnratedType()
|
||||
{
|
||||
return UnratedItem.Music;
|
||||
@@ -65,7 +74,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
else
|
||||
{
|
||||
// Try to get the year from the folder name
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
info.IsLocalTrailer = TrailerTypes.Contains(TrailerType.LocalTrailer);
|
||||
|
||||
if (!IsInMixedFolder && LocationType == LocationType.FileSystem)
|
||||
if (!DetectIsInMixedFolder() && LocationType == LocationType.FileSystem)
|
||||
{
|
||||
info.Name = System.IO.Path.GetFileName(ContainingFolderPath);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
else
|
||||
{
|
||||
// Try to get the year from the folder name
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public override IEnumerable<string> GetDeletePaths()
|
||||
{
|
||||
if (!IsInMixedFolder)
|
||||
if (!DetectIsInMixedFolder())
|
||||
{
|
||||
return new[] { ContainingFolderPath };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user