aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs2
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs28
-rw-r--r--MediaBrowser.Model/Dto/DisplayPreferencesDto.cs4
-rw-r--r--MediaBrowser.Model/Dto/MediaSourceInfo.cs4
-rw-r--r--MediaBrowser.Model/Dto/MetadataEditorInfo.cs14
-rw-r--r--MediaBrowser.Model/Globalization/CultureDto.cs28
-rw-r--r--MediaBrowser.Model/IO/IFileSystem.cs2
-rw-r--r--MediaBrowser.Model/Search/SearchHintResult.cs22
8 files changed, 48 insertions, 56 deletions
diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
index 58b06ca1d7..6e129246b0 100644
--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
@@ -115,7 +115,7 @@ namespace MediaBrowser.Model.Dlna
return "DLNA.ORG_PN=" + orgPn + orgOp + orgCi + dlnaflags;
}
- public static List<string> BuildVideoHeader(
+ public static IEnumerable<string> BuildVideoHeader(
DeviceProfile profile,
string container,
string videoCodec,
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index cf84650678..a678c54e7f 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -675,7 +675,7 @@ namespace MediaBrowser.Model.Dlna
return string.Format(CultureInfo.InvariantCulture, "{0}/videos/{1}/stream{2}?{3}", baseUrl, ItemId, extension, queryString);
}
- private static List<NameValuePair> BuildParams(StreamInfo item, string accessToken)
+ private static IEnumerable<NameValuePair> BuildParams(StreamInfo item, string accessToken)
{
var list = new List<NameValuePair>();
@@ -805,34 +805,12 @@ namespace MediaBrowser.Model.Dlna
return list;
}
- public List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, string baseUrl, string accessToken)
- {
- return GetExternalSubtitles(transcoderSupport, includeSelectedTrackOnly, false, baseUrl, accessToken);
- }
-
- public List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
- {
- var list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);
- var newList = new List<SubtitleStreamInfo>();
-
- // First add the selected track
- foreach (SubtitleStreamInfo stream in list)
- {
- if (stream.DeliveryMethod == SubtitleDeliveryMethod.External)
- {
- newList.Add(stream);
- }
- }
-
- return newList;
- }
-
- public List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, string baseUrl, string accessToken)
+ public IEnumerable<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, string baseUrl, string accessToken)
{
return GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, false, baseUrl, accessToken);
}
- public List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
+ public IEnumerable<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
{
var list = new List<SubtitleStreamInfo>();
diff --git a/MediaBrowser.Model/Dto/DisplayPreferencesDto.cs b/MediaBrowser.Model/Dto/DisplayPreferencesDto.cs
index 90163ae91f..6a4453536e 100644
--- a/MediaBrowser.Model/Dto/DisplayPreferencesDto.cs
+++ b/MediaBrowser.Model/Dto/DisplayPreferencesDto.cs
@@ -63,10 +63,10 @@ namespace MediaBrowser.Model.Dto
public int PrimaryImageWidth { get; set; }
/// <summary>
- /// Gets or sets the custom prefs.
+ /// Gets the custom prefs.
/// </summary>
/// <value>The custom prefs.</value>
- public Dictionary<string, string?> CustomPrefs { get; set; }
+ public Dictionary<string, string?> CustomPrefs { get; }
/// <summary>
/// Gets or sets the scroll direction.
diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
index ec3b37efa3..049e14333f 100644
--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs
+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dto
public MediaSourceInfo()
{
Formats = Array.Empty<string>();
- MediaStreams = new List<MediaStream>();
+ MediaStreams = Array.Empty<MediaStream>();
MediaAttachments = Array.Empty<MediaAttachment>();
RequiredHttpHeaders = new Dictionary<string, string>();
SupportsTranscoding = true;
@@ -88,7 +88,7 @@ namespace MediaBrowser.Model.Dto
public Video3DFormat? Video3DFormat { get; set; }
- public List<MediaStream> MediaStreams { get; set; }
+ public IReadOnlyList<MediaStream> MediaStreams { get; set; }
public IReadOnlyList<MediaAttachment> MediaAttachments { get; set; }
diff --git a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
index e0e889f7d0..d098669baa 100644
--- a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
+++ b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
@@ -1,7 +1,7 @@
-#nullable disable
#pragma warning disable CS1591
using System;
+using System.Collections.Generic;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Providers;
@@ -19,16 +19,16 @@ namespace MediaBrowser.Model.Dto
ContentTypeOptions = Array.Empty<NameValuePair>();
}
- public ParentalRating[] ParentalRatingOptions { get; set; }
+ public IReadOnlyList<ParentalRating> ParentalRatingOptions { get; set; }
- public CountryInfo[] Countries { get; set; }
+ public IReadOnlyList<CountryInfo> Countries { get; set; }
- public CultureDto[] Cultures { get; set; }
+ public IReadOnlyList<CultureDto> Cultures { get; set; }
- public ExternalIdInfo[] ExternalIdInfos { get; set; }
+ public IReadOnlyList<ExternalIdInfo> ExternalIdInfos { get; set; }
- public string ContentType { get; set; }
+ public string? ContentType { get; set; }
- public NameValuePair[] ContentTypeOptions { get; set; }
+ public IReadOnlyList<NameValuePair> ContentTypeOptions { get; set; }
}
}
diff --git a/MediaBrowser.Model/Globalization/CultureDto.cs b/MediaBrowser.Model/Globalization/CultureDto.cs
index 5246f87d92..d0cf2aad0d 100644
--- a/MediaBrowser.Model/Globalization/CultureDto.cs
+++ b/MediaBrowser.Model/Globalization/CultureDto.cs
@@ -1,7 +1,6 @@
-#nullable disable
#pragma warning disable CS1591
-using System;
+using System.Collections.Generic;
namespace MediaBrowser.Model.Globalization
{
@@ -10,39 +9,42 @@ namespace MediaBrowser.Model.Globalization
/// </summary>
public class CultureDto
{
- public CultureDto()
+ public CultureDto(string name, string displayName, string twoLetterISOLanguageName, IReadOnlyList<string> threeLetterISOLanguageNames)
{
- ThreeLetterISOLanguageNames = Array.Empty<string>();
+ Name = name;
+ DisplayName = displayName;
+ TwoLetterISOLanguageName = twoLetterISOLanguageName;
+ ThreeLetterISOLanguageNames = threeLetterISOLanguageNames;
}
/// <summary>
- /// Gets or sets the name.
+ /// Gets the name.
/// </summary>
/// <value>The name.</value>
- public string Name { get; set; }
+ public string Name { get; }
/// <summary>
- /// Gets or sets the display name.
+ /// Gets the display name.
/// </summary>
/// <value>The display name.</value>
- public string DisplayName { get; set; }
+ public string DisplayName { get; }
/// <summary>
- /// Gets or sets the name of the two letter ISO language.
+ /// Gets the name of the two letter ISO language.
/// </summary>
/// <value>The name of the two letter ISO language.</value>
- public string TwoLetterISOLanguageName { get; set; }
+ public string TwoLetterISOLanguageName { get; }
/// <summary>
/// Gets the name of the three letter ISO language.
/// </summary>
/// <value>The name of the three letter ISO language.</value>
- public string ThreeLetterISOLanguageName
+ public string? ThreeLetterISOLanguageName
{
get
{
var vals = ThreeLetterISOLanguageNames;
- if (vals.Length > 0)
+ if (vals.Count > 0)
{
return vals[0];
}
@@ -51,6 +53,6 @@ namespace MediaBrowser.Model.Globalization
}
}
- public string[] ThreeLetterISOLanguageNames { get; set; }
+ public IReadOnlyList<string> ThreeLetterISOLanguageNames { get; }
}
}
diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.cs
index 0f77d6b5bf..7207795b09 100644
--- a/MediaBrowser.Model/IO/IFileSystem.cs
+++ b/MediaBrowser.Model/IO/IFileSystem.cs
@@ -199,6 +199,6 @@ namespace MediaBrowser.Model.IO
void SetAttributes(string path, bool isHidden, bool readOnly);
- List<FileSystemMetadata> GetDrives();
+ IEnumerable<FileSystemMetadata> GetDrives();
}
}
diff --git a/MediaBrowser.Model/Search/SearchHintResult.cs b/MediaBrowser.Model/Search/SearchHintResult.cs
index 92ba4139ea..762a9a0787 100644
--- a/MediaBrowser.Model/Search/SearchHintResult.cs
+++ b/MediaBrowser.Model/Search/SearchHintResult.cs
@@ -1,4 +1,5 @@
-#nullable disable
+using System.Collections.Generic;
+
namespace MediaBrowser.Model.Search
{
/// <summary>
@@ -7,15 +8,26 @@ namespace MediaBrowser.Model.Search
public class SearchHintResult
{
/// <summary>
- /// Gets or sets the search hints.
+ /// Initializes a new instance of the <see cref="SearchHintResult" /> class.
+ /// </summary>
+ /// <param name="searchHints">The search hints.</param>
+ /// <param name="totalRecordCount">The total record count.</param>
+ public SearchHintResult(IReadOnlyList<SearchHint> searchHints, int totalRecordCount)
+ {
+ SearchHints = searchHints;
+ TotalRecordCount = totalRecordCount;
+ }
+
+ /// <summary>
+ /// Gets the search hints.
/// </summary>
/// <value>The search hints.</value>
- public SearchHint[] SearchHints { get; set; }
+ public IReadOnlyList<SearchHint> SearchHints { get; }
/// <summary>
- /// Gets or sets the total record count.
+ /// Gets the total record count.
/// </summary>
/// <value>The total record count.</value>
- public int TotalRecordCount { get; set; }
+ public int TotalRecordCount { get; }
}
}