Merge pull request #11 from jellyfin/master

nightly
This commit is contained in:
artiume 2020-02-04 06:02:38 -05:00 committed by GitHub
commit 3b6a4c3a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
134 changed files with 292 additions and 457 deletions

View File

@ -31,7 +31,7 @@ COPY --from=web-builder /dist /jellyfin/jellyfin-web
# mesa-va-drivers: needed for VAAPI # mesa-va-drivers: needed for VAAPI
RUN apt-get update \ RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \ && apt-get install --no-install-recommends --no-install-suggests -y \
libfontconfig1 libgomp1 libva-drm2 mesa-va-drivers openssl \ libfontconfig1 libgomp1 libva-drm2 mesa-va-drivers openssl ca-certificates \
&& apt-get clean autoclean \ && apt-get clean autoclean \
&& apt-get autoremove \ && apt-get autoremove \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \

View File

@ -24,7 +24,7 @@ RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin"
FROM debian:buster-slim FROM debian:buster-slim
RUN apt-get update \ RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \ && apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \
libssl-dev \ libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /cache /config /media \ && mkdir -p /cache /config /media \
&& chmod 777 /cache /config /media && chmod 777 /cache /config /media

View File

@ -24,7 +24,7 @@ RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin"
FROM debian:buster-slim FROM debian:buster-slim
RUN apt-get update \ RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \ && apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \
libssl-dev \ libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /cache /config /media \ && mkdir -p /cache /config /media \
&& chmod 777 /cache /config /media && chmod 777 /cache /config /media

View File

@ -9,7 +9,7 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>

View File

@ -18,7 +18,6 @@ using MediaBrowser.Controller.Playlists;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -16,7 +16,7 @@ namespace Emby.Dlna.Didl
public Filter(string filter) public Filter(string filter)
{ {
_all = StringHelper.EqualsIgnoreCase(filter, "*"); _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);
_fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); _fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
} }

View File

@ -6,7 +6,6 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Emby.Dlna.Didl; using Emby.Dlna.Didl;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;

View File

@ -1,4 +1,3 @@
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;

View File

@ -5,7 +5,6 @@ using System.Linq;
using System.Text; using System.Text;
using Emby.Dlna.Common; using Emby.Dlna.Common;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions;
namespace Emby.Dlna.Server namespace Emby.Dlna.Server
{ {

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml; using System.Xml;

View File

@ -4,10 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> <TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' " >true</TreatWarningsAsErrors>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Notifications; using MediaBrowser.Controller.Notifications;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Notifications; using MediaBrowser.Model.Notifications;

View File

@ -1,9 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />

View File

@ -2,7 +2,6 @@
#pragma warning disable SA1600 #pragma warning disable SA1600
using System; using System;
using System.Linq;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Activity; using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Events; using MediaBrowser.Model.Events;

View File

@ -1007,7 +1007,7 @@ namespace Emby.Server.Implementations
{ {
string dir = Path.Combine(ApplicationPaths.PluginsPath, args.Argument.name); string dir = Path.Combine(ApplicationPaths.PluginsPath, args.Argument.name);
var types = Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories) var types = Directory.EnumerateFiles(dir, "*.dll", SearchOption.AllDirectories)
.Select(x => Assembly.LoadFrom(x)) .Select(Assembly.LoadFrom)
.SelectMany(x => x.ExportedTypes) .SelectMany(x => x.ExportedTypes)
.Where(x => x.IsClass && !x.IsAbstract && !x.IsInterface && !x.IsGenericType) .Where(x => x.IsClass && !x.IsAbstract && !x.IsInterface && !x.IsGenericType)
.ToArray(); .ToArray();
@ -1707,29 +1707,6 @@ namespace Emby.Server.Implementations
_plugins = list.ToArray(); _plugins = list.ToArray();
} }
/// <summary>
/// This returns localhost in the case of no external dns, and the hostname if the
/// dns is prefixed with a valid Uri prefix.
/// </summary>
/// <param name="externalDns">The external dns prefix to get the hostname of.</param>
/// <returns>The hostname in <paramref name="externalDns"/>.</returns>
private static string GetHostnameFromExternalDns(string externalDns)
{
if (string.IsNullOrEmpty(externalDns))
{
return "localhost";
}
try
{
return new Uri(externalDns).Host;
}
catch
{
return externalDns;
}
}
public virtual void LaunchUrl(string url) public virtual void LaunchUrl(string url)
{ {
if (!CanLaunchWebBrowser) if (!CanLaunchWebBrowser)

View File

@ -35,14 +35,6 @@ namespace Emby.Server.Implementations.Channels
return Task.CompletedTask; return Task.CompletedTask;
} }
public static string GetUserDistinctValue(User user)
{
var channels = user.Policy.EnabledChannels
.OrderBy(i => i);
return string.Join("|", channels);
}
private void CleanDatabase(CancellationToken cancellationToken) private void CleanDatabase(CancellationToken cancellationToken)
{ {
var installedChannelIds = ((ChannelManager)_channelManager).GetInstalledChannelIds(); var installedChannelIds = ((ChannelManager)_channelManager).GetInstalledChannelIds();
@ -75,19 +67,23 @@ namespace Emby.Server.Implementations.Channels
{ {
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
_libraryManager.DeleteItem(item, new DeleteOptions _libraryManager.DeleteItem(
item,
new DeleteOptions
{ {
DeleteFileLocation = false DeleteFileLocation = false
},
}, false); false);
} }
// Finally, delete the channel itself // Finally, delete the channel itself
_libraryManager.DeleteItem(channel, new DeleteOptions _libraryManager.DeleteItem(
channel,
new DeleteOptions
{ {
DeleteFileLocation = false DeleteFileLocation = false
},
}, false); false);
} }
} }
} }

View File

@ -28,18 +28,28 @@ namespace Emby.Server.Implementations.Channels
_libraryManager = libraryManager; _libraryManager = libraryManager;
} }
/// <inheritdoc />
public string Name => "Refresh Channels"; public string Name => "Refresh Channels";
/// <inheritdoc />
public string Description => "Refreshes internet channel information."; public string Description => "Refreshes internet channel information.";
/// <inheritdoc />
public string Category => "Internet Channels"; public string Category => "Internet Channels";
/// <inheritdoc />
public bool IsHidden => ((ChannelManager)_channelManager).Channels.Length == 0; public bool IsHidden => ((ChannelManager)_channelManager).Channels.Length == 0;
/// <inheritdoc />
public bool IsEnabled => true; public bool IsEnabled => true;
/// <inheritdoc />
public bool IsLogged => true; public bool IsLogged => true;
/// <inheritdoc />
public string Key => "RefreshInternetChannels";
/// <inheritdoc />
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{ {
var manager = (ChannelManager)_channelManager; var manager = (ChannelManager)_channelManager;
@ -50,18 +60,18 @@ namespace Emby.Server.Implementations.Channels
.ConfigureAwait(false); .ConfigureAwait(false);
} }
/// <summary> /// <inheritdoc />
/// Creates the triggers that define when the task will run
/// </summary>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{ {
return new[] { return new[]
{
// Every so often // Every so often
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} new TaskTriggerInfo
{
Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks
}
}; };
} }
public string Key => "RefreshInternetChannels";
} }
} }

View File

@ -1,7 +1,6 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
#pragma warning disable SA1600 #pragma warning disable SA1600
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Emby.Server.Implementations.Images; using Emby.Server.Implementations.Images;

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Emby.Server.Implementations.AppBase; using Emby.Server.Implementations.AppBase;

View File

@ -29,11 +29,11 @@
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" /> <PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.2.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.1" />
<PackageReference Include="Mono.Nat" Version="2.0.0" /> <PackageReference Include="Mono.Nat" Version="2.0.0" />
<PackageReference Include="ServiceStack.Text.Core" Version="5.7.0" /> <PackageReference Include="ServiceStack.Text.Core" Version="5.8.0" />
<PackageReference Include="sharpcompress" Version="0.24.0" /> <PackageReference Include="sharpcompress" Version="0.24.0" />
<PackageReference Include="SQLitePCL.pretty.netstandard" Version="2.1.0" /> <PackageReference Include="SQLitePCL.pretty.netstandard" Version="2.1.0" />
<PackageReference Include="System.Interactive.Async" Version="4.0.0" /> <PackageReference Include="System.Interactive.Async" Version="4.0.0" />

