Merge pull request #7233 from Bond-009/warn60

This commit is contained in:
Cody Robibero
2022-02-14 16:57:00 -07:00
committed by GitHub
22 changed files with 133 additions and 153 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -199,6 +199,6 @@ namespace MediaBrowser.Model.IO
void SetAttributes(string path, bool isHidden, bool readOnly);
List<FileSystemMetadata> GetDrives();
IEnumerable<FileSystemMetadata> GetDrives();
}
}

View File

@@ -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>
/// <value>The search hints.</value>
public SearchHint[] SearchHints { get; set; }
/// <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 or sets the total record count.
/// Gets the search hints.
/// </summary>
/// <value>The search hints.</value>
public IReadOnlyList<SearchHint> SearchHints { get; }
/// <summary>
/// Gets the total record count.
/// </summary>
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
public int TotalRecordCount { get; }
}
}