Merge branch 'dev' into cleanup
@ -3,3 +3,6 @@
|
||||
Dockerfile
|
||||
CONTRIBUTORS.md
|
||||
README.md
|
||||
deployment/*/dist
|
||||
deployment/*/pkg-dist
|
||||
deployment/collect-dist/
|
||||
|
@ -9,4 +9,4 @@ steps:
|
||||
- name: build
|
||||
image: microsoft/dotnet:2-sdk
|
||||
commands:
|
||||
- dotnet publish --configuration release --output /release
|
||||
- dotnet publish --configuration release --output /release Jellyfin.Server
|
||||
|
133
.editorconfig
Normal file
@ -0,0 +1,133 @@
|
||||
# With more recent updates Visual Studio 2017 supports EditorConfig files out of the box
|
||||
# Visual Studio Code needs an extension: https://github.com/editorconfig/editorconfig-vscode
|
||||
# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig
|
||||
###############################
|
||||
# Core EditorConfig Options #
|
||||
###############################
|
||||
root = true
|
||||
# All files
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
|
||||
# Code files
|
||||
[*.{cs,csx,vb,vbx}]
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
###############################
|
||||
# .NET Coding Conventions #
|
||||
###############################
|
||||
[*.{cs,vb}]
|
||||
# Organize usings
|
||||
dotnet_sort_system_directives_first = true
|
||||
# this. preferences
|
||||
dotnet_style_qualification_for_field = false:silent
|
||||
dotnet_style_qualification_for_property = false:silent
|
||||
dotnet_style_qualification_for_method = false:silent
|
||||
dotnet_style_qualification_for_event = false:silent
|
||||
# Language keywords vs BCL types preferences
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
|
||||
dotnet_style_predefined_type_for_member_access = true:silent
|
||||
# Parentheses preferences
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
||||
# Modifier preferences
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
# Expression-level preferences
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
|
||||
dotnet_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:silent
|
||||
###############################
|
||||
# Naming Conventions #
|
||||
###############################
|
||||
# Style Definitions
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
# Use PascalCase for constant fields
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
||||
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
|
||||
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||
###############################
|
||||
# C# Coding Conventions #
|
||||
###############################
|
||||
[*.cs]
|
||||
# var preferences
|
||||
csharp_style_var_for_built_in_types = true:silent
|
||||
csharp_style_var_when_type_is_apparent = true:silent
|
||||
csharp_style_var_elsewhere = true:silent
|
||||
# Expression-bodied members
|
||||
csharp_style_expression_bodied_methods = false:silent
|
||||
csharp_style_expression_bodied_constructors = false:silent
|
||||
csharp_style_expression_bodied_operators = false:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
# Pattern matching preferences
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
# Null-checking preferences
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
# Modifier preferences
|
||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
||||
# Expression-level preferences
|
||||
csharp_prefer_braces = true:silent
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
###############################
|
||||
# C# Formatting Rules #
|
||||
###############################
|
||||
# New line preferences
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
# Indentation preferences
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = flush_left
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
# Wrapping preferences
|
||||
csharp_preserve_single_line_statements = true
|
||||
csharp_preserve_single_line_blocks = true
|
||||
###############################
|
||||
# VB Coding Conventions #
|
||||
###############################
|
||||
[*.vb]
|
||||
# Modifier preferences
|
||||
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
|
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a bug report
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs**
|
||||
Please paste any log errors.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**System (please complete the following information):**
|
||||
- OS: [e.g. Docker, Debian, Windows]
|
||||
- Browser: [e.g. Firefox, Chrome, Safari]
|
||||
- Jellyfin Version: [e.g. 10.0.1]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/enhancement-request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Enhancement request
|
||||
about: Suggest an modification to an existing feature
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature
|
||||
title: ''
|
||||
labels: feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the feature you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
9
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y).
|
||||
For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our https://jellyfin.readthedocs.io/en/latest/developer-docs/contributing/ page.
|
||||
|
||||
**Changes**
|
||||
Describe your changes here in 1-5 sentences.
|
||||
|
||||
**Issues**
|
||||
Tag any issues that this PR solves here.
|
||||
Fixes #
|
34
.gitignore
vendored
@ -1,5 +1,3 @@
|
||||
!*
|
||||
|
||||
.directory
|
||||
|
||||
#################
|
||||
@ -49,6 +47,8 @@ ProgramData-UI*/
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
.vs/
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
@ -204,7 +204,6 @@ $RECYCLE.BIN/
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
|
||||
|
||||
#############
|
||||
## Python
|
||||
#############
|
||||
@ -234,22 +233,33 @@ pip-log.txt
|
||||
|
||||
#Mr Developer
|
||||
.mr.developer.cfg
|
||||
MediaBrowser.WebDashboard/dashboard-ui/.idea/
|
||||
/.vs
|
||||
|
||||
##########
|
||||
# Rider
|
||||
##########
|
||||
.idea/
|
||||
|
||||
##########
|
||||
# Visual Studio Code
|
||||
##########
|
||||
.vscode/
|
||||
|
||||
#########################
|
||||
# Debian build artifacts
|
||||
# Build artifacts
|
||||
#########################
|
||||
|
||||
debian/.debhelper/
|
||||
debian/files
|
||||
debian/jellyfin.substvars
|
||||
debian/jellyfin/
|
||||
|
||||
# Artifacts for debian-x64
|
||||
deployment/debian-package-x64/pkg-src/.debhelper/
|
||||
deployment/debian-package-x64/pkg-src/*.debhelper
|
||||
deployment/debian-package-x64/pkg-src/debhelper-build-stamp
|
||||
deployment/debian-package-x64/pkg-src/files
|
||||
deployment/debian-package-x64/pkg-src/jellyfin.substvars
|
||||
deployment/debian-package-x64/pkg-src/jellyfin/
|
||||
# Don't ignore the debian/bin folder
|
||||
!debian/bin/
|
||||
!deployment/debian-package-x64/pkg-src/bin/
|
||||
|
||||
deployment/**/dist/
|
||||
deployment/**/pkg-dist/
|
||||
deployment/**/pkg-dist-tmp/
|
||||
deployment/collect-dist/
|
||||
|
||||
|
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "ThirdParty/taglib-sharp"]
|
||||
path = ThirdParty/taglib-sharp
|
||||
url = https://github.com/mono/taglib-sharp.git
|
||||
[submodule "MediaBrowser.WebDashboard/jellyfin-web"]
|
||||
path = MediaBrowser.WebDashboard/jellyfin-web
|
||||
url = https://github.com/jellyfin/jellyfin-web.git
|
||||
|
@ -1,5 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -77,7 +77,7 @@ namespace BDInfo
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
_fileSystem = fileSystem;
|
||||
@ -235,7 +235,7 @@ namespace BDInfo
|
||||
break;
|
||||
}
|
||||
}
|
||||
else throw ex;
|
||||
else throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -273,7 +273,7 @@ namespace BDInfo
|
||||
break;
|
||||
}
|
||||
}
|
||||
else throw ex;
|
||||
else throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ namespace BDInfo
|
||||
break;
|
||||
}
|
||||
}
|
||||
else throw ex;
|
||||
else throw;
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ namespace BDInfo
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -9,21 +8,14 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("BDInfo")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BDInfo")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016 CinemaSquid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1")]
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
@ -10,7 +10,9 @@
|
||||
- [Bond_009](https://github.com/Bond-009)
|
||||
- [AnthonyLavado](https://github.com/anthonylavado)
|
||||
- [sparky8251](https://github.com/sparky8251)
|
||||
- [LeoVerto](https://github.com/LeoVerto]
|
||||
- [LeoVerto](https://github.com/LeoVerto)
|
||||
- [grafixeyehero](https://github.com/grafixeyehero)
|
||||
- [cvium](https://github.com/cvium)
|
||||
|
||||
# Emby Contributors
|
||||
|
||||
|
31
Dockerfile
@ -1,24 +1,31 @@
|
||||
ARG DOTNET_VERSION=2
|
||||
|
||||
|
||||
# Download ffmpeg first to allow quicker rebuild of other layers
|
||||
FROM alpine as ffmpeg
|
||||
ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64bit-static.tar.xz
|
||||
RUN wget ${FFMPEG_URL} -O - | tar Jxf - \
|
||||
&& mkdir ffmpeg-bin \
|
||||
&& mv ffmpeg*/ffmpeg ffmpeg-bin \
|
||||
&& mv ffmpeg*/ffprobe ffmpeg-bin
|
||||
|
||||
|
||||
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder
|
||||
WORKDIR /repo
|
||||
COPY . .
|
||||
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
||||
&& dotnet clean \
|
||||
&& dotnet publish --configuration release --output /jellyfin
|
||||
&& dotnet publish \
|
||||
--configuration release \
|
||||
--output /jellyfin \
|
||||
Jellyfin.Server
|
||||
|
||||
|
||||
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
|
||||
COPY --from=builder /jellyfin /jellyfin
|
||||
COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/
|
||||
EXPOSE 8096
|
||||
|
||||
VOLUME /config /media
|
||||
|
||||
ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64bit-static.tar.xz
|
||||
RUN apt update \
|
||||
&& apt install -y xz-utils \
|
||||
&& curl ${FFMPEG_URL} | tar Jxf - -C /usr/bin --wildcards --strip-components=1 ffmpeg*/ffmpeg ffmpeg*/ffprobe \
|
||||
&& apt remove -y xz-utils
|
||||
|
||||
ENTRYPOINT if [ -n "$PUID$PGUID" ]; \
|
||||
then echo "PUID/PGID are deprecated. Use Docker user param." >&2; exit 1; \
|
||||
else dotnet /jellyfin/jellyfin.dll -programdata /config; fi
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y libfontconfig1 --no-install-recommends # needed for Skia
|
||||
ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config
|
||||
|
@ -3,15 +3,19 @@ ARG DOTNET_VERSION=3.0
|
||||
FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder
|
||||
WORKDIR /repo
|
||||
COPY . .
|
||||
#TODO Remove or update the sed line when we update dotnet version.
|
||||
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
||||
&& find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \
|
||||
&& dotnet clean \
|
||||
&& dotnet publish --configuration release --output /jellyfin
|
||||
&& dotnet publish \
|
||||
--configuration release \
|
||||
--output /jellyfin \
|
||||
Jellyfin.Server
|
||||
|
||||
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
|
||||
COPY --from=builder /jellyfin /jellyfin
|
||||
EXPOSE 8096
|
||||
RUN apt update \
|
||||
&& apt install -y ffmpeg
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ffmpeg
|
||||
VOLUME /config /media
|
||||
ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config
|
@ -1,5 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -81,7 +81,7 @@ namespace DvdLib.Ifo
|
||||
|
||||
private void ReadVTS(ushort vtsNum, List<FileSystemMetadata> allFiles)
|
||||
{
|
||||
var filename = String.Format("VTS_{0:00}_0.IFO", vtsNum);
|
||||
var filename = string.Format("VTS_{0:00}_0.IFO", vtsNum);
|
||||
|
||||
var vtsPath = allFiles.FirstOrDefault(i => string.Equals(i.Name, filename, StringComparison.OrdinalIgnoreCase)) ??
|
||||
allFiles.FirstOrDefault(i => string.Equals(i.Name, Path.ChangeExtension(filename, ".bup"), StringComparison.OrdinalIgnoreCase));
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -20,7 +20,7 @@ namespace DvdLib.Ifo
|
||||
else if ((data[3] & 0x40) != 0) FrameRate = 25;
|
||||
}
|
||||
|
||||
private byte GetBCDValue(byte data)
|
||||
private static byte GetBCDValue(byte data)
|
||||
{
|
||||
return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F));
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -9,21 +8,14 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("DvdLib")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DvdLib")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1")]
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Service;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -11,7 +11,7 @@ namespace Emby.Dlna.ConnectionManager
|
||||
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
|
||||
}
|
||||
|
||||
private IEnumerable<StateVariable> GetStateVariables()
|
||||
private static IEnumerable<StateVariable> GetStateVariables()
|
||||
{
|
||||
var list = new List<StateVariable>();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Emby.Dlna.ConnectionManager
|
||||
@ -19,7 +19,7 @@ namespace Emby.Dlna.ConnectionManager
|
||||
return list;
|
||||
}
|
||||
|
||||
private ServiceAction PrepareForConnection()
|
||||
private static ServiceAction PrepareForConnection()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -78,7 +78,7 @@ namespace Emby.Dlna.ConnectionManager
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetCurrentConnectionInfo()
|
||||
private static ServiceAction GetCurrentConnectionInfo()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Service;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -12,7 +12,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
GetStateVariables());
|
||||
}
|
||||
|
||||
private IEnumerable<StateVariable> GetStateVariables()
|
||||
private static IEnumerable<StateVariable> GetStateVariables()
|
||||
{
|
||||
var list = new List<StateVariable>();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Emby.Dlna.ContentDirectory
|
||||
@ -20,7 +20,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
};
|
||||
}
|
||||
|
||||
private ServiceAction GetGetSystemUpdateIDAction()
|
||||
private static ServiceAction GetGetSystemUpdateIDAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetSearchCapabilitiesAction()
|
||||
private static ServiceAction GetSearchCapabilitiesAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -54,7 +54,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetSortCapabilitiesAction()
|
||||
private static ServiceAction GetSortCapabilitiesAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -71,7 +71,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetX_GetFeatureListAction()
|
||||
private static ServiceAction GetX_GetFeatureListAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -88,7 +88,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetSearchAction()
|
||||
private static ServiceAction GetSearchAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
|
@ -375,7 +375,7 @@ namespace Emby.Dlna.Didl
|
||||
? GetMimeType(filename)
|
||||
: mediaProfile.MimeType;
|
||||
|
||||
writer.WriteAttributeString("protocolInfo", String.Format(
|
||||
writer.WriteAttributeString("protocolInfo", string.Format(
|
||||
"http-get:*:{0}:{1}",
|
||||
mimeType,
|
||||
contentFeatures
|
||||
@ -573,7 +573,7 @@ namespace Emby.Dlna.Didl
|
||||
streamInfo.RunTimeTicks ?? 0,
|
||||
streamInfo.TranscodeSeekInfo);
|
||||
|
||||
writer.WriteAttributeString("protocolInfo", String.Format(
|
||||
writer.WriteAttributeString("protocolInfo", string.Format(
|
||||
"http-get:*:{0}:{1}",
|
||||
mimeType,
|
||||
contentFeatures
|
||||
@ -1017,7 +1017,7 @@ namespace Emby.Dlna.Didl
|
||||
var contentFeatures = new ContentFeatureBuilder(_profile)
|
||||
.BuildImageHeader(format, width, height, imageInfo.IsDirectStream, org_Pn);
|
||||
|
||||
writer.WriteAttributeString("protocolInfo", String.Format(
|
||||
writer.WriteAttributeString("protocolInfo", string.Format(
|
||||
"http-get:*:{0}:{1}",
|
||||
GetMimeType("file." + format),
|
||||
contentFeatures
|
||||
|
@ -95,7 +95,7 @@ namespace Emby.Dlna
|
||||
{
|
||||
if (deviceInfo == null)
|
||||
{
|
||||
throw new ArgumentNullException("deviceInfo");
|
||||
throw new ArgumentNullException(nameof(deviceInfo));
|
||||
}
|
||||
|
||||
var profile = GetProfiles()
|
||||
@ -207,7 +207,7 @@ namespace Emby.Dlna
|
||||
{
|
||||
if (headers == null)
|
||||
{
|
||||
throw new ArgumentNullException("headers");
|
||||
throw new ArgumentNullException(nameof(headers));
|
||||
}
|
||||
|
||||
// Convert to case insensitive
|
||||
@ -335,7 +335,7 @@ namespace Emby.Dlna
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
var info = GetProfileInfosInternal().First(i => string.Equals(i.Info.Id, id, StringComparison.OrdinalIgnoreCase));
|
||||
|
@ -1,5 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 2.5 KiB |
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Emby.Dlna.Server;
|
||||
using Emby.Dlna.Service;
|
||||
@ -21,7 +21,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
|
||||
}
|
||||
|
||||
private IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized()
|
||||
private static IEnumerable<KeyValuePair<string, string>> HandleIsAuthorized()
|
||||
{
|
||||
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
@ -29,7 +29,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
};
|
||||
}
|
||||
|
||||
private IEnumerable<KeyValuePair<string, string>> HandleIsValidated()
|
||||
private static IEnumerable<KeyValuePair<string, string>> HandleIsValidated()
|
||||
{
|
||||
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Service;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -12,7 +12,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
GetStateVariables());
|
||||
}
|
||||
|
||||
private IEnumerable<StateVariable> GetStateVariables()
|
||||
private static IEnumerable<StateVariable> GetStateVariables()
|
||||
{
|
||||
var list = new List<StateVariable>();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
@ -19,7 +19,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
};
|
||||
}
|
||||
|
||||
private ServiceAction GetIsValidated()
|
||||
private static ServiceAction GetIsValidated()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -41,7 +41,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetIsAuthorized()
|
||||
private static ServiceAction GetIsAuthorized()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -63,7 +63,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetRegisterDevice()
|
||||
private static ServiceAction GetRegisterDevice()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
@ -85,7 +85,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
|
||||
return action;
|
||||
}
|
||||
|
||||
private ServiceAction GetGetValidationSucceededUpdateID()
|
||||
private static ServiceAction GetGetValidationSucceededUpdateID()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
{
|
||||
|
@ -311,7 +311,7 @@ namespace Emby.Dlna.PlayTo
|
||||
throw new InvalidOperationException("Unable to find service");
|
||||
}
|
||||
|
||||
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, String.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
|
||||
await new SsdpHttpClient(_httpClient, _config).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, string.Format("{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
|
||||
.ConfigureAwait(false);
|
||||
|
||||
RestartTimer(true);
|
||||
@ -364,7 +364,7 @@ namespace Emby.Dlna.PlayTo
|
||||
private string CreateDidlMeta(string value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return String.Empty;
|
||||
return string.Empty;
|
||||
|
||||
return DescriptionXmlBuilder.Escape(value);
|
||||
}
|
||||
@ -783,7 +783,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (container == null)
|
||||
{
|
||||
throw new ArgumentNullException("container");
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
var url = container.GetValue(uPnpNamespaces.Res);
|
||||
@ -810,7 +810,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (container == null)
|
||||
{
|
||||
throw new ArgumentNullException("container");
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
var resElement = container.Element(uPnpNamespaces.Res);
|
||||
@ -979,7 +979,7 @@ namespace Emby.Dlna.PlayTo
|
||||
if (modelDescription != null)
|
||||
deviceProperties.ModelDescription = modelDescription.Value;
|
||||
|
||||
deviceProperties.BaseUrl = String.Format("http://{0}:{1}", url.Host, url.Port);
|
||||
deviceProperties.BaseUrl = string.Format("http://{0}:{1}", url.Host, url.Port);
|
||||
|
||||
var icon = document.Descendants(uPnpNamespaces.ud.GetName("icon")).FirstOrDefault();
|
||||
|
||||
@ -1021,7 +1021,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
throw new ArgumentNullException("element");
|
||||
throw new ArgumentNullException(nameof(element));
|
||||
}
|
||||
|
||||
var mimeType = element.GetDescendantValue(uPnpNamespaces.ud.GetName("mimetype"));
|
||||
@ -1173,7 +1173,7 @@ namespace Emby.Dlna.PlayTo
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);
|
||||
return string.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,10 +114,10 @@ namespace Emby.Dlna.PlayTo
|
||||
info.Headers.TryGetValue("NTS", out nts);
|
||||
|
||||
string usn;
|
||||
if (!info.Headers.TryGetValue("USN", out usn)) usn = String.Empty;
|
||||
if (!info.Headers.TryGetValue("USN", out usn)) usn = string.Empty;
|
||||
|
||||
string nt;
|
||||
if (!info.Headers.TryGetValue("NT", out nt)) nt = String.Empty;
|
||||
if (!info.Headers.TryGetValue("NT", out nt)) nt = string.Empty;
|
||||
|
||||
if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 &&
|
||||
!_disposed)
|
||||
@ -829,7 +829,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
throw new ArgumentNullException("url");
|
||||
throw new ArgumentNullException(nameof(url));
|
||||
}
|
||||
|
||||
var parts = url.Split('/');
|
||||
@ -855,7 +855,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
throw new ArgumentNullException("url");
|
||||
throw new ArgumentNullException(nameof(url));
|
||||
}
|
||||
|
||||
var request = new StreamParams
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
@ -49,7 +49,7 @@ namespace Emby.Dlna.PlayTo
|
||||
return playlistItem;
|
||||
}
|
||||
|
||||
private bool IsSupported(DirectPlayProfile profile, Photo item)
|
||||
private static bool IsSupported(DirectPlayProfile profile, Photo item)
|
||||
{
|
||||
var mediaPath = item.Path;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Emby.Dlna.Common;
|
||||
using System;
|
||||
@ -47,7 +47,7 @@ namespace Emby.Dlna.PlayTo
|
||||
}
|
||||
}
|
||||
|
||||
private string NormalizeServiceUrl(string baseUrl, string serviceUrl)
|
||||
private static string NormalizeServiceUrl(string baseUrl, string serviceUrl)
|
||||
{
|
||||
// If it's already a complete url, don't stick anything onto the front of it
|
||||
if (serviceUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -80,7 +80,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (container == null)
|
||||
{
|
||||
throw new ArgumentNullException("container");
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
return new Argument
|
||||
|
@ -10,7 +10,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (container == null)
|
||||
{
|
||||
throw new ArgumentNullException("container");
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
return new uBaseObject
|
||||
|
@ -26,7 +26,7 @@ namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
throw new ArgumentNullException("obj");
|
||||
throw new ArgumentNullException(nameof(obj));
|
||||
}
|
||||
|
||||
return string.Equals(Id, obj.Id);
|
||||
|
@ -26,7 +26,7 @@ namespace Emby.Dlna.PlayTo
|
||||
if (item == null)
|
||||
return list;
|
||||
|
||||
var uPnpResponse = XElement.Parse((String)item);
|
||||
var uPnpResponse = XElement.Parse((string)item);
|
||||
|
||||
var uObjects = from container in uPnpResponse.Elements(uPnpNamespaces.containers)
|
||||
select new uParserObject { Element = container };
|
||||
|
@ -1,17 +1,16 @@
|
||||
using System.Resources;
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Dlna2")]
|
||||
[assembly: AssemblyTitle("Emby.Dlna")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Emby.Dlna2")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
@ -26,5 +25,3 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using System;
|
||||
@ -24,12 +24,12 @@ namespace Emby.Dlna.Server
|
||||
{
|
||||
if (string.IsNullOrEmpty(serverUdn))
|
||||
{
|
||||
throw new ArgumentNullException("serverUdn");
|
||||
throw new ArgumentNullException(nameof(serverUdn));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(serverAddress))
|
||||
{
|
||||
throw new ArgumentNullException("serverAddress");
|
||||
throw new ArgumentNullException(nameof(serverAddress));
|
||||
}
|
||||
|
||||
_profile = profile;
|
||||
@ -39,10 +39,7 @@ namespace Emby.Dlna.Server
|
||||
_serverId = serverId;
|
||||
}
|
||||
|
||||
private bool EnableAbsoluteUrls
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
private static bool EnableAbsoluteUrls => false;
|
||||
|
||||
public string GetXml()
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Dlna.Common;
|
||||
using Emby.Dlna.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
@ -28,7 +28,7 @@ namespace Emby.Dlna.Service
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
private void AppendActionList(StringBuilder builder, IEnumerable<ServiceAction> actions)
|
||||
private static void AppendActionList(StringBuilder builder, IEnumerable<ServiceAction> actions)
|
||||
{
|
||||
builder.Append("<actionList>");
|
||||
|
||||
@ -59,7 +59,7 @@ namespace Emby.Dlna.Service
|
||||
builder.Append("</actionList>");
|
||||
}
|
||||
|
||||
private void AppendServiceStateTable(StringBuilder builder, IEnumerable<StateVariable> stateVariables)
|
||||
private static void AppendServiceStateTable(StringBuilder builder, IEnumerable<StateVariable> stateVariables)
|
||||
{
|
||||
builder.Append("<serviceStateTable>");
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -9,17 +8,14 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("Emby.Drawing.Skia")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Emby.Drawing.Skia")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
@ -197,7 +197,7 @@ namespace Emby.Drawing.Skia
|
||||
|
||||
private static bool HasDiacritics(string text)
|
||||
{
|
||||
return !String.Equals(text, text.RemoveDiacritics(), StringComparison.Ordinal);
|
||||
return !string.Equals(text, text.RemoveDiacritics(), StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static bool RequiresSpecialCharacterHack(string path)
|
||||
@ -509,11 +509,11 @@ namespace Emby.Drawing.Skia
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(inputPath))
|
||||
{
|
||||
throw new ArgumentNullException("inputPath");
|
||||
throw new ArgumentNullException(nameof(inputPath));
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(inputPath))
|
||||
{
|
||||
throw new ArgumentNullException("outputPath");
|
||||
throw new ArgumentNullException(nameof(outputPath));
|
||||
}
|
||||
|
||||
var skiaOutputFormat = GetImageFormat(selectedOutputFormat);
|
||||
@ -594,12 +594,12 @@ namespace Emby.Drawing.Skia
|
||||
// If foreground layer present then draw
|
||||
if (hasForegroundColor)
|
||||
{
|
||||
if (!Double.TryParse(options.ForegroundLayer, out double opacity))
|
||||
if (!double.TryParse(options.ForegroundLayer, out double opacity))
|
||||
{
|
||||
opacity = .4;
|
||||
}
|
||||
|
||||
canvas.DrawColor(new SKColor(0, 0, 0, (Byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver);
|
||||
canvas.DrawColor(new SKColor(0, 0, 0, (byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver);
|
||||
}
|
||||
|
||||
if (hasIndicator)
|
||||
|
@ -1,4 +1,4 @@
|
||||
using SkiaSharp;
|
||||
using SkiaSharp;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.IO;
|
||||
@ -20,6 +20,11 @@ namespace Emby.Drawing.Skia
|
||||
|
||||
public static SKEncodedImageFormat GetEncodedFormat(string outputPath)
|
||||
{
|
||||
if (outputPath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(outputPath));
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(outputPath).ToLower();
|
||||
|
||||
if (ext == ".jpg" || ext == ".jpeg")
|
||||
|
@ -50,12 +50,13 @@ namespace Emby.Drawing.Common
|
||||
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
|
||||
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
|
||||
{
|
||||
var extension = Path.GetExtension(path);
|
||||
|
||||
if (string.IsNullOrEmpty(extension))
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentException("ImageHeader doesn't support image file");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
|
||||
if (!SupportedExtensions.Contains(extension))
|
||||
{
|
||||
throw new ArgumentException("ImageHeader doesn't support " + extension);
|
||||
@ -94,7 +95,7 @@ namespace Emby.Drawing.Common
|
||||
}
|
||||
}
|
||||
|
||||
throw new ArgumentException(ErrorMessage, "binaryReader");
|
||||
throw new ArgumentException(ErrorMessage, nameof(binaryReader));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -121,7 +122,7 @@ namespace Emby.Drawing.Common
|
||||
/// </summary>
|
||||
/// <param name="binaryReader">The binary reader.</param>
|
||||
/// <returns>System.Int16.</returns>
|
||||
private static short ReadLittleEndianInt16(BinaryReader binaryReader)
|
||||
private static short ReadLittleEndianInt16(this BinaryReader binaryReader)
|
||||
{
|
||||
var bytes = new byte[sizeof(short)];
|
||||
|
||||
@ -137,7 +138,7 @@ namespace Emby.Drawing.Common
|
||||
/// </summary>
|
||||
/// <param name="binaryReader">The binary reader.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
private static int ReadLittleEndianInt32(BinaryReader binaryReader)
|
||||
private static int ReadLittleEndianInt32(this BinaryReader binaryReader)
|
||||
{
|
||||
var bytes = new byte[sizeof(int)];
|
||||
for (int i = 0; i < sizeof(int); i += 1)
|
||||
@ -205,25 +206,30 @@ namespace Emby.Drawing.Common
|
||||
/// <exception cref="System.ArgumentException"></exception>
|
||||
private static ImageSize DecodeJfif(BinaryReader binaryReader)
|
||||
{
|
||||
// A JPEG image consists of a sequence of segments,
|
||||
// each beginning with a marker, each of which begins with a 0xFF byte
|
||||
// followed by a byte indicating what kind of marker it is.
|
||||
// Source: https://en.wikipedia.org/wiki/JPEG#Syntax_and_structure
|
||||
while (binaryReader.ReadByte() == 0xff)
|
||||
{
|
||||
byte marker = binaryReader.ReadByte();
|
||||
short chunkLength = ReadLittleEndianInt16(binaryReader);
|
||||
if (marker == 0xc0)
|
||||
short chunkLength = binaryReader.ReadLittleEndianInt16();
|
||||
// SOF0: Indicates that this is a baseline DCT-based JPEG,
|
||||
// and specifies the width, height, number of components, and component subsampling
|
||||
// SOF2: Indicates that this is a progressive DCT-based JPEG,
|
||||
// and specifies the width, height, number of components, and component subsampling
|
||||
if (marker == 0xc0 || marker == 0xc2)
|
||||
{
|
||||
binaryReader.ReadByte();
|
||||
int height = ReadLittleEndianInt16(binaryReader);
|
||||
int width = ReadLittleEndianInt16(binaryReader);
|
||||
return new ImageSize
|
||||
{
|
||||
Width = width,
|
||||
Height = height
|
||||
};
|
||||
// https://help.accusoft.com/ImageGear/v18.2/Windows/ActiveX/IGAX-10-12.html
|
||||
binaryReader.ReadByte(); // We don't care about the first byte
|
||||
int height = binaryReader.ReadLittleEndianInt16();
|
||||
int width = binaryReader.ReadLittleEndianInt16();
|
||||
return new ImageSize(width, height);
|
||||
}
|
||||
|
||||
if (chunkLength < 0)
|
||||
{
|
||||
var uchunkLength = (ushort)chunkLength;
|
||||
ushort uchunkLength = (ushort)chunkLength;
|
||||
binaryReader.ReadBytes(uchunkLength - 2);
|
||||
}
|
||||
else
|
||||
|
@ -80,7 +80,7 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
_imageEncoder = value;
|
||||
@ -179,7 +179,7 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (options == null)
|
||||
{
|
||||
throw new ArgumentNullException("options");
|
||||
throw new ArgumentNullException(nameof(options));
|
||||
}
|
||||
|
||||
var originalImage = options.Image;
|
||||
@ -491,7 +491,7 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
try
|
||||
@ -691,12 +691,12 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (string.IsNullOrEmpty(originalImagePath))
|
||||
{
|
||||
throw new ArgumentNullException("originalImagePath");
|
||||
throw new ArgumentNullException(nameof(originalImagePath));
|
||||
}
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException("item");
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
|
||||
var treatmentRequiresTransparency = false;
|
||||
@ -779,16 +779,16 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
if (string.IsNullOrEmpty(uniqueName))
|
||||
{
|
||||
throw new ArgumentNullException("uniqueName");
|
||||
throw new ArgumentNullException(nameof(uniqueName));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(fileExtension))
|
||||
{
|
||||
throw new ArgumentNullException("fileExtension");
|
||||
throw new ArgumentNullException(nameof(fileExtension));
|
||||
}
|
||||
|
||||
var filename = uniqueName.GetMD5() + fileExtension;
|
||||
@ -811,11 +811,11 @@ namespace Emby.Drawing
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
{
|
||||
throw new ArgumentNullException("filename");
|
||||
throw new ArgumentNullException(nameof(filename));
|
||||
}
|
||||
|
||||
var prefix = filename.Substring(0, 1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -7,9 +7,9 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("Emby.Drawing")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Emby.Drawing")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
<ProjectReference Include="..\..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
|
||||
|
@ -44,13 +44,13 @@ namespace IsoMounter
|
||||
_logger.LogDebug(
|
||||
"[{0}] System PATH is currently set to [{1}].",
|
||||
Name,
|
||||
EnvironmentInfo.GetEnvironmentVariable("PATH") ?? ""
|
||||
Environment.GetEnvironmentVariable("PATH") ?? ""
|
||||
);
|
||||
|
||||
_logger.LogDebug(
|
||||
"[{0}] System path separator is [{1}].",
|
||||
Name,
|
||||
EnvironmentInfo.PathSeparator
|
||||
Path.PathSeparator
|
||||
);
|
||||
|
||||
_logger.LogDebug(
|
||||
@ -87,7 +87,7 @@ namespace IsoMounter
|
||||
UmountCommand
|
||||
);
|
||||
|
||||
if (!String.IsNullOrEmpty(SudoCommand) && !String.IsNullOrEmpty(MountCommand) && !String.IsNullOrEmpty(UmountCommand)) {
|
||||
if (!string.IsNullOrEmpty(SudoCommand) && !string.IsNullOrEmpty(MountCommand) && !string.IsNullOrEmpty(UmountCommand)) {
|
||||
ExecutablesAvailable = true;
|
||||
} else {
|
||||
ExecutablesAvailable = false;
|
||||
@ -118,25 +118,27 @@ namespace IsoMounter
|
||||
public bool CanMount(string path)
|
||||
{
|
||||
|
||||
if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux) {
|
||||
_logger.LogInformation(
|
||||
"[{0}] Checking we can attempt to mount [{1}], Extension = [{2}], Operating System = [{3}], Executables Available = [{4}].",
|
||||
Name,
|
||||
path,
|
||||
Path.GetExtension(path),
|
||||
EnvironmentInfo.OperatingSystem,
|
||||
ExecutablesAvailable.ToString()
|
||||
);
|
||||
|
||||
if (ExecutablesAvailable) {
|
||||
return string.Equals(Path.GetExtension(path), ".iso", StringComparison.OrdinalIgnoreCase);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (EnvironmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Linux)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_logger.LogInformation(
|
||||
"[{0}] Checking we can attempt to mount [{1}], Extension = [{2}], Operating System = [{3}], Executables Available = [{4}].",
|
||||
Name,
|
||||
path,
|
||||
Path.GetExtension(path),
|
||||
EnvironmentInfo.OperatingSystem,
|
||||
ExecutablesAvailable.ToString()
|
||||
);
|
||||
|
||||
if (ExecutablesAvailable)
|
||||
{
|
||||
return string.Equals(Path.GetExtension(path), ".iso", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Task Install(CancellationToken cancellationToken)
|
||||
@ -150,7 +152,7 @@ namespace IsoMounter
|
||||
return Task.FromResult<IIsoMount>(mountedISO);
|
||||
}
|
||||
else {
|
||||
throw new IOException(String.Format(
|
||||
throw new IOException(string.Format(
|
||||
"An error occurred trying to mount image [$0].",
|
||||
isoPath
|
||||
));
|
||||
@ -211,18 +213,16 @@ namespace IsoMounter
|
||||
private string GetFullPathForExecutable(string name)
|
||||
{
|
||||
|
||||
foreach (string test in (EnvironmentInfo.GetEnvironmentVariable("PATH") ?? "").Split(EnvironmentInfo.PathSeparator)) {
|
||||
|
||||
foreach (string test in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator))
|
||||
{
|
||||
string path = test.Trim();
|
||||
|
||||
if (!String.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) {
|
||||
if (!string.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) {
|
||||
return FileSystem.GetFullPath(path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private uint GetUID()
|
||||
|
21
Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("IsoMounter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
@ -30,7 +30,7 @@ namespace Emby.Naming.AudioBook
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
if (IsDirectory)
|
||||
return null;
|
||||
|
@ -5,6 +5,17 @@
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Authors>Jellyfin Contributors</Authors>
|
||||
<PackageId>Jellyfin.Naming</PackageId>
|
||||
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
|
||||
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
21
Emby.Naming/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Naming")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
@ -18,7 +18,7 @@ namespace Emby.Naming.Subtitles
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
var extension = Path.GetExtension(path);
|
||||
@ -52,7 +52,7 @@ namespace Emby.Naming.Subtitles
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
// Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _.
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Naming.Common;
|
||||
using Emby.Naming.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@ -74,7 +74,7 @@ namespace Emby.Naming.TV
|
||||
return result ?? new EpisodePathParserResult();
|
||||
}
|
||||
|
||||
private EpisodePathParserResult Parse(string name, EpisodeExpression expression)
|
||||
private static EpisodePathParserResult Parse(string name, EpisodeExpression expression)
|
||||
{
|
||||
var result = new EpisodePathParserResult();
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace Emby.Naming.TV
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
var isStub = false;
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Emby.Naming.Common;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@ -63,7 +63,7 @@ namespace Emby.Naming.Video
|
||||
result;
|
||||
}
|
||||
|
||||
private CleanDateTimeResult Clean(string name, Regex expression)
|
||||
private static CleanDateTimeResult Clean(string name, Regex expression)
|
||||
{
|
||||
var result = new CleanDateTimeResult();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Emby.Naming.Video
|
||||
@ -30,7 +30,7 @@ namespace Emby.Naming.Video
|
||||
};
|
||||
}
|
||||
|
||||
private CleanStringResult Clean(string name, Regex expression)
|
||||
private static CleanStringResult Clean(string name, Regex expression)
|
||||
{
|
||||
var result = new CleanStringResult();
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace Emby.Naming.Video
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
// Note: the tags need be be surrounded be either a space ( ), hyphen -, dot . or underscore _.
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Naming.Common;
|
||||
using Emby.Naming.Common;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
@ -36,7 +36,7 @@ namespace Emby.Naming.Video
|
||||
return new Format3DResult();
|
||||
}
|
||||
|
||||
private Format3DResult Parse(string[] videoFlags, Format3DRule rule)
|
||||
private static Format3DResult Parse(string[] videoFlags, Format3DRule rule)
|
||||
{
|
||||
var result = new Format3DResult();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Naming.Common;
|
||||
using Emby.Naming.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -236,7 +236,7 @@ namespace Emby.Naming.Video
|
||||
if (testFilename.StartsWith(folderName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
testFilename = testFilename.Substring(folderName.Length).Trim();
|
||||
return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase)||Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == String.Empty;
|
||||
return testFilename.StartsWith("-", StringComparison.OrdinalIgnoreCase) || Regex.Replace(testFilename, @"\[([^]]*)\]", "").Trim() == string.Empty;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -45,7 +45,7 @@ namespace Emby.Naming.Video
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
var isStub = false;
|
||||
|
@ -5,6 +5,10 @@
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -8,29 +8,14 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("Emby.Notifications")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Emby.Notifications")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4d1d313b-60bb-4e11-acf9-cda6745266ef")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
@ -8,27 +8,14 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTitle("Emby.Photos")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Emby.Photos")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("Jellyfin Project")]
|
||||
[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("89ab4548-770d-41fd-a891-8daff44f452c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
@ -202,7 +202,7 @@ namespace Emby.Server.Implementations.Activity
|
||||
return name;
|
||||
}
|
||||
|
||||
private string GetPlaybackNotificationType(string mediaType)
|
||||
private static string GetPlaybackNotificationType(string mediaType)
|
||||
{
|
||||
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@ -220,7 +220,7 @@ namespace Emby.Server.Implementations.Activity
|
||||
return null;
|
||||
}
|
||||
|
||||
private string GetPlaybackStoppedNotificationType(string mediaType)
|
||||
private static string GetPlaybackStoppedNotificationType(string mediaType)
|
||||
{
|
||||
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@ -577,8 +577,8 @@ namespace Emby.Server.Implementations.Activity
|
||||
/// <param name="description">The name of this item (singular form)</param>
|
||||
private static string CreateValueString(int value, string description)
|
||||
{
|
||||
return String.Format("{0:#,##0} {1}",
|
||||
value, value == 1 ? description : String.Format("{0}s", description));
|
||||
return string.Format("{0:#,##0} {1}",
|
||||
value, value == 1 ? description : string.Format("{0}s", description));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Activity
|
||||
{
|
||||
if (entry == null)
|
||||
{
|
||||
throw new ArgumentNullException("entry");
|
||||
throw new ArgumentNullException(nameof(entry));
|
||||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
@ -122,7 +122,7 @@ namespace Emby.Server.Implementations.Activity
|
||||
{
|
||||
if (entry == null)
|
||||
{
|
||||
throw new ArgumentNullException("entry");
|
||||
throw new ArgumentNullException(nameof(entry));
|
||||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
@ -251,7 +251,7 @@ namespace Emby.Server.Implementations.Activity
|
||||
}
|
||||
}
|
||||
|
||||
private ActivityLogEntry GetEntry(IReadOnlyList<IResultSetValue> reader)
|
||||
private static ActivityLogEntry GetEntry(IReadOnlyList<IResultSetValue> reader)
|
||||
{
|
||||
var index = 0;
|
||||
|
||||
|
@ -55,61 +55,31 @@ namespace Emby.Server.Implementations.AppBase
|
||||
}
|
||||
|
||||
private const string _virtualDataPath = "%AppDataPath%";
|
||||
public string VirtualDataPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return _virtualDataPath;
|
||||
}
|
||||
}
|
||||
public string VirtualDataPath => _virtualDataPath;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image cache path.
|
||||
/// </summary>
|
||||
/// <value>The image cache path.</value>
|
||||
public string ImageCachePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(CachePath, "images");
|
||||
}
|
||||
}
|
||||
public string ImageCachePath => Path.Combine(CachePath, "images");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the plugin directory
|
||||
/// </summary>
|
||||
/// <value>The plugins path.</value>
|
||||
public string PluginsPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(ProgramDataPath, "plugins");
|
||||
}
|
||||
}
|
||||
public string PluginsPath => Path.Combine(ProgramDataPath, "plugins");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the plugin configurations directory
|
||||
/// </summary>
|
||||
/// <value>The plugin configurations path.</value>
|
||||
public string PluginConfigurationsPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(PluginsPath, "configurations");
|
||||
}
|
||||
}
|
||||
public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to where temporary update files will be stored
|
||||
/// </summary>
|
||||
/// <value>The plugin configurations path.</value>
|
||||
public string TempUpdatePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(ProgramDataPath, "updates");
|
||||
}
|
||||
}
|
||||
public string TempUpdatePath => Path.Combine(ProgramDataPath, "updates");
|
||||
|
||||
/// <summary>
|
||||
/// The _log directory
|
||||
@ -133,10 +103,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
|
||||
return _logDirectoryPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
_logDirectoryPath = value;
|
||||
}
|
||||
set => _logDirectoryPath = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -161,23 +128,14 @@ namespace Emby.Server.Implementations.AppBase
|
||||
|
||||
return _configurationDirectoryPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
_configurationDirectoryPath = value;
|
||||
}
|
||||
set => _configurationDirectoryPath = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the system configuration file
|
||||
/// </summary>
|
||||
/// <value>The system configuration file path.</value>
|
||||
public string SystemConfigurationFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(ConfigurationDirectoryPath, "system.xml");
|
||||
}
|
||||
}
|
||||
public string SystemConfigurationFilePath => Path.Combine(ConfigurationDirectoryPath, "system.xml");
|
||||
|
||||
/// <summary>
|
||||
/// The _cache directory
|
||||
@ -200,22 +158,13 @@ namespace Emby.Server.Implementations.AppBase
|
||||
|
||||
return _cachePath;
|
||||
}
|
||||
set
|
||||
{
|
||||
_cachePath = value;
|
||||
}
|
||||
set => _cachePath = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the folder path to the temp directory within the cache folder
|
||||
/// </summary>
|
||||
/// <value>The temp directory.</value>
|
||||
public string TempDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(CachePath, "temp");
|
||||
}
|
||||
}
|
||||
public string TempDirectory => Path.Combine(CachePath, "temp");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -99,6 +99,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
/// <param name="applicationPaths">The application paths.</param>
|
||||
/// <param name="loggerFactory">The logger factory.</param>
|
||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||
/// <param name="fileSystem">The file system</param>
|
||||
protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
{
|
||||
CommonApplicationPaths = applicationPaths;
|
||||
@ -155,7 +156,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
{
|
||||
if (newConfiguration == null)
|
||||
{
|
||||
throw new ArgumentNullException("newConfiguration");
|
||||
throw new ArgumentNullException(nameof(newConfiguration));
|
||||
}
|
||||
|
||||
ValidateCachePath(newConfiguration);
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.IO;
|
||||
@ -18,6 +18,7 @@ namespace Emby.Server.Implementations.AppBase
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="xmlSerializer">The XML serializer.</param>
|
||||
/// <param name="fileSystem">The file system</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using Emby.Common.Implementations.Serialization;
|
||||
using Emby.Common.Implementations.Serialization;
|
||||
using Emby.Drawing;
|
||||
using Emby.Photos;
|
||||
using Emby.Dlna;
|
||||
@ -41,7 +41,6 @@ using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
@ -80,7 +79,6 @@ using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.News;
|
||||
using MediaBrowser.Model.Reflection;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Services;
|
||||
@ -133,13 +131,7 @@ namespace Emby.Server.Implementations
|
||||
/// Gets or sets a value indicating whether this instance can self update.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
||||
public virtual bool CanSelfUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public virtual bool CanSelfUpdate => false;
|
||||
|
||||
public virtual bool CanLaunchWebBrowser
|
||||
{
|
||||
@ -245,10 +237,7 @@ namespace Emby.Server.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string OperatingSystemDisplayName
|
||||
{
|
||||
get { return EnvironmentInfo.OperatingSystemName; }
|
||||
}
|
||||
public virtual string OperatingSystemDisplayName => EnvironmentInfo.OperatingSystemName;
|
||||
|
||||
/// <summary>
|
||||
/// The container
|
||||
@ -261,10 +250,7 @@ namespace Emby.Server.Implementations
|
||||
/// Gets the server configuration manager.
|
||||
/// </summary>
|
||||
/// <value>The server configuration manager.</value>
|
||||
public IServerConfigurationManager ServerConfigurationManager
|
||||
{
|
||||
get { return (IServerConfigurationManager)ConfigurationManager; }
|
||||
}
|
||||
public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration manager.
|
||||
@ -352,11 +338,6 @@ namespace Emby.Server.Implementations
|
||||
/// </summary>
|
||||
/// <value>The installation manager.</value>
|
||||
protected IInstallationManager InstallationManager { get; private set; }
|
||||
/// <summary>
|
||||
/// Gets the security manager.
|
||||
/// </summary>
|
||||
/// <value>The security manager.</value>
|
||||
protected ISecurityManager SecurityManager { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the zip client.
|
||||
@ -368,7 +349,6 @@ namespace Emby.Server.Implementations
|
||||
|
||||
public StartupOptions StartupOptions { get; private set; }
|
||||
|
||||
internal IPowerManagement PowerManagement { get; private set; }
|
||||
internal IImageEncoder ImageEncoder { get; private set; }
|
||||
|
||||
protected IProcessFactory ProcessFactory { get; private set; }
|
||||
@ -390,7 +370,6 @@ namespace Emby.Server.Implementations
|
||||
ILoggerFactory loggerFactory,
|
||||
StartupOptions options,
|
||||
IFileSystem fileSystem,
|
||||
IPowerManagement powerManagement,
|
||||
IEnvironmentInfo environmentInfo,
|
||||
IImageEncoder imageEncoder,
|
||||
ISystemEvents systemEvents,
|
||||
@ -416,7 +395,6 @@ namespace Emby.Server.Implementations
|
||||
Logger = LoggerFactory.CreateLogger("App");
|
||||
|
||||
StartupOptions = options;
|
||||
PowerManagement = powerManagement;
|
||||
|
||||
ImageEncoder = imageEncoder;
|
||||
|
||||
@ -456,13 +434,7 @@ namespace Emby.Server.Implementations
|
||||
/// Gets the current application version
|
||||
/// </summary>
|
||||
/// <value>The application version.</value>
|
||||
public Version ApplicationVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return _version ?? (_version = typeof(ApplicationHost).Assembly.GetName().Version);
|
||||
}
|
||||
}
|
||||
public Version ApplicationVersion => _version ?? (_version = typeof(ApplicationHost).Assembly.GetName().Version);
|
||||
|
||||
private DeviceId _deviceId;
|
||||
public string SystemId
|
||||
@ -482,15 +454,9 @@ namespace Emby.Server.Implementations
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Emby Server";
|
||||
}
|
||||
}
|
||||
public string Name => "Emby Server";
|
||||
|
||||
private Tuple<Assembly, string> GetAssembly(Type type)
|
||||
private static Tuple<Assembly, string> GetAssembly(Type type)
|
||||
{
|
||||
var assembly = type.GetTypeInfo().Assembly;
|
||||
string path = null;
|
||||
@ -503,14 +469,6 @@ namespace Emby.Server.Implementations
|
||||
return new StreamHelper();
|
||||
}
|
||||
|
||||
public virtual bool SupportsAutoRunAtStartup
|
||||
{
|
||||
get
|
||||
{
|
||||
return EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an instance of type and resolves all constructor dependancies
|
||||
/// </summary>
|
||||
@ -524,7 +482,7 @@ namespace Emby.Server.Implementations
|
||||
/// <summary>
|
||||
/// Creates the instance safe.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="typeInfo">The type information.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
protected object CreateInstanceSafe(Tuple<Type, string> typeInfo)
|
||||
{
|
||||
@ -691,8 +649,6 @@ namespace Emby.Server.Implementations
|
||||
{
|
||||
Resolve<ITaskManager>().AddTasks(GetExports<IScheduledTask>(false));
|
||||
|
||||
ConfigureAutorun();
|
||||
|
||||
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
||||
|
||||
MediaEncoder.Init();
|
||||
@ -746,21 +702,6 @@ namespace Emby.Server.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the autorun.
|
||||
/// </summary>
|
||||
private void ConfigureAutorun()
|
||||
{
|
||||
try
|
||||
{
|
||||
ConfigureAutoRunAtStartup(ConfigurationManager.CommonConfiguration.RunAtStartup);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Error configuring autorun");
|
||||
}
|
||||
}
|
||||
|
||||
private IJsonSerializer CreateJsonSerializer()
|
||||
{
|
||||
return new JsonSerializer(FileSystemManager, LoggerFactory.CreateLogger("JsonSerializer"));
|
||||
@ -856,12 +797,7 @@ namespace Emby.Server.Implementations
|
||||
SocketFactory = new SocketFactory(LoggerFactory.CreateLogger("SocketFactory"));
|
||||
RegisterSingleInstance(SocketFactory);
|
||||
|
||||
RegisterSingleInstance(PowerManagement);
|
||||
|
||||
SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LoggerFactory, FileSystemManager, CryptographyProvider);
|
||||
RegisterSingleInstance(SecurityManager);
|
||||
|
||||
InstallationManager = new InstallationManager(LoggerFactory.CreateLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
||||
InstallationManager = new InstallationManager(LoggerFactory.CreateLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, ServerConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);
|
||||
RegisterSingleInstance(InstallationManager);
|
||||
|
||||
ZipClient = new ZipClient(FileSystemManager);
|
||||
@ -976,7 +912,7 @@ namespace Emby.Server.Implementations
|
||||
PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LoggerFactory.CreateLogger("PlaylistManager"), UserManager, ProviderManager);
|
||||
RegisterSingleInstance<IPlaylistManager>(PlaylistManager);
|
||||
|
||||
LiveTvManager = new LiveTvManager(this, HttpClient, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager, SecurityManager, () => ChannelManager);
|
||||
LiveTvManager = new LiveTvManager(this, HttpClient, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager, () => ChannelManager);
|
||||
RegisterSingleInstance(LiveTvManager);
|
||||
|
||||
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
|
||||
@ -1034,13 +970,7 @@ namespace Emby.Server.Implementations
|
||||
return s => JsvReader.GetParseFn(propertyType)(s);
|
||||
}
|
||||
|
||||
public virtual string PackageRuntime
|
||||
{
|
||||
get
|
||||
{
|
||||
return "netcore";
|
||||
}
|
||||
}
|
||||
public virtual string PackageRuntime => "netcore";
|
||||
|
||||
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo)
|
||||
{
|
||||
@ -1079,7 +1009,7 @@ namespace Emby.Server.Implementations
|
||||
return name + "/" + ApplicationVersion;
|
||||
}
|
||||
|
||||
private string FormatAttribute(string str)
|
||||
private static string FormatAttribute(string str)
|
||||
{
|
||||
var arr = str.ToCharArray();
|
||||
|
||||
@ -1096,13 +1026,7 @@ namespace Emby.Server.Implementations
|
||||
return result;
|
||||
}
|
||||
|
||||
protected virtual bool SupportsDualModeSockets
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
protected virtual bool SupportsDualModeSockets => true;
|
||||
|
||||
private X509Certificate GetCertificate(CertificateInfo info)
|
||||
{
|
||||
@ -1218,8 +1142,7 @@ namespace Emby.Server.Implementations
|
||||
HttpClient,
|
||||
ZipClient,
|
||||
ProcessFactory,
|
||||
5000,
|
||||
EnvironmentInfo);
|
||||
5000);
|
||||
|
||||
MediaEncoder = mediaEncoder;
|
||||
RegisterSingleInstance(MediaEncoder);
|
||||
@ -1572,8 +1495,6 @@ namespace Emby.Server.Implementations
|
||||
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||
protected void OnConfigurationUpdated(object sender, EventArgs e)
|
||||
{
|
||||
ConfigureAutorun();
|
||||
|
||||
var requiresRestart = false;
|
||||
|
||||
// Don't do anything if these haven't been set yet
|
||||
@ -1924,7 +1845,6 @@ namespace Emby.Server.Implementations
|
||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||
WanAddress = wanAddress,
|
||||
HasUpdateAvailable = HasUpdateAvailable,
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
ServerName = FriendlyName,
|
||||
LocalAddress = localAddress,
|
||||
@ -1961,18 +1881,9 @@ namespace Emby.Server.Implementations
|
||||
};
|
||||
}
|
||||
|
||||
public bool EnableHttps
|
||||
{
|
||||
get
|
||||
{
|
||||
return SupportsHttps && ServerConfigurationManager.Configuration.EnableHttps;
|
||||
}
|
||||
}
|
||||
public bool EnableHttps => SupportsHttps && ServerConfigurationManager.Configuration.EnableHttps;
|
||||
|
||||
public bool SupportsHttps
|
||||
{
|
||||
get { return Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy; }
|
||||
}
|
||||
public bool SupportsHttps => Certificate != null || ServerConfigurationManager.Configuration.IsBehindProxy;
|
||||
|
||||
public async Task<string> GetLocalApiUrl(CancellationToken cancellationToken)
|
||||
{
|
||||
@ -2166,15 +2077,10 @@ namespace Emby.Server.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
public string FriendlyName
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(ServerConfigurationManager.Configuration.ServerName)
|
||||
? Environment.MachineName
|
||||
: ServerConfigurationManager.Configuration.ServerName;
|
||||
}
|
||||
}
|
||||
public string FriendlyName =>
|
||||
string.IsNullOrEmpty(ServerConfigurationManager.Configuration.ServerName)
|
||||
? Environment.MachineName
|
||||
: ServerConfigurationManager.Configuration.ServerName;
|
||||
|
||||
public int HttpPort { get; private set; }
|
||||
|
||||
@ -2211,7 +2117,7 @@ namespace Emby.Server.Implementations
|
||||
private bool _hasUpdateAvailable;
|
||||
public bool HasUpdateAvailable
|
||||
{
|
||||
get { return _hasUpdateAvailable; }
|
||||
get => _hasUpdateAvailable;
|
||||
set
|
||||
{
|
||||
var fireEvent = value && !_hasUpdateAvailable;
|
||||
@ -2251,23 +2157,6 @@ namespace Emby.Server.Implementations
|
||||
OnApplicationUpdated(package);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the automatic run at startup.
|
||||
/// </summary>
|
||||
/// <param name="autorun">if set to <c>true</c> [autorun].</param>
|
||||
protected void ConfigureAutoRunAtStartup(bool autorun)
|
||||
{
|
||||
if (SupportsAutoRunAtStartup)
|
||||
{
|
||||
ConfigureAutoRunInternal(autorun);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void ConfigureAutoRunInternal(bool autorun)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This returns localhost in the case of no external dns, and the hostname if the
|
||||
/// dns is prefixed with a valid Uri prefix.
|
||||
|
@ -15,14 +15,14 @@ namespace Emby.Server.Implementations.Archiving
|
||||
/// </summary>
|
||||
public class ZipClient : IZipClient
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public ZipClient(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
public ZipClient(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Extracts all.
|
||||
/// </summary>
|
||||
/// <param name="sourceFile">The source file.</param>
|
||||
@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Archiving
|
||||
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
|
||||
public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
{
|
||||
ExtractAll(fileStream, targetPath, overwriteExistingFiles);
|
||||
}
|
||||
@ -116,7 +116,7 @@ namespace Emby.Server.Implementations.Archiving
|
||||
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
|
||||
public void ExtractAllFrom7z(string sourceFile, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
{
|
||||
ExtractAllFrom7z(fileStream, targetPath, overwriteExistingFiles);
|
||||
}
|
||||
@ -156,7 +156,7 @@ namespace Emby.Server.Implementations.Archiving
|
||||
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
|
||||
public void ExtractAllFromTar(string sourceFile, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
using (var fileStream = _fileSystem.OpenRead(sourceFile))
|
||||
{
|
||||
ExtractAllFromTar(fileStream, targetPath, overwriteExistingFiles);
|
||||
}
|
||||
|
@ -30,10 +30,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
return channel.GetChannelImage(type, cancellationToken);
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Channel Image Provider"; }
|
||||
}
|
||||
public string Name => "Channel Image Provider";
|
||||
|
||||
public bool Supports(BaseItem item)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
@ -67,13 +67,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
_providerManager = providerManager;
|
||||
}
|
||||
|
||||
private TimeSpan CacheLength
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromHours(3);
|
||||
}
|
||||
}
|
||||
private static TimeSpan CacheLength => TimeSpan.FromHours(3);
|
||||
|
||||
public void AddParts(IEnumerable<IChannel> channels)
|
||||
{
|
||||
@ -269,6 +263,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
};
|
||||
|
||||
//TODO Fix The co-variant conversion (internalResult.Items) between Folder[] and BaseItem[], this can generate runtime issues.
|
||||
var returnItems = _dtoService.GetBaseItemDtos(internalResult.Items, dtoOptions, user);
|
||||
|
||||
var result = new QueryResult<BaseItemDto>
|
||||
@ -419,7 +414,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
return list;
|
||||
}
|
||||
|
||||
private MediaSourceInfo NormalizeMediaSource(BaseItem item, MediaSourceInfo info)
|
||||
private static MediaSourceInfo NormalizeMediaSource(BaseItem item, MediaSourceInfo info)
|
||||
{
|
||||
info.RunTimeTicks = info.RunTimeTicks ?? item.RunTimeTicks;
|
||||
|
||||
@ -492,7 +487,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
return item;
|
||||
}
|
||||
|
||||
private string GetOfficialRating(ChannelParentalRating rating)
|
||||
private static string GetOfficialRating(ChannelParentalRating rating)
|
||||
{
|
||||
switch (rating)
|
||||
{
|
||||
@ -533,7 +528,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
var channel = GetChannel(id);
|
||||
@ -577,7 +572,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel));
|
||||
}
|
||||
@ -891,7 +886,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
filename + ".json");
|
||||
}
|
||||
|
||||
private string GetIdToHash(string externalId, string channelName)
|
||||
private static string GetIdToHash(string externalId, string channelName)
|
||||
{
|
||||
// Increment this as needed to force new downloads
|
||||
// Incorporate Name because it's being used to convert channel entity to provider
|
||||
@ -1187,7 +1182,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (channel == null)
|
||||
{
|
||||
throw new ArgumentNullException("channel");
|
||||
throw new ArgumentNullException(nameof(channel));
|
||||
}
|
||||
|
||||
var result = GetAllChannels()
|
||||
|
@ -25,35 +25,17 @@ namespace Emby.Server.Implementations.Channels
|
||||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Refresh Channels"; }
|
||||
}
|
||||
public string Name => "Refresh Channels";
|
||||
|
||||
public string Description
|
||||
{
|
||||
get { return "Refreshes internet channel information."; }
|
||||
}
|
||||
public string Description => "Refreshes internet channel information.";
|
||||
|
||||
public string Category
|
||||
{
|
||||
get { return "Internet Channels"; }
|
||||
}
|
||||
public string Category => "Internet Channels";
|
||||
|
||||
public bool IsHidden
|
||||
{
|
||||
get { return ((ChannelManager)_channelManager).Channels.Length == 0; }
|
||||
}
|
||||
public bool IsHidden => ((ChannelManager)_channelManager).Channels.Length == 0;
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
public bool IsEnabled => true;
|
||||
|
||||
public bool IsLogged
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
public bool IsLogged => true;
|
||||
|
||||
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
@ -77,9 +59,6 @@ namespace Emby.Server.Implementations.Channels
|
||||
};
|
||||
}
|
||||
|
||||
public string Key
|
||||
{
|
||||
get { return "RefreshInternetChannels"; }
|
||||
}
|
||||
public string Key => "RefreshInternetChannels";
|
||||
}
|
||||
}
|
||||
|
@ -38,28 +38,19 @@ namespace Emby.Server.Implementations.Configuration
|
||||
/// Gets the type of the configuration.
|
||||
/// </summary>
|
||||
/// <value>The type of the configuration.</value>
|
||||
protected override Type ConfigurationType
|
||||
{
|
||||
get { return typeof(ServerConfiguration); }
|
||||
}
|
||||
protected override Type ConfigurationType => typeof(ServerConfiguration);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the application paths.
|
||||
/// </summary>
|
||||
/// <value>The application paths.</value>
|
||||
public IServerApplicationPaths ApplicationPaths
|
||||
{
|
||||
get { return (IServerApplicationPaths)CommonApplicationPaths; }
|
||||
}
|
||||
public IServerApplicationPaths ApplicationPaths => (IServerApplicationPaths)CommonApplicationPaths;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration.
|
||||
/// </summary>
|
||||
/// <value>The configuration.</value>
|
||||
public ServerConfiguration Configuration
|
||||
{
|
||||
get { return (ServerConfiguration)CommonConfiguration; }
|
||||
}
|
||||
public ServerConfiguration Configuration => (ServerConfiguration)CommonConfiguration;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [configuration updated].
|
||||
|
@ -24,15 +24,9 @@ namespace Emby.Server.Implementations.Data
|
||||
WriteLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
|
||||
}
|
||||
|
||||
protected TransactionMode TransactionMode
|
||||
{
|
||||
get { return TransactionMode.Deferred; }
|
||||
}
|
||||
protected TransactionMode TransactionMode => TransactionMode.Deferred;
|
||||
|
||||
protected TransactionMode ReadTransactionMode
|
||||
{
|
||||
get { return TransactionMode.Deferred; }
|
||||
}
|
||||
protected TransactionMode ReadTransactionMode => TransactionMode.Deferred;
|
||||
|
||||
internal static int ThreadSafeMode { get; set; }
|
||||
|
||||
@ -58,10 +52,7 @@ namespace Emby.Server.Implementations.Data
|
||||
private string _defaultWal;
|
||||
protected ManagedConnection _connection;
|
||||
|
||||
protected virtual bool EnableSingleConnection
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
protected virtual bool EnableSingleConnection => true;
|
||||
|
||||
protected ManagedConnection CreateConnection(bool isReadOnly = false)
|
||||
{
|
||||
@ -238,21 +229,9 @@ namespace Emby.Server.Implementations.Data
|
||||
Logger.LogInformation("PRAGMA synchronous=" + db.Query("PRAGMA synchronous").SelectScalarString().First());
|
||||
}
|
||||
|
||||
protected virtual bool EnableTempStoreMemory
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
protected virtual bool EnableTempStoreMemory => false;
|
||||
|
||||
protected virtual int? CacheSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
protected virtual int? CacheSize => null;
|
||||
|
||||
internal static void CheckOk(int rc)
|
||||
{
|
||||
@ -276,7 +255,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(GetType().Name + " has been disposed and cannot be accessed.");
|
||||
throw new ObjectDisposedException(GetType().Name ,"Object has been disposed and cannot be accessed.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,13 +32,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// Gets the name of the repository
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SQLite";
|
||||
}
|
||||
}
|
||||
public string Name => "SQLite";
|
||||
|
||||
/// <summary>
|
||||
/// The _json serializer
|
||||
@ -94,11 +88,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (displayPreferences == null)
|
||||
{
|
||||
throw new ArgumentNullException("displayPreferences");
|
||||
throw new ArgumentNullException(nameof(displayPreferences));
|
||||
}
|
||||
if (string.IsNullOrEmpty(displayPreferences.Id))
|
||||
{
|
||||
throw new ArgumentNullException("displayPreferences.Id");
|
||||
throw new ArgumentNullException(nameof(displayPreferences.Id));
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
@ -142,7 +136,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (displayPreferences == null)
|
||||
{
|
||||
throw new ArgumentNullException("displayPreferences");
|
||||
throw new ArgumentNullException(nameof(displayPreferences));
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
@ -174,7 +168,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (string.IsNullOrEmpty(displayPreferencesId))
|
||||
{
|
||||
throw new ArgumentNullException("displayPreferencesId");
|
||||
throw new ArgumentNullException(nameof(displayPreferencesId));
|
||||
}
|
||||
|
||||
var guidId = displayPreferencesId.GetMD5();
|
||||
|
@ -14,7 +14,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (queries == null)
|
||||
{
|
||||
throw new ArgumentNullException("queries");
|
||||
throw new ArgumentNullException(nameof(queries));
|
||||
}
|
||||
|
||||
connection.RunInTransaction(conn =>
|
||||
@ -134,7 +134,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
throw new ArgumentNullException("obj");
|
||||
throw new ArgumentNullException(nameof(obj));
|
||||
}
|
||||
|
||||
using (var stream = new MemoryStream())
|
||||
|
@ -82,11 +82,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (config == null)
|
||||
{
|
||||
throw new ArgumentNullException("config");
|
||||
throw new ArgumentNullException(nameof(config));
|
||||
}
|
||||
if (jsonSerializer == null)
|
||||
{
|
||||
throw new ArgumentNullException("jsonSerializer");
|
||||
throw new ArgumentNullException(nameof(jsonSerializer));
|
||||
}
|
||||
|
||||
_appHost = appHost;
|
||||
@ -455,7 +455,7 @@ namespace Emby.Server.Implementations.Data
|
||||
"ColorTransfer"
|
||||
};
|
||||
|
||||
private string GetSaveItemCommandText()
|
||||
private static string GetSaveItemCommandText()
|
||||
{
|
||||
var saveColumns = new List<string>
|
||||
{
|
||||
@ -558,7 +558,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException("item");
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
|
||||
SaveItems(new List<BaseItem> { item }, cancellationToken);
|
||||
@ -568,7 +568,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
throw new ArgumentNullException("item");
|
||||
throw new ArgumentNullException(nameof(item));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -605,7 +605,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (items == null)
|
||||
{
|
||||
throw new ArgumentNullException("items");
|
||||
throw new ArgumentNullException(nameof(items));
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
@ -1070,7 +1070,7 @@ namespace Emby.Server.Implementations.Data
|
||||
saveItemStatement.MoveNext();
|
||||
}
|
||||
|
||||
private string SerializeProviderIds(BaseItem item)
|
||||
private static string SerializeProviderIds(BaseItem item)
|
||||
{
|
||||
// Ideally we shouldn't need this IsNullOrWhiteSpace check but we're seeing some cases of bad data slip through
|
||||
var ids = item.ProviderIds
|
||||
@ -1085,7 +1085,7 @@ namespace Emby.Server.Implementations.Data
|
||||
return string.Join("|", ids.Select(i => i.Key + "=" + i.Value).ToArray());
|
||||
}
|
||||
|
||||
private void DeserializeProviderIds(string value, BaseItem item)
|
||||
private static void DeserializeProviderIds(string value, BaseItem item)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
@ -1226,7 +1226,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (id.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -1948,7 +1948,7 @@ namespace Emby.Server.Implementations.Data
|
||||
return item;
|
||||
}
|
||||
|
||||
private Guid[] SplitToGuids(string value)
|
||||
private static Guid[] SplitToGuids(string value)
|
||||
{
|
||||
var ids = value.Split('|');
|
||||
|
||||
@ -1965,7 +1965,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Gets chapters for an item
|
||||
/// </summary>
|
||||
/// <param name="id">The id.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>IEnumerable{ChapterInfo}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">id</exception>
|
||||
public List<ChapterInfo> GetChapters(BaseItem item)
|
||||
@ -1996,7 +1996,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Gets a single chapter for an item
|
||||
/// </summary>
|
||||
/// <param name="id">The id.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <returns>ChapterInfo.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">id</exception>
|
||||
@ -2067,12 +2067,12 @@ namespace Emby.Server.Implementations.Data
|
||||
|
||||
if (id.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
if (chapters == null)
|
||||
{
|
||||
throw new ArgumentNullException("chapters");
|
||||
throw new ArgumentNullException(nameof(chapters));
|
||||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
@ -2144,7 +2144,7 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
}
|
||||
|
||||
private bool EnableJoinUserData(InternalItemsQuery query)
|
||||
private static bool EnableJoinUserData(InternalItemsQuery query)
|
||||
{
|
||||
if (query.User == null)
|
||||
{
|
||||
@ -2681,7 +2681,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -2739,7 +2739,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -2928,7 +2928,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -3212,7 +3212,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -3286,7 +3286,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -3362,7 +3362,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5184,7 +5184,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (id.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5233,7 +5233,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5273,7 +5273,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5387,12 +5387,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (itemId.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("itemId");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (ancestorIds == null)
|
||||
{
|
||||
throw new ArgumentNullException("ancestorIds");
|
||||
throw new ArgumentNullException(nameof(ancestorIds));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5556,7 +5556,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
if (!query.Limit.HasValue)
|
||||
@ -5915,12 +5915,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (itemId.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("itemId");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (values == null)
|
||||
{
|
||||
throw new ArgumentNullException("keys");
|
||||
throw new ArgumentNullException(nameof(values));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -5991,12 +5991,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
{
|
||||
if (itemId.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("itemId");
|
||||
throw new ArgumentNullException(nameof(itemId));
|
||||
}
|
||||
|
||||
if (people == null)
|
||||
{
|
||||
throw new ArgumentNullException("people");
|
||||
throw new ArgumentNullException(nameof(people));
|
||||
}
|
||||
|
||||
CheckDisposed();
|
||||
@ -6102,7 +6102,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
throw new ArgumentNullException("query");
|
||||
throw new ArgumentNullException(nameof(query));
|
||||
}
|
||||
|
||||
var cmdText = "select " + string.Join(",", _mediaStreamSaveColumns) + " from mediastreams where";
|
||||
@ -6158,12 +6158,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
|
||||
if (id.Equals(Guid.Empty))
|
||||
{
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
}
|
||||
|
||||
if (streams == null)
|
||||
{
|
||||
throw new ArgumentNullException("streams");
|
||||
throw new ArgumentNullException(nameof(streams));
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -28,13 +28,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// Gets the name of the repository
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SQLite";
|
||||
}
|
||||
}
|
||||
public string Name => "SQLite";
|
||||
|
||||
/// <summary>
|
||||
/// Opens the connection to the database
|
||||
@ -136,13 +130,7 @@ namespace Emby.Server.Implementations.Data
|
||||
return list;
|
||||
}
|
||||
|
||||
protected override bool EnableTempStoreMemory
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
protected override bool EnableTempStoreMemory => true;
|
||||
|
||||
/// <summary>
|
||||
/// Saves the user data.
|
||||
@ -151,15 +139,15 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (userData == null)
|
||||
{
|
||||
throw new ArgumentNullException("userData");
|
||||
throw new ArgumentNullException(nameof(userData));
|
||||
}
|
||||
if (internalUserId <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("internalUserId");
|
||||
throw new ArgumentNullException(nameof(internalUserId));
|
||||
}
|
||||
if (string.IsNullOrEmpty(key))
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
PersistUserData(internalUserId, key, userData, cancellationToken);
|
||||
@ -169,11 +157,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (userData == null)
|
||||
{
|
||||
throw new ArgumentNullException("userData");
|
||||
throw new ArgumentNullException(nameof(userData));
|
||||
}
|
||||
if (internalUserId <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("internalUserId");
|
||||
throw new ArgumentNullException(nameof(internalUserId));
|
||||
}
|
||||
|
||||
PersistAllUserData(internalUserId, userData, cancellationToken);
|
||||
@ -182,7 +170,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Persists the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="internalUserId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <param name="userData">The user data.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
@ -203,7 +191,7 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveUserData(IDatabaseConnection db, long internalUserId, string key, UserItemData userData)
|
||||
private static void SaveUserData(IDatabaseConnection db, long internalUserId, string key, UserItemData userData)
|
||||
{
|
||||
using (var statement = db.PrepareStatement("replace into UserDatas (key, userId, rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex) values (@key, @userId, @rating,@played,@playCount,@isFavorite,@playbackPositionTicks,@lastPlayedDate,@AudioStreamIndex,@SubtitleStreamIndex)"))
|
||||
{
|
||||
@ -280,7 +268,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Gets the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="internalUserId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>Task{UserItemData}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
@ -292,11 +280,11 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (internalUserId <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("internalUserId");
|
||||
throw new ArgumentNullException(nameof(internalUserId));
|
||||
}
|
||||
if (string.IsNullOrEmpty(key))
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
using (WriteLock.Read())
|
||||
@ -323,7 +311,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (keys == null)
|
||||
{
|
||||
throw new ArgumentNullException("keys");
|
||||
throw new ArgumentNullException(nameof(keys));
|
||||
}
|
||||
|
||||
if (keys.Count == 0)
|
||||
@ -337,13 +325,13 @@ namespace Emby.Server.Implementations.Data
|
||||
/// <summary>
|
||||
/// Return all user-data associated with the given user
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="internalUserId"></param>
|
||||
/// <returns></returns>
|
||||
public List<UserItemData> GetAllUserData(long internalUserId)
|
||||
{
|
||||
if (internalUserId <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("internalUserId");
|
||||
throw new ArgumentNullException(nameof(internalUserId));
|
||||
}
|
||||
|
||||
var list = new List<UserItemData>();
|
||||
|
@ -31,13 +31,7 @@ namespace Emby.Server.Implementations.Data
|
||||
/// Gets the name of the repository
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SQLite";
|
||||
}
|
||||
}
|
||||
public string Name => "SQLite";
|
||||
|
||||
/// <summary>
|
||||
/// Opens the connection to the database
|
||||
@ -85,7 +79,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException("user");
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
var serialized = _jsonSerializer.SerializeToBytes(user);
|
||||
@ -122,7 +116,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException("user");
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
var serialized = _jsonSerializer.SerializeToBytes(user);
|
||||
@ -207,14 +201,13 @@ namespace Emby.Server.Implementations.Data
|
||||
/// Deletes the user.
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">user</exception>
|
||||
public void DeleteUser(User user)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException("user");
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
using (WriteLock.Write())
|
||||
|
@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (string.IsNullOrEmpty(typeName))
|
||||
{
|
||||
throw new ArgumentNullException("typeName");
|
||||
throw new ArgumentNullException(nameof(typeName));
|
||||
}
|
||||
|
||||
return _typeMap.GetOrAdd(typeName, LookupType);
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
@ -10,15 +10,12 @@ namespace Emby.Server.Implementations.Devices
|
||||
public class DeviceId
|
||||
{
|
||||
private readonly IApplicationPaths _appPaths;
|
||||
private readonly ILogger _logger;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILogger _logger;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
private readonly object _syncLock = new object();
|
||||
|
||||
private string CachePath
|
||||
{
|
||||
get { return Path.Combine(_appPaths.DataPath, "device.txt"); }
|
||||
}
|
||||
private string CachePath => Path.Combine(_appPaths.DataPath, "device.txt");
|
||||
|
||||
private string GetCachedId()
|
||||
{
|
||||
@ -26,7 +23,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
{
|
||||
lock (_syncLock)
|
||||
{
|
||||
var value = File.ReadAllText(CachePath, Encoding.UTF8);
|
||||
var value = File.ReadAllText(CachePath, Encoding.UTF8);
|
||||
|
||||
Guid guid;
|
||||
if (Guid.TryParse(value, out guid))
|
||||
@ -57,7 +54,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
{
|
||||
var path = CachePath;
|
||||
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path));
|
||||
|
||||
lock (_syncLock)
|
||||
{
|
||||
@ -70,7 +67,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
}
|
||||
}
|
||||
|
||||
private string GetNewId()
|
||||
private static string GetNewId()
|
||||
{
|
||||
return Guid.NewGuid().ToString("N");
|
||||
}
|
||||
@ -92,18 +89,16 @@ namespace Emby.Server.Implementations.Devices
|
||||
|
||||
public DeviceId(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem)
|
||||
{
|
||||
if (fileSystem == null) {
|
||||
throw new ArgumentNullException ("fileSystem");
|
||||
}
|
||||
if (fileSystem == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(fileSystem));
|
||||
}
|
||||
|
||||
_appPaths = appPaths;
|
||||
_logger = logger;
|
||||
_fileSystem = fileSystem;
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return _id ?? (_id = GetDeviceId()); }
|
||||
}
|
||||
public string Value => _id ?? (_id = GetDeviceId());
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Devices;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -360,10 +360,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
return path;
|
||||
}
|
||||
|
||||
private string DefaultCameraUploadsPath
|
||||
{
|
||||
get { return Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads"); }
|
||||
}
|
||||
private string DefaultCameraUploadsPath => Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads");
|
||||
|
||||
public bool CanAccessDevice(User user, string deviceId)
|
||||
{
|
||||
@ -373,7 +370,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
}
|
||||
if (string.IsNullOrEmpty(deviceId))
|
||||
{
|
||||
throw new ArgumentNullException("deviceId");
|
||||
throw new ArgumentNullException(nameof(deviceId));
|
||||
}
|
||||
|
||||
if (!CanAccessDevice(user.Policy, deviceId))
|
||||
@ -389,7 +386,7 @@ namespace Emby.Server.Implementations.Devices
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CanAccessDevice(UserPolicy policy, string id)
|
||||
private static bool CanAccessDevice(UserPolicy policy, string id)
|
||||
{
|
||||
if (policy.EnableAllDevices)
|
||||
{
|
||||
|
@ -81,30 +81,15 @@ namespace Emby.Server.Implementations.Diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
public ProcessOptions StartInfo
|
||||
{
|
||||
get { return _options; }
|
||||
}
|
||||
public ProcessOptions StartInfo => _options;
|
||||
|
||||
public StreamWriter StandardInput
|
||||
{
|
||||
get { return _process.StandardInput; }
|
||||
}
|
||||
public StreamWriter StandardInput => _process.StandardInput;
|
||||
|
||||
public StreamReader StandardError
|
||||
{
|
||||
get { return _process.StandardError; }
|
||||
}
|
||||
public StreamReader StandardError => _process.StandardError;
|
||||
|
||||
public StreamReader StandardOutput
|
||||
{
|
||||
get { return _process.StandardOutput; }
|
||||
}
|
||||
public StreamReader StandardOutput => _process.StandardOutput;
|
||||
|
||||
public int ExitCode
|
||||
{
|
||||
get { return _process.ExitCode; }
|
||||
}
|
||||
public int ExitCode => _process.ExitCode;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Devices;
|
||||
@ -189,7 +189,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
return dto;
|
||||
}
|
||||
|
||||
private IList<BaseItem> GetTaggedItems(IItemByName byName, User user, DtoOptions options)
|
||||
private static IList<BaseItem> GetTaggedItems(IItemByName byName, User user, DtoOptions options)
|
||||
{
|
||||
return byName.GetTaggedItems(new InternalItemsQuery(user)
|
||||
{
|
||||
@ -295,7 +295,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
return dto;
|
||||
}
|
||||
|
||||
private void NormalizeMediaSourceContainers(BaseItemDto dto)
|
||||
private static void NormalizeMediaSourceContainers(BaseItemDto dto)
|
||||
{
|
||||
foreach (var mediaSource in dto.MediaSources)
|
||||
{
|
||||
@ -347,7 +347,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
return dto;
|
||||
}
|
||||
|
||||
private void SetItemByNameInfo(BaseItem item, BaseItemDto dto, IList<BaseItem> taggedItems, User user = null)
|
||||
private static void SetItemByNameInfo(BaseItem item, BaseItemDto dto, IList<BaseItem> taggedItems, User user = null)
|
||||
{
|
||||
if (item is MusicArtist)
|
||||
{
|
||||
@ -447,7 +447,7 @@ namespace Emby.Server.Implementations.Dto
|
||||
}
|
||||
}
|
||||
|
||||
private int GetChildCount(Folder folder, User user)
|
||||
private static int GetChildCount(Folder folder, User user)
|
||||
{
|
||||
// Right now this is too slow to calculate for top level folders on a per-user basis
|
||||
// Just return something so that apps that are expecting a value won't think the folders are empty
|
||||
@ -470,11 +470,11 @@ namespace Emby.Server.Implementations.Dto
|
||||
return item.Id.ToString("N");
|
||||
}
|
||||
|
||||
private void SetBookProperties(BaseItemDto dto, Book item)
|
||||
private static void SetBookProperties(BaseItemDto dto, Book item)
|
||||
{
|
||||
dto.SeriesName = item.SeriesName;
|
||||
}
|
||||
private void SetPhotoProperties(BaseItemDto dto, Photo item)
|
||||
private static void SetPhotoProperties(BaseItemDto dto, Photo item)
|
||||
{
|
||||
dto.CameraMake = item.CameraMake;
|
||||
dto.CameraModel = item.CameraModel;
|
||||
@ -520,13 +520,13 @@ namespace Emby.Server.Implementations.Dto
|
||||
dto.Album = item.Album;
|
||||
}
|
||||
|
||||
private void SetGameProperties(BaseItemDto dto, Game item)
|
||||
private static void SetGameProperties(BaseItemDto dto, Game item)
|
||||
{
|
||||
dto.GameSystem = item.GameSystem;
|
||||
dto.MultiPartGameFiles = item.MultiPartGameFiles;
|
||||
}
|
||||
|
||||
private void SetGameSystemProperties(BaseItemDto dto, GameSystem item)
|
||||
private static void SetGameSystemProperties(BaseItemDto dto, GameSystem item)
|
||||
{
|
||||
dto.GameSystem = item.GameSystemName;
|
||||
}
|
||||
|
@ -45,7 +45,6 @@
|
||||
<EmbeddedResource Include="TextEncoding\NLangDetect\Profiles\*" />
|
||||
<EmbeddedResource Include="TextEncoding\NLangDetect\Utils\messages.properties" />
|
||||
<EmbeddedResource Include="Localization\Ratings\*.txt" />
|
||||
<EmbeddedResource Include="values.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
@ -227,7 +227,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("PortMapper");
|
||||
throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
|
||||
// On some systems the device discovered event seems to fire repeatedly
|
||||
|
@ -1,65 +0,0 @@
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Threading;
|
||||
|
||||
namespace Emby.Server.Implementations.EntryPoints
|
||||
{
|
||||
public class KeepServerAwake : IServerEntryPoint
|
||||
{
|
||||
private readonly ISessionManager _sessionManager;
|
||||
private readonly ILogger _logger;
|
||||
private ITimer _timer;
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
private readonly ITimerFactory _timerFactory;
|
||||
private readonly IPowerManagement _powerManagement;
|
||||
|
||||
public KeepServerAwake(ISessionManager sessionManager, ILogger logger, IServerApplicationHost appHost, ITimerFactory timerFactory, IPowerManagement powerManagement)
|
||||
{
|
||||
_sessionManager = sessionManager;
|
||||
_logger = logger;
|
||||
_appHost = appHost;
|
||||
_timerFactory = timerFactory;
|
||||
_powerManagement = powerManagement;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
_timer = _timerFactory.Create(OnTimerCallback, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
|
||||
}
|
||||
|
||||
private void OnTimerCallback(object state)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
try
|
||||
{
|
||||
if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 15))
|
||||
{
|
||||
_powerManagement.PreventSystemStandby();
|
||||
}
|
||||
else
|
||||
{
|
||||
_powerManagement.AllowSystemStandby();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error resetting system standby timer");
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_timer != null)
|
||||
{
|
||||
_timer.Dispose();
|
||||
_timer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
@ -142,7 +142,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||
_providerManager_RefreshProgress(sender, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(e.Argument, 100)));
|
||||
}
|
||||
|
||||
private bool EnableRefreshMessage(BaseItem item)
|
||||
private static bool EnableRefreshMessage(BaseItem item)
|
||||
{
|
||||
var folder = item as Folder;
|
||||
|
||||
@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||
};
|
||||
}
|
||||
|
||||
private bool FilterItem(BaseItem item)
|
||||
private static bool FilterItem(BaseItem item)
|
||||
{
|
||||
if (!item.IsFolder && !item.HasPathProtocol)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
|
||||
// TODO Log exception or Investigate and properly fix.
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -30,10 +30,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||
|
||||
public string Description => "Refresh user infos";
|
||||
|
||||
public string Category
|
||||
{
|
||||
get { return "Library"; }
|
||||
}
|
||||
public string Category => "Library";
|
||||
|
||||
public bool IsHidden => true;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using MediaBrowser.Model.System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Emby.Server.Implementations.EnvironmentInfo
|
||||
{
|
||||
// TODO: Rework @bond
|
||||
public class EnvironmentInfo : IEnvironmentInfo
|
||||
{
|
||||
public EnvironmentInfo(MediaBrowser.Model.System.OperatingSystem operatingSystem)
|
||||
@ -31,37 +29,8 @@ namespace Emby.Server.Implementations.EnvironmentInfo
|
||||
}
|
||||
}
|
||||
|
||||
public string OperatingSystemVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString();
|
||||
}
|
||||
}
|
||||
public string OperatingSystemVersion => Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString();
|
||||
|
||||
public char PathSeparator
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.PathSeparator;
|
||||
}
|
||||
}
|
||||
|
||||
public Architecture SystemArchitecture { get { return RuntimeInformation.OSArchitecture; } }
|
||||
|
||||
public string GetEnvironmentVariable(string name)
|
||||
{
|
||||
return Environment.GetEnvironmentVariable(name);
|
||||
}
|
||||
|
||||
public string StackTrace
|
||||
{
|
||||
get { return Environment.StackTrace; }
|
||||
}
|
||||
|
||||
public void SetProcessEnvironmentVariable(string name, string value)
|
||||
{
|
||||
Environment.SetEnvironmentVariable(name, value);
|
||||
}
|
||||
public Architecture SystemArchitecture => RuntimeInformation.OSArchitecture;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@ -48,11 +48,11 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
{
|
||||
if (appPaths == null)
|
||||
{
|
||||
throw new ArgumentNullException("appPaths");
|
||||
throw new ArgumentNullException(nameof(appPaths));
|
||||
}
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException("logger");
|
||||
throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
|
||||
_logger = logger;
|
||||
@ -87,7 +87,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
{
|
||||
if (string.IsNullOrEmpty(host))
|
||||
{
|
||||
throw new ArgumentNullException("host");
|
||||
throw new ArgumentNullException(nameof(host));
|
||||
}
|
||||
|
||||
HttpClientInfo client;
|
||||
@ -104,7 +104,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
return client;
|
||||
}
|
||||
|
||||
private WebRequest CreateWebRequest(string url)
|
||||
private static WebRequest CreateWebRequest(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -185,7 +185,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
return request;
|
||||
}
|
||||
|
||||
private CredentialCache GetCredential(string url, string username, string password)
|
||||
private static CredentialCache GetCredential(string url, string username, string password)
|
||||
{
|
||||
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
|
||||
CredentialCache credentialCache = new CredentialCache();
|
||||
@ -220,7 +220,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
}
|
||||
}
|
||||
|
||||
private void SetUserAgent(HttpWebRequest request, string userAgent)
|
||||
private static void SetUserAgent(HttpWebRequest request, string userAgent)
|
||||
{
|
||||
request.UserAgent = userAgent;
|
||||
}
|
||||
@ -491,7 +491,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
return responseInfo;
|
||||
}
|
||||
|
||||
private void SetHeaders(WebHeaderCollection headers, HttpResponseInfo responseInfo)
|
||||
private static void SetHeaders(WebHeaderCollection headers, HttpResponseInfo responseInfo)
|
||||
{
|
||||
foreach (var key in headers.AllKeys)
|
||||
{
|
||||
@ -541,7 +541,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
|
||||
if (options.Progress == null)
|
||||
{
|
||||
throw new ArgumentNullException("progress");
|
||||
throw new ArgumentException("Options did not have a Progress value.",nameof(options));
|
||||
}
|
||||
|
||||
options.CancellationToken.ThrowIfCancellationRequested();
|
||||
@ -616,7 +616,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
}
|
||||
}
|
||||
|
||||
private long? GetContentLength(HttpWebResponse response)
|
||||
private static long? GetContentLength(HttpWebResponse response)
|
||||
{
|
||||
var length = response.ContentLength;
|
||||
|
||||
@ -704,7 +704,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.Url))
|
||||
{
|
||||
throw new ArgumentNullException("options");
|
||||
throw new ArgumentNullException(nameof(options));
|
||||
}
|
||||
}
|
||||
|
||||
@ -713,7 +713,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private string GetHostFromUrl(string url)
|
||||
private static string GetHostFromUrl(string url)
|
||||
{
|
||||
var index = url.IndexOf("://", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
@ -803,7 +803,7 @@ namespace Emby.Server.Implementations.HttpClientManager
|
||||
};
|
||||
}
|
||||
|
||||
private Task<WebResponse> GetResponseAsync(WebRequest request, TimeSpan timeout)
|
||||
private static Task<WebResponse> GetResponseAsync(WebRequest request, TimeSpan timeout)
|
||||
{
|
||||
var taskCompletion = new TaskCompletionSource<WebResponse>();
|
||||
|
||||
|