View File

@ -16,7 +16,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events; using MediaBrowser.Model.Events;
using MediaBrowser.Model.Extensions;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints namespace Emby.Server.Implementations.EntryPoints

View File

@ -1,4 +1,3 @@
using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Emby.Server.Implementations.Udp; using Emby.Server.Implementations.Udp;

View File

@ -710,10 +710,10 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Creates the root media folder /// Creates the root media folder.
/// </summary> /// </summary>
/// <returns>AggregateFolder.</returns> /// <returns>AggregateFolder.</returns>
/// <exception cref="InvalidOperationException">Cannot create the root folder until plugins have loaded</exception> /// <exception cref="InvalidOperationException">Cannot create the root folder until plugins have loaded.</exception>
public AggregateFolder CreateRootFolder() public AggregateFolder CreateRootFolder()
{ {
var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath; var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
@ -824,7 +824,6 @@ namespace Emby.Server.Implementations.Library
{ {
// If this returns multiple items it could be tricky figuring out which one is correct. // If this returns multiple items it could be tricky figuring out which one is correct.
// In most cases, the newest one will be and the others obsolete but not yet cleaned up // In most cases, the newest one will be and the others obsolete but not yet cleaned up
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentNullException(nameof(path)); throw new ArgumentNullException(nameof(path));
@ -844,7 +843,7 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Gets a Person /// Gets the person.
/// </summary> /// </summary>
/// <param name="name">The name.</param> /// <param name="name">The name.</param>
/// <returns>Task{Person}.</returns> /// <returns>Task{Person}.</returns>
@ -854,7 +853,7 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Gets a Studio /// Gets the studio.
/// </summary> /// </summary>
/// <param name="name">The name.</param> /// <param name="name">The name.</param>
/// <returns>Task{Studio}.</returns> /// <returns>Task{Studio}.</returns>
@ -879,7 +878,7 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Gets a Genre /// Gets the genre.
/// </summary> /// </summary>
/// <param name="name">The name.</param> /// <param name="name">The name.</param>
/// <returns>Task{Genre}.</returns> /// <returns>Task{Genre}.</returns>
@ -889,7 +888,7 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Gets the genre. /// Gets the music genre.
/// </summary> /// </summary>
/// <param name="name">The name.</param> /// <param name="name">The name.</param>
/// <returns>Task{MusicGenre}.</returns> /// <returns>Task{MusicGenre}.</returns>
@ -899,7 +898,7 @@ namespace Emby.Server.Implementations.Library
} }
/// <summary> /// <summary>
/// Gets a Year /// Gets the year.
/// </summary> /// </summary>
/// <param name="value">The value.</param> /// <param name="value">The value.</param>
/// <returns>Task{Year}.</returns> /// <returns>Task{Year}.</returns>
@ -1076,9 +1075,9 @@ namespace Emby.Server.Implementations.Library
var innerProgress = new ActionableProgress<double>(); var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(pct => progress.Report(pct * .96)); innerProgress.RegisterAction(pct => progress.Report(pct * pct * 0.96));
// Now validate the entire media library // Validate the entire media library
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false); await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false);
progress.Report(96); progress.Report(96);
@ -1087,7 +1086,6 @@ namespace Emby.Server.Implementations.Library
innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04))); innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04)));
// Run post-scan tasks
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false); await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
progress.Report(100); progress.Report(100);
@ -1138,7 +1136,7 @@ namespace Emby.Server.Implementations.Library
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error running postscan task"); _logger.LogError(ex, "Error running post-scan task");
} }
numComplete++; numComplete++;

View File

@ -291,10 +291,11 @@ namespace Emby.Server.Implementations.Library
&& authenticationProvider != null && authenticationProvider != null
&& !(authenticationProvider is DefaultAuthenticationProvider)) && !(authenticationProvider is DefaultAuthenticationProvider))
{ {
// We should trust the user that the authprovider says, not what was typed // Trust the username returned by the authentication provider
username = updatedUsername; username = updatedUsername;
// Search the database for the user again; the authprovider might have created it // Search the database for the user again
// the authentication provider might have created it
user = Users user = Users
.FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase)); .FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
@ -667,7 +668,7 @@ namespace Emby.Server.Implementations.Library
throw new ArgumentException("Invalid username", nameof(newName)); throw new ArgumentException("Invalid username", nameof(newName));
} }
if (user.Name.Equals(newName, StringComparison.OrdinalIgnoreCase)) if (user.Name.Equals(newName, StringComparison.Ordinal))
{ {
throw new ArgumentException("The new and old names must be different."); throw new ArgumentException("The new and old names must be different.");
} }

View File

@ -427,7 +427,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{ {
foreach (NameValuePair mapping in mappings) foreach (NameValuePair mapping in mappings)
{ {
if (StringHelper.EqualsIgnoreCase(mapping.Name, channelId)) if (string.Equals(mapping.Name, channelId, StringComparison.OrdinalIgnoreCase))
{ {
return mapping.Value; return mapping.Value;
} }

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@ -10,7 +10,6 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Extensions;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.LiveTv.TunerHosts namespace Emby.Server.Implementations.LiveTv.TunerHosts

View File

@ -3,9 +3,9 @@
"AppDeviceValues": "Aplicació: {0}, Dispositiu: {1}", "AppDeviceValues": "Aplicació: {0}, Dispositiu: {1}",
"Application": "Aplicació", "Application": "Aplicació",
"Artists": "Artistes", "Artists": "Artistes",
"AuthenticationSucceededWithUserName": "{0} s'ha autenticat correctament", "AuthenticationSucceededWithUserName": "{0} s'ha autentificat correctament",
"Books": "Llibres", "Books": "Llibres",
"CameraImageUploadedFrom": "Una nova imatge de càmera ha sigut pujada des de {0}", "CameraImageUploadedFrom": "Una nova imatge de la càmera ha sigut pujada des de {0}",
"Channels": "Canals", "Channels": "Canals",
"ChapterNameValue": "Episodi {0}", "ChapterNameValue": "Episodi {0}",
"Collections": "Col·leccions", "Collections": "Col·leccions",

View File

@ -79,7 +79,7 @@
"SubtitlesDownloadedForItem": "已为 {0} 下载了字幕", "SubtitlesDownloadedForItem": "已为 {0} 下载了字幕",
"Sync": "同步", "Sync": "同步",
"System": "系统", "System": "系统",
"TvShows": "电视节目", "TvShows": "电视",
"User": "用户", "User": "用户",
"UserCreatedWithName": "用户 {0} 已创建", "UserCreatedWithName": "用户 {0} 已创建",
"UserDeletedWithName": "用户 {0} 已删除", "UserDeletedWithName": "用户 {0} 已删除",

View File

@ -1,5 +1,4 @@
using System; using System;
using System.IO;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;

View File

@ -1,6 +1,4 @@
using System; using System;
using System.Net.WebSockets;
using MediaBrowser.Model.Services;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
namespace Emby.Server.Implementations.Net namespace Emby.Server.Implementations.Net

View File

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Emby.Server.Implementations.Images; using Emby.Server.Implementations.Images;

View File

@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
} }
/// <summary> /// <summary>
/// Returns the task to be executed /// Returns the task to be executed.
/// </summary> /// </summary>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param> /// <param name="progress">The progress.</param>
@ -89,7 +89,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
SourceTypes = new SourceType[] { SourceType.Library }, SourceTypes = new SourceType[] { SourceType.Library },
HasChapterImages = false, HasChapterImages = false,
IsVirtualItem = false IsVirtualItem = false
}) })
.OfType<Video>() .OfType<Video>()
.ToList(); .ToList();
@ -160,7 +159,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
} }
} }
public string Name => "Chapter image extraction"; public string Name => "Extract Chapter Images";
public string Description => "Creates thumbnails for videos that have chapters."; public string Description => "Creates thumbnails for videos that have chapters.";

View File

@ -158,9 +158,9 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
} }
public string Name => "Cache file cleanup"; public string Name => "Clean Cache Directory";
public string Description => "Deletes cache files no longer needed by the system"; public string Description => "Deletes cache files no longer needed by the system.";
public string Category => "Maintenance"; public string Category => "Maintenance";

