Merge pull request #9 from jellyfin/master

Yanking in latest changes
This commit is contained in:
LogicalPhallacy
2019-02-11 22:48:50 -08:00
committed by GitHub
349 changed files with 2446 additions and 4839 deletions

View File

@@ -16,8 +16,6 @@ namespace MediaBrowser.Model.Channels
MovieExtra = 6,
TvExtra = 7,
GameExtra = 8
TvExtra = 7
}
}

View File

@@ -6,7 +6,6 @@ namespace MediaBrowser.Model.Configuration
Trailer,
Series,
Music,
Game,
Book,
LiveTvChannel,
LiveTvProgram,

View File

@@ -1,21 +0,0 @@
using System;
namespace MediaBrowser.Model.Connect
{
public class ConnectAuthorization
{
public string ConnectUserId { get; set; }
public string UserName { get; set; }
public string ImageUrl { get; set; }
public string Id { get; set; }
public string[] EnabledLibraries { get; set; }
public bool EnableLiveTv { get; set; }
public string[] EnabledChannels { get; set; }
public ConnectAuthorization()
{
EnabledLibraries = Array.Empty<string>();
EnabledChannels = Array.Empty<string>();
}
}
}

View File

@@ -1,11 +0,0 @@
namespace MediaBrowser.Model.Connect
{
public class ConnectUser
{
public string Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool IsActive { get; set; }
public string ImageUrl { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
namespace MediaBrowser.Model.Connect
{
public class ConnectUserQuery
{
public string Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string NameOrEmail { get; set; }
}
}

View File

@@ -1,14 +0,0 @@
namespace MediaBrowser.Model.Connect
{
public enum UserLinkType
{
/// <summary>
/// The linked user
/// </summary>
LinkedUser = 0,
/// <summary>
/// The guest
/// </summary>
Guest = 1
}
}

View File

@@ -223,7 +223,7 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("DeviceProfileId", item.DeviceProfileId ?? string.Empty));
list.Add(new NameValuePair("DeviceId", item.DeviceId ?? string.Empty));
list.Add(new NameValuePair("MediaSourceId", item.MediaSourceId ?? string.Empty));
list.Add(new NameValuePair("Static", item.IsDirectStream.ToString().ToLower()));
list.Add(new NameValuePair("Static", item.IsDirectStream.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
list.Add(new NameValuePair("VideoCodec", videoCodecs));
list.Add(new NameValuePair("AudioCodec", audioCodecs));
list.Add(new NameValuePair("AudioStreamIndex", item.AudioStreamIndex.HasValue ? item.AudioStreamIndex.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
@@ -251,7 +251,7 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("PlaySessionId", item.PlaySessionId ?? string.Empty));
list.Add(new NameValuePair("api_key", accessToken ?? string.Empty));
string liveStreamId = item.MediaSource == null ? null : item.MediaSource.LiveStreamId;
string liveStreamId = item.MediaSource?.LiveStreamId;
list.Add(new NameValuePair("LiveStreamId", liveStreamId ?? string.Empty));
list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty));
@@ -261,37 +261,37 @@ namespace MediaBrowser.Model.Dlna
{
if (item.RequireNonAnamorphic)
{
list.Add(new NameValuePair("RequireNonAnamorphic", item.RequireNonAnamorphic.ToString().ToLower()));
list.Add(new NameValuePair("RequireNonAnamorphic", item.RequireNonAnamorphic.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? item.TranscodingMaxAudioChannels.Value.ToString(CultureInfo.InvariantCulture) : string.Empty));
if (item.EnableSubtitlesInManifest)
{
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower()));
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
if (item.EnableMpegtsM2TsMode)
{
list.Add(new NameValuePair("EnableMpegtsM2TsMode", item.EnableMpegtsM2TsMode.ToString().ToLower()));
list.Add(new NameValuePair("EnableMpegtsM2TsMode", item.EnableMpegtsM2TsMode.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
if (item.EstimateContentLength)
{
list.Add(new NameValuePair("EstimateContentLength", item.EstimateContentLength.ToString().ToLower()));
list.Add(new NameValuePair("EstimateContentLength", item.EstimateContentLength.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
if (item.TranscodeSeekInfo != TranscodeSeekInfo.Auto)
{
list.Add(new NameValuePair("TranscodeSeekInfo", item.TranscodeSeekInfo.ToString().ToLower()));
list.Add(new NameValuePair("TranscodeSeekInfo", item.TranscodeSeekInfo.ToString().ToLowerInvariant()));
}
if (item.CopyTimestamps)
{
list.Add(new NameValuePair("CopyTimestamps", item.CopyTimestamps.ToString().ToLower()));
list.Add(new NameValuePair("CopyTimestamps", item.CopyTimestamps.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
list.Add(new NameValuePair("RequireAvc", item.RequireAvc.ToString().ToLower()));
list.Add(new NameValuePair("RequireAvc", item.RequireAvc.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()));
}
list.Add(new NameValuePair("Tag", item.MediaSource.ETag ?? string.Empty));
@@ -316,7 +316,7 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("MinSegments", item.MinSegments.Value.ToString(CultureInfo.InvariantCulture)));
}
list.Add(new NameValuePair("BreakOnNonKeyFrames", item.BreakOnNonKeyFrames.ToString()));
list.Add(new NameValuePair("BreakOnNonKeyFrames", item.BreakOnNonKeyFrames.ToString(CultureInfo.InvariantCulture)));
}
foreach (var pair in item.StreamOptions)
@@ -332,7 +332,7 @@ namespace MediaBrowser.Model.Dlna
if (!item.IsDirectStream)
{
list.Add(new NameValuePair("TranscodeReasons", string.Join(",", item.TranscodeReasons.Distinct().Select(i => i.ToString()).ToArray())));
list.Add(new NameValuePair("TranscodeReasons", string.Join(",", item.TranscodeReasons.Distinct().Select(i => i.ToString()))));
}
return list;

View File

@@ -1,7 +1,7 @@
namespace MediaBrowser.Model.Drawing
{
/// <summary>
/// Struct ImageSize
/// Struct ImageDimensions
/// </summary>
public struct ImageDimensions
{

View File

@@ -116,16 +116,8 @@ namespace MediaBrowser.Model.Dto
/// <value>The critic rating.</value>
public float? CriticRating { get; set; }
/// <summary>
/// Gets or sets the game system.
/// </summary>
/// <value>The game system.</value>
public string GameSystem { get; set; }
public string[] ProductionLocations { get; set; }
public string[] MultiPartGameFiles { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
@@ -604,11 +596,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The episode count.</value>
public int? EpisodeCount { get; set; }
/// <summary>
/// Gets or sets the game count.
/// </summary>
/// <value>The game count.</value>
public int? GameCount { get; set; }
/// <summary>
/// Gets or sets the song count.
/// </summary>
/// <value>The song count.</value>

View File

@@ -1,48 +0,0 @@
using System;
namespace MediaBrowser.Model.Dto
{
/// <summary>
/// Class GameSystemSummary
/// </summary>
public class GameSystemSummary
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets the game count.
/// </summary>
/// <value>The game count.</value>
public int GameCount { get; set; }
/// <summary>
/// Gets or sets the game extensions.
/// </summary>
/// <value>The game extensions.</value>
public string[] GameFileExtensions { get; set; }
/// <summary>
/// Gets or sets the client installed game count.
/// </summary>
/// <value>The client installed game count.</value>
public int ClientInstalledGameCount { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="GameSystemSummary"/> class.
/// </summary>
public GameSystemSummary()
{
GameFileExtensions = Array.Empty<string>();
}
}
}

View File

@@ -20,19 +20,9 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The episode count.</value>
public int EpisodeCount { get; set; }
/// <summary>
/// Gets or sets the game count.
/// </summary>
/// <value>The game count.</value>
public int GameCount { get; set; }
public int ArtistCount { get; set; }
public int ProgramCount { get; set; }
/// <summary>
/// Gets or sets the game system count.
/// </summary>
/// <value>The game system count.</value>
public int GameSystemCount { get; set; }
/// <summary>
/// Gets or sets the trailer count.
/// </summary>
/// <value>The trailer count.</value>

View File

@@ -1,6 +1,5 @@
using System;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Dto
@@ -29,22 +28,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The name of the server.</value>
public string ServerName { get; set; }
/// <summary>
/// Gets or sets the name of the connect user.
/// </summary>
/// <value>The name of the connect user.</value>
public string ConnectUserName { get; set; }
/// <summary>
/// Gets or sets the connect user identifier.
/// </summary>
/// <value>The connect user identifier.</value>
public string ConnectUserId { get; set; }
/// <summary>
/// Gets or sets the type of the connect link.
/// </summary>
/// <value>The type of the connect link.</value>
public UserLinkType? ConnectLinkType { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>

View File

@@ -18,7 +18,6 @@ namespace MediaBrowser.Model.Entities
public const string Books = "books";
public const string Photos = "photos";
public const string Games = "games";
public const string LiveTv = "livetv";
public const string Playlists = "playlists";
public const string Folders = "folders";

View File

@@ -104,7 +104,7 @@ namespace MediaBrowser.Model.Entities
attributes.Add("Default");
}
return string.Join(" ", attributes.ToArray());
return string.Join(" ", attributes);
}
if (Type == MediaStreamType.Video)
@@ -120,10 +120,10 @@ namespace MediaBrowser.Model.Entities
if (!string.IsNullOrEmpty(Codec))
{
attributes.Add(Codec.ToUpper());
attributes.Add(Codec.ToUpperInvariant());
}
return string.Join(" ", attributes.ToArray());
return string.Join(" ", attributes);
}
if (Type == MediaStreamType.Subtitle)

View File

@@ -14,10 +14,6 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public const string Audio = "Audio";
/// <summary>
/// The game
/// </summary>
public const string Game = "Game";
/// <summary>
/// The photo
/// </summary>
public const string Photo = "Photo";

View File

@@ -5,7 +5,6 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public enum MetadataProviders
{
Gamesdb = 1,
/// <summary>
/// The imdb
/// </summary>

View File

@@ -1,85 +0,0 @@
using System;
using System.Collections.Generic;
// TODO: @bond Remove
namespace MediaBrowser.Model.Extensions
{
// MoreLINQ - Extensions to LINQ to Objects
// Copyright (c) 2008 Jonathan Skeet. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
public static class LinqExtensions
{
/// <summary>
/// Returns all distinct elements of the given source, where "distinctness"
/// is determined via a projection and the default equality comparer for the projected type.
/// </summary>
/// <remarks>
/// This operator uses deferred execution and streams the results, although
/// a set of already-seen keys is retained. If a key is seen multiple times,
/// only the first element with that key is returned.
/// </remarks>
/// <typeparam name="TSource">Type of the source sequence</typeparam>
/// <typeparam name="TKey">Type of the projected element</typeparam>
/// <param name="source">Source sequence</param>
/// <param name="keySelector">Projection for determining "distinctness"</param>
/// <returns>A sequence consisting of distinct elements from the source sequence,
/// comparing them by the specified key projection.</returns>
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)
{
return source.DistinctBy(keySelector, null);
}
/// <summary>
/// Returns all distinct elements of the given source, where "distinctness"
/// is determined via a projection and the specified comparer for the projected type.
/// </summary>
/// <remarks>
/// This operator uses deferred execution and streams the results, although
/// a set of already-seen keys is retained. If a key is seen multiple times,
/// only the first element with that key is returned.
/// </remarks>
/// <typeparam name="TSource">Type of the source sequence</typeparam>
/// <typeparam name="TKey">Type of the projected element</typeparam>
/// <param name="source">Source sequence</param>
/// <param name="keySelector">Projection for determining "distinctness"</param>
/// <param name="comparer">The equality comparer to use to determine whether or not keys are equal.
/// If null, the default equality comparer for <c>TSource</c> is used.</param>
/// <returns>A sequence consisting of distinct elements from the source sequence,
/// comparing them by the specified key projection.</returns>
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
{
if (source == null) throw new ArgumentNullException(nameof(source));
if (keySelector == null) throw new ArgumentNullException(nameof(keySelector));
return DistinctByImpl(source, keySelector, comparer);
}
private static IEnumerable<TSource> DistinctByImpl<TSource, TKey>(IEnumerable<TSource> source,
Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
{
var knownKeys = new HashSet<TKey>(comparer);
foreach (var element in source)
{
if (knownKeys.Add(keySelector(element)))
{
yield return element;
}
}
}
}
}

View File

@@ -51,7 +51,7 @@ namespace MediaBrowser.Model.Extensions
public static string FirstToUpper(this string str)
{
return string.IsNullOrEmpty(str) ? "" : str.Substring(0, 1).ToUpper() + str.Substring(1);
return string.IsNullOrEmpty(str) ? string.Empty : str.Substring(0, 1).ToUpperInvariant() + str.Substring(1);
}
}
}

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Globalization
@@ -17,12 +19,12 @@ namespace MediaBrowser.Model.Globalization
/// Gets the countries.
/// </summary>
/// <returns>IEnumerable{CountryInfo}.</returns>
CountryInfo[] GetCountries();
Task<CountryInfo[]> GetCountries();
/// <summary>
/// Gets the parental ratings.
/// </summary>
/// <returns>IEnumerable{ParentalRating}.</returns>
ParentalRating[] GetParentalRatings();
IEnumerable<ParentalRating> GetParentalRatings();
/// <summary>
/// Gets the rating level.
/// </summary>
@@ -51,8 +53,6 @@ namespace MediaBrowser.Model.Globalization
/// <returns>IEnumerable{LocalizatonOption}.</returns>
LocalizationOption[] GetLocalizationOptions();
string RemoveDiacritics(string text);
string NormalizeFormKD(string text);
bool HasUnicodeCategory(string value, UnicodeCategory category);

View File

@@ -8,9 +8,12 @@ namespace MediaBrowser.Model.MediaInfo
public static string GetFriendlyName(string codec)
{
if (string.IsNullOrEmpty(codec)) return "";
if (string.IsNullOrEmpty(codec))
{
return string.Empty;
}
switch (codec.ToLower())
switch (codec.ToLowerInvariant())
{
case "ac3":
return "Dolby Digital";
@@ -19,7 +22,7 @@ namespace MediaBrowser.Model.MediaInfo
case "dca":
return "DTS";
default:
return codec.ToUpper();
return codec.ToUpperInvariant();
}
}
}

View File

@@ -158,7 +158,7 @@ namespace MediaBrowser.Model.Net
// Catch-all for all video types that don't require specific mime types
if (VideoFileExtensionsDictionary.ContainsKey(ext))
{
return "video/" + ext.TrimStart('.').ToLower();
return "video/" + ext.TrimStart('.').ToLowerInvariant();
}
// Type text

View File

@@ -5,10 +5,8 @@ namespace MediaBrowser.Model.Notifications
ApplicationUpdateAvailable,
ApplicationUpdateInstalled,
AudioPlayback,
GamePlayback,
VideoPlayback,
AudioPlaybackStopped,
GamePlaybackStopped,
VideoPlaybackStopped,
InstallationFailed,
PluginError,

View File

@@ -30,8 +30,6 @@ namespace MediaBrowser.Model.Providers
public string ImageUrl { get; set; }
public string SearchProviderName { get; set; }
public string GameSystem { get; set; }
public string Overview { get; set; }
public RemoteSearchResult AlbumArtist { get; set; }

View File

@@ -71,8 +71,6 @@ namespace MediaBrowser.Model.Querying
public const string VideoBitRate = "VideoBitRate";
public const string AirTime = "AirTime";
public const string Studio = "Studio";
public const string Players = "Players";
public const string GameSystem = "GameSystem";
public const string IsFavoriteOrLiked = "IsFavoriteOrLiked";
public const string DateLastContentAdded = "DateLastContentAdded";
public const string SeriesDatePlayed = "SeriesDatePlayed";

View File

@@ -1,10 +0,0 @@
using System;
namespace MediaBrowser.Model.Threading
{
public interface ITimer : IDisposable
{
void Change(TimeSpan dueTime, TimeSpan period);
void Change(int dueTimeMs, int periodMs);
}
}

View File

@@ -1,10 +0,0 @@
using System;
namespace MediaBrowser.Model.Threading
{
public interface ITimerFactory
{
ITimer Create(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period);
ITimer Create(Action<object> callback, object state, int dueTimeMs, int periodMs);
}
}