WIP porting new Repository structure

This commit is contained in:
JPVenson
2024-10-09 10:36:08 +00:00
parent be48cdd9e9
commit b09a41ad1f
50 changed files with 211 additions and 162 deletions

View File

@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Globalization;
using System.IO;
using System.Linq;
@@ -1044,7 +1045,7 @@ namespace MediaBrowser.Controller.Entities
return PlayAccess.Full;
}
public virtual List<MediaStream> GetMediaStreams()
public virtual IReadOnlyList<MediaStream> GetMediaStreams()
{
return MediaSourceManager.GetMediaStreams(new MediaStreamQuery
{
@@ -1057,7 +1058,7 @@ namespace MediaBrowser.Controller.Entities
return false;
}
public virtual List<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
public virtual IReadOnlyList<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
{
if (SourceType == SourceType.Channel)
{
@@ -1091,7 +1092,7 @@ namespace MediaBrowser.Controller.Entities
return 1;
}).ThenBy(i => i.Video3DFormat.HasValue ? 1 : 0)
.ThenByDescending(i => i, new MediaSourceWidthComparator())
.ToList();
.ToImmutableList();
}
protected virtual IEnumerable<(BaseItem Item, MediaSourceType MediaSourceType)> GetAllItemsForMediaSources()
@@ -2527,7 +2528,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <param name="children">Media children.</param>
/// <returns><c>true</c> if the rating was updated; otherwise <c>false</c>.</returns>
public bool UpdateRatingToItems(IList<BaseItem> children)
public bool UpdateRatingToItems(IReadOnlyList<BaseItem> children)
{
var currentOfficialRating = OfficialRating;