View File

@ -10,7 +10,7 @@ using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.ScheduledTasks.Tasks namespace Emby.Server.Implementations.ScheduledTasks.Tasks
{ {
/// <summary> /// <summary>
/// Deletes old log files /// Deletes old log files.
/// </summary> /// </summary>
public class DeleteLogFileTask : IScheduledTask, IConfigurableScheduledTask public class DeleteLogFileTask : IScheduledTask, IConfigurableScheduledTask
{ {
@ -33,20 +33,18 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
/// <summary> /// <summary>
/// Creates the triggers that define when the task will run /// Creates the triggers that define when the task will run.
/// </summary> /// </summary>
/// <returns>IEnumerable{BaseTaskTrigger}.</returns> /// <returns>IEnumerable{BaseTaskTrigger}.</returns>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{ {
return new[] { return new[] {
// Every so often
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
}; };
} }
/// <summary> /// <summary>
/// Returns the task to be executed /// Returns the task to be executed.
/// </summary> /// </summary>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param> /// <param name="progress">The progress.</param>
@ -81,7 +79,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
return Task.CompletedTask; return Task.CompletedTask;
} }
public string Name => "Log file cleanup"; public string Name => "Clean Log Directory";
public string Description => string.Format("Deletes log files that are more than {0} days old.", ConfigurationManager.CommonConfiguration.LogFileRetentionDays); public string Description => string.Format("Deletes log files that are more than {0} days old.", ConfigurationManager.CommonConfiguration.LogFileRetentionDays);

View File

@ -125,9 +125,9 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
} }
public string Name => "Transcode file cleanup"; public string Name => "Clean Transcode Directory";
public string Description => "Deletes transcode files more than 24 hours old."; public string Description => "Deletes transcode files more than one day old.";
public string Category => "Maintenance"; public string Category => "Maintenance";

View File

@ -9,12 +9,12 @@ using MediaBrowser.Model.Tasks;
namespace Emby.Server.Implementations.ScheduledTasks namespace Emby.Server.Implementations.ScheduledTasks
{ {
/// <summary> /// <summary>
/// Class PeopleValidationTask /// Class PeopleValidationTask.
/// </summary> /// </summary>
public class PeopleValidationTask : IScheduledTask public class PeopleValidationTask : IScheduledTask
{ {
/// <summary> /// <summary>
/// The _library manager /// The library manager.
/// </summary> /// </summary>
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
@ -32,13 +32,12 @@ namespace Emby.Server.Implementations.ScheduledTasks
} }
/// <summary> /// <summary>
/// Creates the triggers that define when the task will run /// Creates the triggers that define when the task will run.
/// </summary> /// </summary>
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
{ {
return new[] return new[]
{ {
// Every so often
new TaskTriggerInfo new TaskTriggerInfo
{ {
Type = TaskTriggerInfo.TriggerInterval, Type = TaskTriggerInfo.TriggerInterval,
@ -48,7 +47,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
} }
/// <summary> /// <summary>
/// Returns the task to be executed /// Returns the task to be executed.
/// </summary> /// </summary>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param> /// <param name="progress">The progress.</param>
@ -58,7 +57,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
return _libraryManager.ValidatePeople(cancellationToken, progress); return _libraryManager.ValidatePeople(cancellationToken, progress);
} }
public string Name => "Refresh people"; public string Name => "Refresh People";
public string Description => "Updates metadata for actors and directors in your media library."; public string Description => "Updates metadata for actors and directors in your media library.";

View File

@ -96,7 +96,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
} }
/// <inheritdoc /> /// <inheritdoc />
public string Name => "Check for plugin updates"; public string Name => "Update Plugins";
/// <inheritdoc /> /// <inheritdoc />
public string Description => "Downloads and installs updates for plugins that are configured to update automatically."; public string Description => "Downloads and installs updates for plugins that are configured to update automatically.";

View File

@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken); return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
} }
public string Name => "Scan media library"; public string Name => "Scan Media Library";
public string Description => "Scans your media library for new files and refreshes metadata."; public string Description => "Scans your media library for new files and refreshes metadata.";

View File

@ -30,17 +30,17 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Session namespace Emby.Server.Implementations.Session
{ {
/// <summary> /// <summary>
/// Class SessionManager /// Class SessionManager.
/// </summary> /// </summary>
public class SessionManager : ISessionManager, IDisposable public class SessionManager : ISessionManager, IDisposable
{ {
/// <summary> /// <summary>
/// The _user data repository /// The user data repository.
/// </summary> /// </summary>
private readonly IUserDataManager _userDataManager; private readonly IUserDataManager _userDataManager;
/// <summary> /// <summary>
/// The _logger /// The logger.
/// </summary> /// </summary>
private readonly ILogger _logger; private readonly ILogger _logger;
@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Session
private readonly IDeviceManager _deviceManager; private readonly IDeviceManager _deviceManager;
/// <summary> /// <summary>
/// The _active connections /// The active connections.
/// </summary> /// </summary>
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections = private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections =
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase); new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
@ -70,18 +70,23 @@ namespace Emby.Server.Implementations.Session
/// Occurs when [playback start]. /// Occurs when [playback start].
/// </summary> /// </summary>
public event EventHandler<PlaybackProgressEventArgs> PlaybackStart; public event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
/// <summary> /// <summary>
/// Occurs when [playback progress]. /// Occurs when [playback progress].
/// </summary> /// </summary>
public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress; public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
/// <summary> /// <summary>
/// Occurs when [playback stopped]. /// Occurs when [playback stopped].
/// </summary> /// </summary>
public event EventHandler<PlaybackStopEventArgs> PlaybackStopped; public event EventHandler<PlaybackStopEventArgs> PlaybackStopped;
public event EventHandler<SessionEventArgs> SessionStarted; public event EventHandler<SessionEventArgs> SessionStarted;
public event EventHandler<SessionEventArgs> CapabilitiesChanged; public event EventHandler<SessionEventArgs> CapabilitiesChanged;
public event EventHandler<SessionEventArgs> SessionEnded; public event EventHandler<SessionEventArgs> SessionEnded;
public event EventHandler<SessionEventArgs> SessionActivity; public event EventHandler<SessionEventArgs> SessionActivity;
public SessionManager( public SessionManager(
@ -924,7 +929,6 @@ namespace Emby.Server.Implementations.Session
ClientName = session.Client, ClientName = session.Client,
DeviceId = session.DeviceId, DeviceId = session.DeviceId,
Session = session Session = session
}, },
_logger); _logger);
} }
@ -1610,7 +1614,7 @@ namespace Emby.Server.Implementations.Session
private DtoOptions _itemInfoDtoOptions; private DtoOptions _itemInfoDtoOptions;
/// <summary> /// <summary>
/// Converts a BaseItem to a BaseItemInfo /// Converts a BaseItem to a BaseItemInfo.
/// </summary> /// </summary>
private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource) private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
{ {
@ -1680,7 +1684,7 @@ namespace Emby.Server.Implementations.Session
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError("Error getting {0} image info", ex, type); _logger.LogError(ex, "Error getting image information for {Type}", type);
return null; return null;
} }
} }

View File

