combine shared code

This commit is contained in:
Mike Heier 2024-09-08 14:40:06 -04:00
parent 96b133b7b4
commit 203af39e26
3 changed files with 12 additions and 16 deletions

View File

@ -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);
}
}
}

View File

@ -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;

View File

@ -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);
}
}