combine shared code
This commit is contained in:
parent
96b133b7b4
commit
203af39e26
|
@ -3209,5 +3209,10 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
return item is UserRootFolder || item.IsVisibleStandalone(user);
|
||||
}
|
||||
|
||||
public void LogMessage(string message)
|
||||
{
|
||||
_logger.LogInformation("(MJH) {Message}", message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,22 +148,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
public override bool SupportsAddingToPlaylist => true;
|
||||
|
||||
[JsonIgnore]
|
||||
public int MediaSourceCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(PrimaryVersionId))
|
||||
{
|
||||
var item = LibraryManager.GetItemById(PrimaryVersionId);
|
||||
if (item is Video video)
|
||||
{
|
||||
return video.MediaSourceCount;
|
||||
}
|
||||
}
|
||||
|
||||
return LinkedAlternateVersions.Length + LocalAlternateVersions.Length + 1;
|
||||
}
|
||||
}
|
||||
public int MediaSourceCount => GetMediaSourceCount((message) => LibraryManager.LogMessage(message));
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsStacked => AdditionalParts.Length > 0;
|
||||
|
|
|
@ -621,5 +621,11 @@ namespace MediaBrowser.Controller.Library
|
|||
/// This exists so plugins can trigger a library scan.
|
||||
/// </remarks>
|
||||
void QueueLibraryScan();
|
||||
|
||||
/// <summary>
|
||||
/// Logs a message.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to log.</param>
|
||||
void LogMessage(string message);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user