@ -1,11 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using MediaBrowser.Model.Services;
public sealed class HttpPostedFile : IDisposable public sealed class HttpPostedFile : IDisposable
{ {

View File

@ -1,13 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Emby.Server.Implementations.HttpServer; using Emby.Server.Implementations.HttpServer;
using Emby.Server.Implementations.Net; using Emby.Server.Implementations.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Http.Extensions;

View File

@ -1,12 +1,10 @@
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -8,9 +8,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -12,8 +12,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SkiaSharp" Version="1.68.0" /> <PackageReference Include="SkiaSharp" Version="1.68.1" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.0" /> <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.1" />
<PackageReference Include="Jellyfin.SkiaSharp.NativeAssets.LinuxArm" Version="1.68.0" /> <PackageReference Include="Jellyfin.SkiaSharp.NativeAssets.LinuxArm" Version="1.68.0" />
</ItemGroup> </ItemGroup>
@ -25,7 +25,7 @@
<!-- Code analysers--> <!-- Code analysers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7" PrivateAssets="All" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" /> <PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />

View File

@ -1,4 +1,3 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using SkiaSharp; using SkiaSharp;

View File

@ -6,9 +6,6 @@
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
@ -38,16 +35,16 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" /> <PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Graylog" Version="2.1.1" /> <PackageReference Include="Serilog.Sinks.Graylog" Version="2.1.2" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.2" /> <PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.2" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3.netstandard11" Version="1.1.14" /> <PackageReference Include="SQLitePCLRaw.provider.sqlite3.netstandard11" Version="1.1.14" />
</ItemGroup> </ItemGroup>

View File

@ -4,7 +4,6 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Security;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
@ -238,7 +237,7 @@ namespace Jellyfin.Server
{ {
foreach (var address in addresses) foreach (var address in addresses)
{ {
_logger.LogInformation("Kestrel listening on {ipaddr}", address); _logger.LogInformation("Kestrel listening on {IpAddress}", address);
options.Listen(address, appHost.HttpPort); options.Listen(address, appHost.HttpPort);
if (appHost.EnableHttps && appHost.Certificate != null) if (appHost.EnableHttps && appHost.Certificate != null)
@ -443,8 +442,7 @@ namespace Jellyfin.Server
if (!File.Exists(configPath)) if (!File.Exists(configPath))
{ {
// For some reason the csproj name is used instead of the assembly name // For some reason the csproj name is used instead of the assembly name
using (Stream? resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath)) await using Stream? resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath);
{
if (resource == null) if (resource == null)
{ {
throw new InvalidOperationException( throw new InvalidOperationException(
@ -454,10 +452,9 @@ namespace Jellyfin.Server
ResourcePath)); ResourcePath));
} }
using Stream dst = File.Open(configPath, FileMode.CreateNew); await using Stream dst = File.Open(configPath, FileMode.CreateNew);
await resource.CopyToAsync(dst).ConfigureAwait(false); await resource.CopyToAsync(dst).ConfigureAwait(false);
} }
}
return new ConfigurationBuilder() return new ConfigurationBuilder()
.SetBasePath(appPaths.ConfigurationDirectoryPath) .SetBasePath(appPaths.ConfigurationDirectoryPath)

View File

@ -3,7 +3,6 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;

View File

@ -12,7 +12,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Session; using MediaBrowser.Model.Session;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -6,7 +6,6 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Audio;

View File

@ -16,17 +16,13 @@ using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Activity; using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -16,7 +16,6 @@ using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;

View File

@ -5,7 +5,6 @@
using System; using System;
using System.Buffers; using System.Buffers;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Text.Json; using System.Text.Json;
using System.Linq; using System.Linq;
@ -23,7 +22,6 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
using MediaBrowser.Model.Session; using MediaBrowser.Model.Session;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -1,4 +1,3 @@
using System;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;

View File

@ -18,7 +18,7 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.Session namespace MediaBrowser.Api.Session
{ {
/// <summary> /// <summary>
/// Class GetSessions /// Class GetSessions.
/// </summary> /// </summary>
[Route("/Sessions", "GET", Summary = "Gets a list of sessions")] [Route("/Sessions", "GET", Summary = "Gets a list of sessions")]
[Authenticated] [Authenticated]
@ -34,7 +34,7 @@ namespace MediaBrowser.Api.Session
} }
/// <summary> /// <summary>
/// Class DisplayContent /// Class DisplayContent.
/// </summary> /// </summary>
[Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")] [Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")]
[Authenticated] [Authenticated]

View File

@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Activity; using MediaBrowser.Model.Activity;

View File

@ -5,7 +5,6 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;

View File

@ -6,7 +6,6 @@ using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -281,7 +281,6 @@ namespace MediaBrowser.Api
{ {
IsHidden = false, IsHidden = false,
IsDisabled = false IsDisabled = false
}, true, true); }, true, true);
} }
@ -395,10 +394,11 @@ namespace MediaBrowser.Api
throw new MethodNotAllowedException("Hashed-only passwords are not valid for this API."); throw new MethodNotAllowedException("Hashed-only passwords are not valid for this API.");
} }
// Password should always be null
return Post(new AuthenticateUserByName return Post(new AuthenticateUserByName
{ {
Username = user.Name, Username = user.Name,
Password = null, // This should always be null Password = null,
Pw = request.Pw Pw = request.Pw
}); });
} }

View File

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.1" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" /> <PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
</ItemGroup> </ItemGroup>

View File

@ -7,7 +7,6 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;

View File

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Linq; using System.Linq;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;

View File

@ -4,7 +4,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.Extensions;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.MediaEncoding namespace MediaBrowser.Controller.MediaEncoding
@ -90,6 +89,15 @@ namespace MediaBrowser.Controller.MediaEncoding
framerate = val; framerate = val;
} }
} }
else if (part.StartsWith("fps=", StringComparison.OrdinalIgnoreCase))
{
var rate = part.Split(new[] { '=' }, 2)[^1];
if (float.TryParse(rate, NumberStyles.Any, _usCulture, out var val))
{
framerate = val;
}
}
else if (state.RunTimeTicks.HasValue && else if (state.RunTimeTicks.HasValue &&
part.StartsWith("time=", StringComparison.OrdinalIgnoreCase)) part.StartsWith("time=", StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -2,8 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Services; using MediaBrowser.Model.Services;
namespace MediaBrowser.Controller.Net namespace MediaBrowser.Controller.Net

View File

@ -3,7 +3,6 @@ using System.Net.WebSockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using MediaBrowser.Model.Services;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
namespace MediaBrowser.Controller.Net namespace MediaBrowser.Controller.Net

View File

@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Controller.Net namespace MediaBrowser.Controller.Net
{ {
public class StaticResultOptions public class StaticResultOptions

View File

@ -1,5 +1,4 @@
using System; using System;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Persistence namespace MediaBrowser.Controller.Persistence
{ {

View File

@ -126,12 +126,6 @@ namespace MediaBrowser.Controller.Session
[JsonIgnore] [JsonIgnore]
public ISessionController[] SessionControllers { get; set; } public ISessionController[] SessionControllers { get; set; }
/// <summary>
/// Gets or sets the application icon URL.
/// </summary>
/// <value>The application icon URL.</value>
public string AppIconUrl { get; set; }
/// <summary> /// <summary>
/// Gets or sets the supported commands. /// Gets or sets the supported commands.
/// </summary> /// </summary>
@ -259,7 +253,7 @@ namespace MediaBrowser.Controller.Session
foreach (var additionalUser in AdditionalUsers) foreach (var additionalUser in AdditionalUsers)
{ {
if (userId.Equals(userId)) if (additionalUser.UserId.Equals(userId))
{ {
return true; return true;
} }
@ -321,7 +315,7 @@ namespace MediaBrowser.Controller.Session
var newPositionTicks = positionTicks + ProgressIncrement; var newPositionTicks = positionTicks + ProgressIncrement;
var item = progressInfo.Item; var item = progressInfo.Item;
long? runtimeTicks = item == null ? null : item.RunTimeTicks; long? runtimeTicks = item?.RunTimeTicks;
// Don't report beyond the runtime // Don't report beyond the runtime
if (runtimeTicks.HasValue && newPositionTicks >= runtimeTicks.Value) if (runtimeTicks.HasValue && newPositionTicks >= runtimeTicks.Value)

View File

@ -9,7 +9,6 @@ using System.Xml;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Parsers namespace MediaBrowser.LocalMetadata.Parsers

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -18,8 +18,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="BDInfo" Version="0.7.6.1" /> <PackageReference Include="BDInfo" Version="0.7.6.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
<PackageReference Include="UTF.Unknown" Version="2.2.0" /> <PackageReference Include="UTF.Unknown" Version="2.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -5,7 +5,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.MediaEncoding.Subtitles namespace MediaBrowser.MediaEncoding.Subtitles

View File

@ -4,7 +4,6 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.MediaEncoding.Subtitles namespace MediaBrowser.MediaEncoding.Subtitles

View File

@ -1,4 +1,3 @@
using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -169,9 +169,9 @@ namespace MediaBrowser.Model.Dlna
return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue); return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
} }
case ProfileConditionType.Equals: case ProfileConditionType.Equals:
return StringHelper.EqualsIgnoreCase(currentValue, expected); return string.Equals(currentValue, expected, StringComparison.OrdinalIgnoreCase);
case ProfileConditionType.NotEquals: case ProfileConditionType.NotEquals:
return !StringHelper.EqualsIgnoreCase(currentValue, expected); return !string.Equals(currentValue, expected, StringComparison.OrdinalIgnoreCase);
default: default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition); throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
} }

View File

@ -122,7 +122,7 @@ namespace MediaBrowser.Model.Dlna
continue; continue;
} }
if (!StringHelper.EqualsIgnoreCase(container, i.Container)) if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
@ -148,7 +148,7 @@ namespace MediaBrowser.Model.Dlna
continue; continue;
} }
if (!StringHelper.EqualsIgnoreCase(container, i.Container)) if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
@ -158,7 +158,7 @@ namespace MediaBrowser.Model.Dlna
continue; continue;
} }
if (!StringHelper.EqualsIgnoreCase(videoCodec, i.VideoCodec ?? string.Empty)) if (!string.Equals(videoCodec, i.VideoCodec ?? string.Empty, StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }

View File

@ -17,53 +17,53 @@ namespace MediaBrowser.Model.Dlna
private MediaFormatProfile[] ResolveVideoFormatInternal(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType) private MediaFormatProfile[] ResolveVideoFormatInternal(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{ {
if (StringHelper.EqualsIgnoreCase(container, "asf")) if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
{ {
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height); MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { }; return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
} }
if (StringHelper.EqualsIgnoreCase(container, "mp4")) if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
{ {
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height); MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { }; return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
} }
if (StringHelper.EqualsIgnoreCase(container, "avi")) if (string.Equals(container, "avi", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.AVI }; return new MediaFormatProfile[] { MediaFormatProfile.AVI };
if (StringHelper.EqualsIgnoreCase(container, "mkv")) if (string.Equals(container, "mkv", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA }; return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ps") || if (string.Equals(container, "mpeg2ps", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "ts")) string.Equals(container, "ts", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL }; return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
if (StringHelper.EqualsIgnoreCase(container, "mpeg1video")) if (string.Equals(container, "mpeg1video", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 }; return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ts") || if (string.Equals(container, "mpeg2ts", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "mpegts") || string.Equals(container, "mpegts", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "m2ts")) string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase))
{ {
return ResolveVideoMPEG2TSFormat(videoCodec, audioCodec, width, height, timestampType); return ResolveVideoMPEG2TSFormat(videoCodec, audioCodec, width, height, timestampType);
} }
if (StringHelper.EqualsIgnoreCase(container, "flv")) if (string.Equals(container, "flv", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.FLV }; return new MediaFormatProfile[] { MediaFormatProfile.FLV };
if (StringHelper.EqualsIgnoreCase(container, "wtv")) if (string.Equals(container, "wtv", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.WTV }; return new MediaFormatProfile[] { MediaFormatProfile.WTV };
if (StringHelper.EqualsIgnoreCase(container, "3gp")) if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
{ {
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec); MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { }; return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
} }
if (StringHelper.EqualsIgnoreCase(container, "ogv") || StringHelper.EqualsIgnoreCase(container, "ogg")) if (string.Equals(container, "ogv", StringComparison.OrdinalIgnoreCase) || string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.OGV }; return new MediaFormatProfile[] { MediaFormatProfile.OGV };
return new MediaFormatProfile[] { }; return new MediaFormatProfile[] { };
@ -89,7 +89,7 @@ namespace MediaBrowser.Model.Dlna
resolution = "H"; resolution = "H";
} }
if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video")) if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
{ {
var list = new List<MediaFormatProfile>(); var list = new List<MediaFormatProfile>();
@ -97,18 +97,18 @@ namespace MediaBrowser.Model.Dlna
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix)); list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
list.Add(ValueOf("MPEG_TS_SD_KO" + suffix)); list.Add(ValueOf("MPEG_TS_SD_KO" + suffix));
if ((timestampType == TransportStreamTimestamp.Valid) && StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if ((timestampType == TransportStreamTimestamp.Valid) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{ {
list.Add(MediaFormatProfile.MPEG_TS_JP_T); list.Add(MediaFormatProfile.MPEG_TS_JP_T);
} }
return list.ToArray(); return list.ToArray();
} }
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264")) if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm")) if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T }; return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts")) if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
{ {
if (timestampType == TransportStreamTimestamp.None) if (timestampType == TransportStreamTimestamp.None)
{ {
@ -117,7 +117,7 @@ namespace MediaBrowser.Model.Dlna
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T }; return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
} }
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2")) if (string.Equals(audioCodec, "mp2", StringComparison.OrdinalIgnoreCase))
{ {
if (timestampType == TransportStreamTimestamp.None) if (timestampType == TransportStreamTimestamp.None)
{ {
@ -127,19 +127,19 @@ namespace MediaBrowser.Model.Dlna
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) }; return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
} }
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3")) if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
if (string.IsNullOrEmpty(audioCodec) || if (string.IsNullOrEmpty(audioCodec) ||
StringHelper.EqualsIgnoreCase(audioCodec, "ac3")) string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1")) else if (string.Equals(videoCodec, "vc1", StringComparison.OrdinalIgnoreCase))
{ {
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "ac3")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
{ {
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576)) if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
{ {
@ -147,23 +147,23 @@ namespace MediaBrowser.Model.Dlna
} }
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO }; return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
} }
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts")) if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase))
{ {
suffix = StringHelper.EqualsIgnoreCase(suffix, "_ISO") ? suffix : "_T"; suffix = string.Equals(suffix, "_ISO", StringComparison.OrdinalIgnoreCase) ? suffix : "_T";
return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
} }
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4")) else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3")) if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2")) if (string.Equals(audioCodec, "mp2", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3")) if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) }; return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
} }
@ -177,16 +177,16 @@ namespace MediaBrowser.Model.Dlna
private MediaFormatProfile? ResolveVideoMP4Format(string videoCodec, string audioCodec, int? width, int? height) private MediaFormatProfile? ResolveVideoMP4Format(string videoCodec, string audioCodec, int? width, int? height)
{ {
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264")) if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm")) if (string.Equals(audioCodec, "lpcm", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.AVC_MP4_LPCM; return MediaFormatProfile.AVC_MP4_LPCM;
if (string.IsNullOrEmpty(audioCodec) || if (string.IsNullOrEmpty(audioCodec) ||
StringHelper.EqualsIgnoreCase(audioCodec, "ac3")) string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.AVC_MP4_MP_SD_AC3; return MediaFormatProfile.AVC_MP4_MP_SD_AC3;
} }
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3")) if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3; return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3;
} }
@ -194,41 +194,41 @@ namespace MediaBrowser.Model.Dlna
{ {
if ((width.Value <= 720) && (height.Value <= 576)) if ((width.Value <= 720) && (height.Value <= 576))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.AVC_MP4_MP_SD_AAC_MULT5; return MediaFormatProfile.AVC_MP4_MP_SD_AAC_MULT5;
} }
else if ((width.Value <= 1280) && (height.Value <= 720)) else if ((width.Value <= 1280) && (height.Value <= 720))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.AVC_MP4_MP_HD_720p_AAC; return MediaFormatProfile.AVC_MP4_MP_HD_720p_AAC;
} }
else if ((width.Value <= 1920) && (height.Value <= 1080)) else if ((width.Value <= 1920) && (height.Value <= 1080))
{ {
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.AVC_MP4_MP_HD_1080i_AAC; return MediaFormatProfile.AVC_MP4_MP_HD_1080i_AAC;
} }
} }
} }
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4")) string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
{ {
if (width.HasValue && height.HasValue && width.Value <= 720 && height.Value <= 576) if (width.HasValue && height.HasValue && width.Value <= 720 && height.Value <= 576)
{ {
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.MPEG4_P2_MP4_ASP_AAC; return MediaFormatProfile.MPEG4_P2_MP4_ASP_AAC;
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3") || StringHelper.EqualsIgnoreCase(audioCodec, "mp3")) if (string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase) || string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.MPEG4_P2_MP4_NDSD; return MediaFormatProfile.MPEG4_P2_MP4_NDSD;
} }
} }
else if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac")) else if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.MPEG4_P2_MP4_SP_L6_AAC; return MediaFormatProfile.MPEG4_P2_MP4_SP_L6_AAC;
} }
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "aac")) else if (string.Equals(videoCodec, "h263", StringComparison.OrdinalIgnoreCase) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.MPEG4_H263_MP4_P0_L10_AAC; return MediaFormatProfile.MPEG4_H263_MP4_P0_L10_AAC;
} }
@ -238,20 +238,20 @@ namespace MediaBrowser.Model.Dlna
private MediaFormatProfile? ResolveVideo3GPFormat(string videoCodec, string audioCodec) private MediaFormatProfile? ResolveVideo3GPFormat(string videoCodec, string audioCodec)
{ {
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264")) if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
{ {
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.AVC_3GPP_BL_QCIF15_AAC; return MediaFormatProfile.AVC_3GPP_BL_QCIF15_AAC;
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4")) string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
{ {
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AAC; return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AAC;
if (StringHelper.EqualsIgnoreCase(audioCodec, "amrnb")) if (string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AMR; return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AMR;
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "amrnb")) else if (string.Equals(videoCodec, "h263", StringComparison.OrdinalIgnoreCase) && string.Equals(audioCodec, "amrnb", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.MPEG4_H263_3GPP_P0_L10_AMR; return MediaFormatProfile.MPEG4_H263_3GPP_P0_L10_AMR;
} }
@ -261,15 +261,15 @@ namespace MediaBrowser.Model.Dlna
private MediaFormatProfile? ResolveVideoASFFormat(string videoCodec, string audioCodec, int? width, int? height) private MediaFormatProfile? ResolveVideoASFFormat(string videoCodec, string audioCodec, int? width, int? height)
{ {
if (StringHelper.EqualsIgnoreCase(videoCodec, "wmv") && if (string.Equals(videoCodec, "wmv", StringComparison.OrdinalIgnoreCase) &&
(string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma") || StringHelper.EqualsIgnoreCase(videoCodec, "wmapro"))) (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "wmapro", StringComparison.OrdinalIgnoreCase)))
{ {
if (width.HasValue && height.HasValue) if (width.HasValue && height.HasValue)
{ {
if ((width.Value <= 720) && (height.Value <= 576)) if ((width.Value <= 720) && (height.Value <= 576))
{ {
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.WMVMED_FULL; return MediaFormatProfile.WMVMED_FULL;
} }
@ -277,14 +277,14 @@ namespace MediaBrowser.Model.Dlna
} }
} }
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma")) if (string.IsNullOrEmpty(audioCodec) || string.Equals(audioCodec, "wma", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.WMVHIGH_FULL; return MediaFormatProfile.WMVHIGH_FULL;
} }
return MediaFormatProfile.WMVHIGH_PRO; return MediaFormatProfile.WMVHIGH_PRO;
} }
if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1")) if (string.Equals(videoCodec, "vc1", StringComparison.OrdinalIgnoreCase))
{ {
if (width.HasValue && height.HasValue) if (width.HasValue && height.HasValue)
{ {
@ -296,7 +296,7 @@ namespace MediaBrowser.Model.Dlna
return MediaFormatProfile.VC1_ASF_AP_L3_WMA; return MediaFormatProfile.VC1_ASF_AP_L3_WMA;
} }
} }
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video")) else if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
{ {
return MediaFormatProfile.DVR_MS; return MediaFormatProfile.DVR_MS;
} }
@ -306,27 +306,27 @@ namespace MediaBrowser.Model.Dlna
public MediaFormatProfile? ResolveAudioFormat(string container, int? bitrate, int? frequency, int? channels) public MediaFormatProfile? ResolveAudioFormat(string container, int? bitrate, int? frequency, int? channels)
{ {
if (StringHelper.EqualsIgnoreCase(container, "asf")) if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
return ResolveAudioASFFormat(bitrate); return ResolveAudioASFFormat(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "mp3")) if (string.Equals(container, "mp3", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.MP3; return MediaFormatProfile.MP3;
if (StringHelper.EqualsIgnoreCase(container, "lpcm")) if (string.Equals(container, "lpcm", StringComparison.OrdinalIgnoreCase))
return ResolveAudioLPCMFormat(frequency, channels); return ResolveAudioLPCMFormat(frequency, channels);
if (StringHelper.EqualsIgnoreCase(container, "mp4") || if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "aac")) string.Equals(container, "aac", StringComparison.OrdinalIgnoreCase))
return ResolveAudioMP4Format(bitrate); return ResolveAudioMP4Format(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "adts")) if (string.Equals(container, "adts", StringComparison.OrdinalIgnoreCase))
return ResolveAudioADTSFormat(bitrate); return ResolveAudioADTSFormat(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "flac")) if (string.Equals(container, "flac", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.FLAC; return MediaFormatProfile.FLAC;
if (StringHelper.EqualsIgnoreCase(container, "oga") || if (string.Equals(container, "oga", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "ogg")) string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.OGG; return MediaFormatProfile.OGG;
return null; return null;
@ -388,17 +388,17 @@ namespace MediaBrowser.Model.Dlna
public MediaFormatProfile? ResolveImageFormat(string container, int? width, int? height) public MediaFormatProfile? ResolveImageFormat(string container, int? width, int? height)
{ {
if (StringHelper.EqualsIgnoreCase(container, "jpeg") || if (string.Equals(container, "jpeg", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(container, "jpg")) string.Equals(container, "jpg", StringComparison.OrdinalIgnoreCase))
return ResolveImageJPGFormat(width, height); return ResolveImageJPGFormat(width, height);
if (StringHelper.EqualsIgnoreCase(container, "png")) if (string.Equals(container, "png", StringComparison.OrdinalIgnoreCase))
return ResolveImagePNGFormat(width, height); return ResolveImagePNGFormat(width, height);
if (StringHelper.EqualsIgnoreCase(container, "gif")) if (string.Equals(container, "gif", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.GIF_LRG; return MediaFormatProfile.GIF_LRG;
if (StringHelper.EqualsIgnoreCase(container, "raw")) if (string.Equals(container, "raw", StringComparison.OrdinalIgnoreCase))
return MediaFormatProfile.RAW; return MediaFormatProfile.RAW;
return null; return null;

View File

@ -76,9 +76,9 @@ namespace MediaBrowser.Model.Dlna
private static double GetVideoBitrateScaleFactor(string codec) private static double GetVideoBitrateScaleFactor(string codec)
{ {
if (StringHelper.EqualsIgnoreCase(codec, "h265") || if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(codec, "hevc") || string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase) ||
StringHelper.EqualsIgnoreCase(codec, "vp9")) string.Equals(codec, "vp9", StringComparison.OrdinalIgnoreCase))
{ {
return .5; return .5;
} }

View File

@ -48,22 +48,22 @@ namespace MediaBrowser.Model.Dlna
if (subFactors.Length == 3) if (subFactors.Length == 3)
{ {
if (StringHelper.EqualsIgnoreCase("upnp:class", subFactors[0]) && if (string.Equals("upnp:class", subFactors[0], StringComparison.OrdinalIgnoreCase) &&
(StringHelper.EqualsIgnoreCase("=", subFactors[1]) || StringHelper.EqualsIgnoreCase("derivedfrom", subFactors[1]))) (string.Equals("=", subFactors[1]) || string.Equals("derivedfrom", subFactors[1], StringComparison.OrdinalIgnoreCase)))
{ {
if (StringHelper.EqualsIgnoreCase("\"object.item.imageItem\"", subFactors[2]) || StringHelper.EqualsIgnoreCase("\"object.item.imageItem.photo\"", subFactors[2])) if (string.Equals("\"object.item.imageItem\"", subFactors[2]) || string.Equals("\"object.item.imageItem.photo\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
{ {
SearchType = SearchType.Image; SearchType = SearchType.Image;
} }
else if (StringHelper.EqualsIgnoreCase("\"object.item.videoItem\"", subFactors[2])) else if (string.Equals("\"object.item.videoItem\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
{ {
SearchType = SearchType.Video; SearchType = SearchType.Video;
} }
else if (StringHelper.EqualsIgnoreCase("\"object.container.playlistContainer\"", subFactors[2])) else if (string.Equals("\"object.container.playlistContainer\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
{ {
SearchType = SearchType.Playlist; SearchType = SearchType.Playlist;
} }
else if (StringHelper.EqualsIgnoreCase("\"object.container.album.musicAlbum\"", subFactors[2])) else if (string.Equals("\"object.container.album.musicAlbum\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
{ {
SearchType = SearchType.MusicAlbum; SearchType = SearchType.MusicAlbum;
} }

View File

@ -35,7 +35,7 @@ namespace MediaBrowser.Model.Dlna
foreach (MediaSourceInfo i in options.MediaSources) foreach (MediaSourceInfo i in options.MediaSources)
{ {
if (string.IsNullOrEmpty(options.MediaSourceId) || if (string.IsNullOrEmpty(options.MediaSourceId) ||
StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId)) string.Equals(i.Id, options.MediaSourceId, StringComparison.OrdinalIgnoreCase))
{ {
mediaSources.Add(i); mediaSources.Add(i);
} }
@ -68,7 +68,7 @@ namespace MediaBrowser.Model.Dlna
foreach (MediaSourceInfo i in options.MediaSources) foreach (MediaSourceInfo i in options.MediaSources)
{ {
if (string.IsNullOrEmpty(options.MediaSourceId) || if (string.IsNullOrEmpty(options.MediaSourceId) ||
StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId)) string.Equals(i.Id, options.MediaSourceId, StringComparison.OrdinalIgnoreCase))
{ {
mediaSources.Add(i); mediaSources.Add(i);
} }
@ -582,7 +582,7 @@ namespace MediaBrowser.Model.Dlna
{ {
foreach (var profile in subtitleProfiles) foreach (var profile in subtitleProfiles)
{ {
if (profile.Method == SubtitleDeliveryMethod.External && StringHelper.EqualsIgnoreCase(profile.Format, stream.Codec)) if (profile.Method == SubtitleDeliveryMethod.External && string.Equals(profile.Format, stream.Codec, StringComparison.OrdinalIgnoreCase))
{ {
return stream.Index; return stream.Index;
} }
@ -1198,7 +1198,7 @@ namespace MediaBrowser.Model.Dlna
continue; continue;
} }
if (subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format) && StringHelper.EqualsIgnoreCase(profile.Format, subtitleStream.Codec)) if (subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format) && string.Equals(profile.Format, subtitleStream.Codec, StringComparison.OrdinalIgnoreCase))
{ {
return profile; return profile;
} }
@ -1292,7 +1292,7 @@ namespace MediaBrowser.Model.Dlna
if ((profile.Method == SubtitleDeliveryMethod.External && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format)) || if ((profile.Method == SubtitleDeliveryMethod.External && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format)) ||
(profile.Method == SubtitleDeliveryMethod.Hls && subtitleStream.IsTextSubtitleStream)) (profile.Method == SubtitleDeliveryMethod.Hls && subtitleStream.IsTextSubtitleStream))
{ {
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format); bool requiresConversion = !string.Equals(subtitleStream.Codec, profile.Format, StringComparison.OrdinalIgnoreCase);
if (!requiresConversion) if (!requiresConversion)
{ {

View File

@ -153,18 +153,18 @@ namespace MediaBrowser.Model.Dlna
} }
// Try to keep the url clean by omitting defaults // Try to keep the url clean by omitting defaults
if (StringHelper.EqualsIgnoreCase(pair.Name, "StartTimeTicks") && if (string.Equals(pair.Name, "StartTimeTicks", StringComparison.OrdinalIgnoreCase) &&
StringHelper.EqualsIgnoreCase(pair.Value, "0")) string.Equals(pair.Value, "0", StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
if (StringHelper.EqualsIgnoreCase(pair.Name, "SubtitleStreamIndex") && if (string.Equals(pair.Name, "SubtitleStreamIndex", StringComparison.OrdinalIgnoreCase) &&
StringHelper.EqualsIgnoreCase(pair.Value, "-1")) string.Equals(pair.Value, "-1", StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
if (StringHelper.EqualsIgnoreCase(pair.Name, "Static") && if (string.Equals(pair.Name, "Static", StringComparison.OrdinalIgnoreCase) &&
StringHelper.EqualsIgnoreCase(pair.Value, "false")) string.Equals(pair.Value, "false", StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
@ -192,7 +192,7 @@ namespace MediaBrowser.Model.Dlna
if (MediaType == DlnaProfileType.Audio) if (MediaType == DlnaProfileType.Audio)
{ {
if (StringHelper.EqualsIgnoreCase(SubProtocol, "hls")) if (string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase))
{ {
return string.Format("{0}/audio/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString); return string.Format("{0}/audio/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
} }
@ -200,7 +200,7 @@ namespace MediaBrowser.Model.Dlna
return string.Format("{0}/audio/{1}/stream{2}?{3}", baseUrl, ItemId, extension, queryString); return string.Format("{0}/audio/{1}/stream{2}?{3}", baseUrl, ItemId, extension, queryString);
} }
if (StringHelper.EqualsIgnoreCase(SubProtocol, "hls")) if (string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase))
{ {
return string.Format("{0}/videos/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString); return string.Format("{0}/videos/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
} }
@ -237,7 +237,7 @@ namespace MediaBrowser.Model.Dlna
long startPositionTicks = item.StartPositionTicks; long startPositionTicks = item.StartPositionTicks;
var isHls = StringHelper.EqualsIgnoreCase(item.SubProtocol, "hls"); var isHls = string.Equals(item.SubProtocol, "hls", StringComparison.OrdinalIgnoreCase);
if (isHls) if (isHls)
{ {
@ -370,7 +370,7 @@ namespace MediaBrowser.Model.Dlna
var list = new List<SubtitleStreamInfo>(); var list = new List<SubtitleStreamInfo>();
// HLS will preserve timestamps so we can just grab the full subtitle stream // HLS will preserve timestamps so we can just grab the full subtitle stream
long startPositionTicks = StringHelper.EqualsIgnoreCase(SubProtocol, "hls") long startPositionTicks = string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase)
? 0 ? 0
: (PlayMethod == PlayMethod.Transcode && !CopyTimestamps ? StartPositionTicks : 0); : (PlayMethod == PlayMethod.Transcode && !CopyTimestamps ? StartPositionTicks : 0);
@ -435,7 +435,7 @@ namespace MediaBrowser.Model.Dlna
if (info.DeliveryMethod == SubtitleDeliveryMethod.External) if (info.DeliveryMethod == SubtitleDeliveryMethod.External)
{ {
if (MediaSource.Protocol == MediaProtocol.File || !StringHelper.EqualsIgnoreCase(stream.Codec, subtitleProfile.Format) || !stream.IsExternal) if (MediaSource.Protocol == MediaProtocol.File || !string.Equals(stream.Codec, subtitleProfile.Format, StringComparison.OrdinalIgnoreCase) || !stream.IsExternal)
{ {
info.Url = string.Format("{0}/Videos/{1}/{2}/Subtitles/{3}/{4}/Stream.{5}", info.Url = string.Format("{0}/Videos/{1}/{2}/Subtitles/{3}/{4}/Stream.{5}",
baseUrl, baseUrl,
@ -802,7 +802,7 @@ namespace MediaBrowser.Model.Dlna
foreach (string codec in AudioCodecs) foreach (string codec in AudioCodecs)
{ {
if (StringHelper.EqualsIgnoreCase(codec, inputCodec)) if (string.Equals(codec, inputCodec, StringComparison.OrdinalIgnoreCase))
{ {
return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec }; return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec };
} }
@ -827,7 +827,7 @@ namespace MediaBrowser.Model.Dlna
foreach (string codec in VideoCodecs) foreach (string codec in VideoCodecs)
{ {
if (StringHelper.EqualsIgnoreCase(codec, inputCodec)) if (string.Equals(codec, inputCodec, StringComparison.OrdinalIgnoreCase))
{ {
return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec }; return string.IsNullOrEmpty(codec) ? new string[] { } : new[] { codec };
} }
@ -884,7 +884,7 @@ namespace MediaBrowser.Model.Dlna
{ {
get get
{ {
var defaultValue = StringHelper.EqualsIgnoreCase(Container, "m2ts") var defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase)
? TransportStreamTimestamp.Valid ? TransportStreamTimestamp.Valid
: TransportStreamTimestamp.None; : TransportStreamTimestamp.None;

View File

@ -88,11 +88,11 @@ namespace MediaBrowser.Model.Entities
{ {
attributes.Add(StringHelper.FirstToUpper(Language)); attributes.Add(StringHelper.FirstToUpper(Language));
} }
if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca")) if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase))
{ {
attributes.Add(AudioCodec.GetFriendlyName(Codec)); attributes.Add(AudioCodec.GetFriendlyName(Codec));
} }
else if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc")) else if (!string.IsNullOrEmpty(Profile) && !string.Equals(Profile, "lc", StringComparison.OrdinalIgnoreCase))
{ {
attributes.Add(Profile); attributes.Add(Profile);
} }
@ -394,8 +394,8 @@ namespace MediaBrowser.Model.Entities
return codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) == -1 && return codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) == -1 &&
codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) == -1 && codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) == -1 &&
codec.IndexOf("dvbsub", StringComparison.OrdinalIgnoreCase) == -1 && codec.IndexOf("dvbsub", StringComparison.OrdinalIgnoreCase) == -1 &&
!StringHelper.EqualsIgnoreCase(codec, "sub") && !string.Equals(codec, "sub", StringComparison.OrdinalIgnoreCase) &&
!StringHelper.EqualsIgnoreCase(codec, "dvb_subtitle"); !string.Equals(codec, "dvb_subtitle", StringComparison.OrdinalIgnoreCase);
} }
public bool SupportsSubtitleConversionTo(string toCodec) public bool SupportsSubtitleConversionTo(string toCodec)
@ -408,21 +408,21 @@ namespace MediaBrowser.Model.Entities
var fromCodec = Codec; var fromCodec = Codec;
// Can't convert from this // Can't convert from this
if (StringHelper.EqualsIgnoreCase(fromCodec, "ass")) if (string.Equals(fromCodec, "ass", StringComparison.OrdinalIgnoreCase))
{ {
return false; return false;
} }
if (StringHelper.EqualsIgnoreCase(fromCodec, "ssa")) if (string.Equals(fromCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{ {
return false; return false;
} }
// Can't convert to this // Can't convert to this
if (StringHelper.EqualsIgnoreCase(toCodec, "ass")) if (string.Equals(toCodec, "ass", StringComparison.OrdinalIgnoreCase))
{ {
return false; return false;
} }
if (StringHelper.EqualsIgnoreCase(toCodec, "ssa")) if (string.Equals(toCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{ {
return false; return false;
} }

View File

@ -2,6 +2,7 @@ using System;
namespace MediaBrowser.Model.Extensions namespace MediaBrowser.Model.Extensions
{ {
// TODO: @bond remove
public static class ListHelper public static class ListHelper
{ {
public static bool ContainsIgnoreCase(string[] list, string value) public static bool ContainsIgnoreCase(string[] list, string value)

View File

@ -1,57 +1,38 @@
using System;
using System.Text;
namespace MediaBrowser.Model.Extensions namespace MediaBrowser.Model.Extensions
{ {
/// <summary> /// <summary>
/// Isolating these helpers allow this entire project to be easily converted to Java /// Helper methods for manipulating strings.
/// </summary> /// </summary>
public static class StringHelper public static class StringHelper
{ {
/// <summary> /// <summary>
/// Equalses the ignore case. /// Returns the string with the first character as uppercase.
/// </summary> /// </summary>
/// <param name="str1">The STR1.</param> /// <param name="str">The input string.</param>
/// <param name="str2">The STR2.</param> /// <returns>The string with the first character as uppercase.</returns>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public static string FirstToUpper(string str)
public static bool EqualsIgnoreCase(string str1, string str2)
{ {
return string.Equals(str1, str2, StringComparison.OrdinalIgnoreCase); if (string.IsNullOrEmpty(str))
{
return string.Empty;
} }
/// <summary> if (char.IsUpper(str[0]))
/// Replaces the specified STR.
/// </summary>
/// <param name="str">The STR.</param>
/// <param name="oldValue">The old value.</param>
/// <param name="newValue">The new value.</param>
/// <param name="comparison">The comparison.</param>
/// <returns>System.String.</returns>
public static string Replace(this string str, string oldValue, string newValue, StringComparison comparison)
{ {
var sb = new StringBuilder(); return str;
var previousIndex = 0;
var index = str.IndexOf(oldValue, comparison);
while (index != -1)
{
sb.Append(str.Substring(previousIndex, index - previousIndex));
sb.Append(newValue);
index += oldValue.Length;
previousIndex = index;
index = str.IndexOf(oldValue, index, comparison);
} }
sb.Append(str.Substring(previousIndex)); return string.Create(
str.Length,
return sb.ToString(); str,
} (chars, buf) =>
public static string FirstToUpper(this string str)
{ {
return string.IsNullOrEmpty(str) ? string.Empty : str.Substring(0, 1).ToUpperInvariant() + str.Substring(1); chars[0] = char.ToUpperInvariant(buf[0]);
for (int i = 1; i < chars.Length; i++)
{
chars[i] = buf[i];
}
});
} }
} }
} }

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
namespace MediaBrowser.Model.IO namespace MediaBrowser.Model.IO
{ {

View File

@ -8,16 +8,16 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.1" />
<PackageReference Include="System.Globalization" Version="4.3.0" /> <PackageReference Include="System.Globalization" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="4.6.0" /> <PackageReference Include="System.Text.Json" Version="4.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,3 @@
using System.IO;
using System.Net; using System.Net;
namespace MediaBrowser.Model.Net namespace MediaBrowser.Model.Net

View File

@ -165,20 +165,20 @@ namespace MediaBrowser.Model.Net
} }
// Type text // Type text
if (StringHelper.EqualsIgnoreCase(ext, ".html") if (string.Equals(ext, ".html", StringComparison.OrdinalIgnoreCase)
|| StringHelper.EqualsIgnoreCase(ext, ".htm")) || string.Equals(ext, ".htm", StringComparison.OrdinalIgnoreCase))
{ {
return "text/html; charset=UTF-8"; return "text/html; charset=UTF-8";
} }
if (StringHelper.EqualsIgnoreCase(ext, ".log") if (string.Equals(ext, ".log", StringComparison.OrdinalIgnoreCase)
|| StringHelper.EqualsIgnoreCase(ext, ".srt")) || string.Equals(ext, ".srt", StringComparison.OrdinalIgnoreCase))
{ {
return "text/plain"; return "text/plain";
} }
// Misc // Misc
if (StringHelper.EqualsIgnoreCase(ext, ".dll")) if (string.Equals(ext, ".dll", StringComparison.OrdinalIgnoreCase))
{ {
return "application/octet-stream"; return "application/octet-stream";
} }

View File

@ -79,7 +79,7 @@ namespace MediaBrowser.Model.Notifications
{ {
foreach (NotificationOption i in Options) foreach (NotificationOption i in Options)
{ {
if (StringHelper.EqualsIgnoreCase(type, i.Type)) return i; if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase)) return i;
} }
return null; return null;
} }

View File

@ -39,9 +39,9 @@ namespace MediaBrowser.Model.Tasks
Task Execute(CancellationToken cancellationToken, IProgress<double> progress); Task Execute(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary> /// <summary>
/// Gets the default triggers. /// Gets the default triggers that define when the task will run.
/// </summary> /// </summary>
/// <returns>IEnumerable{BaseTaskTrigger}.</returns> /// <returns>The default triggers that define when the task will run.</returns>
IEnumerable<TaskTriggerInfo> GetDefaultTriggers(); IEnumerable<TaskTriggerInfo> GetDefaultTriggers();
} }
} }

View File

@ -5,7 +5,6 @@ using System.Linq;
using System.Net; using System.Net;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;

View File

@ -11,11 +11,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.1" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.0.1" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.1" />
<PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" /> <PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" />
<PackageReference Include="PlaylistsNET" Version="1.0.4" /> <PackageReference Include="PlaylistsNET" Version="1.0.4" />
<PackageReference Include="TvDbSharper" Version="2.0.0" /> <PackageReference Include="TvDbSharper" Version="3.0.1" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -5,7 +5,6 @@ using System.Linq;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;

View File

@ -3,7 +3,6 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;

View File

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

Some files were not shown because too many files have changed in this diff Show More