From a2c1ec0de341b1ce1cdfe7404901d5350d1f2929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 11:14:24 +0100 Subject: [PATCH 001/140] Add RPM package spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/.gitignore | 3 + rpm-package/README.md | 44 ++++++++++++ rpm-package/jellyfin.env | 27 +++++++ rpm-package/jellyfin.service | 15 ++++ rpm-package/jellyfin.spec | 135 +++++++++++++++++++++++++++++++++++ rpm-package/jellyfin.sudoers | 19 +++++ rpm-package/restart.sh | 6 ++ rpm-package/update-db.sh | 12 ++++ 8 files changed, 261 insertions(+) create mode 100644 rpm-package/.gitignore create mode 100644 rpm-package/README.md create mode 100644 rpm-package/jellyfin.env create mode 100644 rpm-package/jellyfin.service create mode 100644 rpm-package/jellyfin.spec create mode 100644 rpm-package/jellyfin.sudoers create mode 100755 rpm-package/restart.sh create mode 100755 rpm-package/update-db.sh diff --git a/rpm-package/.gitignore b/rpm-package/.gitignore new file mode 100644 index 0000000000..6019b98c22 --- /dev/null +++ b/rpm-package/.gitignore @@ -0,0 +1,3 @@ +*.rpm +*.zip +*.tar.gz \ No newline at end of file diff --git a/rpm-package/README.md b/rpm-package/README.md new file mode 100644 index 0000000000..1fba9eaadd --- /dev/null +++ b/rpm-package/README.md @@ -0,0 +1,44 @@ +# unoffical jellyfin RPM + + + +## ffmpeg + +The RPM package for Fedora/CentOS requires some additional repos as ffmpeg is not in the main repositories. + +```shell +# ffmpeg from RPMfusion free +# Fedora +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +# CentOS 7 +$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm +``` + +## In-App service control + +A sample sudoers-policy is located at `/usr/share/jellyfin/jellyfin-sudoers` which you need to review and copy to `/etc/sudoers.d`. +Use `install -D -m 0600 -o root -g root /usr/share/jellyfin/jellyfin-sudoers /etc/sudoers.d/jellyfin-sudoers` for the right permissions. +Finally uncomment JELLYFIN_RESTART_OPT in /etc/sysconfig/jellyfin and restart the service. + +## Database patching +To fix the paths in the emby database for a migration to jellyfin run the script: +```shell +/usr/share/jellyfin/update-db-paths.sh +``` +PS: Please **backup your emby database beforehand**. + +## Building with dotnet + +Jellyfin is build with `--self-contained` so no dotnet required for runtime. + +```shell +# dotnet required for building the RPM +# Fedora +$ sudo dnf copr enable @dotnet-sig/dotnet +# CentOS +$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm +``` + +## TODO + +- [ ] OpenSUSE \ No newline at end of file diff --git a/rpm-package/jellyfin.env b/rpm-package/jellyfin.env new file mode 100644 index 0000000000..a935db68ae --- /dev/null +++ b/rpm-package/jellyfin.env @@ -0,0 +1,27 @@ +# Jellyfin default configuration options + +# Use this file to override the default configurations; add additional +# options with JELLYFIN_ADD_OPTS. + +# To override the user or this config file's location, use +# /etc/systemd/system/jellyfin.service.d/override.conf + +# +# This is a POSIX shell fragment +# + +# +# General options +# + +# Tell jellyfin wich ffmpeg/ffprobe to use +# JELLYFIN_FFMPEG="-ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe" + +# Data directory +JELLYFIN_DATA="/var/lib/jellyfin" +# To enable In-App service control uncomment JELLYFIN_RESTART_OPT +# and install the sample sudo policy to Allow jellyfin group to start, stop and restart itself. +# /usr/share/jellyfin/jellyfin-sudoers to /etc/sudoers.d/ +# JELLYFIN_RESTART_OPT="-restartpath /usr/libexec/jellyfin/restart.sh" +# Additional options for the binary +JELLYFIN_ADD_OPTS="" \ No newline at end of file diff --git a/rpm-package/jellyfin.service b/rpm-package/jellyfin.service new file mode 100644 index 0000000000..26d82a825f --- /dev/null +++ b/rpm-package/jellyfin.service @@ -0,0 +1,15 @@ +[Unit] +After=network.target +Description=Jellyfin is a free software media system that puts you in control of managing and streaming your media. + +[Service] +EnvironmentFile=/etc/sysconfig/jellyfin +WorkingDirectory=/var/lib/jellyfin +ExecStart=/usr/bin/jellyfin -programdata ${JELLYFIN_DATA} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_ADD_OPTS} ${JELLYFIN_FFMPEG} +TimeoutSec=15 +Restart=on-failure +User=jellyfin +Group=jellyfin + +[Install] +WantedBy=multi-user.target diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec new file mode 100644 index 0000000000..af2f929b18 --- /dev/null +++ b/rpm-package/jellyfin.spec @@ -0,0 +1,135 @@ +%global debug_package %{nil} +# jellyfin commit to package +%global commit f8a720d3d8adbdb1f092a42e592dae37ba3f25bb +%global gittag v3.5.2-5 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +# Taglib-sharp commit of the submodule since github archive doesn't include submodules +%global taglib_commit ee5ab21742b71fd1b87ee24895582327e9e04776 +%global taglib_shortcommit %(c=%{taglib_commit}; echo ${c:0:7}) + +Name: jellyfin +Version: 3.5.2.git%{shortcommit} +Release: 3%{?dist} +Summary: The Free Software Media Browser. +License: GPLv2 +URL: https://jellyfin.media +Source0: https://github.com/%{name}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source1: jellyfin.service +Source2: jellyfin.env +Source3: jellyfin.sudoers +Source4: restart.sh +Source5: https://github.com/mono/taglib-sharp/archive/%{taglib_commit}/taglib-sharp-%{taglib_shortcommit}.tar.gz +Source6: update-db.sh + +%{?systemd_requires} +BuildRequires: systemd +Requires(pre): shadow-utils +BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel, glibc-devel, libicu-devel +Requires: libcurl, fontconfig, freetype, openssl, glibc libicu +# Requirements not packaged in main repos +# COPR @dotnet-sig/dotnet +BuildRequires: dotnet-sdk-2.2 +# RPMfusion free +Requires: ffmpeg + +# For the update-db-paths.sh script to fix emby paths to jellyfin +Recommends: sqlite + +# Fedora has openssl1.1 which is incompatible with dotnet +%{?fedora:Requires: compat-openssl10} +# Disable Automatic Dependency Processing for Centos +%{?el7:AutoReqProv: no} + +%description +Jellyfin is a free software media system that puts you in control of managing and streaming your media. + + +%prep +%autosetup -n %{name}-%{commit} +pushd ThirdParty + tar xf %{S:5} + rm -rf taglib-sharp + mv taglib-sharp-%{taglib_commit} taglib-sharp +popd + +%build +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +dotnet build --runtime linux-x64 + +%install +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime linux-x64 +%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE +%{__install} -D -m 0644 debian/conf/jellyfin.service.conf %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%{__mkdir} -p %{buildroot}%{_bindir} +tee %{buildroot}%{_bindir}/jellyfin << EOF +#!/bin/sh +exec %{_libdir}/%{name}/%{name} \${@} +EOF +%{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin +%{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +%{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +%{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/%{name}-sudoers +%{__install} -D -m 0750 %{SOURCE4} %{buildroot}%{_libexecdir}/%{name}/restart.sh +%{__install} -D -m 0755 %{SOURCE6} %{buildroot}%{_datadir}/%{name}/update-db-paths.sh + +%files +%{_libdir}/%{name}/dashboard-ui/* +%attr(755,root,root) %{_bindir}/%{name} +%attr(644,root,root) %{_libdir}/%{name}/*.json +%attr(644,root,root) %{_libdir}/%{name}/*.pdb +%attr(755,root,root) %{_libdir}/%{name}/*.dll +%attr(755,root,root) %{_libdir}/%{name}/*.so +%attr(755,root,root) %{_libdir}/%{name}/*.a +%attr(755,root,root) %{_libdir}/%{name}/createdump +%attr(755,root,root) %{_libdir}/%{name}/jellyfin +%attr(644,root,root) %{_libdir}/%{name}/sosdocsunix.txt +%attr(644,root,root) %{_unitdir}/%{name}.service +%attr(600,root,root) %{_datadir}/%{name}/%{name}-sudoers +%attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh +%attr(750,root,root) %{_libexecdir}/%{name}/restart.sh +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%attr(-,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin +%if 0%{?fedora} +%license LICENSE +%else +%{_datadir}/licenses/%{name}/LICENSE +%endif + +%pre +getent group jellyfin >/dev/null || groupadd -r jellyfin +getent passwd jellyfin >/dev/null || \ + useradd -r -g jellyfin -d %{_sharedstatedir}/jellyfin -s /sbin/nologin \ + -c "Jellyfin default user" jellyfin +exit 0 + +%post +%systemd_post jellyfin.service + +%preun +%systemd_preun jellyfin.service + +%postun +%systemd_postun_with_restart jellyfin.service + +%posttrans +echo -e "\e[31m +To enable In-App service control copy the sudo-policy (be sure to check it contents) with: + +install -D -m 0600 %{_datadir}/%{name}/%{name}-sudoers %{_sysconfdir}/sudoers.d/%{name}-sudoers + +and uncomment JELLYFIN_RESTART_OPT in %{_sysconfdir}/sysconfig/%{name} \e[0m" >> /dev/stderr + +%changelog +* Sat Jan 05 2019 Thomas Büttner - 3.5.2-3 +- Added script for database migration + +* Fri Jan 04 2019 Thomas Büttner - 3.5.2-2 +- Moved sudoers policy and added a note for In-App service control +- Set Restart=on-failure in jellyfin.service + +* Thu Jan 03 2019 Thomas Büttner - 3.5.2-1 +- Initial RPM package diff --git a/rpm-package/jellyfin.sudoers b/rpm-package/jellyfin.sudoers new file mode 100644 index 0000000000..b31d52f7ec --- /dev/null +++ b/rpm-package/jellyfin.sudoers @@ -0,0 +1,19 @@ +# Allow jellyfin group to start, stop and restart itself +Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin +Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin +Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin + + +%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD +%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD +%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD + +Defaults!RESTARTSERVER_SYSTEMD !requiretty +Defaults!STARTSERVER_SYSTEMD !requiretty +Defaults!STOPSERVER_SYSTEMD !requiretty + +# Uncomment to allow the server to mount iso images +# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount +# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount + +Defaults:%jellyfin !requiretty diff --git a/rpm-package/restart.sh b/rpm-package/restart.sh new file mode 100755 index 0000000000..e84dca587f --- /dev/null +++ b/rpm-package/restart.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +NAME=jellyfin +restart_cmd="/usr/bin/systemctl restart ${NAME}" +echo "sleep 2; sudo $restart_cmd > /dev/null 2>&1" | at now > /dev/null 2>&1 +exit 0 \ No newline at end of file diff --git a/rpm-package/update-db.sh b/rpm-package/update-db.sh new file mode 100755 index 0000000000..5866495126 --- /dev/null +++ b/rpm-package/update-db.sh @@ -0,0 +1,12 @@ +#!/bin/sh +db=${1:-/var/lib/jellyfin/data/library.db} +embypath=${2:-/var/lib/emby-server} +jellyfinpath=${3:-/var/lib/jellyfin} +sqlite3 ${db} << SQL +UPDATE Chapters2 +SET ImagePath=REPLACE(ImagePath, '${embypath}', '${jellyfinpath}'); +UPDATE TypedBaseItems +SET Path=REPLACE(Path, '${embypath}', '${jellyfinpath}'); +UPDATE TypedBaseItems +SET data=REPLACE(data, '${embypath}', '${jellyfinpath}'); +SQL From a968913e9f855a99435c7506431a5ec3d3ba1f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 11:22:03 +0100 Subject: [PATCH 002/140] CentOS Build fails since it has no Recommends: tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/README.md | 1 + rpm-package/jellyfin.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rpm-package/README.md b/rpm-package/README.md index 1fba9eaadd..bbc8e7348e 100644 --- a/rpm-package/README.md +++ b/rpm-package/README.md @@ -21,6 +21,7 @@ Use `install -D -m 0600 -o root -g root /usr/share/jellyfin/jellyfin-sudoers /et Finally uncomment JELLYFIN_RESTART_OPT in /etc/sysconfig/jellyfin and restart the service. ## Database patching +You may need to install sqlite since CentOS has no `Recommends:` with `yum install sqlite`. To fix the paths in the emby database for a migration to jellyfin run the script: ```shell /usr/share/jellyfin/update-db-paths.sh diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index af2f929b18..5cadf779d5 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -33,7 +33,7 @@ BuildRequires: dotnet-sdk-2.2 Requires: ffmpeg # For the update-db-paths.sh script to fix emby paths to jellyfin -Recommends: sqlite +%{?fedora:Recommends: sqlite} # Fedora has openssl1.1 which is incompatible with dotnet %{?fedora:Requires: compat-openssl10} From af0451b6ac203860d00c7d209007356362c06d2f Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Thu, 3 Jan 2019 19:47:35 +0100 Subject: [PATCH 003/140] Added .NET base .editorconfig file. Changed UTF-8-BOM to UTF-8 from defaults. --- .editorconfig | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..05fea2835c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,125 @@ +# 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 # +############################### +# All files +[*] +indent_style = space +# 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 From a8da00f0a24029938da361ab7ce55875e7514e2f Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Thu, 3 Jan 2019 19:50:03 +0100 Subject: [PATCH 004/140] Added some generic editorconfig rules. --- .editorconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.editorconfig b/.editorconfig index 05fea2835c..a3b72c9af5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,14 @@ # All files [*] indent_style = space +root = true +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 From 0eafc3fd1136a4c1356812d89650331002b9b666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 17:47:57 +0100 Subject: [PATCH 005/140] Update update-db.sh --- rpm-package/update-db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm-package/update-db.sh b/rpm-package/update-db.sh index 5866495126..92c13cb8a9 100755 --- a/rpm-package/update-db.sh +++ b/rpm-package/update-db.sh @@ -1,7 +1,7 @@ #!/bin/sh -db=${1:-/var/lib/jellyfin/data/library.db} embypath=${2:-/var/lib/emby-server} jellyfinpath=${3:-/var/lib/jellyfin} +db=${1:-${jellyfinpath}/data/library.db} sqlite3 ${db} << SQL UPDATE Chapters2 SET ImagePath=REPLACE(ImagePath, '${embypath}', '${jellyfinpath}'); From b3de385d5b94166b32c67c63345c282e6564c11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 21:30:45 +0100 Subject: [PATCH 006/140] Re-add sudo policy for in-app service restart. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/README.md | 11 +++++++---- rpm-package/jellyfin.env | 6 ++---- rpm-package/jellyfin.spec | 17 ++++++----------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/rpm-package/README.md b/rpm-package/README.md index bbc8e7348e..84aded8c6a 100644 --- a/rpm-package/README.md +++ b/rpm-package/README.md @@ -14,11 +14,14 @@ $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-re $ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm ``` -## In-App service control +## ISO mounting + +To allow jellyfin to mount/umonut ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` +``` +# %jellyfin ALL=(ALL) NOPASSWD: /bin/mount +# %jellyfin ALL=(ALL) NOPASSWD: /bin/umount +``` -A sample sudoers-policy is located at `/usr/share/jellyfin/jellyfin-sudoers` which you need to review and copy to `/etc/sudoers.d`. -Use `install -D -m 0600 -o root -g root /usr/share/jellyfin/jellyfin-sudoers /etc/sudoers.d/jellyfin-sudoers` for the right permissions. -Finally uncomment JELLYFIN_RESTART_OPT in /etc/sysconfig/jellyfin and restart the service. ## Database patching You may need to install sqlite since CentOS has no `Recommends:` with `yum install sqlite`. diff --git a/rpm-package/jellyfin.env b/rpm-package/jellyfin.env index a935db68ae..2e2b2ba8e5 100644 --- a/rpm-package/jellyfin.env +++ b/rpm-package/jellyfin.env @@ -19,9 +19,7 @@ # Data directory JELLYFIN_DATA="/var/lib/jellyfin" -# To enable In-App service control uncomment JELLYFIN_RESTART_OPT -# and install the sample sudo policy to Allow jellyfin group to start, stop and restart itself. -# /usr/share/jellyfin/jellyfin-sudoers to /etc/sudoers.d/ -# JELLYFIN_RESTART_OPT="-restartpath /usr/libexec/jellyfin/restart.sh" +# In-App service control +JELLYFIN_RESTART_OPT="-restartpath /usr/libexec/jellyfin/restart.sh" # Additional options for the binary JELLYFIN_ADD_OPTS="" \ No newline at end of file diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index 5cadf779d5..090f6e319b 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -9,7 +9,7 @@ Name: jellyfin Version: 3.5.2.git%{shortcommit} -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Free Software Media Browser. License: GPLv2 URL: https://jellyfin.media @@ -71,7 +71,7 @@ EOF %{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin %{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service %{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} -%{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/%{name}-sudoers +%{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers %{__install} -D -m 0750 %{SOURCE4} %{buildroot}%{_libexecdir}/%{name}/restart.sh %{__install} -D -m 0755 %{SOURCE6} %{buildroot}%{_datadir}/%{name}/update-db-paths.sh @@ -87,10 +87,10 @@ EOF %attr(755,root,root) %{_libdir}/%{name}/jellyfin %attr(644,root,root) %{_libdir}/%{name}/sosdocsunix.txt %attr(644,root,root) %{_unitdir}/%{name}.service -%attr(600,root,root) %{_datadir}/%{name}/%{name}-sudoers %attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh %attr(750,root,root) %{_libexecdir}/%{name}/restart.sh %config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %attr(-,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin %if 0%{?fedora} @@ -115,15 +115,10 @@ exit 0 %postun %systemd_postun_with_restart jellyfin.service -%posttrans -echo -e "\e[31m -To enable In-App service control copy the sudo-policy (be sure to check it contents) with: - -install -D -m 0600 %{_datadir}/%{name}/%{name}-sudoers %{_sysconfdir}/sudoers.d/%{name}-sudoers - -and uncomment JELLYFIN_RESTART_OPT in %{_sysconfdir}/sysconfig/%{name} \e[0m" >> /dev/stderr - %changelog +* Sat Jan 05 2019 Thomas Büttner - 3.5.2-4 +- Re-added sudoers policy + * Sat Jan 05 2019 Thomas Büttner - 3.5.2-3 - Added script for database migration From 90ab6a40fcdc97bd845c67e65f916210de59552d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 22:06:10 +0100 Subject: [PATCH 007/140] add Firewalld serivce.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin-firewalld.xml | 9 +++++++++ rpm-package/jellyfin.spec | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 rpm-package/jellyfin-firewalld.xml diff --git a/rpm-package/jellyfin-firewalld.xml b/rpm-package/jellyfin-firewalld.xml new file mode 100644 index 0000000000..062db370da --- /dev/null +++ b/rpm-package/jellyfin-firewalld.xml @@ -0,0 +1,9 @@ + + + Jellyfin + The Free Software Media System. + + + + + \ No newline at end of file diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index 090f6e319b..17da904269 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -9,7 +9,7 @@ Name: jellyfin Version: 3.5.2.git%{shortcommit} -Release: 4%{?dist} +Release: 5%{?dist} Summary: The Free Software Media Browser. License: GPLv2 URL: https://jellyfin.media @@ -20,6 +20,7 @@ Source3: jellyfin.sudoers Source4: restart.sh Source5: https://github.com/mono/taglib-sharp/archive/%{taglib_commit}/taglib-sharp-%{taglib_shortcommit}.tar.gz Source6: update-db.sh +Source7: jellyfin-firewalld.xml %{?systemd_requires} BuildRequires: systemd @@ -74,6 +75,7 @@ EOF %{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers %{__install} -D -m 0750 %{SOURCE4} %{buildroot}%{_libexecdir}/%{name}/restart.sh %{__install} -D -m 0755 %{SOURCE6} %{buildroot}%{_datadir}/%{name}/update-db-paths.sh +%{__install} -D -m 0755 %{SOURCE7} %{buildroot}%{_prefix}/lib/firewalld/service/%{name}.xml %files %{_libdir}/%{name}/dashboard-ui/* @@ -89,6 +91,7 @@ EOF %attr(644,root,root) %{_unitdir}/%{name}.service %attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh %attr(750,root,root) %{_libexecdir}/%{name}/restart.sh +%attr(644,root,root) %{_prefix}/lib/firewalld/service/%{name}.xml %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf @@ -116,6 +119,9 @@ exit 0 %systemd_postun_with_restart jellyfin.service %changelog +* Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 +- Add firewalld service.xml + * Sat Jan 05 2019 Thomas Büttner - 3.5.2-4 - Re-added sudoers policy From abddc4786ca748213b07afc0ce8f7aa7481a2c9e Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sat, 5 Jan 2019 22:40:33 +0100 Subject: [PATCH 008/140] Reduce log spam from ffmpeg info --- MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index b68961889e..578e9f2644 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.MediaEncoding.Encoder return false; } - _logger.LogInformation("ffmpeg info: {0}", output); + _logger.LogDebug("ffmpeg output: {Output}", output); if (output.IndexOf("Libav developers", StringComparison.OrdinalIgnoreCase) != -1) { @@ -160,10 +160,12 @@ namespace MediaBrowser.MediaEncoding.Encoder Arguments = arguments, IsHidden = true, ErrorDialog = false, - RedirectStandardOutput = true + RedirectStandardOutput = true, + // ffmpeg uses stderr to log info, don't show this + RedirectStandardError = true }); - _logger.LogInformation("Running {Path} {Arguments}", path, arguments); + _logger.LogDebug("Running {Path} {Arguments}", path, arguments); using (process) { @@ -175,7 +177,7 @@ namespace MediaBrowser.MediaEncoding.Encoder } catch { - _logger.LogInformation("Killing process {path} {arguments}", path, arguments); + _logger.LogWarning("Killing process {Path} {Arguments}", path, arguments); // Hate having to do this try From 79229fe3ae80bd0f10d2aadb09737170ce0af936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sat, 5 Jan 2019 22:44:46 +0100 Subject: [PATCH 009/140] bump to 10.0.0 and use simple version scheme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.spec | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index 17da904269..5b53bd005e 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -1,19 +1,17 @@ %global debug_package %{nil} -# jellyfin commit to package -%global commit f8a720d3d8adbdb1f092a42e592dae37ba3f25bb -%global gittag v3.5.2-5 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +# jellyfin tag to package +%global gittag v10.0.0 # Taglib-sharp commit of the submodule since github archive doesn't include submodules %global taglib_commit ee5ab21742b71fd1b87ee24895582327e9e04776 %global taglib_shortcommit %(c=%{taglib_commit}; echo ${c:0:7}) Name: jellyfin -Version: 3.5.2.git%{shortcommit} -Release: 5%{?dist} +Version: 10.0.0 +Release: 1%{?dist} Summary: The Free Software Media Browser. License: GPLv2 URL: https://jellyfin.media -Source0: https://github.com/%{name}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source0: https://github.com/%{name}/%{name}/archive/%{gittag}.tar.gz Source1: jellyfin.service Source2: jellyfin.env Source3: jellyfin.sudoers @@ -46,7 +44,7 @@ Jellyfin is a free software media system that puts you in control of managing an %prep -%autosetup -n %{name}-%{commit} +%autosetup -n %{name}-%{version} pushd ThirdParty tar xf %{S:5} rm -rf taglib-sharp @@ -119,6 +117,9 @@ exit 0 %systemd_postun_with_restart jellyfin.service %changelog +* Sat Jan 05 2019 Thomas Büttner - 10.0.0-1 +- Bump version to 10.0.0 + * Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 - Add firewalld service.xml From bb879fff33ddc40bc15b025c3e7449c7becb2d46 Mon Sep 17 00:00:00 2001 From: cvium Date: Sat, 5 Jan 2019 23:07:06 +0100 Subject: [PATCH 010/140] Remove AutoRunAtStartup --- .../ApplicationHost.cs | 45 ------------------- .../IServerApplicationHost.cs | 6 --- .../BaseApplicationConfiguration.cs | 6 --- MediaBrowser.Model/System/SystemInfo.cs | 6 --- 4 files changed, 63 deletions(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 2368519685..63dc01f64d 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -506,14 +506,6 @@ namespace Emby.Server.Implementations return new StreamHelper(); } - public virtual bool SupportsAutoRunAtStartup - { - get - { - return EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows; - } - } - /// /// Creates an instance of type and resolves all constructor dependancies /// @@ -706,8 +698,6 @@ namespace Emby.Server.Implementations { Resolve().AddTasks(GetExports(false)); - ConfigureAutorun(); - ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated; MediaEncoder.Init(); @@ -763,21 +753,6 @@ namespace Emby.Server.Implementations } } - /// - /// Configures the autorun. - /// - 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")); @@ -1591,8 +1566,6 @@ namespace Emby.Server.Implementations /// The instance containing the event data. protected void OnConfigurationUpdated(object sender, EventArgs e) { - ConfigureAutorun(); - var requiresRestart = false; // Don't do anything if these haven't been set yet @@ -1943,7 +1916,6 @@ namespace Emby.Server.Implementations CanLaunchWebBrowser = CanLaunchWebBrowser, WanAddress = wanAddress, HasUpdateAvailable = HasUpdateAvailable, - SupportsAutoRunAtStartup = SupportsAutoRunAtStartup, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, ServerName = FriendlyName, LocalAddress = localAddress, @@ -2296,23 +2268,6 @@ namespace Emby.Server.Implementations OnApplicationUpdated(package); } - /// - /// Configures the automatic run at startup. - /// - /// if set to true [autorun]. - protected void ConfigureAutoRunAtStartup(bool autorun) - { - if (SupportsAutoRunAtStartup) - { - ConfigureAutoRunInternal(autorun); - } - } - - protected virtual void ConfigureAutoRunInternal(bool autorun) - { - throw new NotImplementedException(); - } - /// /// This returns localhost in the case of no external dns, and the hostname if the /// dns is prefixed with a valid Uri prefix. diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 830c160e34..4dc5590312 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -24,12 +24,6 @@ namespace MediaBrowser.Controller Task GetPublicSystemInfo(CancellationToken cancellationToken); - /// - /// Gets a value indicating whether [supports automatic run at startup]. - /// - /// true if [supports automatic run at startup]; otherwise, false. - bool SupportsAutoRunAtStartup { get; } - bool CanLaunchWebBrowser { get; } /// diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs index f84735bed6..08bf2379f6 100644 --- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs +++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs @@ -29,12 +29,6 @@ namespace MediaBrowser.Model.Configuration /// The log file retention days. public int LogFileRetentionDays { get; set; } - /// - /// Gets or sets a value indicating whether [run at startup]. - /// - /// true if [run at startup]; otherwise, false. - public bool RunAtStartup { get; set; } - /// /// Gets or sets a value indicating whether this instance is first run. /// diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index 031222b751..a63ce5e66c 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -118,12 +118,6 @@ namespace MediaBrowser.Model.System /// true if this instance has update available; otherwise, false. public bool HasUpdateAvailable { get; set; } - /// - /// Gets or sets a value indicating whether [supports automatic run at startup]. - /// - /// true if [supports automatic run at startup]; otherwise, false. - public bool SupportsAutoRunAtStartup { get; set; } - public string EncoderLocationType { get; set; } public Architecture SystemArchitecture { get; set; } From 56f9572b03c1049131d78f316c2018e271fd3325 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 15:38:50 -0500 Subject: [PATCH 011/140] Bump version to 10.0.0 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9dc21d467e..f536f4f15c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +jellyfin (10.0.0-1) unstable; urgency=medium + + * The first Jellyfin release under our new versioning scheme + * Numerous bugfixes and code readability improvements + * Updated logging configuration, including flag for it and configdir + * Updated theming including logo + * Dozens of other improvements as documented in PR#419 + + -- Joshua Boniface Sat, 05 Jan 2019 15:39:25 -0500 + jellyfin (3.5.2-5) unstable; urgency=medium * Fully GPL'd release - remove tainted code from MediaBrowser.Common From 263274e1aedfd73b90d4fabae75727e3da6528d0 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 16:49:33 -0500 Subject: [PATCH 012/140] Add VCS entries to control file --- debian/control | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/control b/debian/control index 13c62c8065..74bebeaf15 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,9 @@ Build-Depends: debhelper (>= 9), libfontconfig1-dev, libfreetype6-dev Standards-Version: 3.9.4 +Homepage: https://jellyfin.media/ +Vcs-Git: https://github.org/jellyfin/jellyfin.git +Vcs-Browser: https://github.org/jellyfin/jellyfin Package: jellyfin Replaces: mediabrowser, emby, emby-server-beta, jellyfin-dev, emby-server From 3f65cb4f4882d63457192f1bc2f22eaeb9b035c9 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 19:19:23 -0500 Subject: [PATCH 013/140] Add several more debuild artificats to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9bbfd9b745..befba5a20e 100644 --- a/.gitignore +++ b/.gitignore @@ -247,6 +247,8 @@ MediaBrowser.WebDashboard/dashboard-ui/.idea/ ######################### debian/.debhelper/ +debian/*.debhelper +debian/debhelper-build-stamp debian/files debian/jellyfin.substvars debian/jellyfin/ From 177c4835a5403d47eab10cf597694d8f2567f25f Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 19:55:55 -0500 Subject: [PATCH 014/140] Add updated configurations for log and config dir 1. Add log and config flags to init and config 2. Move the existing logs and config dirs to the right places 3. Some cleanups in the control scripts 4. Prune the changelog of pre-Jellyfin entries --- debian/changelog | 13 ------------- debian/conf/jellyfin | 8 ++++++-- debian/conf/logging.json | 21 +++++++++++++++++++++ debian/install | 1 + debian/jellyfin.service | 2 +- debian/postinst | 24 +++++++++++++++--------- debian/postrm | 25 +++++++++++++++++-------- debian/preinst | 20 ++++++++++++-------- debian/prerm | 12 ++++-------- 9 files changed, 77 insertions(+), 49 deletions(-) create mode 100644 debian/conf/logging.json diff --git a/debian/changelog b/debian/changelog index f536f4f15c..ad82a7fa40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,16 +44,3 @@ jellyfin (3.5.2) unstable; urgency=medium * Rename from emby-server on version 3.5.2 -- Joshua Boniface Sun, 9 Dec 2018 15:20:58 -0400 - -emby-server (3.5.2-unlocked) unstable; urgency=medium - - * Taking changes from upstream 3.5.2, beautifying some JS files - - -- Vasily Mon, 22 Oct 2018 03:45:13 +0400 - -emby-server (3.4.1.18-unlocked) unstable; urgency=medium - - * Hard fork of Emby 3.4.1.18 including premium unlock - - -- Joshua Boniface Thu, 9 Aug 2018 00:33:19 -0400 - diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index fb00e7f65c..2735fe8e77 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -16,7 +16,11 @@ # # Data directory -JELLYFIN_DATA="/var/lib/jellyfin" +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +# Config directory +JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" +# Logging directory +JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # Restart script for in-app server control JELLYFIN_RESTART_SCRIPT="/usr/lib/jellyfin/restart.sh" # Additional options for the binary @@ -29,4 +33,4 @@ JELLYFIN_ADD_OPTS="" # Application username JELLYFIN_USER="jellyfin" # Full application command -JELLYFIN_ARGS="-programdata $JELLYFIN_DATA -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS" +JELLYFIN_ARGS="-programdata $JELLYFIN_DATA_DIRECTORY -configdir $JELLYFIN_CONFIG_DIRECTORY -logdir $JELLYFIN_LOG_DIRECTORY -restartpath $JELLYFIN_RESTART_SCRIPT $JELLYFIN_ADD_OPTS" diff --git a/debian/conf/logging.json b/debian/conf/logging.json new file mode 100644 index 0000000000..2ebe5655f3 --- /dev/null +++ b/debian/conf/logging.json @@ -0,0 +1,21 @@ +{ + "Serilog": { + "MinimumLevel": "Information", + "WriteTo": [ + { "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + }, + { "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] + } +} diff --git a/debian/install b/debian/install index bc26f9f09a..adaff7b26f 100644 --- a/debian/install +++ b/debian/install @@ -1,5 +1,6 @@ usr/lib/jellyfin usr/lib/ debian/conf/jellyfin etc/default/ +debian/conf/logging.json etc/jellyfin/ debian/conf/jellyfin.service.conf etc/systemd/system/jellyfin.service.d/ debian/bin/jellyfin-sudoers etc/sudoers.d/ debian/bin/restart.sh usr/lib/jellyfin/ diff --git a/debian/jellyfin.service b/debian/jellyfin.service index 4c37399092..c17422029a 100644 --- a/debian/jellyfin.service +++ b/debian/jellyfin.service @@ -6,7 +6,7 @@ After = network.target Type = simple EnvironmentFile = /etc/default/jellyfin User = jellyfin -ExecStart = /usr/bin/jellyfin -programdata ${JELLYFIN_DATA} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS} +ExecStart = /usr/bin/jellyfin -programdata ${JELLYFIN_DATA_DIRECTORY} -configdir ${JELLYFIN_CONFIG_DIRECTORY} -logdir ${JELLYFIN_LOG_DIRECTORY} -restartpath ${JELLYFIN_RESTART_SCRIPT} ${JELLYFIN_ADD_OPTS} Restart = on-failure TimeoutSec = 15 diff --git a/debian/postinst b/debian/postinst index 502bba3422..7bf2e32de8 100644 --- a/debian/postinst +++ b/debian/postinst @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_LOG_DIRECTORY-/var/log/$NAME} case "$1" in configure) @@ -34,8 +30,18 @@ case "$1" in mkdir $PROGRAMDATA chown -R jellyfin:jellyfin $PROGRAMDATA fi + # ensure $JELLYFIN_CONFIG_DIRECTORY has appropriate permissions + if [[ -n $JELLYFIN_CONFIG_DIRECTORY && ! -d $JELLYFIN_CONFIG_DIRECTORY ]]; then + mkdir $JELLYFIN_CONFIG_DIRECTORY + chown -R jellyfin:jellyfin $JELLYFIN_CONFIG_DIRECTORY + fi + # ensure $JELLYFIN_LOG_DIRECTORY has appropriate permissions + if [[ -n $JELLYFIN_LOG_DIRECTORY && ! -d $JELLYFIN_LOG_DIRECTORY ]]; then + mkdir $JELLYFIN_LOG_DIRECTORY + chown -R jellyfin:jellyfin $JELLYFIN_LOG_DIRECTORY + fi - chmod +x ${JELLYFIN_DIR}/restart.sh > /dev/null 2>&1 || true + chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true # Install jellyfin symlink into /usr/bin ln -sf /usr/lib/jellyfin/bin/jellyfin /usr/bin/jellyfin diff --git a/debian/postrm b/debian/postrm index 852841b163..cbf77325ee 100644 --- a/debian/postrm +++ b/debian/postrm @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -37,13 +33,26 @@ case "$1" in deb-systemd-helper unmask jellyfin.service >/dev/null fi + # Remove user and group userdel jellyfin > /dev/null 2>&1 || true delgroup --quiet jellyfin > /dev/null 2>&1 || true + # Remove config dir + if [[ -d $CONFIGDATA ]]; then + rm -rf $CONFIGDATA + fi + # Remove log dir + if [[ -d $LOGDATA ]]; then + rm -rf $LOGDATA + fi + # Remove program data dir if [[ -d $PROGRAMDATA ]]; then rm -rf $PROGRAMDATA fi + # Remove binary symlink [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin + # Remove sudoers config [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers + # Remove /var/lib/jellyfin, just in case [[ -d /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin ;; remove) diff --git a/debian/preinst b/debian/preinst index 2ce29a0cf1..0063e0e637 100644 --- a/debian/preinst +++ b/debian/preinst @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. @@ -57,6 +53,14 @@ case "$1" in # Clean up old Emby cruft that can break the user's system [[ -f /etc/sudoers.d/emby ]] && rm -f /etc/sudoers.d/emby + # If we have existing config or log dirs in /var/lib/jellyfin, move them into the right place + if [[ -d $PROGRAMDATA/config ]]; then + mv $PROGRAMDATA/config $CONFIGDATA + fi + if [[ -d $PROGRAMDATA/logs ]]; then + mv $PROGRAMDATA/logs $LOGDATA + fi + ;; abort-upgrade) ;; diff --git a/debian/prerm b/debian/prerm index 3cdffed79d..4770c03c41 100644 --- a/debian/prerm +++ b/debian/prerm @@ -2,7 +2,6 @@ set -e NAME=jellyfin -CONF_FILE=/etc/${NAME}.conf DEFAULT_FILE=/etc/default/${NAME} # Source Jellyfin default configuration @@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then . $DEFAULT_FILE fi -# Source Jellyfin user configuration overrides -if [[ -f $CONF_FILE ]]; then - . $CONF_FILE -fi - -# Data directory where Jellyfin database, cache and logs are stored -PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME} +# Data directories for program data (cache, db), configs, and logs +PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} +CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} +LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME} case "$1" in remove|upgrade|deconfigure) From 4e8149bc86b524f59d60fbe2e207427963a694ee Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 5 Jan 2019 23:42:00 -0500 Subject: [PATCH 015/140] Update logging for async mode from #438 --- debian/conf/logging.json | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/conf/logging.json b/debian/conf/logging.json index 2ebe5655f3..5d98484cdf 100644 --- a/debian/conf/logging.json +++ b/debian/conf/logging.json @@ -7,13 +7,21 @@ "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" } }, - { "Name": "File", + { + "Name": "Async", "Args": { - "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", - "fileSizeLimitBytes": 10485700, - "rollOnFileSizeLimit": true, - "retainedFileCountLimit": 10, - "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + "configure": [ + { + "Name": "File", + "Args": { + "path": "%JELLYFIN_LOG_DIR%//jellyfin.log", + "fileSizeLimitBytes": 10485700, + "rollOnFileSizeLimit": true, + "retainedFileCountLimit": 10, + "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}" + } + } + ] } } ] From c07d5a69635494e1bcd39890df8f929fb7353709 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 2 Jan 2019 15:57:48 +0100 Subject: [PATCH 016/140] Remove unused PowerManagement It isn't up to the application to prevent the system from going to sleep --- .../ApplicationHost.cs | 5 -- .../EntryPoints/KeepServerAwake.cs | 65 ------------------- .../LiveTv/EmbyTV/EmbyTV.cs | 20 +++++- .../LiveTv/EmbyTV/TimerManager.cs | 30 ++------- Jellyfin.Server/CoreAppHost.cs | 4 +- Jellyfin.Server/PowerManagement.cs | 23 ------- Jellyfin.Server/Program.cs | 4 +- MediaBrowser.Model/System/IPowerManagement.cs | 11 ---- 8 files changed, 26 insertions(+), 136 deletions(-) delete mode 100644 Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs delete mode 100644 Jellyfin.Server/PowerManagement.cs delete mode 100644 MediaBrowser.Model/System/IPowerManagement.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 9b9c6146fa..950ae10c7d 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -369,7 +369,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; } @@ -391,7 +390,6 @@ namespace Emby.Server.Implementations ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, - IPowerManagement powerManagement, IEnvironmentInfo environmentInfo, IImageEncoder imageEncoder, ISystemEvents systemEvents, @@ -417,7 +415,6 @@ namespace Emby.Server.Implementations Logger = LoggerFactory.CreateLogger("App"); StartupOptions = options; - PowerManagement = powerManagement; ImageEncoder = imageEncoder; @@ -857,8 +854,6 @@ 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); diff --git a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs deleted file mode 100644 index a6dadcef0c..0000000000 --- a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs +++ /dev/null @@ -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; - } - } - } -} diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 59f9fe86f8..81a47bfea1 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -75,7 +75,23 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV private readonly IStreamHelper _streamHelper; - public EmbyTV(IServerApplicationHost appHost, IStreamHelper streamHelper, IMediaSourceManager mediaSourceManager, IAssemblyInfo assemblyInfo, ILogger logger, IJsonSerializer jsonSerializer, IPowerManagement powerManagement, IHttpClient httpClient, IServerConfigurationManager config, ILiveTvManager liveTvManager, IFileSystem fileSystem, ILibraryManager libraryManager, ILibraryMonitor libraryMonitor, IProviderManager providerManager, IMediaEncoder mediaEncoder, ITimerFactory timerFactory, IProcessFactory processFactory, ISystemEvents systemEvents) + public EmbyTV(IServerApplicationHost appHost, + IStreamHelper streamHelper, + IMediaSourceManager mediaSourceManager, + IAssemblyInfo assemblyInfo, + ILogger logger, + IJsonSerializer jsonSerializer, + IHttpClient httpClient, + IServerConfigurationManager config, + ILiveTvManager liveTvManager, + IFileSystem fileSystem, + ILibraryManager libraryManager, + ILibraryMonitor libraryMonitor, + IProviderManager providerManager, + IMediaEncoder mediaEncoder, + ITimerFactory timerFactory, + IProcessFactory processFactory, + ISystemEvents systemEvents) { Current = this; @@ -97,7 +113,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV _streamHelper = streamHelper; _seriesTimerProvider = new SeriesTimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "seriestimers")); - _timerProvider = new TimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger, timerFactory, powerManagement); + _timerProvider = new TimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger, timerFactory); _timerProvider.TimerFired += _timerProvider_TimerFired; _config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated; diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs index 76a044c023..e4ab347704 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs @@ -9,7 +9,6 @@ using MediaBrowser.Model.Serialization; using MediaBrowser.Model.IO; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Threading; -using MediaBrowser.Model.System; namespace Emby.Server.Implementations.LiveTv.EmbyTV { @@ -20,14 +19,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV public event EventHandler> TimerFired; private readonly ITimerFactory _timerFactory; - private readonly IPowerManagement _powerManagement; - public TimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1, ITimerFactory timerFactory, IPowerManagement powerManagement) + public TimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1, ITimerFactory timerFactory) : base(fileSystem, jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase)) { _logger = logger1; _timerFactory = timerFactory; - _powerManagement = powerManagement; } public void RestartTimers() @@ -36,7 +33,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV foreach (var item in GetAll().ToList()) { - AddOrUpdateSystemTimer(item, false); + AddOrUpdateSystemTimer(item); } } @@ -59,7 +56,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV public override void Update(TimerInfo item) { base.Update(item); - AddOrUpdateSystemTimer(item, false); + AddOrUpdateSystemTimer(item); } public void AddOrUpdate(TimerInfo item, bool resetTimer) @@ -90,7 +87,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } base.Add(item); - AddOrUpdateSystemTimer(item, true); + AddOrUpdateSystemTimer(item); } private bool ShouldStartTimer(TimerInfo item) @@ -104,7 +101,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV return true; } - private void AddOrUpdateSystemTimer(TimerInfo item, bool scheduleSystemWakeTimer) + private void AddOrUpdateSystemTimer(TimerInfo item) { StopTimer(item); @@ -124,23 +121,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var dueTime = startDate - now; StartTimer(item, dueTime); - - if (scheduleSystemWakeTimer && dueTime >= TimeSpan.FromMinutes(15)) - { - ScheduleSystemWakeTimer(startDate, item.Name); - } - } - - private void ScheduleSystemWakeTimer(DateTime startDate, string displayName) - { - try - { - _powerManagement.ScheduleWake(startDate.AddMinutes(-5), displayName); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error scheduling wake timer"); - } } private void StartTimer(TimerInfo item, TimeSpan dueTime) diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index b546343871..64e03f22ea 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -11,8 +11,8 @@ namespace Jellyfin.Server { public class CoreAppHost : ApplicationHost { - public CoreAppHost(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, IPowerManagement powerManagement, IEnvironmentInfo environmentInfo, MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder, ISystemEvents systemEvents, MediaBrowser.Common.Net.INetworkManager networkManager) - : base(applicationPaths, loggerFactory, options, fileSystem, powerManagement, environmentInfo, imageEncoder, systemEvents, networkManager) + public CoreAppHost(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, IEnvironmentInfo environmentInfo, MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder, ISystemEvents systemEvents, MediaBrowser.Common.Net.INetworkManager networkManager) + : base(applicationPaths, loggerFactory, options, fileSystem, environmentInfo, imageEncoder, systemEvents, networkManager) { } diff --git a/Jellyfin.Server/PowerManagement.cs b/Jellyfin.Server/PowerManagement.cs deleted file mode 100644 index c27c518937..0000000000 --- a/Jellyfin.Server/PowerManagement.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using MediaBrowser.Model.System; - -namespace Jellyfin.Server.Native -{ - public class PowerManagement : IPowerManagement - { - public void PreventSystemStandby() - { - - } - - public void AllowSystemStandby() - { - - } - - public void ScheduleWake(DateTime wakeTimeUtc, string displayName) - { - - } - } -} diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 03fdacb26f..e9f4708c8b 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -13,7 +13,6 @@ using Emby.Server.Implementations; using Emby.Server.Implementations.EnvironmentInfo; using Emby.Server.Implementations.IO; using Emby.Server.Implementations.Networking; -using Jellyfin.Server.Native; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Drawing; @@ -71,7 +70,6 @@ namespace Jellyfin.Server _loggerFactory, options, fileSystem, - new PowerManagement(), environmentInfo, new NullImageEncoder(), new SystemEvents(_loggerFactory.CreateLogger("SystemEvents")), @@ -274,7 +272,7 @@ namespace Jellyfin.Server } } - public static void Shutdown() + public static void Shutdown() { ApplicationTaskCompletionSource.SetResult(true); } diff --git a/MediaBrowser.Model/System/IPowerManagement.cs b/MediaBrowser.Model/System/IPowerManagement.cs deleted file mode 100644 index 03907568cf..0000000000 --- a/MediaBrowser.Model/System/IPowerManagement.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace MediaBrowser.Model.System -{ - public interface IPowerManagement - { - void PreventSystemStandby(); - void AllowSystemStandby(); - void ScheduleWake(DateTime wakeTimeUtc, string displayName); - } -} From ec2d3ef6033065d0e9c4d66918c64fde2c7fbf93 Mon Sep 17 00:00:00 2001 From: hawken Date: Sat, 5 Jan 2019 20:14:26 +0000 Subject: [PATCH 017/140] Stop including .git in dpkg source tarball --- debian/source/options | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/source/options diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000000..45bef47641 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +tar-ignore = ".git*" From 5623d4b63217cf5d786f0c9ac5407d7b3e6d8831 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 6 Jan 2019 13:53:35 +0100 Subject: [PATCH 018/140] BaseApplicationPaths set up default config and log dir paths --- Jellyfin.Server/Program.cs | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 03fdacb26f..f1559e8852 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -47,6 +47,8 @@ namespace Jellyfin.Server } ServerApplicationPaths appPaths = createApplicationPaths(options); + // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager + Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath); await createLogger(appPaths); _loggerFactory = new SerilogLoggerFactory(); _logger = _loggerFactory.CreateLogger("Main"); @@ -140,23 +142,8 @@ namespace Jellyfin.Server } else { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - configDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - } - else - { - // $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. - configDir = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME"); - // If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config should be used. - if (string.IsNullOrEmpty(configDir)) - { - configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); - } - } - configDir = Path.Combine(configDir, "jellyfin"); - // Ensure the dir exists - Directory.CreateDirectory(configDir); + // Let BaseApplicationPaths set up the default value + configDir = null; } } @@ -169,12 +156,9 @@ namespace Jellyfin.Server } else { - logDir = Path.Combine(programDataPath, "logs"); - // Ensure the dir exists - Directory.CreateDirectory(logDir); + // Let BaseApplicationPaths set up the default value + logDir = null; } - // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager - Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", logDir); } string appPath = AppContext.BaseDirectory; From d4182e761cbd18a85e3dc85812940b92f6a632dc Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 6 Jan 2019 14:53:07 -0500 Subject: [PATCH 019/140] Tweakes based on review feedback --- debian/changelog | 2 +- debian/conf/jellyfin | 4 +--- debian/postrm | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad82a7fa40..61223e7253 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ jellyfin (10.0.0-1) unstable; urgency=medium * Numerous bugfixes and code readability improvements * Updated logging configuration, including flag for it and configdir * Updated theming including logo - * Dozens of other improvements as documented in PR#419 + * Dozens of other improvements as documented in GitHub pull request #419 -- Joshua Boniface Sat, 05 Jan 2019 15:39:25 -0500 diff --git a/debian/conf/jellyfin b/debian/conf/jellyfin index 2735fe8e77..861865aae2 100644 --- a/debian/conf/jellyfin +++ b/debian/conf/jellyfin @@ -15,11 +15,9 @@ # General options # -# Data directory +# Program directories JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" -# Config directory JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" -# Logging directory JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # Restart script for in-app server control JELLYFIN_RESTART_SCRIPT="/usr/lib/jellyfin/restart.sh" diff --git a/debian/postrm b/debian/postrm index cbf77325ee..690f5d587e 100644 --- a/debian/postrm +++ b/debian/postrm @@ -52,8 +52,10 @@ case "$1" in [[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin # Remove sudoers config [[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers - # Remove /var/lib/jellyfin, just in case - [[ -d /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin + # Remove anything at the default locations; catches situations where the user moved the defaults + [[ -e /etc/jellyfin ]] && rm -rf /etc/jellyfin + [[ -e /var/log/jellyfin ]] && rm -rf /var/log/jellyfin + [[ -e /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin ;; remove) if [[ -x "/usr/bin/deb-systemd-helper" ]]; then From 73fd0cd8c69b733112f3f8c9539e988f6c73d164 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 6 Jan 2019 20:59:13 +0100 Subject: [PATCH 020/140] SubtitleEncoder: stop using tuples for clarity * Replace Tuples with a ValueTuple or a struct --- .../Subtitles/SubtitleEncoder.cs | 171 ++++++++++-------- 1 file changed, 97 insertions(+), 74 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index a1dc9b7d4a..68faffa91f 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -1,26 +1,25 @@ -using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Model.Entities; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Serialization; -using System; +using System; using System.Collections.Concurrent; -using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.IO; using MediaBrowser.Model.Diagnostics; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.MediaInfo; +using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Text; +using Microsoft.Extensions.Logging; namespace MediaBrowser.MediaEncoding.Subtitles { @@ -110,7 +109,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles if (endTimeTicks.HasValue) { - var endTime = endTimeTicks.Value; + long endTime = endTimeTicks.Value; track.TrackEvents = track.TrackEvents .TakeWhile(i => i.StartPositionTicks <= endTime) @@ -150,48 +149,51 @@ namespace MediaBrowser.MediaEncoding.Subtitles var subtitle = await GetSubtitleStream(mediaSource, subtitleStream, cancellationToken) .ConfigureAwait(false); - var inputFormat = subtitle.Item2; + var inputFormat = subtitle.format; var writer = TryGetWriter(outputFormat); // Return the original if we don't have any way of converting it if (writer == null) { - return subtitle.Item1; + return subtitle.stream; } // Return the original if the same format is being requested // Character encoding was already handled in GetSubtitleStream if (string.Equals(inputFormat, outputFormat, StringComparison.OrdinalIgnoreCase)) { - return subtitle.Item1; + return subtitle.stream; } - using (var stream = subtitle.Item1) + using (var stream = subtitle.stream) { - return ConvertSubtitles(stream, inputFormat, outputFormat, startTimeTicks, endTimeTicks, preserveOriginalTimestamps, cancellationToken); + return ConvertSubtitles(stream, inputFormat, outputFormat, startTimeTicks, endTimeTicks, preserveOriginalTimestamps, cancellationToken); } } - private async Task> GetSubtitleStream(MediaSourceInfo mediaSource, + private async Task<(Stream stream, string format)> GetSubtitleStream( + MediaSourceInfo mediaSource, MediaStream subtitleStream, CancellationToken cancellationToken) { - var inputFiles = new[] { mediaSource.Path }; + string[] inputFiles; - if (mediaSource.VideoType.HasValue) + if (mediaSource.VideoType.HasValue + && (mediaSource.VideoType.Value == VideoType.BluRay || mediaSource.VideoType.Value == VideoType.Dvd)) { - if (mediaSource.VideoType.Value == VideoType.BluRay || mediaSource.VideoType.Value == VideoType.Dvd) - { - var mediaSourceItem = (Video)_libraryManager.GetItemById(new Guid(mediaSource.Id)); - inputFiles = mediaSourceItem.GetPlayableStreamFileNames(_mediaEncoder).ToArray(); - } + var mediaSourceItem = (Video)_libraryManager.GetItemById(new Guid(mediaSource.Id)); + inputFiles = mediaSourceItem.GetPlayableStreamFileNames(_mediaEncoder); + } + else + { + inputFiles = new[] { mediaSource.Path }; } var fileInfo = await GetReadableFile(mediaSource.Path, inputFiles, mediaSource.Protocol, subtitleStream, cancellationToken).ConfigureAwait(false); - var stream = await GetSubtitleStream(fileInfo.Item1, subtitleStream.Language, fileInfo.Item2, fileInfo.Item4, cancellationToken).ConfigureAwait(false); + var stream = await GetSubtitleStream(fileInfo.Path, subtitleStream.Language, fileInfo.Protocol, fileInfo.IsExternal, cancellationToken).ConfigureAwait(false); - return new Tuple(stream, fileInfo.Item3); + return (stream, fileInfo.Format); } private async Task GetSubtitleStream(string path, string language, MediaProtocol protocol, bool requiresCharset, CancellationToken cancellationToken) @@ -206,15 +208,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles if (!string.IsNullOrEmpty(charset)) { using (var inputStream = new MemoryStream(bytes)) + using (var reader = new StreamReader(inputStream, _textEncoding.GetEncodingFromCharset(charset))) { - using (var reader = new StreamReader(inputStream, _textEncoding.GetEncodingFromCharset(charset))) - { - var text = await reader.ReadToEndAsync().ConfigureAwait(false); + var text = await reader.ReadToEndAsync().ConfigureAwait(false); - bytes = Encoding.UTF8.GetBytes(text); + bytes = Encoding.UTF8.GetBytes(text); - return new MemoryStream(bytes); - } + return new MemoryStream(bytes); } } } @@ -222,7 +222,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles return _fileSystem.OpenRead(path); } - private async Task> GetReadableFile(string mediaPath, + private async Task GetReadableFile( + string mediaPath, string[] inputFiles, MediaProtocol protocol, MediaStream subtitleStream, @@ -237,30 +238,30 @@ namespace MediaBrowser.MediaEncoding.Subtitles string.Equals(subtitleStream.Codec, "ssa", StringComparison.OrdinalIgnoreCase) || string.Equals(subtitleStream.Codec, "srt", StringComparison.OrdinalIgnoreCase)) { - // Extract + // Extract outputCodec = "copy"; outputFormat = subtitleStream.Codec; } else if (string.Equals(subtitleStream.Codec, "subrip", StringComparison.OrdinalIgnoreCase)) { - // Extract + // Extract outputCodec = "copy"; outputFormat = "srt"; } else { - // Extract + // Extract outputCodec = "srt"; outputFormat = "srt"; } - // Extract + // Extract var outputPath = GetSubtitleCachePath(mediaPath, protocol, subtitleStream.Index, "." + outputFormat); await ExtractTextSubtitle(inputFiles, protocol, subtitleStream.Index, outputCodec, outputPath, cancellationToken) .ConfigureAwait(false); - return new Tuple(outputPath, MediaProtocol.File, outputFormat, false); + return new SubtitleInfo(outputPath, MediaProtocol.File, outputFormat, false); } var currentFormat = (Path.GetExtension(subtitleStream.Path) ?? subtitleStream.Codec) @@ -268,15 +269,31 @@ namespace MediaBrowser.MediaEncoding.Subtitles if (GetReader(currentFormat, false) == null) { - // Convert + // Convert var outputPath = GetSubtitleCachePath(mediaPath, protocol, subtitleStream.Index, ".srt"); await ConvertTextSubtitleToSrt(subtitleStream.Path, subtitleStream.Language, protocol, outputPath, cancellationToken).ConfigureAwait(false); - return new Tuple(outputPath, MediaProtocol.File, "srt", true); + return new SubtitleInfo(outputPath, MediaProtocol.File, "srt", true); } - return new Tuple(subtitleStream.Path, protocol, currentFormat, true); + return new SubtitleInfo(subtitleStream.Path, protocol, currentFormat, true); + } + + private struct SubtitleInfo + { + public SubtitleInfo(string path, MediaProtocol protocol, string format, bool isExternal) + { + Path = path; + Protocol = protocol; + Format = format; + IsExternal = isExternal; + } + + public string Path { get; set; } + public MediaProtocol Protocol { get; set; } + public string Format { get; set; } + public bool IsExternal { get; set; } } private ISubtitleParser GetReader(string format, bool throwIfMissing) @@ -482,7 +499,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles } catch (IOException ex) { - _logger.LogError(ex, "Error deleting converted subtitle {0}", outputPath); + _logger.LogError(ex, "Error deleting converted subtitle {Path}", outputPath); } } } @@ -493,7 +510,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles if (failed) { - var msg = string.Format("ffmpeg subtitle conversion failed for {0}", inputPath); + var msg = string.Format("ffmpeg subtitle conversion failed for {Path}", inputPath); _logger.LogError(msg); @@ -501,7 +518,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles } await SetAssFont(outputPath).ConfigureAwait(false); - _logger.LogInformation("ffmpeg subtitle conversion succeeded for {0}", inputPath); + _logger.LogInformation("ffmpeg subtitle conversion succeeded for {Path}", inputPath); } /// @@ -515,8 +532,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles /// The cancellation token. /// Task. /// Must use inputPath list overload - private async Task ExtractTextSubtitle(string[] inputFiles, MediaProtocol protocol, int subtitleStreamIndex, - string outputCodec, string outputPath, CancellationToken cancellationToken) + private async Task ExtractTextSubtitle( + string[] inputFiles, + MediaProtocol protocol, + int subtitleStreamIndex, + string outputCodec, + string outputPath, + CancellationToken cancellationToken) { var semaphore = GetLock(outputPath); @@ -535,8 +557,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles } } - private async Task ExtractTextSubtitleInternal(string inputPath, int subtitleStreamIndex, - string outputCodec, string outputPath, CancellationToken cancellationToken) + private async Task ExtractTextSubtitleInternal( + string inputPath, + int subtitleStreamIndex, + string outputCodec, + string outputPath, + CancellationToken cancellationToken) { if (string.IsNullOrEmpty(inputPath)) { @@ -564,7 +590,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles ErrorDialog = false }); - _logger.LogInformation("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); + _logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments); try { @@ -583,7 +609,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles { try { - _logger.LogInformation("Killing ffmpeg subtitle extraction process"); + _logger.LogWarning("Killing ffmpeg subtitle extraction process"); process.Kill(); } @@ -605,7 +631,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles try { - _logger.LogInformation("Deleting extracted subtitle due to failure: {0}", outputPath); + _logger.LogWarning("Deleting extracted subtitle due to failure: {Path}", outputPath); _fileSystem.DeleteFile(outputPath); } catch (FileNotFoundException) @@ -614,7 +640,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles } catch (IOException ex) { - _logger.LogError(ex, "Error deleting extracted subtitle {0}", outputPath); + _logger.LogError(ex, "Error deleting extracted subtitle {Path}", outputPath); } } else if (!_fileSystem.FileExists(outputPath)) @@ -624,7 +650,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles if (failed) { - var msg = string.Format("ffmpeg subtitle extraction failed for {0} to {1}", inputPath, outputPath); + var msg = $"ffmpeg subtitle extraction failed for {inputPath} to {outputPath}"; _logger.LogError(msg); @@ -632,7 +658,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles } else { - var msg = string.Format("ffmpeg subtitle extraction completed for {0} to {1}", inputPath, outputPath); + var msg = $"ffmpeg subtitle extraction completed for {inputPath} to {outputPath}"; _logger.LogInformation(msg); } @@ -650,19 +676,17 @@ namespace MediaBrowser.MediaEncoding.Subtitles /// Task. private async Task SetAssFont(string file) { - _logger.LogInformation("Setting ass font within {0}", file); + _logger.LogInformation("Setting ass font within {File}", file); string text; Encoding encoding; using (var fileStream = _fileSystem.OpenRead(file)) + using (var reader = new StreamReader(fileStream, true)) { - using (var reader = new StreamReader(fileStream, true)) - { - encoding = reader.CurrentEncoding; + encoding = reader.CurrentEncoding; - text = await reader.ReadToEndAsync().ConfigureAwait(false); - } + text = await reader.ReadToEndAsync().ConfigureAwait(false); } var newText = text.Replace(",Arial,", ",Arial Unicode MS,"); @@ -707,7 +731,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles var charset = _textEncoding.GetDetectedEncodingName(bytes, bytes.Length, language, true); - _logger.LogDebug("charset {0} detected for {1}", charset ?? "null", path); + _logger.LogDebug("charset {0} detected for {Path}", charset ?? "null", path); return charset; } @@ -716,18 +740,18 @@ namespace MediaBrowser.MediaEncoding.Subtitles { if (protocol == MediaProtocol.Http) { - HttpRequestOptions opts = new HttpRequestOptions(); - opts.Url = path; - opts.CancellationToken = cancellationToken; - using (var file = await _httpClient.Get(opts).ConfigureAwait(false)) + HttpRequestOptions opts = new HttpRequestOptions() { - using (var memoryStream = new MemoryStream()) - { - await file.CopyToAsync(memoryStream).ConfigureAwait(false); - memoryStream.Position = 0; + Url = path, + CancellationToken = cancellationToken + }; + using (var file = await _httpClient.Get(opts).ConfigureAwait(false)) + using (var memoryStream = new MemoryStream()) + { + await file.CopyToAsync(memoryStream).ConfigureAwait(false); + memoryStream.Position = 0; - return memoryStream.ToArray(); - } + return memoryStream.ToArray(); } } if (protocol == MediaProtocol.File) @@ -737,6 +761,5 @@ namespace MediaBrowser.MediaEncoding.Subtitles throw new ArgumentOutOfRangeException("protocol"); } - } } From 7bee88280c74b791e63ded8dfd37b7ac14df549d Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 6 Jan 2019 15:02:28 -0500 Subject: [PATCH 021/140] Hotfix to postinst to correct permissions Without this, if not importing a previous config, the perms are broken on the config directories. Fixes this. --- debian/postinst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/debian/postinst b/debian/postinst index 7bf2e32de8..3690d20ba3 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,21 +25,22 @@ case "$1" in adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ --gecos "Jellyfin default user" > /dev/null 2>&1 fi - # ensure $PROGRAMDATA has appropriate permissions + # ensure $PROGRAMDATA exists if [[ ! -d $PROGRAMDATA ]]; then mkdir $PROGRAMDATA - chown -R jellyfin:jellyfin $PROGRAMDATA fi - # ensure $JELLYFIN_CONFIG_DIRECTORY has appropriate permissions - if [[ -n $JELLYFIN_CONFIG_DIRECTORY && ! -d $JELLYFIN_CONFIG_DIRECTORY ]]; then - mkdir $JELLYFIN_CONFIG_DIRECTORY - chown -R jellyfin:jellyfin $JELLYFIN_CONFIG_DIRECTORY + # ensure $CONFIGDATA exists + if [[ ! -d $CONFIGDATA ]]; then + mkdir $CONFIGDATA fi - # ensure $JELLYFIN_LOG_DIRECTORY has appropriate permissions - if [[ -n $JELLYFIN_LOG_DIRECTORY && ! -d $JELLYFIN_LOG_DIRECTORY ]]; then - mkdir $JELLYFIN_LOG_DIRECTORY - chown -R jellyfin:jellyfin $JELLYFIN_LOG_DIRECTORY + # ensure $LOGDATA exists + if [[ ! -d $LOGDATA ]]; then + mkdir $LOGDATA fi + # Ensure permissions are correct on all config directories + chown -R jellyfin:jellyfin $PROGRAMDATA + chown -R jellyfin:jellyfin $CONFIGDATA + chown -R jellyfin:jellyfin $LOGDATA chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true From e93896f7a4f6e2a2d3c74cc3fdcceeb575e093c3 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 6 Jan 2019 01:59:27 -0500 Subject: [PATCH 022/140] Update readme to use readthedocs and clean up 1. Replace all Wiki references to Readthedocs.io references 2. Clean up the layout a bit, remove some redundant bits and make "about" bits consistent between Docs and README --- README.md | 49 ++++++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index c4133eb9de..dfa8457de1 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,36 @@

Jellyfin

The Free Software Media System

-

-Jellyfin is a free software media system that puts you in control of managing and streaming your media. -

- ------ - -

-Want to get started? Choose from Prebuilt Packages, or Build from Source. -

-

-Want to contribute? Check out our wiki for guidelines. -

- ---

+Logo banner +

GPL 2.0 License Build Status Docker Pull Count -Chat on Matrix +Documentation +Chat on Matrix Join our Subreddit

-For further details, please see [our wiki](https://github.com/jellyfin/jellyfin/wiki). +--- -To receive the latest updates, please visit [our public chat on Matrix/Riot](https://matrix.to/#/#jellyfin:matrix.org), our [announce chat](https://matrix.to/#/#jellyfin-announce:matrix.org) for release info, and follow us on [Social Media](https://github.com/jellyfin/jellyfin/wiki/Social-Media). - -## About - -The Jellyfin project was started as a result of Emby's decision to take their code closed-source, as well as various philosophical differences with the core developers. Jellyfin seeks to be the free software alternative to Emby and Plex to provide media management and streaming from a dedicated server to end-user devices. - -Jellyfin is descended from Emby 3.5.2, ported to the .NET Core framework, and aims to contain build facilities for every platform. - -## Issues and Feature Requests +Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. There are no strings attached, no premium licenses or features, and no hidden agendas: just a team who want to build something better and work together to achieve it. We welcome anyone who is interested in joining us in our quest! +For further details, please see [our documentation page](https://jellyfin.readthedocs.io). To receive the latest updates, get help with Jellyfin, and join the community, please visit [one of our communication channels on Matrix/Riot or social media](https://jellyfin.readthedocs.io/en/latest/user-docs/getting-help). +For more information about the project, please see our [about page](https://jellyfin.readthedocs.io/en/latest/about/).

- New idea or improvement? -Open a Feature Request. +Want to get started? +Choose from Prebuilt Packages or Build from Source, then see our Quickstart guide.

- Something not working right? -Open an Issue. +Want to contribute? +Check out our documentation for guidelines. +

+

+New idea or improvement? Something not working right? +Open an Issue.

- - -## Contributing to Jellyfin - -If you're interested in contributing, please see [our wiki for guidelines](https://github.com/jellyfin/jellyfin/wiki/Contributing-to-Jellyfin). From e60dc805d6d33bf099d5eea06b73534542b75121 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 6 Jan 2019 17:45:50 -0500 Subject: [PATCH 023/140] Remove deprecation warning from Docker --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47414ad122..1dd49511ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,4 @@ RUN apt update \ && 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 +ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config From 12112ea25da848d6677a5e4b8582cd5c50aeb981 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 6 Jan 2019 17:52:51 -0500 Subject: [PATCH 024/140] Remove more news --- .../ApplicationHost.cs | 1 - MediaBrowser.Api/NewsService.cs | 46 ------------------- MediaBrowser.Model/News/INewsService.cs | 17 ------- MediaBrowser.Model/News/NewsItem.cs | 14 ------ MediaBrowser.Model/News/NewsQuery.cs | 9 ---- 5 files changed, 87 deletions(-) delete mode 100644 MediaBrowser.Api/NewsService.cs delete mode 100644 MediaBrowser.Model/News/INewsService.cs delete mode 100644 MediaBrowser.Model/News/NewsItem.cs delete mode 100644 MediaBrowser.Model/News/NewsQuery.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 950ae10c7d..54bce70ca7 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -80,7 +80,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; diff --git a/MediaBrowser.Api/NewsService.cs b/MediaBrowser.Api/NewsService.cs deleted file mode 100644 index cbc77bfc9a..0000000000 --- a/MediaBrowser.Api/NewsService.cs +++ /dev/null @@ -1,46 +0,0 @@ -using MediaBrowser.Model.News; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Services; - -namespace MediaBrowser.Api -{ - [Route("/News/Product", "GET", Summary = "Gets the latest product news.")] - public class GetProductNews : IReturn> - { - /// - /// Skips over a given number of items within the results. Use for paging. - /// - /// The start index. - [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? StartIndex { get; set; } - - /// - /// The maximum number of items to return - /// - /// The limit. - [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? Limit { get; set; } - } - - public class NewsService : BaseApiService - { - private readonly INewsService _newsService; - - public NewsService(INewsService newsService) - { - _newsService = newsService; - } - - public object Get(GetProductNews request) - { - var result = _newsService.GetProductNews(new NewsQuery - { - StartIndex = request.StartIndex, - Limit = request.Limit - - }); - - return ToOptimizedResult(result); - } - } -} diff --git a/MediaBrowser.Model/News/INewsService.cs b/MediaBrowser.Model/News/INewsService.cs deleted file mode 100644 index 4c92664d9b..0000000000 --- a/MediaBrowser.Model/News/INewsService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using MediaBrowser.Model.Querying; - -namespace MediaBrowser.Model.News -{ - /// - /// Interface INewsFeed - /// - public interface INewsService - { - /// - /// Gets the product news. - /// - /// The query. - /// QueryResult{NewsItem}. - QueryResult GetProductNews(NewsQuery query); - } -} diff --git a/MediaBrowser.Model/News/NewsItem.cs b/MediaBrowser.Model/News/NewsItem.cs deleted file mode 100644 index 2a05c420a7..0000000000 --- a/MediaBrowser.Model/News/NewsItem.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace MediaBrowser.Model.News -{ - public class NewsItem - { - public string Title { get; set; } - public string Link { get; set; } - public string Description { get; set; } - public string DescriptionHtml { get; set; } - public string Guid { get; set; } - public DateTime Date { get; set; } - } -} diff --git a/MediaBrowser.Model/News/NewsQuery.cs b/MediaBrowser.Model/News/NewsQuery.cs deleted file mode 100644 index 5678889217..0000000000 --- a/MediaBrowser.Model/News/NewsQuery.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MediaBrowser.Model.News -{ - public class NewsQuery - { - public int? StartIndex { get; set; } - - public int? Limit { get; set; } - } -} \ No newline at end of file From 9f7bebc72866eab8c3ad7825e2b60bcc83d9d106 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 6 Jan 2019 18:05:06 -0500 Subject: [PATCH 025/140] Fix Skia in Docker --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1dd49511ab..9ac8d48e57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64 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 + && apt remove -y xz-utils \ + && apt install -y libfontconfig1 # needed for Skia ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config From d6d8c404503f4439dc4bf4aa1a09a4c29cf45cfa Mon Sep 17 00:00:00 2001 From: Sparky Date: Sun, 6 Jan 2019 20:45:38 -0500 Subject: [PATCH 026/140] Change UI accents, update artwork Replaced "Emby Green" with blue taken from artwork. Replaced artwork. Kept old "Emby Green" themes for future reuse and renamed them "classic". Removed CSS element that was making the Jellyfin banner too small. --- Emby.Dlna/Images/logo120.jpg | Bin 4134 -> 5337 bytes Emby.Dlna/Images/logo120.png | Bin 2671 -> 7522 bytes Emby.Dlna/Images/logo240.jpg | Bin 10263 -> 11520 bytes Emby.Dlna/Images/logo240.png | Bin 6468 -> 18287 bytes Emby.Dlna/Images/logo48.jpg | Bin 1580 -> 1839 bytes Emby.Dlna/Images/logo48.png | Bin 932 -> 2554 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Emby.Dlna/Images/logo120.jpg b/Emby.Dlna/Images/logo120.jpg index 9a0e199a36274206529bd0a96fd00f763de658b9..c70f4db0de76cd2b0e92a0ecdf358620ee6cafb7 100644 GIT binary patch literal 5337 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 a2Uk5$qk9aw<2_9+>S~|z_ggLMZ1f-IbKFb- literal 4134 zcmb7{cT^MG7RDzHLX#vkX%dQb=}3$8E+D-~GoeYS5u`~8O+e{I5UB!UFkA%@;R#X< zf>fm!5r}|D(F-=D$cuW*`}gfxYu3z}b#iKrejPD3@k{NW2^`S62ZufVnZR= zXxE6Ji-3O4gh1i6i3lbJCfex#8Asg!5)MQF5fBg(03$&VBbl_hq z!3f#|`cnT({xQUq%+)H9_gAMuHBFb5FH`5VVzY?k(D^6!un(eni)>a?~5cPUPta3x!(>pPKRe2tp zT0cGeE#`mK{1yZHr3Ug#O@^nU{~<9kbp^YZcW>(*OMpibooi(ynj{Y>Y>`tSeE@%4 z47E5F$X%VZJp#00_o(#%lOetWh3zMsHm>g&*wtP2WqJ(>Dvmi*`l5`O=v-G#O1tYDyQy3~Nel;5m(KZ^``i@^x4iq< z|G72HyN$zDiJ@z$ajLsXR8Vb%jn@rt>V4)xjL(FdL3Ji($?0n$D_)=yRzj_W+g0e2 zg6n$U;+RiyVVcuo-Y|$8JAboP&>X*U`li z*o1`T=n(8^1uNUiE|^Dr^}|uzU+HAf0)6vcF7su{RULn*qAkBRZwm8&s_DqGXROn^ zCNP`wV|#7oY{E=5^TS)8)AO$R`mSbCGi@aY#sx&L;z@H?mD`g$TQNe*_|P7o<`hRihYsLWs0qcHLLux4XkvNUt$dnNW)*vri=d#DmJ*;@&l-5uVO2F4q$&GRLaUMT7 zpN23GaqvliIcIgRyL|e@eM7R(jb3UShV=-HqGIyK`d%47erj)nQ+jvRi%BbJelB9X zPjel!++Qy_Xz=k(s6)^bzStvRx1)4lfLdgKVeBja{No%mj}Om=qx&1lBD3?$28R12 z%1zPQ9IuS}X!4!KB_|v?SxkFQ8++wMEbgI!5!3KetWcdyz=)YiSyUR26VK$}V4y|G zp*hvc?e;D62KkRHw~7{QLdpw^-kc1mlZ@1_Z8;r;jbWj^+v9;V(g_CR(+A^o1Rms$ z*s&W00n*q%uz6{$=bom-<-fm}pIYVJQ0yFT88A0yZn3FQeC@{Ij6uHd1$s0f(A#pw z*t2nbO#Xved4dZ6JOkamrp=wS+t?e%XzwZ_q1exBr?lH(nZmGduKRkQrkky{RdfVn>J)iH?-(QTp(ZI zvmLNfDre7a^$x7wU!Z+*f(X#h8V-W~v!#HLf`GgnLdOb=Cd60%T`si{2lxbt?*)zv zp9u$6ENDJY--^;3St_O96Sq>klSd8J^KOs7jjJGJ8zYZ9a7Z{XP{)`*M_N$i6 zcY6*VZ-PuNZ=iU@Ll*^obe?7Wc)%eZAIh2xx~y3cO;kRg&OwxmC{xfCgmBnY2pT4^t7KU=%Uxq;=Q(jR=!f=yxEGbucS5sT zV<$k-q6KC7WNgw&Q6ouhuLVUZMxaW#m?1#?Lm@SWcc&Qpuqi*z%W6?1}UMuvS3)X_SrIH%79vf zf2L}xs`HqH@pjyC97@CxO|bw{2br?j?vv|ge_lb*JSH=v>T`jTJ2S^v_@5~(m z*)rfLGeJy=@VfgW%LScevHL+O-Ljsih^DNudKE@}QaYp_xOT#>zCyQz6wK;wg|5gk z-rfpcM+1AtdUw}tKu6}xx($a62JEE7r@HXoKu4-8Vxn6ICsVu+V>wL*naFJ*TEyiJ z;(73{To3w_3K%it&kxoQjgNIU61s^~UDhv?GAUFsTH z6^C`xP-vM$E|=Y=Tm{;mK4r_Cp#iK_n?+3%)W!-kBen`6+dmEpV63x686=XbmD124Vx~5Gb@9l0!)O7k^+72o7wQPzjSEE)$?B zs(W1K;zL_r_tat?kLr<^Um3|NJRcS7V)0VK1FccH6=z#WA?oF;(~eS>uLbxr^&4th z3T4lH|JG4@Hp@T-!k;6Z6DZ)!%2*?Mwt4i^i?K1&S*wWFiNVTMubUUsQdW|wF#e(9l8NVpqG&YxHB7>=sJ_0`F%@cnRwu?`lPv|v2 zQ@ow1#)+vCQ6(!UO+SL>oSi%=W}I(EwS2kMt2jDmJePI!V7NxC?G`q(ms6>Eq-UexZos2Ajy8w3R@#O5 zFG5CzzSb+r=O!NfVTWzjOe^73@AgZsm^~O+lYh<0N!<9vrpg|ggo&fMEQO@Cws6@0 zG(|Mmk+eP43M)s5&-oLAeuY3)HZ*oE{pB`;7O*7^_EN7hEWcB0vlPTI!P6Ae07nmE zE|596-VPJfb1QH(9#9uJzfHo)8isn@G3@FI~n*r^vqLyrIyq=BM6 zD8Rusltg!$&PW#746Y|-5AO8s;JnXWWAGk(eb>=FQ-#%_y*v52O?;`cf$5#4(rX17 ziB>@uD3?Ot&J&RHt5T`Y74>UxG*cf`)E1WAnYG#x$y0Ar0O{}2v=f+2r*?7s=8 zH8LnPAcW-nO*rkp0}gyC)~+J2&b$ux+b!IT7)dPc)qEGOY=E_Vbqe7t3-`CXD=%8oy{m3fU;M)4`N_u24Oz?TWXA0-lS`}^wC+3z;FDy=8 zIQ5xc$}qXIxuNxhW?p4WW2@$*U-xt$>QJP2I$Ml|(Ih(}e!MR9D%y1?qO1SdtXuDN zujqVMl&!QUo4bkyZFsck80K_n%lCpdICV95PBNxzx@V*k@7l#;4ji4G|MZy zUMb`>DVCkbiHe2A8W*|dQ#6HbM88&fNElBck-S&dHs7rdU386A4j9&BU(xNAEglU5 zOW>VW-DgLin^?cyu8Ivg_D$U62ymI@rG8eD4*gQUYfmDD+^@lVyuW_9_HC5!O~5G+ zBeg9`wNpv|>}q7=$&L`T=#IQ&!G4=*ch*c9cbZ~e#>u^#SGMnotcgb*pZm@iwD-e8 zsr6}x$`6mXpJ_0i!)u2stc-n}H3+ajaPouhgfsyNXw^tin? zeX@S)t?uj9r;f%MhfU#%6gOcb(W$C%waXM~8ET{;E{qEqVa`1FCb^_m(M(r2;N!g~ i<E|Odq#E~&HNW1^6s<% diff --git a/Emby.Dlna/Images/logo120.png b/Emby.Dlna/Images/logo120.png index c7fc5c1ce1245f589293686b0b0f282a5eddcc5f..321c4772920b3b5e81c61a63f06d5bb2100514f2 100644 GIT binary patch literal 7522 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 delta 2663 zcmV-t3YhicI`0&aBYz4uNklscm!Tiq74|7^Uxhx1*MBaPF8dd5zlzW7(|u*< znw_V1OwN&{F9&{iuL*Y9TBj87Ljm(!&|^#2b$Qa`PXgY%!egIEpU;Ob!u>%&9K!P> zHWc@V@%};eT1mYJ@5O8H;j>SduI;)Gk53ei_5G6H)nWHp>(4nQKQTv=ymVbsmBH?W@!FwXR}^Lvi3UpHwERSL?EZlIdwDIt9UVPi1|bMQi6D*w)Mx~>!eXoX zy#6kwHSqW?^_%z)i*S1%!2cb$hZQfHJB0|v6x*@Zg@0v!4%XzLW9Ms&S`4VRzGPMZ zP93;(Sp*yZ?FQkqZwjZlF%eru0mRK=F~3G9J}vy5BC4hLn&Na=!MC8# zhHluYgMVc)z@}!^i-W$FzXHg=5M^uawuTF+M?!Cg)kYR8Vt_Rfv{aG33dnrM+s|st z*19;#|EAzS=m*l{X1e19AlE^wQxE_zMEn0>T`(tG^(C_WyItXu7f`Ct>U=1MfQ zx(JUq$;$b5OEk*IqyWGg;F1j(R)y259={v?vQtaLMFVz`9(zy*^+3u1u!exvmi&zH z*#RvYOtHN%On4FvS+>;@~&bJiYlF#-A+~)}H$}L$#eoK0+qg5j1UF6s; zmwzDp{53#6*zAC+ueb%^K0t8C?ydn>&3rv8T(+yJaMzR`55j<|kKo1&yh2O9uh+C8 zROcD9k(6gAA^g`97;)edWEe>}gn|`c(S23tbYlSH4}BkihxIrwCS1~b|AjebkN?FK zxQ9rOeWYio8UvRg!&S3I=-aMT;i{_|1%DC;2?bR&M)nbOm94E(91`*W%4-R3B9QxP zQH4`!{cv!kjj_3UQ9faf*Tp6hKRf=Hr*YQNq$EhzNz-9sttMUb?|94V; z!q^LY9-p5CxB~`$ov>oUyY@B3P2;2o z_f#Jij;ReK1s^pQUI0VfH-Aoo;Y;{1>MN7=nyhfqLjcU;0RE?{rEGBHNXsE$WyPP1 z1NdTmc%dkp+(-h9VXSi1Ka4X5en7ZvfC4Oo6>Q+1)&29vZoy^tid|tt1lVZ6qjoKl zz9)_ae+sz6#+N>#)L|9+PCURB0^A~i-;Lv(EDEypFn`J129nx(m?SFJ z58?p+N6F`((m2>;z{{EFps7lls?^B_M#+YZCL46RkUb?#PZv_U@Ex5ljG6E^cRdm% z{Jna@zc3^IB|AY^76H>GJBwd*M}Q5!=n6{0N$tyJ1F5`7+@;l za6%(%bWjnNEEi!Zo1`qrwyh3rtMdf`&F(hvatk4$a{7IMwk@@Q+jR5z#8nWmA3 zL8dY9h^+1H{|w@sEz{m!_TVJ8m!&-mc|ZEL%b*RSIc*T#zzw2>&;DZ07Vl@xQCqy9 zIQ}i(X^VG#-haK^oGsq9^p=Zj0dgQ?&s9^V2>qvA^S#K}ZIUxl0C{u#!3StZ@G-*; zgQ^mOD(SLab0&*$*)9P5#HvFk%hlVtzY53)z*GeJ- zz9%3*xqQgvmP5D!e?|B#pKC<{++C!{9t7y6qH7AMcz-yN0k{X`T3OJTEzuZX524!E znl;$^szB-SyU{N@<+31H#I_d3cgKY}lD z=R-rt8Gizew*22}h06xf#uM>)vs}9gqU$4J(Kksy?1)x(+u?tYuAvIJ(tCx^S+1Q0 z6YSH`5#NMGKNC*0J36bPLAM%M)dsZX6gl_y$K=>x~7=ZB9ev1J1F5rBk$Jq;Ue-MC%@%)GlRrmGybP+y3U*f%Z z?LB<k53Se^*y}afdgdy*(V-3FyhT=S^YW=+nKkdTm&kdTm&kdU;o{11bo VqMyCgaAg1h002ovPDHLkV1nzmHMIZ$ diff --git a/Emby.Dlna/Images/logo240.jpg b/Emby.Dlna/Images/logo240.jpg index 74cb2c429ac84f0add08351ffb4aec28f798f643..da1cb5e071b7b4407803f549f1be3e0bf64f95cc 100644 GIT binary patch literal 11520 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 literal 10263 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 Q;CgeMVBkZ5{LAwH0O_{Z9RL6T diff --git a/Emby.Dlna/Images/logo240.png b/Emby.Dlna/Images/logo240.png index d229ed24cda26e5c65ac3fb8119908e887c21e76..64c8281299ec62baed2ba1722ae637783272885a 100644 GIT binary patch literal 18287 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 literal 6468 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 Vzk#?2l>hJNLr=$8yAEm_`G2J7e!Tzy diff --git a/Emby.Dlna/Images/logo48.jpg b/Emby.Dlna/Images/logo48.jpg index 9822a8e2f47754552233b6311d67d400971b3ba5..269bcf589435927a83309c9120ec2c4d02faf637 100644 GIT binary patch delta 1699 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 Hu0mjfe6QWW delta 911 zcmV;A191HM6Ql=_BYy*HNklu|V5VQ-;{s1!-KF0jQ?Z}{&nV~58lQ1(g z^PRvH_=YeuGZh$=UMUwXN5MRqy(JzQu0HUzSjXX;>X%7+fc_db~oo&jFKKcgh z6rN8>=DlYpjxuV3t%yx+R=bOg)|wUv~8IsF8=S`}_XvwvRV4bApQwv>NB#9K+Xl>bMzsn;dk z)EjIkA6K#?EvroQNrJ6JtYiV(z1f|85@s-sL+Sxpk zw&Lyq_&-0s^7^QfhhcQz(5Wo1o9uu#LWPNJa4Y~OQ`F#Cu6aj3ZXu##otzevr3mu3 zxqrp_li%dCXg!kaO#+*I?+}^ua$6gxY>tI_?+X@+A`5Zy=+FPH111|yV@{HTUCdO-M?Q|WL&YH$)5 l&`hNk9xuq6LC5Uz5gc=dP@FKM&Hw-a00>D%PDHLkV1oWquw4KE From 1c326fe7d4367a2cfb91ea11e6440da11c346744 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 6 Jan 2019 22:46:52 -0500 Subject: [PATCH 027/140] Download ffmpeg in a separate layer This slightly speeds up rebuilding since the ffmpeg layer cache is used even when Jellyfin source is changed. --- Dockerfile | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ac8d48e57..75700e6f52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,15 @@ 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 . . @@ -7,17 +17,12 @@ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ && dotnet clean \ && dotnet publish --configuration release --output /jellyfin + 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 \ && apt install -y libfontconfig1 # needed for Skia - ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config From e1379610e588d6226e50149942bd8589a2c0bb08 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 7 Jan 2019 16:58:33 +0100 Subject: [PATCH 028/140] Ground work to get plugins functional again --- MediaBrowser.Common/MediaBrowser.Common.csproj | 5 +++++ MediaBrowser.Controller/MediaBrowser.Controller.csproj | 5 +++++ MediaBrowser.Model/MediaBrowser.Model.csproj | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index f625a17eef..a485fa8be0 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -1,5 +1,10 @@  + + Jellyfin Contributors + Jellyfin.Common + + diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 4567f62dd5..3decbc42f7 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -1,5 +1,10 @@  + + Jellyfin Contributors + Jellyfin.Controller + + diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index fe10688426..e223f2cc81 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -1,5 +1,10 @@  + + Jellyfin Contributors + Jellyfin.Model + + netstandard2.0 false From 1f5b9a04fb42a31f0f218cd2a529d8aa69c4b440 Mon Sep 17 00:00:00 2001 From: Sparky Date: Mon, 7 Jan 2019 11:19:46 -0500 Subject: [PATCH 029/140] Open log files in browser again Fixes #485 Looks like we regressed and now only the .txt logs would open in the browser when clicked. Added in MimeType handler for .log files. Problem solved. --- MediaBrowser.Model/Net/MimeTypes.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index d66d62fea2..de35c5e120 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -183,6 +183,10 @@ namespace MediaBrowser.Model.Net { return "text/plain"; } + if (StringHelper.EqualsIgnoreCase(ext, ".log")) + { + return "text/plain"; + } if (StringHelper.EqualsIgnoreCase(ext, ".xml")) { return "application/xml"; From ae4a82570cda3cede46e8cc006a2e3c524d9d485 Mon Sep 17 00:00:00 2001 From: Sparky Date: Mon, 7 Jan 2019 11:23:11 -0500 Subject: [PATCH 030/140] Fixed odd formatting in MimeType.CS Think there might have been a mismatch between tabs and spaces. All spaces now. --- MediaBrowser.Model/Net/MimeTypes.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index d66d62fea2..8f0a99ebd8 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -228,10 +228,10 @@ namespace MediaBrowser.Model.Net if (StringHelper.EqualsIgnoreCase(ext, ".oga")) { return "audio/ogg"; - } - if (StringHelper.EqualsIgnoreCase(ext, ".opus")) - { - return "audio/ogg"; + } + if (StringHelper.EqualsIgnoreCase(ext, ".opus")) + { + return "audio/ogg"; } if (StringHelper.EqualsIgnoreCase(ext, ".ac3")) { From 672e635742955222b39757ce94e9478e843ec3b4 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 7 Jan 2019 18:39:35 +0100 Subject: [PATCH 031/140] Remove unused resource --- Emby.Server.Implementations/Emby.Server.Implementations.csproj | 1 - Emby.Server.Implementations/values.txt | 0 2 files changed, 1 deletion(-) delete mode 100644 Emby.Server.Implementations/values.txt diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 2415050198..da3a4da073 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -45,7 +45,6 @@ - diff --git a/Emby.Server.Implementations/values.txt b/Emby.Server.Implementations/values.txt deleted file mode 100644 index e69de29bb2..0000000000 From cbff18edb5ce0921cad626264708e3de4ebe0832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Mon, 7 Jan 2019 18:51:37 +0100 Subject: [PATCH 032/140] Add logging and config directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.env | 6 ++++-- rpm-package/jellyfin.service | 2 +- rpm-package/jellyfin.spec | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rpm-package/jellyfin.env b/rpm-package/jellyfin.env index 2e2b2ba8e5..827a33f468 100644 --- a/rpm-package/jellyfin.env +++ b/rpm-package/jellyfin.env @@ -17,8 +17,10 @@ # Tell jellyfin wich ffmpeg/ffprobe to use # JELLYFIN_FFMPEG="-ffmpeg /usr/bin/ffmpeg -ffprobe /usr/bin/ffprobe" -# Data directory -JELLYFIN_DATA="/var/lib/jellyfin" +# Program directories +JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin" +JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin" +JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin" # In-App service control JELLYFIN_RESTART_OPT="-restartpath /usr/libexec/jellyfin/restart.sh" # Additional options for the binary diff --git a/rpm-package/jellyfin.service b/rpm-package/jellyfin.service index 26d82a825f..0ece5b57f4 100644 --- a/rpm-package/jellyfin.service +++ b/rpm-package/jellyfin.service @@ -5,7 +5,7 @@ Description=Jellyfin is a free software media system that puts you in control of [Service] EnvironmentFile=/etc/sysconfig/jellyfin WorkingDirectory=/var/lib/jellyfin -ExecStart=/usr/bin/jellyfin -programdata ${JELLYFIN_DATA} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_ADD_OPTS} ${JELLYFIN_FFMPEG} +ExecStart=/usr/bin/jellyfin -programdata ${JELLYFIN_DATA_DIRECTORY} -configdir ${JELLYFIN_CONFIG_DIRECTORY} -logdir ${JELLYFIN_LOG_DIRECTORY} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_ADD_OPTS} ${JELLYFIN_FFMPEG} TimeoutSec=15 Restart=on-failure User=jellyfin diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index 5b53bd005e..a7619ea05c 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -62,12 +62,16 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime linux-x64 %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE %{__install} -D -m 0644 debian/conf/jellyfin.service.conf %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%{__install} -D -m 0644 debian/conf/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json %{__mkdir} -p %{buildroot}%{_bindir} tee %{buildroot}%{_bindir}/jellyfin << EOF #!/bin/sh exec %{_libdir}/%{name}/%{name} \${@} EOF %{__mkdir} -p %{buildroot}%{_sharedstatedir}/jellyfin +%{__mkdir} -p %{buildroot}%{_sysconfdir}/%{name} +%{__mkdir} -p %{buildroot}%{_var}/log/jellyfin + %{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service %{__install} -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{__install} -D -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/%{name}-sudoers @@ -90,10 +94,13 @@ EOF %attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh %attr(750,root,root) %{_libexecdir}/%{name}/restart.sh %attr(644,root,root) %{_prefix}/lib/firewalld/service/%{name}.xml +%attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf +%config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json %attr(-,jellyfin,jellyfin) %dir %{_sharedstatedir}/jellyfin +%attr(-,jellyfin,jellyfin) %dir %{_var}/log/jellyfin %if 0%{?fedora} %license LICENSE %else @@ -117,8 +124,9 @@ exit 0 %systemd_postun_with_restart jellyfin.service %changelog -* Sat Jan 05 2019 Thomas Büttner - 10.0.0-1 +* Mon Jan 07 2019 Thomas Büttner - 10.0.0-1 - Bump version to 10.0.0 +- Add logging and config directories * Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 - Add firewalld service.xml From 0e455b0f6232751d72580b5454303cfaee371aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Mon, 7 Jan 2019 19:28:04 +0100 Subject: [PATCH 033/140] fixed restart.sh permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index a7619ea05c..c55d1d2605 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -92,7 +92,7 @@ EOF %attr(644,root,root) %{_libdir}/%{name}/sosdocsunix.txt %attr(644,root,root) %{_unitdir}/%{name}.service %attr(755,root,root) %{_datadir}/%{name}/update-db-paths.sh -%attr(750,root,root) %{_libexecdir}/%{name}/restart.sh +%attr(755,root,root) %{_libexecdir}/%{name}/restart.sh %attr(644,root,root) %{_prefix}/lib/firewalld/service/%{name}.xml %attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name} From 880825514a0d1f255699ce69783847374179c9a9 Mon Sep 17 00:00:00 2001 From: hawken Date: Mon, 7 Jan 2019 21:10:11 +0000 Subject: [PATCH 034/140] Fix regression where it would do integer divisions, giving wrong result --- MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 2 +- MediaBrowser.Controller/Entities/Movies/Movie.cs | 2 +- MediaBrowser.Controller/Entities/TV/Episode.cs | 2 +- MediaBrowser.Controller/Entities/Trailer.cs | 2 +- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index e888a55825..51fb73df7a 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.Entities.Movies } public override double GetDefaultPrimaryImageAspectRatio() - => 2 / 3; + => 2.0 / 3; public override UnratedItem GetBlockUnratedType() { diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 4f743991bc..1d7e1cff19 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.Controller.Entities.Movies return 0; } - return 2 / 3; + return 2.0 / 3; } protected override async Task RefreshedOwnedItems(MetadataRefreshOptions options, List fileSystemChildren, CancellationToken cancellationToken) diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 00e055c51a..0a367c5948 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -111,7 +111,7 @@ namespace MediaBrowser.Controller.Entities.TV return 0; } - return 16 / 9; + return 16.0 / 9; } public override List GetUserDataKeys() diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 2ef268ed18..d84ac187b0 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.Entities public TrailerType[] TrailerTypes { get; set; } public override double GetDefaultPrimaryImageAspectRatio() - => 2 / 3; + => 2.0 / 3; public override UnratedItem GetBlockUnratedType() { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 4dc6c75173..c4a75d1999 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -54,11 +54,11 @@ namespace MediaBrowser.Controller.LiveTv if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase)) { - return 2 / 3; + return 2.0 / 3; } else { - return 16 / 9; + return 16.0 / 9; } } From 82a801c9ae0d7a5074ad0003d1aa5c2154da9382 Mon Sep 17 00:00:00 2001 From: hawken Date: Mon, 7 Jan 2019 21:16:38 +0000 Subject: [PATCH 035/140] Some less obvious ones that I was told were there --- Emby.Server.Implementations/LiveTv/LiveTvManager.cs | 6 +++--- .../ScheduledTasks/Tasks/DeleteLogFileTask.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index b597a935a2..a81a0bcbb7 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1056,7 +1056,7 @@ namespace Emby.Server.Implementations.LiveTv var numComplete = 0; double progressPerService = _services.Length == 0 ? 0 - : 1 / _services.Length; + : 1.0 / _services.Length; var newChannelIdList = new List(); var newProgramIdList = new List(); @@ -1262,7 +1262,7 @@ namespace Emby.Server.Implementations.LiveTv } numComplete++; - double percent = numComplete / allChannelsList.Count; + double percent = numComplete / (double) allChannelsList.Count; progress.Report(85 * percent + 15); } @@ -1307,7 +1307,7 @@ namespace Emby.Server.Implementations.LiveTv } numComplete++; - double percent = numComplete / list.Count; + double percent = numComplete / (double) list.Count; progress.Report(100 * percent); } diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs index b754d7cb52..95395f96c2 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs @@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks foreach (var file in filesToDelete) { - double percent = index / filesToDelete.Count; + double percent = index / (double) filesToDelete.Count; progress.Report(100 * percent); From ba1794f64bb1959b3af0fbbddca57df14a5544a9 Mon Sep 17 00:00:00 2001 From: hawken Date: Mon, 7 Jan 2019 23:24:34 +0000 Subject: [PATCH 036/140] Remove tabs and trailing whitespace --- .../Archiving/ZipClient.cs | 18 +- .../Devices/DeviceId.cs | 16 +- .../Net/SocketFactory.cs | 4 +- Emby.Server.Implementations/Net/UdpSocket.cs | 2 +- .../Networking/IPNetwork/IPNetwork.cs | 54 +- .../Core/CharDistributionAnalyser.cs | 147 ++-- .../XmlTvReaderLanguageTests.cs | 31 +- Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs | 64 +- Jellyfin.Server/SocketSharp/RequestMono.cs | 14 +- MediaBrowser.Api/Images/ImageByNameService.cs | 20 +- .../MediaEncoding/EncodingHelper.cs | 5 +- .../Net/IHttpResultFactory.cs | 10 +- MediaBrowser.Model/Dlna/DlnaFlags.cs | 36 +- MediaBrowser.Model/Net/ISocketFactory.cs | 15 +- MediaBrowser.Model/Net/SocketReceiveResult.cs | 18 +- MediaBrowser.Model/Services/HttpUtility.cs | 786 +++++++----------- MediaBrowser.Model/Services/RouteAttribute.cs | 114 +-- .../BoxSets/MovieDbBoxSetProvider.cs | 2 +- .../Manager/ProviderManager.cs | 2 +- .../Movies/FanartMovieImageProvider.cs | 4 +- .../Music/AudioDbAlbumProvider.cs | 2 +- .../TV/FanArt/FanartSeriesProvider.cs | 2 +- .../TV/TheMovieDb/MovieDbProviderBase.cs | 2 +- .../TV/TheMovieDb/MovieDbSeasonProvider.cs | 2 +- .../TV/TheTVDB/TvdbEpisodeImageProvider.cs | 16 +- .../TV/TheTVDB/TvdbEpisodeProvider.cs | 2 +- .../Savers/SeasonNfoSaver.cs | 12 +- Mono.Nat/AbstractNatDevice.cs | 35 +- Mono.Nat/Enums/ProtocolType.cs | 16 +- Mono.Nat/EventArgs/DeviceEventArgs.cs | 34 +- Mono.Nat/INatDevice.cs | 18 +- Mono.Nat/Mapping.cs | 150 ++-- Mono.Nat/Pmp/PmpConstants.cs | 52 +- Mono.Nat/Pmp/PmpSearcher.cs | 10 +- Mono.Nat/Upnp/Searchers/UpnpSearcher.cs | 20 +- OpenSubtitlesHandler/Utilities.cs | 2 +- RSSDP/DeviceAvailableEventArgs.cs | 79 +- RSSDP/DeviceEventArgs.cs | 62 +- RSSDP/DeviceUnavailableEventArgs.cs | 82 +- RSSDP/DiscoveredSsdpDevice.cs | 134 +-- RSSDP/DisposableManagedObjectBase.cs | 72 +- RSSDP/HttpRequestParser.cs | 124 +-- RSSDP/HttpResponseParser.cs | 127 ++- RSSDP/IEnumerableExtensions.cs | 36 +- RSSDP/ISsdpDeviceLocator.cs | 242 +++--- RSSDP/ISsdpDevicePublisher.cs | 57 +- RSSDP/RequestReceivedEventArgs.cs | 80 +- RSSDP/ResponseReceivedEventArgs.cs | 69 +- RSSDP/SsdpCommunicationsServer.cs | 31 +- RSSDP/SsdpConstants.cs | 100 +-- RSSDP/SsdpDevice.cs | 4 +- RSSDP/SsdpDevicePublisher.cs | 8 +- RSSDP/SsdpEmbeddedDevice.cs | 84 +- RSSDP/SsdpRootDevice.cs | 114 ++- SocketHttpListener/Net/ChunkStream.cs | 6 +- SocketHttpListener/Net/ChunkedInputStream.cs | 2 +- .../Net/HttpListenerResponse.Managed.cs | 14 +- .../Net/HttpRequestStream.Managed.cs | 6 +- SocketHttpListener/Net/HttpRequestStream.cs | 6 +- .../Net/HttpResponseStream.Managed.cs | 6 +- SocketHttpListener/Net/WebHeaderCollection.cs | 114 +-- 61 files changed, 1576 insertions(+), 1820 deletions(-) diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs index fd61f2617e..169e7af0a3 100644 --- a/Emby.Server.Implementations/Archiving/ZipClient.cs +++ b/Emby.Server.Implementations/Archiving/ZipClient.cs @@ -15,14 +15,14 @@ namespace Emby.Server.Implementations.Archiving ///
public class ZipClient : IZipClient { - private readonly IFileSystem _fileSystem; + private readonly IFileSystem _fileSystem; - public ZipClient(IFileSystem fileSystem) - { - _fileSystem = fileSystem; - } + public ZipClient(IFileSystem fileSystem) + { + _fileSystem = fileSystem; + } - /// + /// /// Extracts all. /// /// The source file. @@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Archiving /// if set to true [overwrite existing files]. 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 /// if set to true [overwrite existing files]. 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 /// if set to true [overwrite existing files]. 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); } diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 90cef5d06e..ce6bd67af9 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -10,8 +10,8 @@ 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(); @@ -26,7 +26,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 +57,7 @@ namespace Emby.Server.Implementations.Devices { var path = CachePath; - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); lock (_syncLock) { @@ -92,13 +92,13 @@ 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 ("fileSystem"); + } _appPaths = appPaths; _logger = logger; - _fileSystem = fileSystem; + _fileSystem = fileSystem; } public string Value diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs index 3f93e767fb..515f99f3cc 100644 --- a/Emby.Server.Implementations/Net/SocketFactory.cs +++ b/Emby.Server.Implementations/Net/SocketFactory.cs @@ -10,11 +10,11 @@ namespace Emby.Server.Implementations.Net { public class SocketFactory : ISocketFactory { - // THIS IS A LINKED FILE - SHARED AMONGST MULTIPLE PLATFORMS + // THIS IS A LINKED FILE - SHARED AMONGST MULTIPLE PLATFORMS // Be careful to check any changes compile and work for all platform projects it is shared in. // Not entirely happy with this. Would have liked to have done something more generic/reusable, - // but that wasn't really the point so kept to YAGNI principal for now, even if the + // but that wasn't really the point so kept to YAGNI principal for now, even if the // interfaces are a bit ugly, specific and make assumptions. private readonly ILogger _logger; diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.cs index 523ca3752a..8d5b671f28 100644 --- a/Emby.Server.Implementations/Net/UdpSocket.cs +++ b/Emby.Server.Implementations/Net/UdpSocket.cs @@ -8,7 +8,7 @@ using MediaBrowser.Model.Net; namespace Emby.Server.Implementations.Net { - // THIS IS A LINKED FILE - SHARED AMONGST MULTIPLE PLATFORMS + // THIS IS A LINKED FILE - SHARED AMONGST MULTIPLE PLATFORMS // Be careful to check any changes compile and work for all platform projects it is shared in. public sealed class UdpSocket : DisposableManagedObjectBase, ISocket diff --git a/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs b/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs index 8d0fb79971..da858e44e2 100644 --- a/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs +++ b/Emby.Server.Implementations/Networking/IPNetwork/IPNetwork.cs @@ -7,7 +7,7 @@ using System.Text.RegularExpressions; namespace System.Net { /// - /// IP Network utility class. + /// IP Network utility class. /// Use IPNetwork.Parse to create instances. /// public class IPNetwork : IComparable @@ -210,7 +210,7 @@ namespace System.Net /// /// 192.168.168.100 - 255.255.255.0 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -231,7 +231,7 @@ namespace System.Net /// /// 192.168.168.100/24 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -253,7 +253,7 @@ namespace System.Net /// /// 192.168.168.100 255.255.255.0 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -276,7 +276,7 @@ namespace System.Net /// /// 192.168.0.1/24 /// 192.168.0.1 255.255.255.0 - /// + /// /// Network : 192.168.0.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -303,7 +303,7 @@ namespace System.Net /// /// 192.168.168.100 - 255.255.255.0 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -329,7 +329,7 @@ namespace System.Net /// /// 192.168.168.100/24 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -354,7 +354,7 @@ namespace System.Net /// /// 192.168.0.1/24 /// 192.168.0.1 255.255.255.0 - /// + /// /// Network : 192.168.0.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -379,7 +379,7 @@ namespace System.Net /// /// 192.168.0.1/24 /// 192.168.0.1 255.255.255.0 - /// + /// /// Network : 192.168.0.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -409,7 +409,7 @@ namespace System.Net /// /// 192.168.168.100 - 255.255.255.0 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -520,7 +520,7 @@ namespace System.Net /// /// 192.168.168.100 255.255.255.0 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -578,7 +578,7 @@ namespace System.Net /// /// 192.168.168.100/24 - /// + /// /// Network : 192.168.168.0 /// Netmask : 255.255.255.0 /// Cidr : 24 @@ -962,7 +962,7 @@ namespace System.Net /// 20180217 lduchosal /// impossible to reach code, byte cannot be negative : - /// + /// /// if (cidr < 0) { /// if (tryParse == false) { /// throw new ArgumentOutOfRangeException("cidr"); @@ -1275,7 +1275,7 @@ namespace System.Net } /// - /// return true if ipaddress is contained in + /// return true if ipaddress is contained in /// IANA_ABLK_RESERVED1, IANA_BBLK_RESERVED1, IANA_CBLK_RESERVED1 /// /// @@ -1294,7 +1294,7 @@ namespace System.Net } /// - /// return true if ipnetwork is contained in + /// return true if ipnetwork is contained in /// IANA_ABLK_RESERVED1, IANA_BBLK_RESERVED1, IANA_CBLK_RESERVED1 /// /// @@ -1395,9 +1395,9 @@ namespace System.Net /// /// Supernet two consecutive cidr equal subnet into a single one - /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23 + /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23 /// 10.1.0.0/16 + 10.0.0.0/16 = 10.0.0.0/15 - /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24 + /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24 /// /// /// @@ -1410,9 +1410,9 @@ namespace System.Net /// /// Try to supernet two consecutive cidr equal subnet into a single one - /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23 + /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23 /// 10.1.0.0/16 + 10.0.0.0/16 = 10.0.0.0/15 - /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24 + /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24 /// /// /// @@ -1841,13 +1841,13 @@ namespace System.Net #region TryGuessCidr /// - /// - /// Class Leading bits Default netmask - /// A (CIDR /8) 00 255.0.0.0 - /// A (CIDR /8) 01 255.0.0.0 - /// B (CIDR /16) 10 255.255.0.0 - /// C (CIDR /24) 11 255.255.255.0 - /// + /// + /// Class Leading bits Default netmask + /// A (CIDR /8) 00 255.0.0.0 + /// A (CIDR /8) 01 255.0.0.0 + /// B (CIDR /16) 10 255.255.0.0 + /// C (CIDR /24) 11 255.255.255.0 + /// /// /// /// @@ -1931,7 +1931,7 @@ namespace System.Net /** * Need a better way to do it - * + * #region TrySubstractNetwork public static bool TrySubstractNetwork(IPNetwork[] ipnetworks, IPNetwork substract, out IEnumerable result) { diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs index 8b5bc37d3a..da59959327 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharDistributionAnalyser.cs @@ -38,12 +38,11 @@ namespace UniversalDetector.Core { /// - /// Base class for the Character Distribution Method, used for + /// Base class for the Character Distribution Method, used for /// the CJK encodings /// public abstract class CharDistributionAnalyser { - protected const float SURE_YES = 0.99f; protected const float SURE_NO = 0.01f; protected const int MINIMUM_DATA_THRESHOLD = 4; @@ -57,19 +56,19 @@ namespace UniversalDetector.Core //Total character encounted. protected int totalChars; - + // Mapping table to get frequency order from char order (get from GetOrder()) protected int[] charToFreqOrder; // Size of above table protected int tableSize; - //This is a constant value varies from language to language, it is used - // in calculating confidence. - protected float typicalDistributionRatio; + //This is a constant value varies from language to language, it is used + // in calculating confidence. + protected float typicalDistributionRatio; public CharDistributionAnalyser() - { + { Reset(); } @@ -77,10 +76,10 @@ namespace UniversalDetector.Core /// Feed a block of data and do distribution analysis /// /// - //public abstract void HandleData(byte[] buf, int offset, int len); - + //public abstract void HandleData(byte[] buf, int offset, int len); + /// - /// we do not handle character base on its original encoding string, but + /// we do not handle character base on its original encoding string, but /// convert this encoding string to a number, here called order. /// This allow multiple encoding of a language to share one frequency table /// @@ -88,9 +87,9 @@ namespace UniversalDetector.Core /// /// public abstract int GetOrder(byte[] buf, int offset); - + /// - /// Feed a character with known length + /// Feed a character with known length /// /// A /// buf offset @@ -107,13 +106,13 @@ namespace UniversalDetector.Core } } - public virtual void Reset() + public virtual void Reset() { done = false; totalChars = 0; freqChars = 0; } - + /// /// return confidence base on received data /// @@ -133,16 +132,16 @@ namespace UniversalDetector.Core //normalize confidence, (we don't want to be 100% sure) return SURE_YES; } - + //It is not necessary to receive all data to draw conclusion. For charset detection, // certain amount of data is enough - public bool GotEnoughData() + public bool GotEnoughData() { return totalChars > ENOUGH_DATA_THRESHOLD; } } - + public class GB18030DistributionAnalyser : CharDistributionAnalyser { // GB2312 most frequently used character table @@ -155,7 +154,7 @@ namespace UniversalDetector.Core * * Idea Distribution Ratio = 0.79135/(1-0.79135) = 3.79 * Random Distribution Ration = 512 / (3755 - 512) = 0.157 - * + * * Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR *****************************************************************************/ @@ -400,8 +399,8 @@ namespace UniversalDetector.Core 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189, 852,1221,1400,1486, 882,2299,4036, 351, 28,1122, 700,6479,6480,6481,6482,6483, //last 512 - /*************************************************************************************** - *Everything below is of no interest for detection purpose * + /*************************************************************************************** + *Everything below is of no interest for detection purpose * *************************************************************************************** 5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636, @@ -601,7 +600,7 @@ namespace UniversalDetector.Core tableSize = GB2312_TABLE_SIZE; typicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO; } - + /// /// for GB2312 encoding, we are interested /// first byte range: 0xb0 -- 0xfe @@ -609,20 +608,20 @@ namespace UniversalDetector.Core /// no validation needed here. State machine has done that /// /// - public override int GetOrder(byte[] buf, int offset) - { - if (buf[offset] >= 0xB0 && buf[offset+1] >= 0xA1) + public override int GetOrder(byte[] buf, int offset) + { + if (buf[offset] >= 0xB0 && buf[offset+1] >= 0xA1) return 94 * (buf[offset] - 0xb0) + buf[offset+1] - 0xA1; else return -1; } } - + public class EUCTWDistributionAnalyser : CharDistributionAnalyser { // EUCTW frequency table - // Converted from big5 work - // by Taiwan's Mandarin Promotion Council + // Converted from big5 work + // by Taiwan's Mandarin Promotion Council // /****************************************************************************** * 128 --> 0.42261 @@ -633,7 +632,7 @@ namespace UniversalDetector.Core * * Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98 * Random Distribution Ration = 512/(5401-512)=0.105 - * + * * Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR *****************************************************************************/ @@ -979,8 +978,8 @@ namespace UniversalDetector.Core 890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114, 941, // 8086 2294, 208,3499,4057,2019, 330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118, // 8102 - /*************************************************************************************** - *Everything below is of no interest for detection purpose * + /*************************************************************************************** + *Everything below is of no interest for detection purpose * *************************************************************************************** 2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122, // 8118 @@ -1022,7 +1021,7 @@ namespace UniversalDetector.Core 8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693, // 8694 8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709, // 8710 8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725, // 8726 - 8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741, // 8742 //13973 + 8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741, // 8742 //13973 ****************************************************************************************/ }; @@ -1038,15 +1037,15 @@ namespace UniversalDetector.Core /// second byte range: 0xa1 -- 0xfe /// no validation needed here. State machine has done that /// - public override int GetOrder(byte[] buf, int offset) - { - if (buf[offset] >= 0xC4) + public override int GetOrder(byte[] buf, int offset) + { + if (buf[offset] >= 0xC4) return 94 * (buf[offset] - 0xC4) + buf[offset+1] - 0xA1; else return -1; } } - + public class EUCKRDistributionAnalyser : CharDistributionAnalyser { // Sampling from about 20M text materials include literature and computer technology @@ -1215,8 +1214,8 @@ namespace UniversalDetector.Core 2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042, 670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, //512, 256 - /*************************************************************************************** - * Everything below is of no interest for detection purpose + /*************************************************************************************** + * Everything below is of no interest for detection purpose * *************************************************************************************** 2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658, @@ -1619,32 +1618,32 @@ namespace UniversalDetector.Core 8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719, 8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735, 8736,8737,8738,8739,8740,8741 */ }; - + public EUCKRDistributionAnalyser() { charToFreqOrder = EUCKR_CHAR2FREQ_ORDER; tableSize = EUCKR_TABLE_SIZE; - typicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO; + typicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO; } - + /// /// first byte range: 0xb0 -- 0xfe /// second byte range: 0xa1 -- 0xfe /// no validation needed here. State machine has done that /// - public override int GetOrder(byte[] buf, int offset) - { - if (buf[offset] >= 0xB0) + public override int GetOrder(byte[] buf, int offset) + { + if (buf[offset] >= 0xB0) return 94 * (buf[offset] - 0xB0) + buf[offset+1] - 0xA1; else return -1; } } - + public class BIG5DistributionAnalyser : CharDistributionAnalyser { // Big5 frequency table - // by Taiwan's Mandarin Promotion Council + // by Taiwan's Mandarin Promotion Council // /****************************************************************************** * 128 --> 0.42261 @@ -1655,7 +1654,7 @@ namespace UniversalDetector.Core * * Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98 * Random Distribution Ration = 512/(5401-512)=0.105 - * + * * Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR *****************************************************************************/ @@ -2001,8 +2000,8 @@ namespace UniversalDetector.Core 890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795, 941, // 5360 2299, 208,3546,4161,2020, 330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798, // 5376 //last 512 - /*************************************************************************************** - *Everything below is of no interest for detection purpose * + /*************************************************************************************** + *Everything below is of no interest for detection purpose * *************************************************************************************** 2522,1613,4812,5799,3345,3945,2523,5800,4162,5801,1637,4163,2471,4813,3946,5802, // 5392 @@ -2545,29 +2544,29 @@ namespace UniversalDetector.Core 13968,13969,13970,13971,13972, //13973 ****************************************************************************************/ }; - + public BIG5DistributionAnalyser() { charToFreqOrder = BIG5_CHAR2FREQ_ORDER; tableSize = BIG5_TABLE_SIZE; - typicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO; + typicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO; } - + /// /// first byte range: 0xa4 -- 0xfe /// second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe /// no validation needed here. State machine has done that /// - public override int GetOrder(byte[] buf, int offset) - { + public override int GetOrder(byte[] buf, int offset) + { if (buf[offset] >= 0xA4) { if (buf[offset+1] >= 0xA1) return 157 * (buf[offset] - 0xA4) + buf[offset+1] - 0xA1 + 63; else return 157 * (buf[offset] - 0xA4) + buf[offset+1] - 0x40; } else { - return -1; - } + return -1; + } } } @@ -2575,7 +2574,7 @@ namespace UniversalDetector.Core { //Sampling from about 20M text materials include literature and computer technology // Japanese frequency table, applied to both S-JIS and EUC-JP - //They are sorted in order. + //They are sorted in order. /****************************************************************************** * 128 --> 0.77094 @@ -2586,8 +2585,8 @@ namespace UniversalDetector.Core * * Idea Distribution Ratio = 0.92635 / (1-0.92635) = 12.58 * Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191 - * - * Typical Distribution Ratio, 25% of IDR + * + * Typical Distribution Ratio, 25% of IDR *****************************************************************************/ protected static float SJIS_TYPICAL_DISTRIBUTION_RATIO = 3.0f; @@ -2869,8 +2868,8 @@ namespace UniversalDetector.Core 1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, // 4352 2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, // 4368 //last 512 - /*************************************************************************************** - *Everything below is of no interest for detection purpose * + /*************************************************************************************** + *Everything below is of no interest for detection purpose * *************************************************************************************** 2138,2122,3730,2888,1995,1820,1044,6190,6191,6192,6193,6194,6195,6196,6197,6198, // 4384 @@ -3118,31 +3117,31 @@ namespace UniversalDetector.Core 8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255, // 8256 8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271, // 8272 ****************************************************************************************/ - }; + }; public SJISDistributionAnalyser() { charToFreqOrder = SJIS_CHAR2FREQ_ORDER; tableSize = SJIS_TABLE_SIZE; - typicalDistributionRatio = SJIS_TYPICAL_DISTRIBUTION_RATIO; + typicalDistributionRatio = SJIS_TYPICAL_DISTRIBUTION_RATIO; } - + /// /// first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe /// second byte range: 0x40 -- 0x7e, 0x81 -- oxfe /// no validation needed here. State machine has done that /// - public override int GetOrder(byte[] buf, int offset) - { + public override int GetOrder(byte[] buf, int offset) + { int order = 0; - - if (buf[offset] >= 0x81 && buf[offset] <= 0x9F) + + if (buf[offset] >= 0x81 && buf[offset] <= 0x9F) order = 188 * (buf[offset] - 0x81); - else if (buf[offset] >= 0xE0 && buf[offset] <= 0xEF) + else if (buf[offset] >= 0xE0 && buf[offset] <= 0xEF) order = 188 * (buf[offset] - 0xE0 + 31); else return -1; order += buf[offset+1] - 0x40; - + if (buf[offset+1] > 0x7F) order--; return order; @@ -3154,20 +3153,18 @@ namespace UniversalDetector.Core public EUCJPDistributionAnalyser() : base() { } - + /// /// first byte range: 0xa0 -- 0xfe /// second byte range: 0xa1 -- 0xfe /// no validation needed here. State machine has done that /// - public override int GetOrder(byte[] buf, int offset) - { - if (buf[offset] >= 0xA0) + public override int GetOrder(byte[] buf, int offset) + { + if (buf[offset] >= 0xA0) return 94 * (buf[offset] - 0xA1) + buf[offset+1] - 0xA1; else return -1; } } - - } diff --git a/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderLanguageTests.cs b/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderLanguageTests.cs index 489e16ee6d..77dabe13e3 100644 --- a/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderLanguageTests.cs +++ b/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderLanguageTests.cs @@ -12,23 +12,22 @@ namespace Emby.XmlTv.Test [TestClass] public class XmlTvReaderLanguageTests { - /* - Homes Under the Hammer - Spanish - Homes Under the Hammer - Spanish 2 - Homes Under the Hammer - English - Homes Under the Hammer - English 2 - Homes Under the Hammer - Empty Language - Homes Under the Hammer - Empty Language 2 - Homes Under the Hammer - No Language - Homes Under the Hammer - No Language 2 - */ + /* Homes Under the Hammer - Spanish + * Homes Under the Hammer - Spanish 2 + * Homes Under the Hammer - English + * Homes Under the Hammer - English 2 + * Homes Under the Hammer - Empty Language + * Homes Under the Hammer - Empty Language 2 + * Homes Under the Hammer - No Language + * Homes Under the Hammer - No Language 2 + */ - /* Expected Behaviour: - - Language = Null Homes Under the Hammer - No Language - - Language = "" Homes Under the Hammer - No Language - - Language = es Homes Under the Hammer - Spanish - - Language = en Homes Under the Hammer - English - */ + /* Expected Behaviour: + * - Language = Null Homes Under the Hammer - No Language + * - Language = "" Homes Under the Hammer - No Language + * - Language = es Homes Under the Hammer - Spanish + * - Language = en Homes Under the Hammer - English + */ [TestMethod] [DeploymentItem("Xml Files\\MultilanguageData.xml")] diff --git a/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs b/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs index d96c391fb0..72f1630b78 100644 --- a/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs +++ b/Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs @@ -580,7 +580,7 @@ namespace Emby.XmlTv.Classes public void ParseEpisodeDataForOnScreen(XmlReader reader, XmlTvProgram result) { - //// example: 'Episode #FFEE' + //// example: 'Episode #FFEE' //serEpNum = ConvertHTMLToAnsi(nodeEpisodeNum); //int num1 = serEpNum.IndexOf("#", 0); //if (num1 < 0) num1 = 0; @@ -832,23 +832,22 @@ namespace Emby.XmlTv.Classes public void ProcessNode(XmlReader reader, Action setter, string languageRequired = null, Action allOccurrencesSetter = null) { - /* - Homes Under the Hammer - Spanish - Homes Under the Hammer - Spanish 2 - Homes Under the Hammer - English - Homes Under the Hammer - English 2 - Homes Under the Hammer - Empty Language - Homes Under the Hammer - Empty Language 2 - Homes Under the Hammer - No Language - Homes Under the Hammer - No Language 2 - */ + /* Homes Under the Hammer - Spanish + * Homes Under the Hammer - Spanish 2 + * Homes Under the Hammer - English + * Homes Under the Hammer - English 2 + * Homes Under the Hammer - Empty Language + * Homes Under the Hammer - Empty Language 2 + * Homes Under the Hammer - No Language + * Homes Under the Hammer - No Language 2 + */ - /* Expected Behaviour: - - Language = Null Homes Under the Hammer - No Language - - Language = "" Homes Under the Hammer - No Language - - Language = es Homes Under the Hammer - Spanish - - Language = en Homes Under the Hammer - English - */ + /* Expected Behaviour: + * - Language = Null Homes Under the Hammer - No Language + * - Language = "" Homes Under the Hammer - No Language + * - Language = es Homes Under the Hammer - Spanish + * - Language = en Homes Under the Hammer - English + */ var results = new List>(); @@ -921,23 +920,22 @@ namespace Emby.XmlTv.Classes public void ProcessMultipleNodes(XmlReader reader, Action setter, string languageRequired = null) { - /* - Property - English - Property - English 2 - Property - Spanish - Property - Spanish 2 - Property - Empty Language - Property - Empty Language 2 - Property - No Language - Property - No Language 2 - */ + /* Property - English + * Property - English 2 + * Property - Spanish + * Property - Spanish 2 + * Property - Empty Language + * Property - Empty Language 2 + * Property - No Language + * Property - No Language 2 + */ - /* Expected Behaviour: - - Language = Null Property - No Language / Property - No Language 2 - - Language = "" Property - Empty Language / Property - Empty Language 2 - - Language = es Property - Spanish / Property - Spanish 2 - - Language = en Property - English / Property - English 2 - */ + /* Expected Behaviour: + * - Language = Null Property - No Language / Property - No Language 2 + * - Language = "" Property - Empty Language / Property - Empty Language 2 + * - Language = es Property - Spanish / Property - Spanish 2 + * - Language = en Property - English / Property - English 2 + */ var currentElementName = reader.Name; var values = new[] { new { Language = reader.GetAttribute("lang"), Value = reader.ReadElementContentAsString() } }.ToList(); diff --git a/Jellyfin.Server/SocketSharp/RequestMono.cs b/Jellyfin.Server/SocketSharp/RequestMono.cs index 31f2894977..81ccef5507 100644 --- a/Jellyfin.Server/SocketSharp/RequestMono.cs +++ b/Jellyfin.Server/SocketSharp/RequestMono.cs @@ -97,12 +97,12 @@ namespace Jellyfin.SocketSharp } #if NET_4_0 - if (validateRequestNewMode && !checked_form) { - // Setting this before calling the validator prevents - // possible endless recursion - checked_form = true; - ValidateNameValueCollection ("Form", query_string_nvc, RequestValidationSource.Form); - } else + if (validateRequestNewMode && !checked_form) { + // Setting this before calling the validator prevents + // possible endless recursion + checked_form = true; + ValidateNameValueCollection ("Form", query_string_nvc, RequestValidationSource.Form); + } else #endif if (validate_form && !checked_form) { @@ -546,7 +546,7 @@ namespace Jellyfin.SocketSharp const byte HYPHEN = (byte)'-', LF = (byte)'\n', CR = (byte)'\r'; - // See RFC 2046 + // See RFC 2046 // In the case of multipart entities, in which one or more different // sets of data are combined in a single body, a "multipart" media type // field must appear in the entity's header. The body must then contain diff --git a/MediaBrowser.Api/Images/ImageByNameService.cs b/MediaBrowser.Api/Images/ImageByNameService.cs index 2100e9e91e..7d328a3739 100644 --- a/MediaBrowser.Api/Images/ImageByNameService.cs +++ b/MediaBrowser.Api/Images/ImageByNameService.cs @@ -133,7 +133,7 @@ namespace MediaBrowser.Api.Images { try { - return _fileSystem.GetFiles(path, BaseItem.SupportedImageExtensions, false, true) + return _fileSystem.GetFiles(path, BaseItem.SupportedImageExtensions, false, true) .Select(i => new ImageByNameInfo { Name = _fileSystem.GetFileNameWithoutExtension(i), @@ -185,7 +185,7 @@ namespace MediaBrowser.Api.Images var paths = BaseItem.SupportedImageExtensions.Select(i => Path.Combine(_appPaths.GeneralPath, request.Name, filename + i)).ToList(); - var path = paths.FirstOrDefault(_fileSystem.FileExists) ?? paths.FirstOrDefault(); + var path = paths.FirstOrDefault(_fileSystem.FileExists) ?? paths.FirstOrDefault(); return _resultFactory.GetStaticFileResult(Request, path); } @@ -199,11 +199,11 @@ namespace MediaBrowser.Api.Images { var themeFolder = Path.Combine(_appPaths.RatingsPath, request.Theme); - if (_fileSystem.DirectoryExists(themeFolder)) + if (_fileSystem.DirectoryExists(themeFolder)) { var path = BaseItem.SupportedImageExtensions .Select(i => Path.Combine(themeFolder, request.Name + i)) - .FirstOrDefault(_fileSystem.FileExists); + .FirstOrDefault(_fileSystem.FileExists); if (!string.IsNullOrEmpty(path)) { @@ -213,14 +213,14 @@ namespace MediaBrowser.Api.Images var allFolder = Path.Combine(_appPaths.RatingsPath, "all"); - if (_fileSystem.DirectoryExists(allFolder)) + if (_fileSystem.DirectoryExists(allFolder)) { // Avoid implicitly captured closure var currentRequest = request; var path = BaseItem.SupportedImageExtensions .Select(i => Path.Combine(allFolder, currentRequest.Name + i)) - .FirstOrDefault(_fileSystem.FileExists); + .FirstOrDefault(_fileSystem.FileExists); if (!string.IsNullOrEmpty(path)) { @@ -240,10 +240,10 @@ namespace MediaBrowser.Api.Images { var themeFolder = Path.Combine(_appPaths.MediaInfoImagesPath, request.Theme); - if (_fileSystem.DirectoryExists(themeFolder)) + if (_fileSystem.DirectoryExists(themeFolder)) { var path = BaseItem.SupportedImageExtensions.Select(i => Path.Combine(themeFolder, request.Name + i)) - .FirstOrDefault(_fileSystem.FileExists); + .FirstOrDefault(_fileSystem.FileExists); if (!string.IsNullOrEmpty(path)) { @@ -253,13 +253,13 @@ namespace MediaBrowser.Api.Images var allFolder = Path.Combine(_appPaths.MediaInfoImagesPath, "all"); - if (_fileSystem.DirectoryExists(allFolder)) + if (_fileSystem.DirectoryExists(allFolder)) { // Avoid implicitly captured closure var currentRequest = request; var path = BaseItem.SupportedImageExtensions.Select(i => Path.Combine(allFolder, currentRequest.Name + i)) - .FirstOrDefault(_fileSystem.FileExists); + .FirstOrDefault(_fileSystem.FileExists); if (!string.IsNullOrEmpty(path)) { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 4fb9a711e4..a6c437e62a 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -740,7 +740,7 @@ namespace MediaBrowser.Controller.MediaEncoding level = NormalizeTranscodingLevel(state.OutputVideoCodec, level); // h264_qsv and h264_nvenc expect levels to be expressed as a decimal. libx264 supports decimal and non-decimal format - // also needed for libx264 due to https://trac.ffmpeg.org/ticket/3307 + // also needed for libx264 due to https://trac.ffmpeg.org/ticket/3307 if (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase) || string.Equals(videoEncoder, "libx264", StringComparison.OrdinalIgnoreCase)) { @@ -1706,7 +1706,8 @@ namespace MediaBrowser.Controller.MediaEncoding if (string.Equals(outputVideoCodec, "libvpx", StringComparison.OrdinalIgnoreCase)) { // per docs: - // -threads number of threads to use for encoding, can't be 0 [auto] with VP8 (recommended value : number of real cores - 1) + // -threads number of threads to use for encoding, can't be 0 [auto] with VP8 + // (recommended value : number of real cores - 1) return Math.Max(Environment.ProcessorCount - 1, 1); } diff --git a/MediaBrowser.Controller/Net/IHttpResultFactory.cs b/MediaBrowser.Controller/Net/IHttpResultFactory.cs index f8e631de35..d23733f5e5 100644 --- a/MediaBrowser.Controller/Net/IHttpResultFactory.cs +++ b/MediaBrowser.Controller/Net/IHttpResultFactory.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Net object GetResult(IRequest requestContext, byte[] content, string contentType, IDictionary responseHeaders = null); object GetResult(IRequest requestContext, Stream content, string contentType, IDictionary responseHeaders = null); - object GetResult(IRequest requestContext, string content, string contentType, IDictionary responseHeaders = null); + object GetResult(IRequest requestContext, string content, string contentType, IDictionary responseHeaders = null); object GetRedirectResult(string url); @@ -43,10 +43,10 @@ namespace MediaBrowser.Controller.Net /// The response headers. /// if set to true [is head request]. /// System.Object. - Task GetStaticResult(IRequest requestContext, - Guid cacheKey, + Task GetStaticResult(IRequest requestContext, + Guid cacheKey, DateTime? lastDateModified, - TimeSpan? cacheDuration, + TimeSpan? cacheDuration, string contentType, Func> factoryFn, IDictionary responseHeaders = null, bool isHeadRequest = false); @@ -74,7 +74,7 @@ namespace MediaBrowser.Controller.Net /// The request context. /// The options. /// System.Object. - Task GetStaticFileResult(IRequest requestContext, + Task GetStaticFileResult(IRequest requestContext, StaticFileResultOptions options); } } diff --git a/MediaBrowser.Model/Dlna/DlnaFlags.cs b/MediaBrowser.Model/Dlna/DlnaFlags.cs index b981e8455c..28c93464d9 100644 --- a/MediaBrowser.Model/Dlna/DlnaFlags.cs +++ b/MediaBrowser.Model/Dlna/DlnaFlags.cs @@ -5,14 +5,14 @@ namespace MediaBrowser.Model.Dlna [Flags] public enum DlnaFlags : ulong { - /*! Background transfer mode. - For use with upload and download transfers to and from the server. - The primary difference between \ref DH_TransferMode_Interactive and - \ref DH_TransferMode_Bulk is that the latter assumes that the user - is not relying on the transfer for immediately rendering the content - and there are no issues with causing a buffer overflow if the - receiver uses TCP flow control to reduce total throughput. - */ + /*! Background transfer mode. + For use with upload and download transfers to and from the server. + The primary difference between \ref DH_TransferMode_Interactive and + \ref DH_TransferMode_Bulk is that the latter assumes that the user + is not relying on the transfer for immediately rendering the content + and there are no issues with causing a buffer overflow if the + receiver uses TCP flow control to reduce total throughput. + */ BackgroundTransferMode = 1 << 22, ByteBasedSeek = 1 << 29, @@ -21,10 +21,10 @@ namespace MediaBrowser.Model.Dlna DlnaV15 = 1 << 20, /*! Interactive transfer mode. - For best effort transfer of images and non-real-time transfers. - URIs with image content usually support \ref DH_TransferMode_Bulk too. - The primary difference between \ref DH_TransferMode_Interactive and - \ref DH_TransferMode_Bulk is that the former assumes that the + For best effort transfer of images and non-real-time transfers. + URIs with image content usually support \ref DH_TransferMode_Bulk too. + The primary difference between \ref DH_TransferMode_Interactive and + \ref DH_TransferMode_Bulk is that the former assumes that the transfer is intended for immediate rendering. */ InteractiveTransferMode = 1 << 23, @@ -35,14 +35,14 @@ namespace MediaBrowser.Model.Dlna SenderPaced = 1L << 31, SnIncrease = 1 << 26, - /*! Streaming transfer mode. - The server transmits at a throughput sufficient for real-time playback of - audio or video. URIs with audio or video often support the - \ref DH_TransferMode_Interactive and \ref DH_TransferMode_Bulk transfer modes. - The most well-known exception to this general claim is for live streams. + /*! Streaming transfer mode. + The server transmits at a throughput sufficient for real-time playback of + audio or video. URIs with audio or video often support the + \ref DH_TransferMode_Interactive and \ref DH_TransferMode_Bulk transfer modes. + The most well-known exception to this general claim is for live streams. */ StreamingTransferMode = 1 << 24, TimeBasedSeek = 1 << 30 } -} \ No newline at end of file +} diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs index 6a4b996007..2100aae2a3 100644 --- a/MediaBrowser.Model/Net/ISocketFactory.cs +++ b/MediaBrowser.Model/Net/ISocketFactory.cs @@ -7,14 +7,13 @@ namespace MediaBrowser.Model.Net /// Implemented by components that can create a platform specific UDP socket implementation, and wrap it in the cross platform interface. /// public interface ISocketFactory - { - - /// - /// Createa a new unicast socket using the specified local port number. - /// - /// The local port to bind to. - /// A implementation. - ISocket CreateUdpSocket(int localPort); + { + /// + /// Createa a new unicast socket using the specified local port number. + /// + /// The local port to bind to. + /// A implementation. + ISocket CreateUdpSocket(int localPort); ISocket CreateUdpBroadcastSocket(int localPort); diff --git a/MediaBrowser.Model/Net/SocketReceiveResult.cs b/MediaBrowser.Model/Net/SocketReceiveResult.cs index 483e2297b9..5a5004de67 100644 --- a/MediaBrowser.Model/Net/SocketReceiveResult.cs +++ b/MediaBrowser.Model/Net/SocketReceiveResult.cs @@ -5,16 +5,16 @@ namespace MediaBrowser.Model.Net /// Used by the sockets wrapper to hold raw data received from a UDP socket. /// public sealed class SocketReceiveResult - { - /// - /// The buffer to place received data into. - /// - public byte[] Buffer { get; set; } + { + /// + /// The buffer to place received data into. + /// + public byte[] Buffer { get; set; } - /// - /// The number of bytes received. - /// - public int ReceivedBytes { get; set; } + /// + /// The number of bytes received. + /// + public int ReceivedBytes { get; set; } /// /// The the data was received from. diff --git a/MediaBrowser.Model/Services/HttpUtility.cs b/MediaBrowser.Model/Services/HttpUtility.cs index f8fd968018..cafb9c3b25 100644 --- a/MediaBrowser.Model/Services/HttpUtility.cs +++ b/MediaBrowser.Model/Services/HttpUtility.cs @@ -9,516 +9,286 @@ namespace MediaBrowser.Model.Services { // Must be sorted static readonly long[] entities = new long[] { - (long)'A' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, - (long)'A' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'A' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'A' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'A' << 56 | (long)'l' << 48 | (long)'p' << 40 | (long)'h' << 32 | (long)'a' << 24, - (long)'A' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'g' << 24, - (long)'A' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'A' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'B' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'C' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'d' << 32 | (long)'i' << 24 | (long)'l' << 16, - (long)'C' << 56 | (long)'h' << 48 | (long)'i' << 40, - (long)'D' << 56 | (long)'a' << 48 | (long)'g' << 40 | (long)'g' << 32 | (long)'e' << 24 | (long)'r' << 16, - (long)'D' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'t' << 32 | (long)'a' << 24, - (long)'E' << 56 | (long)'T' << 48 | (long)'H' << 40, - (long)'E' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'E' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'E' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'E' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'E' << 56 | (long)'t' << 48 | (long)'a' << 40, - (long)'E' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'G' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'m' << 32 | (long)'a' << 24, - (long)'I' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'I' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'I' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'I' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'I' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'K' << 56 | (long)'a' << 48 | (long)'p' << 40 | (long)'p' << 32 | (long)'a' << 24, - (long)'L' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'b' << 32 | (long)'d' << 24 | (long)'a' << 16, - (long)'M' << 56 | (long)'u' << 48, - (long)'N' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'N' << 56 | (long)'u' << 48, - (long)'O' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, - (long)'O' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'O' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'O' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'O' << 56 | (long)'m' << 48 | (long)'e' << 40 | (long)'g' << 32 | (long)'a' << 24, - (long)'O' << 56 | (long)'m' << 48 | (long)'i' << 40 | (long)'c' << 32 | (long)'r' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'O' << 56 | (long)'s' << 48 | (long)'l' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'h' << 16, - (long)'O' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'O' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'P' << 56 | (long)'h' << 48 | (long)'i' << 40, - (long)'P' << 56 | (long)'i' << 48, - (long)'P' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24, - (long)'P' << 56 | (long)'s' << 48 | (long)'i' << 40, - (long)'R' << 56 | (long)'h' << 48 | (long)'o' << 40, - (long)'S' << 56 | (long)'c' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'o' << 24 | (long)'n' << 16, - (long)'S' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24, - (long)'T' << 56 | (long)'H' << 48 | (long)'O' << 40 | (long)'R' << 32 | (long)'N' << 24, - (long)'T' << 56 | (long)'a' << 48 | (long)'u' << 40, - (long)'T' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24, - (long)'U' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'U' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'U' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'U' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'U' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'X' << 56 | (long)'i' << 48, - (long)'Y' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'Y' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'Z' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'a' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'a' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'a' << 56 | (long)'c' << 48 | (long)'u' << 40 | (long)'t' << 32 | (long)'e' << 24, - (long)'a' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, - (long)'a' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'a' << 56 | (long)'l' << 48 | (long)'e' << 40 | (long)'f' << 32 | (long)'s' << 24 | (long)'y' << 16 | (long)'m' << 8, - (long)'a' << 56 | (long)'l' << 48 | (long)'p' << 40 | (long)'h' << 32 | (long)'a' << 24, - (long)'a' << 56 | (long)'m' << 48 | (long)'p' << 40, - (long)'a' << 56 | (long)'n' << 48 | (long)'d' << 40, - (long)'a' << 56 | (long)'n' << 48 | (long)'g' << 40, - (long)'a' << 56 | (long)'p' << 48 | (long)'o' << 40 | (long)'s' << 32, - (long)'a' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'g' << 24, - (long)'a' << 56 | (long)'s' << 48 | (long)'y' << 40 | (long)'m' << 32 | (long)'p' << 24, - (long)'a' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'a' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'b' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'b' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'b' << 56 | (long)'r' << 48 | (long)'v' << 40 | (long)'b' << 32 | (long)'a' << 24 | (long)'r' << 16, - (long)'b' << 56 | (long)'u' << 48 | (long)'l' << 40 | (long)'l' << 32, - (long)'c' << 56 | (long)'a' << 48 | (long)'p' << 40, - (long)'c' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'d' << 32 | (long)'i' << 24 | (long)'l' << 16, - (long)'c' << 56 | (long)'e' << 48 | (long)'d' << 40 | (long)'i' << 32 | (long)'l' << 24, - (long)'c' << 56 | (long)'e' << 48 | (long)'n' << 40 | (long)'t' << 32, - (long)'c' << 56 | (long)'h' << 48 | (long)'i' << 40, - (long)'c' << 56 | (long)'i' << 48 | (long)'r' << 40 | (long)'c' << 32, - (long)'c' << 56 | (long)'l' << 48 | (long)'u' << 40 | (long)'b' << 32 | (long)'s' << 24, - (long)'c' << 56 | (long)'o' << 48 | (long)'n' << 40 | (long)'g' << 32, - (long)'c' << 56 | (long)'o' << 48 | (long)'p' << 40 | (long)'y' << 32, - (long)'c' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'r' << 24, - (long)'c' << 56 | (long)'u' << 48 | (long)'p' << 40, - (long)'c' << 56 | (long)'u' << 48 | (long)'r' << 40 | (long)'r' << 32 | (long)'e' << 24 | (long)'n' << 16, - (long)'d' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'d' << 56 | (long)'a' << 48 | (long)'g' << 40 | (long)'g' << 32 | (long)'e' << 24 | (long)'r' << 16, - (long)'d' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'d' << 56 | (long)'e' << 48 | (long)'g' << 40, - (long)'d' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'t' << 32 | (long)'a' << 24, - (long)'d' << 56 | (long)'i' << 48 | (long)'a' << 40 | (long)'m' << 32 | (long)'s' << 24, - (long)'d' << 56 | (long)'i' << 48 | (long)'v' << 40 | (long)'i' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'e' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'e' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'e' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'e' << 56 | (long)'m' << 48 | (long)'p' << 40 | (long)'t' << 32 | (long)'y' << 24, - (long)'e' << 56 | (long)'m' << 48 | (long)'s' << 40 | (long)'p' << 32, - (long)'e' << 56 | (long)'n' << 48 | (long)'s' << 40 | (long)'p' << 32, - (long)'e' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'e' << 56 | (long)'q' << 48 | (long)'u' << 40 | (long)'i' << 32 | (long)'v' << 24, - (long)'e' << 56 | (long)'t' << 48 | (long)'a' << 40, - (long)'e' << 56 | (long)'t' << 48 | (long)'h' << 40, - (long)'e' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'e' << 56 | (long)'u' << 48 | (long)'r' << 40 | (long)'o' << 32, - (long)'e' << 56 | (long)'x' << 48 | (long)'i' << 40 | (long)'s' << 32 | (long)'t' << 24, - (long)'f' << 56 | (long)'n' << 48 | (long)'o' << 40 | (long)'f' << 32, - (long)'f' << 56 | (long)'o' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'l' << 24 | (long)'l' << 16, - (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'1' << 24 | (long)'2' << 16, - (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'1' << 24 | (long)'4' << 16, - (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'3' << 24 | (long)'4' << 16, - (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'l' << 24, - (long)'g' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'m' << 32 | (long)'a' << 24, - (long)'g' << 56 | (long)'e' << 48, - (long)'g' << 56 | (long)'t' << 48, - (long)'h' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'h' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'h' << 56 | (long)'e' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'t' << 24 | (long)'s' << 16, - (long)'h' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'l' << 32 | (long)'i' << 24 | (long)'p' << 16, - (long)'i' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'i' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'i' << 56 | (long)'e' << 48 | (long)'x' << 40 | (long)'c' << 32 | (long)'l' << 24, - (long)'i' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'i' << 56 | (long)'m' << 48 | (long)'a' << 40 | (long)'g' << 32 | (long)'e' << 24, - (long)'i' << 56 | (long)'n' << 48 | (long)'f' << 40 | (long)'i' << 32 | (long)'n' << 24, - (long)'i' << 56 | (long)'n' << 48 | (long)'t' << 40, - (long)'i' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'i' << 56 | (long)'q' << 48 | (long)'u' << 40 | (long)'e' << 32 | (long)'s' << 24 | (long)'t' << 16, - (long)'i' << 56 | (long)'s' << 48 | (long)'i' << 40 | (long)'n' << 32, - (long)'i' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'k' << 56 | (long)'a' << 48 | (long)'p' << 40 | (long)'p' << 32 | (long)'a' << 24, - (long)'l' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'l' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'b' << 32 | (long)'d' << 24 | (long)'a' << 16, - (long)'l' << 56 | (long)'a' << 48 | (long)'n' << 40 | (long)'g' << 32, - (long)'l' << 56 | (long)'a' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'l' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'l' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'i' << 32 | (long)'l' << 24, - (long)'l' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'l' << 56 | (long)'e' << 48, - (long)'l' << 56 | (long)'f' << 48 | (long)'l' << 40 | (long)'o' << 32 | (long)'o' << 24 | (long)'r' << 16, - (long)'l' << 56 | (long)'o' << 48 | (long)'w' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'t' << 16, - (long)'l' << 56 | (long)'o' << 48 | (long)'z' << 40, - (long)'l' << 56 | (long)'r' << 48 | (long)'m' << 40, - (long)'l' << 56 | (long)'s' << 48 | (long)'a' << 40 | (long)'q' << 32 | (long)'u' << 24 | (long)'o' << 16, - (long)'l' << 56 | (long)'s' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'l' << 56 | (long)'t' << 48, - (long)'m' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'r' << 32, - (long)'m' << 56 | (long)'d' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'h' << 24, - (long)'m' << 56 | (long)'i' << 48 | (long)'c' << 40 | (long)'r' << 32 | (long)'o' << 24, - (long)'m' << 56 | (long)'i' << 48 | (long)'d' << 40 | (long)'d' << 32 | (long)'o' << 24 | (long)'t' << 16, - (long)'m' << 56 | (long)'i' << 48 | (long)'n' << 40 | (long)'u' << 32 | (long)'s' << 24, - (long)'m' << 56 | (long)'u' << 48, - (long)'n' << 56 | (long)'a' << 48 | (long)'b' << 40 | (long)'l' << 32 | (long)'a' << 24, - (long)'n' << 56 | (long)'b' << 48 | (long)'s' << 40 | (long)'p' << 32, - (long)'n' << 56 | (long)'d' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'h' << 24, - (long)'n' << 56 | (long)'e' << 48, - (long)'n' << 56 | (long)'i' << 48, - (long)'n' << 56 | (long)'o' << 48 | (long)'t' << 40, - (long)'n' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'i' << 32 | (long)'n' << 24, - (long)'n' << 56 | (long)'s' << 48 | (long)'u' << 40 | (long)'b' << 32, - (long)'n' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'n' << 56 | (long)'u' << 48, - (long)'o' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'o' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'o' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, - (long)'o' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'o' << 56 | (long)'l' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'e' << 24, - (long)'o' << 56 | (long)'m' << 48 | (long)'e' << 40 | (long)'g' << 32 | (long)'a' << 24, - (long)'o' << 56 | (long)'m' << 48 | (long)'i' << 40 | (long)'c' << 32 | (long)'r' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'o' << 56 | (long)'p' << 48 | (long)'l' << 40 | (long)'u' << 32 | (long)'s' << 24, - (long)'o' << 56 | (long)'r' << 48, - (long)'o' << 56 | (long)'r' << 48 | (long)'d' << 40 | (long)'f' << 32, - (long)'o' << 56 | (long)'r' << 48 | (long)'d' << 40 | (long)'m' << 32, - (long)'o' << 56 | (long)'s' << 48 | (long)'l' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'h' << 16, - (long)'o' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, - (long)'o' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24 | (long)'s' << 16, - (long)'o' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'p' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'a' << 32, - (long)'p' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'t' << 32, - (long)'p' << 56 | (long)'e' << 48 | (long)'r' << 40 | (long)'m' << 32 | (long)'i' << 24 | (long)'l' << 16, - (long)'p' << 56 | (long)'e' << 48 | (long)'r' << 40 | (long)'p' << 32, - (long)'p' << 56 | (long)'h' << 48 | (long)'i' << 40, - (long)'p' << 56 | (long)'i' << 48, - (long)'p' << 56 | (long)'i' << 48 | (long)'v' << 40, - (long)'p' << 56 | (long)'l' << 48 | (long)'u' << 40 | (long)'s' << 32 | (long)'m' << 24 | (long)'n' << 16, - (long)'p' << 56 | (long)'o' << 48 | (long)'u' << 40 | (long)'n' << 32 | (long)'d' << 24, - (long)'p' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24, - (long)'p' << 56 | (long)'r' << 48 | (long)'o' << 40 | (long)'d' << 32, - (long)'p' << 56 | (long)'r' << 48 | (long)'o' << 40 | (long)'p' << 32, - (long)'p' << 56 | (long)'s' << 48 | (long)'i' << 40, - (long)'q' << 56 | (long)'u' << 48 | (long)'o' << 40 | (long)'t' << 32, - (long)'r' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'r' << 56 | (long)'a' << 48 | (long)'d' << 40 | (long)'i' << 32 | (long)'c' << 24, - (long)'r' << 56 | (long)'a' << 48 | (long)'n' << 40 | (long)'g' << 32, - (long)'r' << 56 | (long)'a' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'r' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'r' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'i' << 32 | (long)'l' << 24, - (long)'r' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'r' << 56 | (long)'e' << 48 | (long)'a' << 40 | (long)'l' << 32, - (long)'r' << 56 | (long)'e' << 48 | (long)'g' << 40, - (long)'r' << 56 | (long)'f' << 48 | (long)'l' << 40 | (long)'o' << 32 | (long)'o' << 24 | (long)'r' << 16, - (long)'r' << 56 | (long)'h' << 48 | (long)'o' << 40, - (long)'r' << 56 | (long)'l' << 48 | (long)'m' << 40, - (long)'r' << 56 | (long)'s' << 48 | (long)'a' << 40 | (long)'q' << 32 | (long)'u' << 24 | (long)'o' << 16, - (long)'r' << 56 | (long)'s' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'s' << 56 | (long)'b' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, - (long)'s' << 56 | (long)'c' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'o' << 24 | (long)'n' << 16, - (long)'s' << 56 | (long)'d' << 48 | (long)'o' << 40 | (long)'t' << 32, - (long)'s' << 56 | (long)'e' << 48 | (long)'c' << 40 | (long)'t' << 32, - (long)'s' << 56 | (long)'h' << 48 | (long)'y' << 40, - (long)'s' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24, - (long)'s' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24 | (long)'f' << 16, - (long)'s' << 56 | (long)'i' << 48 | (long)'m' << 40, - (long)'s' << 56 | (long)'p' << 48 | (long)'a' << 40 | (long)'d' << 32 | (long)'e' << 24 | (long)'s' << 16, - (long)'s' << 56 | (long)'u' << 48 | (long)'b' << 40, - (long)'s' << 56 | (long)'u' << 48 | (long)'b' << 40 | (long)'e' << 32, - (long)'s' << 56 | (long)'u' << 48 | (long)'m' << 40, - (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40, - (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'1' << 32, - (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'2' << 32, - (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'3' << 32, - (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'e' << 32, - (long)'s' << 56 | (long)'z' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, - (long)'t' << 56 | (long)'a' << 48 | (long)'u' << 40, - (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'r' << 32 | (long)'e' << 24 | (long)'4' << 16, - (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24, - (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24 | (long)'s' << 16 | (long)'y' << 8 | (long)'m' << 0, - (long)'t' << 56 | (long)'h' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'s' << 24 | (long)'p' << 16, - (long)'t' << 56 | (long)'h' << 48 | (long)'o' << 40 | (long)'r' << 32 | (long)'n' << 24, - (long)'t' << 56 | (long)'i' << 48 | (long)'l' << 40 | (long)'d' << 32 | (long)'e' << 24, - (long)'t' << 56 | (long)'i' << 48 | (long)'m' << 40 | (long)'e' << 32 | (long)'s' << 24, - (long)'t' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'d' << 32 | (long)'e' << 24, - (long)'u' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'u' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'u' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, - (long)'u' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, - (long)'u' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, - (long)'u' << 56 | (long)'m' << 48 | (long)'l' << 40, - (long)'u' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'h' << 24, - (long)'u' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, - (long)'u' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'w' << 56 | (long)'e' << 48 | (long)'i' << 40 | (long)'e' << 32 | (long)'r' << 24 | (long)'p' << 16, - (long)'x' << 56 | (long)'i' << 48, - (long)'y' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, - (long)'y' << 56 | (long)'e' << 48 | (long)'n' << 40, - (long)'y' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, - (long)'z' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, - (long)'z' << 56 | (long)'w' << 48 | (long)'j' << 40, - (long)'z' << 56 | (long)'w' << 48 | (long)'n' << 40 | (long)'j' << 32 - }; + (long)'A' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, + (long)'A' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'A' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'A' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'A' << 56 | (long)'l' << 48 | (long)'p' << 40 | (long)'h' << 32 | (long)'a' << 24, + (long)'A' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'g' << 24, + (long)'A' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'A' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'B' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'C' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'d' << 32 | (long)'i' << 24 | (long)'l' << 16, + (long)'C' << 56 | (long)'h' << 48 | (long)'i' << 40, + (long)'D' << 56 | (long)'a' << 48 | (long)'g' << 40 | (long)'g' << 32 | (long)'e' << 24 | (long)'r' << 16, + (long)'D' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'t' << 32 | (long)'a' << 24, + (long)'E' << 56 | (long)'T' << 48 | (long)'H' << 40, + (long)'E' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'E' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'E' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'E' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'E' << 56 | (long)'t' << 48 | (long)'a' << 40, + (long)'E' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'G' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'m' << 32 | (long)'a' << 24, + (long)'I' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'I' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'I' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'I' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'I' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'K' << 56 | (long)'a' << 48 | (long)'p' << 40 | (long)'p' << 32 | (long)'a' << 24, + (long)'L' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'b' << 32 | (long)'d' << 24 | (long)'a' << 16, + (long)'M' << 56 | (long)'u' << 48, + (long)'N' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'N' << 56 | (long)'u' << 48, + (long)'O' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, + (long)'O' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'O' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'O' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'O' << 56 | (long)'m' << 48 | (long)'e' << 40 | (long)'g' << 32 | (long)'a' << 24, + (long)'O' << 56 | (long)'m' << 48 | (long)'i' << 40 | (long)'c' << 32 | (long)'r' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'O' << 56 | (long)'s' << 48 | (long)'l' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'h' << 16, + (long)'O' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'O' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'P' << 56 | (long)'h' << 48 | (long)'i' << 40, + (long)'P' << 56 | (long)'i' << 48, + (long)'P' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24, + (long)'P' << 56 | (long)'s' << 48 | (long)'i' << 40, + (long)'R' << 56 | (long)'h' << 48 | (long)'o' << 40, + (long)'S' << 56 | (long)'c' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'o' << 24 | (long)'n' << 16, + (long)'S' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24, + (long)'T' << 56 | (long)'H' << 48 | (long)'O' << 40 | (long)'R' << 32 | (long)'N' << 24, + (long)'T' << 56 | (long)'a' << 48 | (long)'u' << 40, + (long)'T' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24, + (long)'U' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'U' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'U' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'U' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'U' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'X' << 56 | (long)'i' << 48, + (long)'Y' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'Y' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'Z' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'a' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'a' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'a' << 56 | (long)'c' << 48 | (long)'u' << 40 | (long)'t' << 32 | (long)'e' << 24, + (long)'a' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, + (long)'a' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'a' << 56 | (long)'l' << 48 | (long)'e' << 40 | (long)'f' << 32 | (long)'s' << 24 | (long)'y' << 16 | (long)'m' << 8, + (long)'a' << 56 | (long)'l' << 48 | (long)'p' << 40 | (long)'h' << 32 | (long)'a' << 24, + (long)'a' << 56 | (long)'m' << 48 | (long)'p' << 40, + (long)'a' << 56 | (long)'n' << 48 | (long)'d' << 40, + (long)'a' << 56 | (long)'n' << 48 | (long)'g' << 40, + (long)'a' << 56 | (long)'p' << 48 | (long)'o' << 40 | (long)'s' << 32, + (long)'a' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'g' << 24, + (long)'a' << 56 | (long)'s' << 48 | (long)'y' << 40 | (long)'m' << 32 | (long)'p' << 24, + (long)'a' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'a' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'b' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'b' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'b' << 56 | (long)'r' << 48 | (long)'v' << 40 | (long)'b' << 32 | (long)'a' << 24 | (long)'r' << 16, + (long)'b' << 56 | (long)'u' << 48 | (long)'l' << 40 | (long)'l' << 32, + (long)'c' << 56 | (long)'a' << 48 | (long)'p' << 40, + (long)'c' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'d' << 32 | (long)'i' << 24 | (long)'l' << 16, + (long)'c' << 56 | (long)'e' << 48 | (long)'d' << 40 | (long)'i' << 32 | (long)'l' << 24, + (long)'c' << 56 | (long)'e' << 48 | (long)'n' << 40 | (long)'t' << 32, + (long)'c' << 56 | (long)'h' << 48 | (long)'i' << 40, + (long)'c' << 56 | (long)'i' << 48 | (long)'r' << 40 | (long)'c' << 32, + (long)'c' << 56 | (long)'l' << 48 | (long)'u' << 40 | (long)'b' << 32 | (long)'s' << 24, + (long)'c' << 56 | (long)'o' << 48 | (long)'n' << 40 | (long)'g' << 32, + (long)'c' << 56 | (long)'o' << 48 | (long)'p' << 40 | (long)'y' << 32, + (long)'c' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'r' << 24, + (long)'c' << 56 | (long)'u' << 48 | (long)'p' << 40, + (long)'c' << 56 | (long)'u' << 48 | (long)'r' << 40 | (long)'r' << 32 | (long)'e' << 24 | (long)'n' << 16, + (long)'d' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'d' << 56 | (long)'a' << 48 | (long)'g' << 40 | (long)'g' << 32 | (long)'e' << 24 | (long)'r' << 16, + (long)'d' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'d' << 56 | (long)'e' << 48 | (long)'g' << 40, + (long)'d' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'t' << 32 | (long)'a' << 24, + (long)'d' << 56 | (long)'i' << 48 | (long)'a' << 40 | (long)'m' << 32 | (long)'s' << 24, + (long)'d' << 56 | (long)'i' << 48 | (long)'v' << 40 | (long)'i' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'e' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'e' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'e' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'e' << 56 | (long)'m' << 48 | (long)'p' << 40 | (long)'t' << 32 | (long)'y' << 24, + (long)'e' << 56 | (long)'m' << 48 | (long)'s' << 40 | (long)'p' << 32, + (long)'e' << 56 | (long)'n' << 48 | (long)'s' << 40 | (long)'p' << 32, + (long)'e' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'e' << 56 | (long)'q' << 48 | (long)'u' << 40 | (long)'i' << 32 | (long)'v' << 24, + (long)'e' << 56 | (long)'t' << 48 | (long)'a' << 40, + (long)'e' << 56 | (long)'t' << 48 | (long)'h' << 40, + (long)'e' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'e' << 56 | (long)'u' << 48 | (long)'r' << 40 | (long)'o' << 32, + (long)'e' << 56 | (long)'x' << 48 | (long)'i' << 40 | (long)'s' << 32 | (long)'t' << 24, + (long)'f' << 56 | (long)'n' << 48 | (long)'o' << 40 | (long)'f' << 32, + (long)'f' << 56 | (long)'o' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'l' << 24 | (long)'l' << 16, + (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'1' << 24 | (long)'2' << 16, + (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'1' << 24 | (long)'4' << 16, + (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'c' << 32 | (long)'3' << 24 | (long)'4' << 16, + (long)'f' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'l' << 24, + (long)'g' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'m' << 32 | (long)'a' << 24, + (long)'g' << 56 | (long)'e' << 48, + (long)'g' << 56 | (long)'t' << 48, + (long)'h' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'h' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'h' << 56 | (long)'e' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'t' << 24 | (long)'s' << 16, + (long)'h' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'l' << 32 | (long)'i' << 24 | (long)'p' << 16, + (long)'i' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'i' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'i' << 56 | (long)'e' << 48 | (long)'x' << 40 | (long)'c' << 32 | (long)'l' << 24, + (long)'i' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'i' << 56 | (long)'m' << 48 | (long)'a' << 40 | (long)'g' << 32 | (long)'e' << 24, + (long)'i' << 56 | (long)'n' << 48 | (long)'f' << 40 | (long)'i' << 32 | (long)'n' << 24, + (long)'i' << 56 | (long)'n' << 48 | (long)'t' << 40, + (long)'i' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'i' << 56 | (long)'q' << 48 | (long)'u' << 40 | (long)'e' << 32 | (long)'s' << 24 | (long)'t' << 16, + (long)'i' << 56 | (long)'s' << 48 | (long)'i' << 40 | (long)'n' << 32, + (long)'i' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'k' << 56 | (long)'a' << 48 | (long)'p' << 40 | (long)'p' << 32 | (long)'a' << 24, + (long)'l' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'l' << 56 | (long)'a' << 48 | (long)'m' << 40 | (long)'b' << 32 | (long)'d' << 24 | (long)'a' << 16, + (long)'l' << 56 | (long)'a' << 48 | (long)'n' << 40 | (long)'g' << 32, + (long)'l' << 56 | (long)'a' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'l' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'l' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'i' << 32 | (long)'l' << 24, + (long)'l' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'l' << 56 | (long)'e' << 48, + (long)'l' << 56 | (long)'f' << 48 | (long)'l' << 40 | (long)'o' << 32 | (long)'o' << 24 | (long)'r' << 16, + (long)'l' << 56 | (long)'o' << 48 | (long)'w' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'t' << 16, + (long)'l' << 56 | (long)'o' << 48 | (long)'z' << 40, + (long)'l' << 56 | (long)'r' << 48 | (long)'m' << 40, + (long)'l' << 56 | (long)'s' << 48 | (long)'a' << 40 | (long)'q' << 32 | (long)'u' << 24 | (long)'o' << 16, + (long)'l' << 56 | (long)'s' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'l' << 56 | (long)'t' << 48, + (long)'m' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'r' << 32, + (long)'m' << 56 | (long)'d' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'h' << 24, + (long)'m' << 56 | (long)'i' << 48 | (long)'c' << 40 | (long)'r' << 32 | (long)'o' << 24, + (long)'m' << 56 | (long)'i' << 48 | (long)'d' << 40 | (long)'d' << 32 | (long)'o' << 24 | (long)'t' << 16, + (long)'m' << 56 | (long)'i' << 48 | (long)'n' << 40 | (long)'u' << 32 | (long)'s' << 24, + (long)'m' << 56 | (long)'u' << 48, + (long)'n' << 56 | (long)'a' << 48 | (long)'b' << 40 | (long)'l' << 32 | (long)'a' << 24, + (long)'n' << 56 | (long)'b' << 48 | (long)'s' << 40 | (long)'p' << 32, + (long)'n' << 56 | (long)'d' << 48 | (long)'a' << 40 | (long)'s' << 32 | (long)'h' << 24, + (long)'n' << 56 | (long)'e' << 48, + (long)'n' << 56 | (long)'i' << 48, + (long)'n' << 56 | (long)'o' << 48 | (long)'t' << 40, + (long)'n' << 56 | (long)'o' << 48 | (long)'t' << 40 | (long)'i' << 32 | (long)'n' << 24, + (long)'n' << 56 | (long)'s' << 48 | (long)'u' << 40 | (long)'b' << 32, + (long)'n' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'n' << 56 | (long)'u' << 48, + (long)'o' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'o' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'o' << 56 | (long)'e' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, + (long)'o' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'o' << 56 | (long)'l' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'e' << 24, + (long)'o' << 56 | (long)'m' << 48 | (long)'e' << 40 | (long)'g' << 32 | (long)'a' << 24, + (long)'o' << 56 | (long)'m' << 48 | (long)'i' << 40 | (long)'c' << 32 | (long)'r' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'o' << 56 | (long)'p' << 48 | (long)'l' << 40 | (long)'u' << 32 | (long)'s' << 24, + (long)'o' << 56 | (long)'r' << 48, + (long)'o' << 56 | (long)'r' << 48 | (long)'d' << 40 | (long)'f' << 32, + (long)'o' << 56 | (long)'r' << 48 | (long)'d' << 40 | (long)'m' << 32, + (long)'o' << 56 | (long)'s' << 48 | (long)'l' << 40 | (long)'a' << 32 | (long)'s' << 24 | (long)'h' << 16, + (long)'o' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'l' << 32 | (long)'d' << 24 | (long)'e' << 16, + (long)'o' << 56 | (long)'t' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24 | (long)'s' << 16, + (long)'o' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'p' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'a' << 32, + (long)'p' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'t' << 32, + (long)'p' << 56 | (long)'e' << 48 | (long)'r' << 40 | (long)'m' << 32 | (long)'i' << 24 | (long)'l' << 16, + (long)'p' << 56 | (long)'e' << 48 | (long)'r' << 40 | (long)'p' << 32, + (long)'p' << 56 | (long)'h' << 48 | (long)'i' << 40, + (long)'p' << 56 | (long)'i' << 48, + (long)'p' << 56 | (long)'i' << 48 | (long)'v' << 40, + (long)'p' << 56 | (long)'l' << 48 | (long)'u' << 40 | (long)'s' << 32 | (long)'m' << 24 | (long)'n' << 16, + (long)'p' << 56 | (long)'o' << 48 | (long)'u' << 40 | (long)'n' << 32 | (long)'d' << 24, + (long)'p' << 56 | (long)'r' << 48 | (long)'i' << 40 | (long)'m' << 32 | (long)'e' << 24, + (long)'p' << 56 | (long)'r' << 48 | (long)'o' << 40 | (long)'d' << 32, + (long)'p' << 56 | (long)'r' << 48 | (long)'o' << 40 | (long)'p' << 32, + (long)'p' << 56 | (long)'s' << 48 | (long)'i' << 40, + (long)'q' << 56 | (long)'u' << 48 | (long)'o' << 40 | (long)'t' << 32, + (long)'r' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'r' << 56 | (long)'a' << 48 | (long)'d' << 40 | (long)'i' << 32 | (long)'c' << 24, + (long)'r' << 56 | (long)'a' << 48 | (long)'n' << 40 | (long)'g' << 32, + (long)'r' << 56 | (long)'a' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'r' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'r' << 56 | (long)'c' << 48 | (long)'e' << 40 | (long)'i' << 32 | (long)'l' << 24, + (long)'r' << 56 | (long)'d' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'r' << 56 | (long)'e' << 48 | (long)'a' << 40 | (long)'l' << 32, + (long)'r' << 56 | (long)'e' << 48 | (long)'g' << 40, + (long)'r' << 56 | (long)'f' << 48 | (long)'l' << 40 | (long)'o' << 32 | (long)'o' << 24 | (long)'r' << 16, + (long)'r' << 56 | (long)'h' << 48 | (long)'o' << 40, + (long)'r' << 56 | (long)'l' << 48 | (long)'m' << 40, + (long)'r' << 56 | (long)'s' << 48 | (long)'a' << 40 | (long)'q' << 32 | (long)'u' << 24 | (long)'o' << 16, + (long)'r' << 56 | (long)'s' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'s' << 56 | (long)'b' << 48 | (long)'q' << 40 | (long)'u' << 32 | (long)'o' << 24, + (long)'s' << 56 | (long)'c' << 48 | (long)'a' << 40 | (long)'r' << 32 | (long)'o' << 24 | (long)'n' << 16, + (long)'s' << 56 | (long)'d' << 48 | (long)'o' << 40 | (long)'t' << 32, + (long)'s' << 56 | (long)'e' << 48 | (long)'c' << 40 | (long)'t' << 32, + (long)'s' << 56 | (long)'h' << 48 | (long)'y' << 40, + (long)'s' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24, + (long)'s' << 56 | (long)'i' << 48 | (long)'g' << 40 | (long)'m' << 32 | (long)'a' << 24 | (long)'f' << 16, + (long)'s' << 56 | (long)'i' << 48 | (long)'m' << 40, + (long)'s' << 56 | (long)'p' << 48 | (long)'a' << 40 | (long)'d' << 32 | (long)'e' << 24 | (long)'s' << 16, + (long)'s' << 56 | (long)'u' << 48 | (long)'b' << 40, + (long)'s' << 56 | (long)'u' << 48 | (long)'b' << 40 | (long)'e' << 32, + (long)'s' << 56 | (long)'u' << 48 | (long)'m' << 40, + (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40, + (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'1' << 32, + (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'2' << 32, + (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'3' << 32, + (long)'s' << 56 | (long)'u' << 48 | (long)'p' << 40 | (long)'e' << 32, + (long)'s' << 56 | (long)'z' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24, + (long)'t' << 56 | (long)'a' << 48 | (long)'u' << 40, + (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'r' << 32 | (long)'e' << 24 | (long)'4' << 16, + (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24, + (long)'t' << 56 | (long)'h' << 48 | (long)'e' << 40 | (long)'t' << 32 | (long)'a' << 24 | (long)'s' << 16 | (long)'y' << 8 | (long)'m' << 0, + (long)'t' << 56 | (long)'h' << 48 | (long)'i' << 40 | (long)'n' << 32 | (long)'s' << 24 | (long)'p' << 16, + (long)'t' << 56 | (long)'h' << 48 | (long)'o' << 40 | (long)'r' << 32 | (long)'n' << 24, + (long)'t' << 56 | (long)'i' << 48 | (long)'l' << 40 | (long)'d' << 32 | (long)'e' << 24, + (long)'t' << 56 | (long)'i' << 48 | (long)'m' << 40 | (long)'e' << 32 | (long)'s' << 24, + (long)'t' << 56 | (long)'r' << 48 | (long)'a' << 40 | (long)'d' << 32 | (long)'e' << 24, + (long)'u' << 56 | (long)'A' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'u' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'u' << 56 | (long)'a' << 48 | (long)'r' << 40 | (long)'r' << 32, + (long)'u' << 56 | (long)'c' << 48 | (long)'i' << 40 | (long)'r' << 32 | (long)'c' << 24, + (long)'u' << 56 | (long)'g' << 48 | (long)'r' << 40 | (long)'a' << 32 | (long)'v' << 24 | (long)'e' << 16, + (long)'u' << 56 | (long)'m' << 48 | (long)'l' << 40, + (long)'u' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'h' << 24, + (long)'u' << 56 | (long)'p' << 48 | (long)'s' << 40 | (long)'i' << 32 | (long)'l' << 24 | (long)'o' << 16 | (long)'n' << 8, + (long)'u' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'w' << 56 | (long)'e' << 48 | (long)'i' << 40 | (long)'e' << 32 | (long)'r' << 24 | (long)'p' << 16, + (long)'x' << 56 | (long)'i' << 48, + (long)'y' << 56 | (long)'a' << 48 | (long)'c' << 40 | (long)'u' << 32 | (long)'t' << 24 | (long)'e' << 16, + (long)'y' << 56 | (long)'e' << 48 | (long)'n' << 40, + (long)'y' << 56 | (long)'u' << 48 | (long)'m' << 40 | (long)'l' << 32, + (long)'z' << 56 | (long)'e' << 48 | (long)'t' << 40 | (long)'a' << 32, + (long)'z' << 56 | (long)'w' << 48 | (long)'j' << 40, + (long)'z' << 56 | (long)'w' << 48 | (long)'n' << 40 | (long)'j' << 32 + }; static readonly char[] entities_values = new char[] { - '\u00C6', - '\u00C1', - '\u00C2', - '\u00C0', - '\u0391', - '\u00C5', - '\u00C3', - '\u00C4', - '\u0392', - '\u00C7', - '\u03A7', - '\u2021', - '\u0394', - '\u00D0', - '\u00C9', - '\u00CA', - '\u00C8', - '\u0395', - '\u0397', - '\u00CB', - '\u0393', - '\u00CD', - '\u00CE', - '\u00CC', - '\u0399', - '\u00CF', - '\u039A', - '\u039B', - '\u039C', - '\u00D1', - '\u039D', - '\u0152', - '\u00D3', - '\u00D4', - '\u00D2', - '\u03A9', - '\u039F', - '\u00D8', - '\u00D5', - '\u00D6', - '\u03A6', - '\u03A0', - '\u2033', - '\u03A8', - '\u03A1', - '\u0160', - '\u03A3', - '\u00DE', - '\u03A4', - '\u0398', - '\u00DA', - '\u00DB', - '\u00D9', - '\u03A5', - '\u00DC', - '\u039E', - '\u00DD', - '\u0178', - '\u0396', - '\u00E1', - '\u00E2', - '\u00B4', - '\u00E6', - '\u00E0', - '\u2135', - '\u03B1', - '\u0026', - '\u2227', - '\u2220', - '\u0027', - '\u00E5', - '\u2248', - '\u00E3', - '\u00E4', - '\u201E', - '\u03B2', - '\u00A6', - '\u2022', - '\u2229', - '\u00E7', - '\u00B8', - '\u00A2', - '\u03C7', - '\u02C6', - '\u2663', - '\u2245', - '\u00A9', - '\u21B5', - '\u222A', - '\u00A4', - '\u21D3', - '\u2020', - '\u2193', - '\u00B0', - '\u03B4', - '\u2666', - '\u00F7', - '\u00E9', - '\u00EA', - '\u00E8', - '\u2205', - '\u2003', - '\u2002', - '\u03B5', - '\u2261', - '\u03B7', - '\u00F0', - '\u00EB', - '\u20AC', - '\u2203', - '\u0192', - '\u2200', - '\u00BD', - '\u00BC', - '\u00BE', - '\u2044', - '\u03B3', - '\u2265', - '\u003E', - '\u21D4', - '\u2194', - '\u2665', - '\u2026', - '\u00ED', - '\u00EE', - '\u00A1', - '\u00EC', - '\u2111', - '\u221E', - '\u222B', - '\u03B9', - '\u00BF', - '\u2208', - '\u00EF', - '\u03BA', - '\u21D0', - '\u03BB', - '\u2329', - '\u00AB', - '\u2190', - '\u2308', - '\u201C', - '\u2264', - '\u230A', - '\u2217', - '\u25CA', - '\u200E', - '\u2039', - '\u2018', - '\u003C', - '\u00AF', - '\u2014', - '\u00B5', - '\u00B7', - '\u2212', - '\u03BC', - '\u2207', - '\u00A0', - '\u2013', - '\u2260', - '\u220B', - '\u00AC', - '\u2209', - '\u2284', - '\u00F1', - '\u03BD', - '\u00F3', - '\u00F4', - '\u0153', - '\u00F2', - '\u203E', - '\u03C9', - '\u03BF', - '\u2295', - '\u2228', - '\u00AA', - '\u00BA', - '\u00F8', - '\u00F5', - '\u2297', - '\u00F6', - '\u00B6', - '\u2202', - '\u2030', - '\u22A5', - '\u03C6', - '\u03C0', - '\u03D6', - '\u00B1', - '\u00A3', - '\u2032', - '\u220F', - '\u221D', - '\u03C8', - '\u0022', - '\u21D2', - '\u221A', - '\u232A', - '\u00BB', - '\u2192', - '\u2309', - '\u201D', - '\u211C', - '\u00AE', - '\u230B', - '\u03C1', - '\u200F', - '\u203A', - '\u2019', - '\u201A', - '\u0161', - '\u22C5', - '\u00A7', - '\u00AD', - '\u03C3', - '\u03C2', - '\u223C', - '\u2660', - '\u2282', - '\u2286', - '\u2211', - '\u2283', - '\u00B9', - '\u00B2', - '\u00B3', - '\u2287', - '\u00DF', - '\u03C4', - '\u2234', - '\u03B8', - '\u03D1', - '\u2009', - '\u00FE', - '\u02DC', - '\u00D7', - '\u2122', - '\u21D1', - '\u00FA', - '\u2191', - '\u00FB', - '\u00F9', - '\u00A8', - '\u03D2', - '\u03C5', - '\u00FC', - '\u2118', - '\u03BE', - '\u00FD', - '\u00A5', - '\u00FF', - '\u03B6', - '\u200D', - '\u200C' - }; + '\u00C6', '\u00C1', '\u00C2', '\u00C0', '\u0391', '\u00C5', '\u00C3', '\u00C4', '\u0392', '\u00C7', '\u03A7', + '\u2021', '\u0394', '\u00D0', '\u00C9', '\u00CA', '\u00C8', '\u0395', '\u0397', '\u00CB', '\u0393', '\u00CD', + '\u00CE', '\u00CC', '\u0399', '\u00CF', '\u039A', '\u039B', '\u039C', '\u00D1', '\u039D', '\u0152', '\u00D3', + '\u00D4', '\u00D2', '\u03A9', '\u039F', '\u00D8', '\u00D5', '\u00D6', '\u03A6', '\u03A0', '\u2033', '\u03A8', + '\u03A1', '\u0160', '\u03A3', '\u00DE', '\u03A4', '\u0398', '\u00DA', '\u00DB', '\u00D9', '\u03A5', '\u00DC', + '\u039E', '\u00DD', '\u0178', '\u0396', '\u00E1', '\u00E2', '\u00B4', '\u00E6', '\u00E0', '\u2135', '\u03B1', + '\u0026', '\u2227', '\u2220', '\u0027', '\u00E5', '\u2248', '\u00E3', '\u00E4', '\u201E', '\u03B2', '\u00A6', + '\u2022', '\u2229', '\u00E7', '\u00B8', '\u00A2', '\u03C7', '\u02C6', '\u2663', '\u2245', '\u00A9', '\u21B5', + '\u222A', '\u00A4', '\u21D3', '\u2020', '\u2193', '\u00B0', '\u03B4', '\u2666', '\u00F7', '\u00E9', '\u00EA', + '\u00E8', '\u2205', '\u2003', '\u2002', '\u03B5', '\u2261', '\u03B7', '\u00F0', '\u00EB', '\u20AC', '\u2203', + '\u0192', '\u2200', '\u00BD', '\u00BC', '\u00BE', '\u2044', '\u03B3', '\u2265', '\u003E', '\u21D4', '\u2194', + '\u2665', '\u2026', '\u00ED', '\u00EE', '\u00A1', '\u00EC', '\u2111', '\u221E', '\u222B', '\u03B9', '\u00BF', + '\u2208', '\u00EF', '\u03BA', '\u21D0', '\u03BB', '\u2329', '\u00AB', '\u2190', '\u2308', '\u201C', '\u2264', + '\u230A', '\u2217', '\u25CA', '\u200E', '\u2039', '\u2018', '\u003C', '\u00AF', '\u2014', '\u00B5', '\u00B7', + '\u2212', '\u03BC', '\u2207', '\u00A0', '\u2013', '\u2260', '\u220B', '\u00AC', '\u2209', '\u2284', '\u00F1', + '\u03BD', '\u00F3', '\u00F4', '\u0153', '\u00F2', '\u203E', '\u03C9', '\u03BF', '\u2295', '\u2228', '\u00AA', + '\u00BA', '\u00F8', '\u00F5', '\u2297', '\u00F6', '\u00B6', '\u2202', '\u2030', '\u22A5', '\u03C6', '\u03C0', + '\u03D6', '\u00B1', '\u00A3', '\u2032', '\u220F', '\u221D', '\u03C8', '\u0022', '\u21D2', '\u221A', '\u232A', + '\u00BB', '\u2192', '\u2309', '\u201D', '\u211C', '\u00AE', '\u230B', '\u03C1', '\u200F', '\u203A', '\u2019', + '\u201A', '\u0161', '\u22C5', '\u00A7', '\u00AD', '\u03C3', '\u03C2', '\u223C', '\u2660', '\u2282', '\u2286', + '\u2211', '\u2283', '\u00B9', '\u00B2', '\u00B3', '\u2287', '\u00DF', '\u03C4', '\u2234', '\u03B8', '\u03D1', + '\u2009', '\u00FE', '\u02DC', '\u00D7', '\u2122', '\u21D1', '\u00FA', '\u2191', '\u00FB', '\u00F9', '\u00A8', + '\u03D2', '\u03C5', '\u00FC', '\u2118', '\u03BE', '\u00FD', '\u00A5', '\u00FF', '\u03B6', '\u200D', '\u200C' + }; #region Methods diff --git a/MediaBrowser.Model/Services/RouteAttribute.cs b/MediaBrowser.Model/Services/RouteAttribute.cs index 264500e605..0dc52af7b7 100644 --- a/MediaBrowser.Model/Services/RouteAttribute.cs +++ b/MediaBrowser.Model/Services/RouteAttribute.cs @@ -6,12 +6,12 @@ namespace MediaBrowser.Model.Services public class RouteAttribute : Attribute { /// - /// Initializes an instance of the class. + /// Initializes an instance of the class. /// /// - /// The path template to map to the request. See - /// RouteAttribute.Path - /// for details on the correct format. + /// The path template to map to the request. See + /// RouteAttribute.Path + /// for details on the correct format. /// public RouteAttribute(string path) : this(path, null) @@ -19,15 +19,15 @@ namespace MediaBrowser.Model.Services } /// - /// Initializes an instance of the class. + /// Initializes an instance of the class. /// /// - /// The path template to map to the request. See - /// RouteAttribute.Path - /// for details on the correct format. + /// The path template to map to the request. See + /// RouteAttribute.Path + /// for details on the correct format. /// - /// A comma-delimited list of HTTP verbs supported by the - /// service. If unspecified, all verbs are assumed to be supported. + /// A comma-delimited list of HTTP verbs supported by the + /// service. If unspecified, all verbs are assumed to be supported. public RouteAttribute(string path, string verbs) { Path = path; @@ -35,51 +35,51 @@ namespace MediaBrowser.Model.Services } /// - /// Gets or sets the path template to be mapped to the request. + /// Gets or sets the path template to be mapped to the request. /// /// - /// A value providing the path mapped to - /// the request. Never . + /// A value providing the path mapped to + /// the request. Never . /// /// - /// Some examples of valid paths are: - /// - /// - /// "/Inventory" - /// "/Inventory/{Category}/{ItemId}" - /// "/Inventory/{ItemPath*}" - /// - /// - /// Variables are specified within "{}" - /// brackets. Each variable in the path is mapped to the same-named property - /// on the request DTO. At runtime, ServiceStack will parse the - /// request URL, extract the variable values, instantiate the request DTO, - /// and assign the variable values into the corresponding request properties, - /// prior to passing the request DTO to the service object for processing. - /// - /// It is not necessary to specify all request properties as - /// variables in the path. For unspecified properties, callers may provide - /// values in the query string. For example: the URL - /// "http://services/Inventory?Category=Books&ItemId=12345" causes the same - /// request DTO to be processed as "http://services/Inventory/Books/12345", - /// provided that the paths "/Inventory" (which supports the first URL) and - /// "/Inventory/{Category}/{ItemId}" (which supports the second URL) - /// are both mapped to the request DTO. - /// - /// Please note that while it is possible to specify property values - /// in the query string, it is generally considered to be less RESTful and - /// less desirable than to specify them as variables in the path. Using the - /// query string to specify property values may also interfere with HTTP - /// caching. - /// - /// The final variable in the path may contain a "*" suffix - /// to grab all remaining segments in the path portion of the request URL and assign - /// them to a single property on the request DTO. - /// For example, if the path "/Inventory/{ItemPath*}" is mapped to the request DTO, - /// then the request URL "http://services/Inventory/Books/12345" will result - /// in a request DTO whose ItemPath property contains "Books/12345". - /// You may only specify one such variable in the path, and it must be positioned at - /// the end of the path. + /// Some examples of valid paths are: + /// + /// + /// "/Inventory" + /// "/Inventory/{Category}/{ItemId}" + /// "/Inventory/{ItemPath*}" + /// + /// + /// Variables are specified within "{}" + /// brackets. Each variable in the path is mapped to the same-named property + /// on the request DTO. At runtime, ServiceStack will parse the + /// request URL, extract the variable values, instantiate the request DTO, + /// and assign the variable values into the corresponding request properties, + /// prior to passing the request DTO to the service object for processing. + /// + /// It is not necessary to specify all request properties as + /// variables in the path. For unspecified properties, callers may provide + /// values in the query string. For example: the URL + /// "http://services/Inventory?Category=Books&ItemId=12345" causes the same + /// request DTO to be processed as "http://services/Inventory/Books/12345", + /// provided that the paths "/Inventory" (which supports the first URL) and + /// "/Inventory/{Category}/{ItemId}" (which supports the second URL) + /// are both mapped to the request DTO. + /// + /// Please note that while it is possible to specify property values + /// in the query string, it is generally considered to be less RESTful and + /// less desirable than to specify them as variables in the path. Using the + /// query string to specify property values may also interfere with HTTP + /// caching. + /// + /// The final variable in the path may contain a "*" suffix + /// to grab all remaining segments in the path portion of the request URL and assign + /// them to a single property on the request DTO. + /// For example, if the path "/Inventory/{ItemPath*}" is mapped to the request DTO, + /// then the request URL "http://services/Inventory/Books/12345" will result + /// in a request DTO whose ItemPath property contains "Books/12345". + /// You may only specify one such variable in the path, and it must be positioned at + /// the end of the path. /// public string Path { get; set; } @@ -93,22 +93,22 @@ namespace MediaBrowser.Model.Services public bool IsHidden { get; set; } /// - /// Gets or sets longer text to explain the behaviour of the route. + /// Gets or sets longer text to explain the behaviour of the route. /// public string Notes { get; set; } /// - /// Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as - /// "GET,PUT,POST,DELETE". + /// Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as + /// "GET,PUT,POST,DELETE". /// /// - /// A providing a comma-delimited list of HTTP verbs supported - /// by the service, or empty if all verbs are supported. + /// A providing a comma-delimited list of HTTP verbs supported + /// by the service, or empty if all verbs are supported. /// public string Verbs { get; set; } /// - /// Used to rank the precedences of route definitions in reverse routing. + /// Used to rank the precedences of route definitions in reverse routing. /// i.e. Priorities below 0 are auto-generated have less precedence. /// public int Priority { get; set; } diff --git a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs index 0369e8ca10..d58aa336b0 100644 --- a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs +++ b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs @@ -158,7 +158,7 @@ namespace MediaBrowser.Providers.BoxSets var dataFilePath = GetDataFilePath(_config.ApplicationPaths, tmdbId, preferredMetadataLanguage); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); _json.SerializeToFile(mainResult, dataFilePath); } diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 8eed5e6266..ae3788f342 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -156,7 +156,7 @@ namespace MediaBrowser.Providers.Manager }).ConfigureAwait(false)) { - // Workaround for tvheadend channel icons + // Workaround for tvheadend channel icons // TODO: Isolate this hack into the tvh plugin if (string.IsNullOrEmpty(response.ContentType)) { diff --git a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs index 6d489498e0..1f5ca00c1a 100644 --- a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs +++ b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs @@ -70,7 +70,7 @@ namespace MediaBrowser.Providers.Movies { return new List { - ImageType.Primary, + ImageType.Primary, ImageType.Thumb, ImageType.Art, ImageType.Logo, @@ -270,7 +270,7 @@ namespace MediaBrowser.Providers.Movies var path = GetFanartJsonPath(id); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); try { diff --git a/MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs b/MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs index aaf0ece3db..618e520bf1 100644 --- a/MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/AudioDbAlbumProvider.cs @@ -158,7 +158,7 @@ namespace MediaBrowser.Providers.Music var path = GetAlbumInfoPath(_config.ApplicationPaths, musicBrainzReleaseGroupId); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); using (var httpResponse = await _httpClient.SendAsync(new HttpRequestOptions { diff --git a/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs b/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs index 3ca0137300..bb9bbf7e09 100644 --- a/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs @@ -312,7 +312,7 @@ namespace MediaBrowser.Providers.TV var path = GetFanartJsonPath(tvdbId); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(path)); try { diff --git a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs index facf5cadf8..0890d19697 100644 --- a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs +++ b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbProviderBase.cs @@ -106,7 +106,7 @@ namespace MediaBrowser.Providers.TV var dataFilePath = GetDataFilePath(id, seasonNumber, episodeNumber, preferredMetadataLanguage); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); _jsonSerializer.SerializeToFile(mainResult, dataFilePath); } diff --git a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs index 217dab663c..f11b8c53dd 100644 --- a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs +++ b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbSeasonProvider.cs @@ -194,7 +194,7 @@ namespace MediaBrowser.Providers.TV var dataFilePath = GetDataFilePath(id, seasonNumber, preferredMetadataLanguage); - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(dataFilePath)); _jsonSerializer.SerializeToFile(mainResult, dataFilePath); } diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs index 23fefa4840..722bf559d9 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs @@ -58,27 +58,27 @@ namespace MediaBrowser.Providers.TV // Process images var seriesDataPath = TvdbSeriesProvider.GetSeriesDataPath(_config.ApplicationPaths, series.ProviderIds); - var nodes = TvdbEpisodeProvider.Current.GetEpisodeXmlNodes(seriesDataPath, episode.GetLookupInfo()); + var nodes = TvdbEpisodeProvider.Current.GetEpisodeXmlNodes(seriesDataPath, episode.GetLookupInfo()); var result = nodes.Select(i => GetImageInfo(i, cancellationToken)) .Where(i => i != null) - .ToList(); + .ToList(); - return Task.FromResult>(result); + return Task.FromResult>(result); } return Task.FromResult>(new RemoteImageInfo[] { }); } - private RemoteImageInfo GetImageInfo(XmlReader reader, CancellationToken cancellationToken) + private RemoteImageInfo GetImageInfo(XmlReader reader, CancellationToken cancellationToken) { var height = 225; var width = 400; var url = string.Empty; - // Use XmlReader for best performance - using (reader) - { + // Use XmlReader for best performance + using (reader) + { reader.MoveToContent(); reader.Read(); @@ -146,7 +146,7 @@ namespace MediaBrowser.Providers.TV reader.Read(); } } - } + } if (string.IsNullOrEmpty(url)) { diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs index d1d8e32c28..e4c18e7ccb 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs @@ -143,7 +143,7 @@ namespace MediaBrowser.Providers.TV /// The series data path. /// The search information. /// List{FileInfo}. - internal List GetEpisodeXmlNodes(string seriesDataPath, EpisodeInfo searchInfo) + internal List GetEpisodeXmlNodes(string seriesDataPath, EpisodeInfo searchInfo) { var seriesXmlPath = TvdbSeriesProvider.Current.GetSeriesXmlPath(searchInfo.SeriesProviderIds, searchInfo.MetadataLanguage); diff --git a/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs index 50ae8d24e6..32253ca3b7 100644 --- a/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs @@ -38,7 +38,7 @@ namespace MediaBrowser.XbmcMetadata.Savers return false; } - return updateType >= MinimumUpdateType || (updateType >= ItemUpdateType.MetadataImport && FileSystem.FileExists(GetSavePath(item))); + return updateType >= MinimumUpdateType || (updateType >= ItemUpdateType.MetadataImport && FileSystem.FileExists(GetSavePath(item))); } protected override void WriteCustomElements(BaseItem item, XmlWriter writer) @@ -62,7 +62,15 @@ namespace MediaBrowser.XbmcMetadata.Savers return list; } - public SeasonNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory) + public SeasonNfoSaver( + IFileSystem fileSystem, + IServerConfigurationManager configurationManager, + ILibraryManager libraryManager, + IUserManager userManager, + IUserDataManager userDataManager, + ILogger logger, + IXmlReaderSettingsFactory xmlReaderSettingsFactory) + : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory) { } } diff --git a/Mono.Nat/AbstractNatDevice.cs b/Mono.Nat/AbstractNatDevice.cs index 1b42160025..1241170c1c 100644 --- a/Mono.Nat/AbstractNatDevice.cs +++ b/Mono.Nat/AbstractNatDevice.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -34,23 +34,22 @@ using System.Threading.Tasks; namespace Mono.Nat { - public abstract class AbstractNatDevice : INatDevice - { - private DateTime lastSeen; - - protected AbstractNatDevice () - { + public abstract class AbstractNatDevice : INatDevice + { + private DateTime lastSeen; - } + protected AbstractNatDevice() + { + } - public abstract IPAddress LocalAddress { get; } - - public DateTime LastSeen - { - get { return lastSeen; } - set { lastSeen = value; } - } + public abstract IPAddress LocalAddress { get; } - public abstract Task CreatePortMap(Mapping mapping); - } + public DateTime LastSeen + { + get { return lastSeen; } + set { lastSeen = value; } + } + + public abstract Task CreatePortMap(Mapping mapping); + } } diff --git a/Mono.Nat/Enums/ProtocolType.cs b/Mono.Nat/Enums/ProtocolType.cs index a1f5cbb0e6..54480598d2 100644 --- a/Mono.Nat/Enums/ProtocolType.cs +++ b/Mono.Nat/Enums/ProtocolType.cs @@ -11,10 +11,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -28,9 +28,9 @@ using System; namespace Mono.Nat { - public enum Protocol - { - Tcp, - Udp - } -} \ No newline at end of file + public enum Protocol + { + Tcp, + Udp + } +} diff --git a/Mono.Nat/EventArgs/DeviceEventArgs.cs b/Mono.Nat/EventArgs/DeviceEventArgs.cs index fbbbf63e3b..6358a0c29f 100644 --- a/Mono.Nat/EventArgs/DeviceEventArgs.cs +++ b/Mono.Nat/EventArgs/DeviceEventArgs.cs @@ -11,10 +11,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -28,18 +28,18 @@ using System; namespace Mono.Nat { - public class DeviceEventArgs : EventArgs - { - private INatDevice device; - - public DeviceEventArgs(INatDevice device) - { - this.device = device; - } - - public INatDevice Device - { - get { return this.device; } - } - } -} \ No newline at end of file + public class DeviceEventArgs : EventArgs + { + private INatDevice device; + + public DeviceEventArgs(INatDevice device) + { + this.device = device; + } + + public INatDevice Device + { + get { return this.device; } + } + } +} diff --git a/Mono.Nat/INatDevice.cs b/Mono.Nat/INatDevice.cs index b0401627ba..6a15090710 100644 --- a/Mono.Nat/INatDevice.cs +++ b/Mono.Nat/INatDevice.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -34,12 +34,12 @@ using System.Threading.Tasks; namespace Mono.Nat { - public interface INatDevice - { - Task CreatePortMap (Mapping mapping); - - IPAddress LocalAddress { get; } + public interface INatDevice + { + Task CreatePortMap (Mapping mapping); - DateTime LastSeen { get; set; } - } + IPAddress LocalAddress { get; } + + DateTime LastSeen { get; set; } + } } diff --git a/Mono.Nat/Mapping.cs b/Mono.Nat/Mapping.cs index dd49404c67..4380689343 100644 --- a/Mono.Nat/Mapping.cs +++ b/Mono.Nat/Mapping.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -30,94 +30,92 @@ using System; namespace Mono.Nat { - public class Mapping - { + public class Mapping + { private string description; private DateTime expiration; private int lifetime; private int privatePort; - private Protocol protocol; - private int publicPort; - + private Protocol protocol; + private int publicPort; + public Mapping(Protocol protocol, int privatePort, int publicPort) + : this (protocol, privatePort, publicPort, 0) + { + } - public Mapping (Protocol protocol, int privatePort, int publicPort) - : this (protocol, privatePort, publicPort, 0) - { - } - - public Mapping (Protocol protocol, int privatePort, int publicPort, int lifetime) - { - this.protocol = protocol; - this.privatePort = privatePort; - this.publicPort = publicPort; - this.lifetime = lifetime; + public Mapping(Protocol protocol, int privatePort, int publicPort, int lifetime) + { + this.protocol = protocol; + this.privatePort = privatePort; + this.publicPort = publicPort; + this.lifetime = lifetime; - if (lifetime == int.MaxValue) - this.expiration = DateTime.MaxValue; - else if (lifetime == 0) - this.expiration = DateTime.Now; - else - this.expiration = DateTime.Now.AddSeconds (lifetime); - } + if (lifetime == int.MaxValue) + this.expiration = DateTime.MaxValue; + else if (lifetime == 0) + this.expiration = DateTime.Now; + else + this.expiration = DateTime.Now.AddSeconds (lifetime); + } public string Description { get { return description; } set { description = value; } } - - public Protocol Protocol - { - get { return protocol; } - internal set { protocol = value; } - } - public int PrivatePort - { - get { return privatePort; } - internal set { privatePort = value; } - } - - public int PublicPort - { - get { return publicPort; } - internal set { publicPort = value; } - } - - public int Lifetime - { - get { return lifetime; } - internal set { lifetime = value; } - } - - public DateTime Expiration - { - get { return expiration; } - internal set { expiration = value; } - } - - public bool IsExpired () - { - return expiration < DateTime.Now; - } - - public override bool Equals (object obj) - { - Mapping other = obj as Mapping; - return other == null ? false : this.protocol == other.protocol && - this.privatePort == other.privatePort && this.publicPort == other.publicPort; - } - - public override int GetHashCode() - { - return this.protocol.GetHashCode() ^ this.privatePort.GetHashCode() ^ this.publicPort.GetHashCode(); - } - - public override string ToString( ) + public Protocol Protocol { - return String.Format( "Protocol: {0}, Public Port: {1}, Private Port: {2}, Description: {3}, Expiration: {4}, Lifetime: {5}", - this.protocol, this.publicPort, this.privatePort, this.description, this.expiration, this.lifetime ); + get { return protocol; } + internal set { protocol = value; } } - } + + public int PrivatePort + { + get { return privatePort; } + internal set { privatePort = value; } + } + + public int PublicPort + { + get { return publicPort; } + internal set { publicPort = value; } + } + + public int Lifetime + { + get { return lifetime; } + internal set { lifetime = value; } + } + + public DateTime Expiration + { + get { return expiration; } + internal set { expiration = value; } + } + + public bool IsExpired() + { + return expiration < DateTime.Now; + } + + public override bool Equals(object obj) + { + Mapping other = obj as Mapping; + return other == null ? false : this.protocol == other.protocol && + this.privatePort == other.privatePort && this.publicPort == other.publicPort; + } + + public override int GetHashCode() + { + return this.protocol.GetHashCode() ^ this.privatePort.GetHashCode() ^ this.publicPort.GetHashCode(); + } + + public override string ToString() + { + return String.Format( "Protocol: {0}, Public Port: {1}, Private Port: {2}, Description: {3}, Expiration: {4}, Lifetime: {5}", + this.protocol, this.publicPort, this.privatePort, this.description, this.expiration, this.lifetime ); + } + } } diff --git a/Mono.Nat/Pmp/PmpConstants.cs b/Mono.Nat/Pmp/PmpConstants.cs index ff3eb62301..83fa8e07cd 100644 --- a/Mono.Nat/Pmp/PmpConstants.cs +++ b/Mono.Nat/Pmp/PmpConstants.cs @@ -11,10 +11,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -29,28 +29,28 @@ using System; namespace Mono.Nat.Pmp { internal static class PmpConstants - { - public const byte Version = (byte)0; - - public const byte OperationCode = (byte)0; - public const byte OperationCodeUdp = (byte)1; - public const byte OperationCodeTcp = (byte)2; + { + public const byte Version = (byte)0; + + public const byte OperationCode = (byte)0; + public const byte OperationCodeUdp = (byte)1; + public const byte OperationCodeTcp = (byte)2; public const byte ServerNoop = (byte)128; - - public const int ClientPort = 5350; - public const int ServerPort = 5351; - - public const int RetryDelay = 250; - public const int RetryAttempts = 9; - - public const int RecommendedLeaseTime = 60 * 60; - public const int DefaultLeaseTime = RecommendedLeaseTime; - - public const short ResultCodeSuccess = 0; - public const short ResultCodeUnsupportedVersion = 1; - public const short ResultCodeNotAuthorized = 2; - public const short ResultCodeNetworkFailure = 3; - public const short ResultCodeOutOfResources = 4; - public const short ResultCodeUnsupportedOperationCode = 5; - } -} \ No newline at end of file + + public const int ClientPort = 5350; + public const int ServerPort = 5351; + + public const int RetryDelay = 250; + public const int RetryAttempts = 9; + + public const int RecommendedLeaseTime = 60 * 60; + public const int DefaultLeaseTime = RecommendedLeaseTime; + + public const short ResultCodeSuccess = 0; + public const short ResultCodeUnsupportedVersion = 1; + public const short ResultCodeNotAuthorized = 2; + public const short ResultCodeNetworkFailure = 3; + public const short ResultCodeOutOfResources = 4; + public const short ResultCodeUnsupportedOperationCode = 5; + } +} diff --git a/Mono.Nat/Pmp/PmpSearcher.cs b/Mono.Nat/Pmp/PmpSearcher.cs index 98cf37f147..5e41558419 100644 --- a/Mono.Nat/Pmp/PmpSearcher.cs +++ b/Mono.Nat/Pmp/PmpSearcher.cs @@ -15,10 +15,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -108,8 +108,8 @@ namespace Mono.Nat foreach (var unicast in properties.UnicastAddresses) { if (/*unicast.DuplicateAddressDetectionState == DuplicateAddressDetectionState.Preferred - && unicast.AddressPreferredLifetime != UInt32.MaxValue - && */unicast.Address.AddressFamily == AddressFamily.InterNetwork) + && unicast.AddressPreferredLifetime != UInt32.MaxValue + && */unicast.Address.AddressFamily == AddressFamily.InterNetwork) { var bytes = unicast.Address.GetAddressBytes(); bytes[3] = 1; @@ -165,7 +165,7 @@ namespace Mono.Nat async Task Search(UdpClient client) { - // Sort out the time for the next search first. The spec says the + // Sort out the time for the next search first. The spec says the // timeout should double after each attempt. Once it reaches 64 seconds // (and that attempt fails), assume no devices available nextSearch = DateTime.Now.AddMilliseconds(timeout); diff --git a/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs b/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs index bcf358d1ca..17ce19768e 100644 --- a/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs +++ b/Mono.Nat/Upnp/Searchers/UpnpSearcher.cs @@ -15,10 +15,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -58,8 +58,8 @@ namespace Mono.Nat } public void Search() - { - } + { + } public async Task Handle(IPAddress localAddress, UpnpDeviceInfo deviceInfo, IPEndPoint endpoint) { @@ -70,16 +70,16 @@ namespace Mono.Nat try { - /* For UPnP Port Mapping we need ot find either WANPPPConnection or WANIPConnection. - Any other device type is no good to us for this purpose. See the IGP overview paper - page 5 for an overview of device types and their hierarchy. - http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf */ + /* For UPnP Port Mapping we need ot find either WANPPPConnection or WANIPConnection. + * Any other device type is no good to us for this purpose. See the IGP overview paper + * page 5 for an overview of device types and their hierarchy. + * http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf */ /* TODO: Currently we are assuming version 1 of the protocol. We should figure out which - version it is and apply the correct URN. */ + * version it is and apply the correct URN. */ /* Some routers don't correctly implement the version ID on the URN, so we only search for the type - prefix. */ + * prefix. */ // We have an internet gateway device now UpnpNatDevice d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient); diff --git a/OpenSubtitlesHandler/Utilities.cs b/OpenSubtitlesHandler/Utilities.cs index f8cfa5c4fb..0806c6fc00 100644 --- a/OpenSubtitlesHandler/Utilities.cs +++ b/OpenSubtitlesHandler/Utilities.cs @@ -47,7 +47,7 @@ namespace OpenSubtitlesHandler /// The hash as Hexadecimal string public static string ComputeHash(Stream stream) { - byte[] hash = MovieHasher.ComputeMovieHash(stream); + byte[] hash = MovieHasher.ComputeMovieHash(stream); return MovieHasher.ToHexadecimal(hash); } /// diff --git a/RSSDP/DeviceAvailableEventArgs.cs b/RSSDP/DeviceAvailableEventArgs.cs index d80b4b65b8..fe1c815669 100644 --- a/RSSDP/DeviceAvailableEventArgs.cs +++ b/RSSDP/DeviceAvailableEventArgs.cs @@ -6,57 +6,56 @@ using MediaBrowser.Model.Net; namespace Rssdp { - /// - /// Event arguments for the event. - /// - public sealed class DeviceAvailableEventArgs : EventArgs - { + /// + /// Event arguments for the event. + /// + public sealed class DeviceAvailableEventArgs : EventArgs + { public IpAddressInfo LocalIpAddress { get; set; } #region Fields private readonly DiscoveredSsdpDevice _DiscoveredDevice; - private readonly bool _IsNewlyDiscovered; + private readonly bool _IsNewlyDiscovered; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Full constructor. - /// - /// A instance representing the available device. - /// A boolean value indicating whether or not this device came from the cache. See for more detail. - /// Thrown if the parameter is null. - public DeviceAvailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool isNewlyDiscovered) - { - if (discoveredDevice == null) throw new ArgumentNullException("discoveredDevice"); + /// + /// Full constructor. + /// + /// A instance representing the available device. + /// A boolean value indicating whether or not this device came from the cache. See for more detail. + /// Thrown if the parameter is null. + public DeviceAvailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool isNewlyDiscovered) + { + if (discoveredDevice == null) throw new ArgumentNullException("discoveredDevice"); - _DiscoveredDevice = discoveredDevice; - _IsNewlyDiscovered = isNewlyDiscovered; - } + _DiscoveredDevice = discoveredDevice; + _IsNewlyDiscovered = isNewlyDiscovered; + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Returns true if the device was discovered due to an alive notification, or a search and was not already in the cache. Returns false if the item came from the cache but matched the current search request. - /// - public bool IsNewlyDiscovered - { - get { return _IsNewlyDiscovered; } - } + /// + /// Returns true if the device was discovered due to an alive notification, or a search and was not already in the cache. Returns false if the item came from the cache but matched the current search request. + /// + public bool IsNewlyDiscovered + { + get { return _IsNewlyDiscovered; } + } - /// - /// A reference to a instance containing the discovered details and allowing access to the full device description. - /// - public DiscoveredSsdpDevice DiscoveredDevice - { - get { return _DiscoveredDevice; } - } + /// + /// A reference to a instance containing the discovered details and allowing access to the full device description. + /// + public DiscoveredSsdpDevice DiscoveredDevice + { + get { return _DiscoveredDevice; } + } - #endregion - - } -} \ No newline at end of file + #endregion + } +} diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.cs index 774d812ee0..5fd441041e 100644 --- a/RSSDP/DeviceEventArgs.cs +++ b/RSSDP/DeviceEventArgs.cs @@ -4,45 +4,45 @@ using System.Text; namespace Rssdp { - /// - /// Event arguments for the and events. - /// - public sealed class DeviceEventArgs : EventArgs - { + /// + /// Event arguments for the and events. + /// + public sealed class DeviceEventArgs : EventArgs + { - #region Fields + #region Fields - private readonly SsdpDevice _Device; + private readonly SsdpDevice _Device; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Constructs a new instance for the specified . - /// - /// The associated with the event this argument class is being used for. - /// Thrown if the argument is null. - public DeviceEventArgs(SsdpDevice device) - { - if (device == null) throw new ArgumentNullException("device"); + /// + /// Constructs a new instance for the specified . + /// + /// The associated with the event this argument class is being used for. + /// Thrown if the argument is null. + public DeviceEventArgs(SsdpDevice device) + { + if (device == null) throw new ArgumentNullException("device"); - _Device = device; - } + _Device = device; + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Returns the instance the event being raised for. - /// - public SsdpDevice Device - { - get { return _Device; } - } + /// + /// Returns the instance the event being raised for. + /// + public SsdpDevice Device + { + get { return _Device; } + } - #endregion + #endregion - } -} \ No newline at end of file + } +} diff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.cs index 171a834a04..1190cfc814 100644 --- a/RSSDP/DeviceUnavailableEventArgs.cs +++ b/RSSDP/DeviceUnavailableEventArgs.cs @@ -5,55 +5,55 @@ using System.Threading.Tasks; namespace Rssdp { - /// - /// Event arguments for the event. - /// - public sealed class DeviceUnavailableEventArgs : EventArgs - { + /// + /// Event arguments for the event. + /// + public sealed class DeviceUnavailableEventArgs : EventArgs + { - #region Fields + #region Fields - private readonly DiscoveredSsdpDevice _DiscoveredDevice; - private readonly bool _Expired; + private readonly DiscoveredSsdpDevice _DiscoveredDevice; + private readonly bool _Expired; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Full constructor. - /// - /// A instance representing the device that has become unavailable. - /// A boolean value indicating whether this device is unavailable because it expired, or because it explicitly sent a byebye notification.. See for more detail. - /// Thrown if the parameter is null. - public DeviceUnavailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool expired) - { - if (discoveredDevice == null) throw new ArgumentNullException("discoveredDevice"); + /// + /// Full constructor. + /// + /// A instance representing the device that has become unavailable. + /// A boolean value indicating whether this device is unavailable because it expired, or because it explicitly sent a byebye notification.. See for more detail. + /// Thrown if the parameter is null. + public DeviceUnavailableEventArgs(DiscoveredSsdpDevice discoveredDevice, bool expired) + { + if (discoveredDevice == null) throw new ArgumentNullException("discoveredDevice"); - _DiscoveredDevice = discoveredDevice; - _Expired = expired; - } + _DiscoveredDevice = discoveredDevice; + _Expired = expired; + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Returns true if the device is considered unavailable because it's cached information expired before a new alive notification or search result was received. Returns false if the device is unavailable because it sent an explicit notification of it's unavailability. - /// - public bool Expired - { - get { return _Expired; } - } + /// + /// Returns true if the device is considered unavailable because it's cached information expired before a new alive notification or search result was received. Returns false if the device is unavailable because it sent an explicit notification of it's unavailability. + /// + public bool Expired + { + get { return _Expired; } + } - /// - /// A reference to a instance containing the discovery details of the removed device. - /// - public DiscoveredSsdpDevice DiscoveredDevice - { - get { return _DiscoveredDevice; } - } + /// + /// A reference to a instance containing the discovery details of the removed device. + /// + public DiscoveredSsdpDevice DiscoveredDevice + { + get { return _DiscoveredDevice; } + } - #endregion - } -} \ No newline at end of file + #endregion + } +} diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.cs index 7e70817ddf..0c5701d29d 100644 --- a/RSSDP/DiscoveredSsdpDevice.cs +++ b/RSSDP/DiscoveredSsdpDevice.cs @@ -7,88 +7,88 @@ using System.Net.Http.Headers; namespace Rssdp { - /// - /// Represents a discovered device, containing basic information about the device and the location of it's full device description document. Also provides convenience methods for retrieving the device description document. - /// - /// - /// - public sealed class DiscoveredSsdpDevice - { + /// + /// Represents a discovered device, containing basic information about the device and the location of it's full device description document. Also provides convenience methods for retrieving the device description document. + /// + /// + /// + public sealed class DiscoveredSsdpDevice + { - #region Fields + #region Fields - private DateTimeOffset _AsAt; + private DateTimeOffset _AsAt; - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice. - /// - public string NotificationType { get; set; } + /// + /// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice. + /// + public string NotificationType { get; set; } - /// - /// Sets or returns the universal service name (USN) of the device. - /// - public string Usn { get; set; } + /// + /// Sets or returns the universal service name (USN) of the device. + /// + public string Usn { get; set; } - /// - /// Sets or returns a URL pointing to the device description document for this device. - /// - public Uri DescriptionLocation { get; set; } + /// + /// Sets or returns a URL pointing to the device description document for this device. + /// + public Uri DescriptionLocation { get; set; } - /// - /// Sets or returns the length of time this information is valid for (from the time). - /// - public TimeSpan CacheLifetime { get; set; } + /// + /// Sets or returns the length of time this information is valid for (from the time). + /// + public TimeSpan CacheLifetime { get; set; } - /// - /// Sets or returns the date and time this information was received. - /// - public DateTimeOffset AsAt - { - get { return _AsAt; } - set - { - if (_AsAt != value) - { - _AsAt = value; - } - } - } + /// + /// Sets or returns the date and time this information was received. + /// + public DateTimeOffset AsAt + { + get { return _AsAt; } + set + { + if (_AsAt != value) + { + _AsAt = value; + } + } + } - /// - /// Returns the headers from the SSDP device response message - /// - public HttpHeaders ResponseHeaders { get; set; } + /// + /// Returns the headers from the SSDP device response message + /// + public HttpHeaders ResponseHeaders { get; set; } - #endregion + #endregion - #region Public Methods + #region Public Methods - /// - /// Returns true if this device information has expired, based on the current date/time, and the & properties. - /// - /// - public bool IsExpired() - { - return this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now; - } + /// + /// Returns true if this device information has expired, based on the current date/time, and the & properties. + /// + /// + public bool IsExpired() + { + return this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now; + } - #endregion + #endregion - #region Overrides + #region Overrides - /// - /// Returns the device's value. - /// - /// A string containing the device's universal service name. - public override string ToString() - { - return this.Usn; - } + /// + /// Returns the device's value. + /// + /// A string containing the device's universal service name. + public override string ToString() + { + return this.Usn; + } - #endregion - } + #endregion + } } diff --git a/RSSDP/DisposableManagedObjectBase.cs b/RSSDP/DisposableManagedObjectBase.cs index 7a0fdd45ab..c1349dd5c7 100644 --- a/RSSDP/DisposableManagedObjectBase.cs +++ b/RSSDP/DisposableManagedObjectBase.cs @@ -5,44 +5,44 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Correclty implements the interface and pattern for an object containing only managed resources, and adds a few common niceities not on the interface such as an property. - /// - public abstract class DisposableManagedObjectBase : IDisposable - { + /// + /// Correclty implements the interface and pattern for an object containing only managed resources, and adds a few common niceities not on the interface such as an property. + /// + public abstract class DisposableManagedObjectBase : IDisposable + { - #region Public Methods + #region Public Methods - /// - /// Override this method and dispose any objects you own the lifetime of if disposing is true; - /// - /// True if managed objects should be disposed, if false, only unmanaged resources should be released. - protected abstract void Dispose(bool disposing); + /// + /// Override this method and dispose any objects you own the lifetime of if disposing is true; + /// + /// True if managed objects should be disposed, if false, only unmanaged resources should be released. + protected abstract void Dispose(bool disposing); - /// - /// Throws and if the property is true. - /// - /// - /// Thrown if the property is true. - /// - protected virtual void ThrowIfDisposed() - { - if (this.IsDisposed) throw new ObjectDisposedException(this.GetType().FullName); - } + /// + /// Throws and if the property is true. + /// + /// + /// Thrown if the property is true. + /// + protected virtual void ThrowIfDisposed() + { + if (this.IsDisposed) throw new ObjectDisposedException(this.GetType().FullName); + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Sets or returns a boolean indicating whether or not this instance has been disposed. - /// - /// - public bool IsDisposed - { - get; - private set; - } + /// + /// Sets or returns a boolean indicating whether or not this instance has been disposed. + /// + /// + public bool IsDisposed + { + get; + private set; + } #endregion @@ -63,7 +63,7 @@ namespace Rssdp.Infrastructure return builder.ToString(); } - + #region IDisposable Members /// @@ -74,8 +74,8 @@ namespace Rssdp.Infrastructure /// /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification="We do exactly as asked, but CA doesn't seem to like us also setting the IsDisposed property. Too bad, it's a good idea and shouldn't cause an exception or anything likely to interfer with the dispose process.")] - public void Dispose() - { + public void Dispose() + { IsDisposed = true; Dispose(true); @@ -83,4 +83,4 @@ namespace Rssdp.Infrastructure #endregion } -} \ No newline at end of file +} diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs index 8460e1ca55..8b027ebd58 100644 --- a/RSSDP/HttpRequestParser.cs +++ b/RSSDP/HttpRequestParser.cs @@ -8,70 +8,70 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Parses a string into a or throws an exception. - /// - public sealed class HttpRequestParser : HttpParserBase - { + /// + /// Parses a string into a or throws an exception. + /// + public sealed class HttpRequestParser : HttpParserBase + { - #region Fields & Constants + #region Fields & Constants - private readonly string[] ContentHeaderNames = new string[] - { - "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" - }; + private readonly string[] ContentHeaderNames = new string[] + { + "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" + }; - #endregion + #endregion - #region Public Methods + #region Public Methods - /// - /// Parses the specified data into a instance. - /// - /// A string containing the data to parse. - /// A instance containing the parsed data. - public override System.Net.Http.HttpRequestMessage Parse(string data) - { - System.Net.Http.HttpRequestMessage retVal = null; + /// + /// Parses the specified data into a instance. + /// + /// A string containing the data to parse. + /// A instance containing the parsed data. + public override System.Net.Http.HttpRequestMessage Parse(string data) + { + System.Net.Http.HttpRequestMessage retVal = null; - try - { - retVal = new System.Net.Http.HttpRequestMessage(); + try + { + retVal = new System.Net.Http.HttpRequestMessage(); - Parse(retVal, retVal.Headers, data); + Parse(retVal, retVal.Headers, data); - return retVal; - } - finally - { - if (retVal != null) - retVal.Dispose(); - } - } + return retVal; + } + finally + { + if (retVal != null) + retVal.Dispose(); + } + } - #endregion + #endregion - #region Overrides + #region Overrides - /// - /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . - /// - /// The first line of the HTTP message to be parsed. - /// Either a or to assign the parsed values to. - protected override void ParseStatusLine(string data, HttpRequestMessage message) - { - if (data == null) throw new ArgumentNullException("data"); - if (message == null) throw new ArgumentNullException("message"); + /// + /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . + /// + /// The first line of the HTTP message to be parsed. + /// Either a or to assign the parsed values to. + protected override void ParseStatusLine(string data, HttpRequestMessage message) + { + if (data == null) throw new ArgumentNullException("data"); + if (message == null) throw new ArgumentNullException("message"); - var parts = data.Split(' '); - if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); + var parts = data.Split(' '); + if (parts.Length < 2) throw new ArgumentException("Status line is invalid. Insufficient status parts.", "data"); - message.Method = new HttpMethod(parts[0].Trim()); - Uri requestUri; - if (Uri.TryCreate(parts[1].Trim(), UriKind.RelativeOrAbsolute, out requestUri)) - message.RequestUri = requestUri; - else - System.Diagnostics.Debug.WriteLine(parts[1]); + message.Method = new HttpMethod(parts[0].Trim()); + Uri requestUri; + if (Uri.TryCreate(parts[1].Trim(), UriKind.RelativeOrAbsolute, out requestUri)) + message.RequestUri = requestUri; + else + System.Diagnostics.Debug.WriteLine(parts[1]); if (parts.Length >= 3) { @@ -79,16 +79,16 @@ namespace Rssdp.Infrastructure } } - /// - /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). - /// - /// A string containing the name of the header to return the type of. - protected override bool IsContentHeader(string headerName) - { - return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); - } + /// + /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). + /// + /// A string containing the name of the header to return the type of. + protected override bool IsContentHeader(string headerName) + { + return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); + } - #endregion + #endregion - } -} \ No newline at end of file + } +} diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs index 8ecb944c22..cbd5517b84 100644 --- a/RSSDP/HttpResponseParser.cs +++ b/RSSDP/HttpResponseParser.cs @@ -8,82 +8,82 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Parses a string into a or throws an exception. - /// - public sealed class HttpResponseParser : HttpParserBase - { + /// + /// Parses a string into a or throws an exception. + /// + public sealed class HttpResponseParser : HttpParserBase + { - #region Fields & Constants + #region Fields & Constants - private readonly string[] ContentHeaderNames = new string[] - { - "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" - }; + private readonly string[] ContentHeaderNames = new string[] + { + "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified" + }; - #endregion + #endregion - #region Public Methods + #region Public Methods - /// - /// Parses the specified data into a instance. - /// - /// A string containing the data to parse. - /// A instance containing the parsed data. - public override HttpResponseMessage Parse(string data) - { - System.Net.Http.HttpResponseMessage retVal = null; - try - { - retVal = new System.Net.Http.HttpResponseMessage(); + /// + /// Parses the specified data into a instance. + /// + /// A string containing the data to parse. + /// A instance containing the parsed data. + public override HttpResponseMessage Parse(string data) + { + System.Net.Http.HttpResponseMessage retVal = null; + try + { + retVal = new System.Net.Http.HttpResponseMessage(); - Parse(retVal, retVal.Headers, data); + Parse(retVal, retVal.Headers, data); - return retVal; - } - catch - { - if (retVal != null) - retVal.Dispose(); + return retVal; + } + catch + { + if (retVal != null) + retVal.Dispose(); - throw; - } - } + throw; + } + } - #endregion + #endregion - #region Overrides Methods + #region Overrides Methods - /// - /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). - /// - /// A string containing the name of the header to return the type of. - /// A boolean, true if th specified header relates to HTTP content, otherwise false. - protected override bool IsContentHeader(string headerName) - { - return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); - } + /// + /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). + /// + /// A string containing the name of the header to return the type of. + /// A boolean, true if th specified header relates to HTTP content, otherwise false. + protected override bool IsContentHeader(string headerName) + { + return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); + } - /// - /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . - /// - /// The first line of the HTTP message to be parsed. - /// Either a or to assign the parsed values to. - protected override void ParseStatusLine(string data, HttpResponseMessage message) - { - if (data == null) throw new ArgumentNullException("data"); - if (message == null) throw new ArgumentNullException("message"); + /// + /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . + /// + /// The first line of the HTTP message to be parsed. + /// Either a or to assign the parsed values to. + protected override void ParseStatusLine(string data, HttpResponseMessage message) + { + if (data == null) throw new ArgumentNullException("data"); + if (message == null) throw new ArgumentNullException("message"); - var parts = data.Split(' '); - if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); + var parts = data.Split(' '); + if (parts.Length < 2) throw new ArgumentException("data status line is invalid. Insufficient status parts.", "data"); - message.Version = ParseHttpVersion(parts[0].Trim()); + message.Version = ParseHttpVersion(parts[0].Trim()); - int statusCode = -1; - if (!Int32.TryParse(parts[1].Trim(), out statusCode)) - throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", "data"); + int statusCode = -1; + if (!Int32.TryParse(parts[1].Trim(), out statusCode)) + throw new ArgumentException("data status line is invalid. Status code is not a valid integer.", "data"); - message.StatusCode = (HttpStatusCode)statusCode; + message.StatusCode = (HttpStatusCode)statusCode; if (parts.Length >= 3) { @@ -91,7 +91,6 @@ namespace Rssdp.Infrastructure } } - #endregion - - } -} \ No newline at end of file + #endregion + } +} diff --git a/RSSDP/IEnumerableExtensions.cs b/RSSDP/IEnumerableExtensions.cs index f72073949d..85a72c01d2 100644 --- a/RSSDP/IEnumerableExtensions.cs +++ b/RSSDP/IEnumerableExtensions.cs @@ -5,24 +5,24 @@ using System.Text; namespace Rssdp.Infrastructure { - internal static class IEnumerableExtensions - { - public static IEnumerable SelectManyRecursive(this IEnumerable source, Func> selector) - { - if (source == null) throw new ArgumentNullException("source"); - if (selector == null) throw new ArgumentNullException("selector"); + internal static class IEnumerableExtensions + { + public static IEnumerable SelectManyRecursive(this IEnumerable source, Func> selector) + { + if (source == null) throw new ArgumentNullException("source"); + if (selector == null) throw new ArgumentNullException("selector"); - return !source.Any() ? source : - source.Concat( - source - .SelectMany(i => selector(i).EmptyIfNull()) - .SelectManyRecursive(selector) - ); - } + return !source.Any() ? source : + source.Concat( + source + .SelectMany(i => selector(i).EmptyIfNull()) + .SelectManyRecursive(selector) + ); + } - public static IEnumerable EmptyIfNull(this IEnumerable source) - { - return source ?? Enumerable.Empty(); - } - } + public static IEnumerable EmptyIfNull(this IEnumerable source) + { + return source ?? Enumerable.Empty(); + } + } } diff --git a/RSSDP/ISsdpDeviceLocator.cs b/RSSDP/ISsdpDeviceLocator.cs index 3ab2718366..32235c0950 100644 --- a/RSSDP/ISsdpDeviceLocator.cs +++ b/RSSDP/ISsdpDeviceLocator.cs @@ -2,140 +2,140 @@ namespace Rssdp.Infrastructure { - /// - /// Interface for components that discover the existence of SSDP devices. - /// - /// - /// Discovering devices includes explicit search requests as well as listening for broadcast status notifications. - /// - /// - /// - /// - public interface ISsdpDeviceLocator - { + /// + /// Interface for components that discover the existence of SSDP devices. + /// + /// + /// Discovering devices includes explicit search requests as well as listening for broadcast status notifications. + /// + /// + /// + /// + public interface ISsdpDeviceLocator + { - #region Events + #region Events - /// - /// Event raised when a device becomes available or is found by a search request. - /// - /// - /// - /// - /// - event EventHandler DeviceAvailable; - - /// - /// Event raised when a device explicitly notifies of shutdown or a device expires from the cache. - /// - /// - /// - /// - /// - event EventHandler DeviceUnavailable; + /// + /// Event raised when a device becomes available or is found by a search request. + /// + /// + /// + /// + /// + event EventHandler DeviceAvailable; - #endregion + /// + /// Event raised when a device explicitly notifies of shutdown or a device expires from the cache. + /// + /// + /// + /// + /// + event EventHandler DeviceUnavailable; - #region Properties + #endregion - /// - /// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the or events. - /// - /// - /// Device alive/byebye notifications whose NT header does not match this filter value will still be captured and cached internally, but will not raise events about device availability. Usually used with either a device type of uuid NT header value. - /// Example filters follow; - /// upnp:rootdevice - /// urn:schemas-upnp-org:device:WANDevice:1 - /// "uuid:9F15356CC-95FA-572E-0E99-85B456BD3012" - /// - /// - /// - /// - /// - string NotificationFilter - { - get; - set; - } + #region Properties - #endregion + /// + /// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the or events. + /// + /// + /// Device alive/byebye notifications whose NT header does not match this filter value will still be captured and cached internally, but will not raise events about device availability. Usually used with either a device type of uuid NT header value. + /// Example filters follow; + /// upnp:rootdevice + /// urn:schemas-upnp-org:device:WANDevice:1 + /// "uuid:9F15356CC-95FA-572E-0E99-85B456BD3012" + /// + /// + /// + /// + /// + string NotificationFilter + { + get; + set; + } - #region Methods + #endregion - #region SearchAsync Overloads + #region Methods - /// - /// Aynchronously performs a search for all devices using the default search timeout, and returns an awaitable task that can be used to retrieve the results. - /// - /// A task whose result is an of instances, representing all found devices. - System.Threading.Tasks.Task> SearchAsync(); + #region SearchAsync Overloads - /// - /// Performs a search for the specified search target (criteria) and default search timeout. - /// - /// The criteria for the search. Value can be; - /// - /// Root devicesupnp:rootdevice - /// Specific device by UUIDuuid:<device uuid> - /// Device typeFully qualified device type starting with urn: i.e urn:schemas-upnp-org:Basic:1 - /// - /// - /// A task whose result is an of instances, representing all found devices. - System.Threading.Tasks.Task> SearchAsync(string searchTarget); + /// + /// Aynchronously performs a search for all devices using the default search timeout, and returns an awaitable task that can be used to retrieve the results. + /// + /// A task whose result is an of instances, representing all found devices. + System.Threading.Tasks.Task> SearchAsync(); - /// - /// Performs a search for the specified search target (criteria) and search timeout. - /// - /// The criteria for the search. Value can be; - /// - /// Root devicesupnp:rootdevice - /// Specific device by UUIDuuid:<device uuid> - /// Device typeA device namespace and type in format of urn:<device namespace>:device:<device type>:<device version> i.e urn:schemas-upnp-org:device:Basic:1 - /// Service typeA service namespace and type in format of urn:<service namespace>:service:<servicetype>:<service version> i.e urn:my-namespace:service:MyCustomService:1 - /// - /// - /// The amount of time to wait for network responses to the search request. Longer values will likely return more devices, but increase search time. A value between 1 and 5 is recommended by the UPnP 1.1 specification. Specify TimeSpan.Zero to return only devices already in the cache. - /// - /// By design RSSDP does not support 'publishing services' as it is intended for use with non-standard UPnP devices that don't publish UPnP style services. However, it is still possible to use RSSDP to search for devices implemetning these services if you know the service type. - /// - /// A task whose result is an of instances, representing all found devices. - System.Threading.Tasks.Task> SearchAsync(string searchTarget, TimeSpan searchWaitTime); + /// + /// Performs a search for the specified search target (criteria) and default search timeout. + /// + /// The criteria for the search. Value can be; + /// + /// Root devicesupnp:rootdevice + /// Specific device by UUIDuuid:<device uuid> + /// Device typeFully qualified device type starting with urn: i.e urn:schemas-upnp-org:Basic:1 + /// + /// + /// A task whose result is an of instances, representing all found devices. + System.Threading.Tasks.Task> SearchAsync(string searchTarget); - /// - /// Performs a search for all devices using the specified search timeout. - /// - /// The amount of time to wait for network responses to the search request. Longer values will likely return more devices, but increase search time. A value between 1 and 5 is recommended by the UPnP 1.1 specification. Specify TimeSpan.Zero to return only devices already in the cache. - /// A task whose result is an of instances, representing all found devices. - System.Threading.Tasks.Task> SearchAsync(TimeSpan searchWaitTime); + /// + /// Performs a search for the specified search target (criteria) and search timeout. + /// + /// The criteria for the search. Value can be; + /// + /// Root devicesupnp:rootdevice + /// Specific device by UUIDuuid:<device uuid> + /// Device typeA device namespace and type in format of urn:<device namespace>:device:<device type>:<device version> i.e urn:schemas-upnp-org:device:Basic:1 + /// Service typeA service namespace and type in format of urn:<service namespace>:service:<servicetype>:<service version> i.e urn:my-namespace:service:MyCustomService:1 + /// + /// + /// The amount of time to wait for network responses to the search request. Longer values will likely return more devices, but increase search time. A value between 1 and 5 is recommended by the UPnP 1.1 specification. Specify TimeSpan.Zero to return only devices already in the cache. + /// + /// By design RSSDP does not support 'publishing services' as it is intended for use with non-standard UPnP devices that don't publish UPnP style services. However, it is still possible to use RSSDP to search for devices implemetning these services if you know the service type. + /// + /// A task whose result is an of instances, representing all found devices. + System.Threading.Tasks.Task> SearchAsync(string searchTarget, TimeSpan searchWaitTime); - #endregion - - /// - /// Starts listening for broadcast notifications of service availability. - /// - /// - /// When called the system will listen for 'alive' and 'byebye' notifications. This can speed up searching, as well as provide dynamic notification of new devices appearing on the network, and previously discovered devices disappearing. - /// - /// - /// - /// - /// - void StartListeningForNotifications(); + /// + /// Performs a search for all devices using the specified search timeout. + /// + /// The amount of time to wait for network responses to the search request. Longer values will likely return more devices, but increase search time. A value between 1 and 5 is recommended by the UPnP 1.1 specification. Specify TimeSpan.Zero to return only devices already in the cache. + /// A task whose result is an of instances, representing all found devices. + System.Threading.Tasks.Task> SearchAsync(TimeSpan searchWaitTime); - /// - /// Stops listening for broadcast notifications of service availability. - /// - /// - /// Does nothing if this instance is not already listening for notifications. - /// - /// Throw if the property is true. - /// - /// - /// - /// - void StopListeningForNotifications(); + #endregion - #endregion + /// + /// Starts listening for broadcast notifications of service availability. + /// + /// + /// When called the system will listen for 'alive' and 'byebye' notifications. This can speed up searching, as well as provide dynamic notification of new devices appearing on the network, and previously discovered devices disappearing. + /// + /// + /// + /// + /// + void StartListeningForNotifications(); - } -} \ No newline at end of file + /// + /// Stops listening for broadcast notifications of service availability. + /// + /// + /// Does nothing if this instance is not already listening for notifications. + /// + /// Throw if the property is true. + /// + /// + /// + /// + void StopListeningForNotifications(); + + #endregion + + } +} diff --git a/RSSDP/ISsdpDevicePublisher.cs b/RSSDP/ISsdpDevicePublisher.cs index b6ebc4176b..b0924701f4 100644 --- a/RSSDP/ISsdpDevicePublisher.cs +++ b/RSSDP/ISsdpDevicePublisher.cs @@ -3,35 +3,34 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Interface for components that publish the existence of SSDP devices. - /// - /// - /// Publishing a device includes sending notifications (alive and byebye) as well as responding to search requests when appropriate. - /// - /// - /// - public interface ISsdpDevicePublisher - { - /// - /// Adds a device (and it's children) to the list of devices being published by this server, making them discoverable to SSDP clients. - /// - /// The instance to add. - /// An awaitable . - void AddDevice(SsdpRootDevice device); + /// + /// Interface for components that publish the existence of SSDP devices. + /// + /// + /// Publishing a device includes sending notifications (alive and byebye) as well as responding to search requests when appropriate. + /// + /// + /// + public interface ISsdpDevicePublisher + { + /// + /// Adds a device (and it's children) to the list of devices being published by this server, making them discoverable to SSDP clients. + /// + /// The instance to add. + /// An awaitable . + void AddDevice(SsdpRootDevice device); - /// - /// Removes a device (and it's children) from the list of devices being published by this server, making them undiscoverable. - /// - /// The instance to add. - /// An awaitable . - Task RemoveDevice(SsdpRootDevice device); + /// + /// Removes a device (and it's children) from the list of devices being published by this server, making them undiscoverable. + /// + /// The instance to add. + /// An awaitable . + Task RemoveDevice(SsdpRootDevice device); - /// - /// Returns a read only list of devices being published by this instance. - /// - /// - System.Collections.Generic.IEnumerable Devices { get; } - - } + /// + /// Returns a read only list of devices being published by this instance. + /// + /// + System.Collections.Generic.IEnumerable Devices { get; } + } } diff --git a/RSSDP/RequestReceivedEventArgs.cs b/RSSDP/RequestReceivedEventArgs.cs index f4e3677605..6a5b0f0864 100644 --- a/RSSDP/RequestReceivedEventArgs.cs +++ b/RSSDP/RequestReceivedEventArgs.cs @@ -8,54 +8,52 @@ using MediaBrowser.Model.Net; namespace Rssdp.Infrastructure { - /// - /// Provides arguments for the event. - /// - public sealed class RequestReceivedEventArgs : EventArgs - { + /// + /// Provides arguments for the event. + /// + public sealed class RequestReceivedEventArgs : EventArgs + { + #region Fields - #region Fields + private readonly HttpRequestMessage _Message; + private readonly IpEndPointInfo _ReceivedFrom; - private readonly HttpRequestMessage _Message; - private readonly IpEndPointInfo _ReceivedFrom; + #endregion - #endregion + public IpAddressInfo LocalIpAddress { get; private set; } - public IpAddressInfo LocalIpAddress { get; private set; } + #region Constructors - #region Constructors + /// + /// Full constructor. + /// + public RequestReceivedEventArgs(HttpRequestMessage message, IpEndPointInfo receivedFrom, IpAddressInfo localIpAddress) + { + _Message = message; + _ReceivedFrom = receivedFrom; + LocalIpAddress = localIpAddress; + } - /// - /// Full constructor. - /// - public RequestReceivedEventArgs(HttpRequestMessage message, IpEndPointInfo receivedFrom, IpAddressInfo localIpAddress) - { - _Message = message; - _ReceivedFrom = receivedFrom; - LocalIpAddress = localIpAddress; - } + #endregion - #endregion + #region Public Properties - #region Public Properties + /// + /// The that was received. + /// + public HttpRequestMessage Message + { + get { return _Message; } + } - /// - /// The that was received. - /// - public HttpRequestMessage Message - { - get { return _Message; } - } + /// + /// The the request came from. + /// + public IpEndPointInfo ReceivedFrom + { + get { return _ReceivedFrom; } + } - /// - /// The the request came from. - /// - public IpEndPointInfo ReceivedFrom - { - get { return _ReceivedFrom; } - } - - #endregion - - } -} \ No newline at end of file + #endregion + } +} diff --git a/RSSDP/ResponseReceivedEventArgs.cs b/RSSDP/ResponseReceivedEventArgs.cs index f67d5da90b..5ec5376df4 100644 --- a/RSSDP/ResponseReceivedEventArgs.cs +++ b/RSSDP/ResponseReceivedEventArgs.cs @@ -8,53 +8,52 @@ using MediaBrowser.Model.Net; namespace Rssdp.Infrastructure { - /// - /// Provides arguments for the event. - /// - public sealed class ResponseReceivedEventArgs : EventArgs - { + /// + /// Provides arguments for the event. + /// + public sealed class ResponseReceivedEventArgs : EventArgs + { public IpAddressInfo LocalIpAddress { get; set; } #region Fields private readonly HttpResponseMessage _Message; - private readonly IpEndPointInfo _ReceivedFrom; + private readonly IpEndPointInfo _ReceivedFrom; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Full constructor. - /// - public ResponseReceivedEventArgs(HttpResponseMessage message, IpEndPointInfo receivedFrom) - { - _Message = message; - _ReceivedFrom = receivedFrom; - } + /// + /// Full constructor. + /// + public ResponseReceivedEventArgs(HttpResponseMessage message, IpEndPointInfo receivedFrom) + { + _Message = message; + _ReceivedFrom = receivedFrom; + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// The that was received. - /// - public HttpResponseMessage Message - { - get { return _Message; } - } + /// + /// The that was received. + /// + public HttpResponseMessage Message + { + get { return _Message; } + } - /// - /// The the response came from. - /// - public IpEndPointInfo ReceivedFrom - { - get { return _ReceivedFrom; } - } + /// + /// The the response came from. + /// + public IpEndPointInfo ReceivedFrom + { + get { return _ReceivedFrom; } + } - #endregion - - } + #endregion + } } diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index 65ec0ca714..e2e5c4e9f5 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -20,22 +20,19 @@ namespace Rssdp.Infrastructure #region Fields - /* - - We could technically use one socket listening on port 1900 for everything. - This should get both multicast (notifications) and unicast (search response) messages, however - this often doesn't work under Windows because the MS SSDP service is running. If that service - is running then it will steal the unicast messages and we will never see search responses. - Since stopping the service would be a bad idea (might not be allowed security wise and might - break other apps running on the system) the only other work around is to use two sockets. - - We use one socket to listen for/receive notifications and search requests (_BroadcastListenSocket). - We use a second socket, bound to a different local port, to send search requests and listen for - responses (_SendSocket). The responses are sent to the local port this socket is bound to, - which isn't port 1900 so the MS service doesn't steal them. While the caller can specify a local - port to use, we will default to 0 which allows the underlying system to auto-assign a free port. - - */ + /* We could technically use one socket listening on port 1900 for everything. + * This should get both multicast (notifications) and unicast (search response) messages, however + * this often doesn't work under Windows because the MS SSDP service is running. If that service + * is running then it will steal the unicast messages and we will never see search responses. + * Since stopping the service would be a bad idea (might not be allowed security wise and might + * break other apps running on the system) the only other work around is to use two sockets. + * + * We use one socket to listen for/receive notifications and search requests (_BroadcastListenSocket). + * We use a second socket, bound to a different local port, to send search requests and listen for + * responses (_SendSocket). The responses are sent to the local port this socket is bound to, + * which isn't port 1900 so the MS service doesn't steal them. While the caller can specify a local + * port to use, we will default to 0 which allows the underlying system to auto-assign a free port. + */ private object _BroadcastListenSocketSynchroniser = new object(); private ISocket _BroadcastListenSocket; @@ -443,7 +440,7 @@ namespace Rssdp.Infrastructure private void ProcessMessage(string data, IpEndPointInfo endPoint, IpAddressInfo receivedOnLocalIpAddress) { //Responses start with the HTTP version, prefixed with HTTP/ while - //requests start with a method which can vary and might be one we haven't + //requests start with a method which can vary and might be one we haven't //seen/don't know. We'll check if this message is a request or a response //by checking for the HTTP/ prefix on the start of the message. if (data.StartsWith("HTTP/", StringComparison.OrdinalIgnoreCase)) diff --git a/RSSDP/SsdpConstants.cs b/RSSDP/SsdpConstants.cs index 87f01f9e0c..ab0ecb0f7e 100644 --- a/RSSDP/SsdpConstants.cs +++ b/RSSDP/SsdpConstants.cs @@ -5,63 +5,63 @@ using System.Threading.Tasks; namespace Rssdp.Infrastructure { - /// - /// Provides constants for common values related to the SSDP protocols. - /// - public static class SsdpConstants - { + /// + /// Provides constants for common values related to the SSDP protocols. + /// + public static class SsdpConstants + { - /// - /// Multicast IP Address used for SSDP multicast messages. Values is 239.255.255.250. - /// - public const string MulticastLocalAdminAddress = "239.255.255.250"; - /// - /// The UDP port used for SSDP multicast messages. Values is 1900. - /// - public const int MulticastPort = 1900; - /// - /// The default multicase TTL for SSDP multicast messages. Value is 4. - /// - public const int SsdpDefaultMulticastTimeToLive = 4; + /// + /// Multicast IP Address used for SSDP multicast messages. Values is 239.255.255.250. + /// + public const string MulticastLocalAdminAddress = "239.255.255.250"; + /// + /// The UDP port used for SSDP multicast messages. Values is 1900. + /// + public const int MulticastPort = 1900; + /// + /// The default multicase TTL for SSDP multicast messages. Value is 4. + /// + public const int SsdpDefaultMulticastTimeToLive = 4; - internal const string MSearchMethod = "M-SEARCH"; + internal const string MSearchMethod = "M-SEARCH"; - internal const string SsdpDiscoverMessage = "ssdp:discover"; - internal const string SsdpDiscoverAllSTHeader = "ssdp:all"; + internal const string SsdpDiscoverMessage = "ssdp:discover"; + internal const string SsdpDiscoverAllSTHeader = "ssdp:all"; - internal const string SsdpDeviceDescriptionXmlNamespace = "urn:schemas-upnp-org:device-1-0"; + internal const string SsdpDeviceDescriptionXmlNamespace = "urn:schemas-upnp-org:device-1-0"; - /// - /// Default buffer size for receiving SSDP broadcasts. Value is 8192 (bytes). - /// - public const int DefaultUdpSocketBufferSize = 8192; - /// - /// The maximum possible buffer size for a UDP message. Value is 65507 (bytes). - /// - public const int MaxUdpSocketBufferSize = 65507; // Max possible UDP packet size on IPv4 without using 'jumbograms'. + /// + /// Default buffer size for receiving SSDP broadcasts. Value is 8192 (bytes). + /// + public const int DefaultUdpSocketBufferSize = 8192; + /// + /// The maximum possible buffer size for a UDP message. Value is 65507 (bytes). + /// + public const int MaxUdpSocketBufferSize = 65507; // Max possible UDP packet size on IPv4 without using 'jumbograms'. - /// - /// Namespace/prefix for UPnP device types. Values is schemas-upnp-org. - /// - public const string UpnpDeviceTypeNamespace = "schemas-upnp-org"; - /// - /// UPnP Root Device type. Value is upnp:rootdevice. - /// - public const string UpnpDeviceTypeRootDevice = "upnp:rootdevice"; - /// - /// The value is used by Windows Explorer for device searches instead of the UPNPDeviceTypeRootDevice constant. - /// Not sure why (different spec, bug, alternate protocol etc). Used to enable Windows Explorer support. - /// - public const string PnpDeviceTypeRootDevice = "pnp:rootdevice"; - /// - /// UPnP Basic Device type. Value is Basic. - /// - public const string UpnpDeviceTypeBasicDevice = "Basic"; + /// + /// Namespace/prefix for UPnP device types. Values is schemas-upnp-org. + /// + public const string UpnpDeviceTypeNamespace = "schemas-upnp-org"; + /// + /// UPnP Root Device type. Value is upnp:rootdevice. + /// + public const string UpnpDeviceTypeRootDevice = "upnp:rootdevice"; + /// + /// The value is used by Windows Explorer for device searches instead of the UPNPDeviceTypeRootDevice constant. + /// Not sure why (different spec, bug, alternate protocol etc). Used to enable Windows Explorer support. + /// + public const string PnpDeviceTypeRootDevice = "pnp:rootdevice"; + /// + /// UPnP Basic Device type. Value is Basic. + /// + public const string UpnpDeviceTypeBasicDevice = "Basic"; - internal const string SsdpKeepAliveNotification = "ssdp:alive"; - internal const string SsdpByeByeNotification = "ssdp:byebye"; + internal const string SsdpKeepAliveNotification = "ssdp:alive"; + internal const string SsdpByeByeNotification = "ssdp:byebye"; - internal const int UdpResendCount = 3; + internal const int UdpResendCount = 3; - } + } } diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.cs index ef6869c8ba..865084d050 100644 --- a/RSSDP/SsdpDevice.cs +++ b/RSSDP/SsdpDevice.cs @@ -75,7 +75,7 @@ namespace Rssdp return rootDevice; } - + #region Public Properties #region UPnP Device Description Properties @@ -330,7 +330,7 @@ namespace Rssdp /// /// The instance added to the collection. /// - /// + /// protected virtual void OnDeviceAdded(SsdpEmbeddedDevice device) { var handlers = this.DeviceAdded; diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.cs index cee9b7f911..30e1c5a0be 100644 --- a/RSSDP/SsdpDevicePublisher.cs +++ b/RSSDP/SsdpDevicePublisher.cs @@ -418,7 +418,7 @@ namespace Rssdp.Infrastructure var values = new Dictionary(StringComparer.OrdinalIgnoreCase); - // If needed later for non-server devices, these headers will need to be dynamic + // If needed later for non-server devices, these headers will need to be dynamic values["HOST"] = "239.255.255.250:1900"; values["DATE"] = DateTime.UtcNow.ToString("r"); values["CACHE-CONTROL"] = "max-age = " + rootDevice.CacheLifetime.TotalSeconds; @@ -463,7 +463,7 @@ namespace Rssdp.Infrastructure var values = new Dictionary(StringComparer.OrdinalIgnoreCase); - // If needed later for non-server devices, these headers will need to be dynamic + // If needed later for non-server devices, these headers will need to be dynamic values["HOST"] = "239.255.255.250:1900"; values["DATE"] = DateTime.UtcNow.ToString("r"); values["SERVER"] = string.Format("{0}/{1} UPnP/1.0 RSSDP/{2}", _OSName, _OSVersion, ServerVersion); @@ -538,9 +538,9 @@ namespace Rssdp.Infrastructure //According to SSDP/UPnP spec, ignore message if missing these headers. // Edit: But some devices do it anyway //if (!e.Message.Headers.Contains("MX")) - // WriteTrace("Ignoring search request - missing MX header."); + // WriteTrace("Ignoring search request - missing MX header."); //else if (!e.Message.Headers.Contains("MAN")) - // WriteTrace("Ignoring search request - missing MAN header."); + // WriteTrace("Ignoring search request - missing MAN header."); //else ProcessSearchRequest(GetFirstHeaderValue(e.Message.Headers, "MX"), GetFirstHeaderValue(e.Message.Headers, "ST"), e.ReceivedFrom, e.LocalIpAddress, CancellationToken.None); } diff --git a/RSSDP/SsdpEmbeddedDevice.cs b/RSSDP/SsdpEmbeddedDevice.cs index dca1ff5e39..0e02ce33c0 100644 --- a/RSSDP/SsdpEmbeddedDevice.cs +++ b/RSSDP/SsdpEmbeddedDevice.cs @@ -4,54 +4,52 @@ using System.Text; namespace Rssdp { - /// - /// Represents a device that is a descendant of a instance. - /// - public class SsdpEmbeddedDevice : SsdpDevice - { + /// + /// Represents a device that is a descendant of a instance. + /// + public class SsdpEmbeddedDevice : SsdpDevice + { - #region Fields - - private SsdpRootDevice _RootDevice; + #region Fields + private SsdpRootDevice _RootDevice; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Default constructor. - /// - public SsdpEmbeddedDevice() - { - } + /// + /// Default constructor. + /// + public SsdpEmbeddedDevice() + { + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Returns the that is this device's first ancestor. If this device is itself an , then returns a reference to itself. - /// - public SsdpRootDevice RootDevice - { - get - { - return _RootDevice; - } - internal set - { - _RootDevice = value; - lock (this.Devices) - { - foreach (var embeddedDevice in this.Devices) - { - ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice; - } - } - } - } + /// + /// Returns the that is this device's first ancestor. If this device is itself an , then returns a reference to itself. + /// + public SsdpRootDevice RootDevice + { + get + { + return _RootDevice; + } + internal set + { + _RootDevice = value; + lock (this.Devices) + { + foreach (var embeddedDevice in this.Devices) + { + ((SsdpEmbeddedDevice)embeddedDevice).RootDevice = _RootDevice; + } + } + } + } - #endregion - - } -} \ No newline at end of file + #endregion + } +} diff --git a/RSSDP/SsdpRootDevice.cs b/RSSDP/SsdpRootDevice.cs index eaf3f6a384..20644535ad 100644 --- a/RSSDP/SsdpRootDevice.cs +++ b/RSSDP/SsdpRootDevice.cs @@ -6,74 +6,72 @@ using Rssdp.Infrastructure; namespace Rssdp { - /// - /// Represents a 'root' device, a device that has no parent. Used for publishing devices and for the root device in a tree of discovered devices. - /// - /// - /// Child (embedded) devices are represented by the in the property. - /// Root devices contain some information that applies to the whole device tree and is therefore not present on child devices, such as and . - /// - public class SsdpRootDevice : SsdpDevice - { - - #region Fields + /// + /// Represents a 'root' device, a device that has no parent. Used for publishing devices and for the root device in a tree of discovered devices. + /// + /// + /// Child (embedded) devices are represented by the in the property. + /// Root devices contain some information that applies to the whole device tree and is therefore not present on child devices, such as and . + /// + public class SsdpRootDevice : SsdpDevice + { + #region Fields - private Uri _UrlBase; + private Uri _UrlBase; - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Default constructor. - /// - public SsdpRootDevice() : base() - { - } + /// + /// Default constructor. + /// + public SsdpRootDevice() : base() + { + } - #endregion + #endregion - #region Public Properties + #region Public Properties - /// - /// Specifies how long clients can cache this device's details for. Optional but defaults to which means no-caching. Recommended value is half an hour. - /// - /// - /// Specifiy to indicate no caching allowed. - /// Also used to specify how often to rebroadcast alive notifications. - /// The UPnP/SSDP specifications indicate this should not be less than 1800 seconds (half an hour), but this is not enforced by this library. - /// - public TimeSpan CacheLifetime - { - get; set; - } + /// + /// Specifies how long clients can cache this device's details for. Optional but defaults to which means no-caching. Recommended value is half an hour. + /// + /// + /// Specifiy to indicate no caching allowed. + /// Also used to specify how often to rebroadcast alive notifications. + /// The UPnP/SSDP specifications indicate this should not be less than 1800 seconds (half an hour), but this is not enforced by this library. + /// + public TimeSpan CacheLifetime + { + get; set; + } - /// - /// Gets or sets the URL used to retrieve the description document for this device/tree. Required. - /// - public Uri Location { get; set; } + /// + /// Gets or sets the URL used to retrieve the description document for this device/tree. Required. + /// + public Uri Location { get; set; } - /// - /// The base URL to use for all relative url's provided in other propertise (and those of child devices). Optional. - /// - /// - /// Defines the base URL. Used to construct fully-qualified URLs. All relative URLs that appear elsewhere in the description are combined with this base URL. If URLBase is empty or not given, the base URL is the URL from which the device description was retrieved (which is the preferred implementation; use of URLBase is no longer recommended). Specified by UPnP vendor. Single URL. - /// - public Uri UrlBase - { - get - { - return _UrlBase ?? this.Location; - } + /// + /// The base URL to use for all relative url's provided in other propertise (and those of child devices). Optional. + /// + /// + /// Defines the base URL. Used to construct fully-qualified URLs. All relative URLs that appear elsewhere in the description are combined with this base URL. If URLBase is empty or not given, the base URL is the URL from which the device description was retrieved (which is the preferred implementation; use of URLBase is no longer recommended). Specified by UPnP vendor. Single URL. + /// + public Uri UrlBase + { + get + { + return _UrlBase ?? this.Location; + } - set - { - _UrlBase = value; - } - } + set + { + _UrlBase = value; + } + } - #endregion - - } + #endregion + } } diff --git a/SocketHttpListener/Net/ChunkStream.cs b/SocketHttpListener/Net/ChunkStream.cs index b41285dbca..662be6313b 100644 --- a/SocketHttpListener/Net/ChunkStream.cs +++ b/SocketHttpListener/Net/ChunkStream.cs @@ -14,7 +14,7 @@ namespace SocketHttpListener.Net // System.Net.ResponseStream // // Author: - // Gonzalo Paniagua Javier (gonzalo@novell.com) + // Gonzalo Paniagua Javier (gonzalo@novell.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // @@ -25,10 +25,10 @@ namespace SocketHttpListener.Net // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: - // + // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. - // + // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/SocketHttpListener/Net/ChunkedInputStream.cs b/SocketHttpListener/Net/ChunkedInputStream.cs index 919bd95ea0..c3bbff82d0 100644 --- a/SocketHttpListener/Net/ChunkedInputStream.cs +++ b/SocketHttpListener/Net/ChunkedInputStream.cs @@ -12,7 +12,7 @@ namespace SocketHttpListener.Net // System.Net.ResponseStream // // Author: - // Gonzalo Paniagua Javier (gonzalo@novell.com) + // Gonzalo Paniagua Javier (gonzalo@novell.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // diff --git a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs index 34953b569a..8fb4518a15 100644 --- a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs +++ b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs @@ -207,13 +207,13 @@ namespace SocketHttpListener.Net } /* Apache forces closing the connection for these status codes: - * HttpStatusCode.BadRequest 400 - * HttpStatusCode.RequestTimeout 408 - * HttpStatusCode.LengthRequired 411 - * HttpStatusCode.RequestEntityTooLarge 413 - * HttpStatusCode.RequestUriTooLong 414 - * HttpStatusCode.InternalServerError 500 - * HttpStatusCode.ServiceUnavailable 503 + * HttpStatusCode.BadRequest 400 + * HttpStatusCode.RequestTimeout 408 + * HttpStatusCode.LengthRequired 411 + * HttpStatusCode.RequestEntityTooLarge 413 + * HttpStatusCode.RequestUriTooLong 414 + * HttpStatusCode.InternalServerError 500 + * HttpStatusCode.ServiceUnavailable 503 */ bool conn_close = (_statusCode == (int)HttpStatusCode.BadRequest || _statusCode == (int)HttpStatusCode.RequestTimeout || _statusCode == (int)HttpStatusCode.LengthRequired || _statusCode == (int)HttpStatusCode.RequestEntityTooLarge diff --git a/SocketHttpListener/Net/HttpRequestStream.Managed.cs b/SocketHttpListener/Net/HttpRequestStream.Managed.cs index c9c148b150..493e2673b2 100644 --- a/SocketHttpListener/Net/HttpRequestStream.Managed.cs +++ b/SocketHttpListener/Net/HttpRequestStream.Managed.cs @@ -13,7 +13,7 @@ namespace SocketHttpListener.Net // System.Net.ResponseStream // // Author: - // Gonzalo Paniagua Javier (gonzalo@novell.com) + // Gonzalo Paniagua Javier (gonzalo@novell.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // @@ -24,10 +24,10 @@ namespace SocketHttpListener.Net // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: - // + // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. - // + // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/SocketHttpListener/Net/HttpRequestStream.cs b/SocketHttpListener/Net/HttpRequestStream.cs index f10c04a4f1..c9a1d5a2db 100644 --- a/SocketHttpListener/Net/HttpRequestStream.cs +++ b/SocketHttpListener/Net/HttpRequestStream.cs @@ -13,7 +13,7 @@ namespace SocketHttpListener.Net // System.Net.ResponseStream // // Author: - // Gonzalo Paniagua Javier (gonzalo@novell.com) + // Gonzalo Paniagua Javier (gonzalo@novell.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // @@ -24,10 +24,10 @@ namespace SocketHttpListener.Net // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: - // + // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. - // + // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/SocketHttpListener/Net/HttpResponseStream.Managed.cs b/SocketHttpListener/Net/HttpResponseStream.Managed.cs index e727f1b4af..6c33c31c9c 100644 --- a/SocketHttpListener/Net/HttpResponseStream.Managed.cs +++ b/SocketHttpListener/Net/HttpResponseStream.Managed.cs @@ -19,7 +19,7 @@ namespace SocketHttpListener.Net // System.Net.ResponseStream // // Author: - // Gonzalo Paniagua Javier (gonzalo@novell.com) + // Gonzalo Paniagua Javier (gonzalo@novell.com) // // Copyright (c) 2005 Novell, Inc. (http://www.novell.com) // @@ -30,10 +30,10 @@ namespace SocketHttpListener.Net // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: - // + // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. - // + // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/SocketHttpListener/Net/WebHeaderCollection.cs b/SocketHttpListener/Net/WebHeaderCollection.cs index 4bed81404b..2b1c630d68 100644 --- a/SocketHttpListener/Net/WebHeaderCollection.cs +++ b/SocketHttpListener/Net/WebHeaderCollection.cs @@ -23,69 +23,69 @@ namespace SocketHttpListener.Net } static readonly bool[] allowed_chars = { - false, false, false, false, false, false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, false, false, false, false, false, - false, false, false, false, false, true, false, true, true, true, true, false, false, false, true, - true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, - false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, - true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, - false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, - true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, - false, true, false - }; + false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, false, false, false, false, false, false, + false, false, false, false, false, true, false, true, true, true, true, false, false, false, true, + true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false, + false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, + true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, + false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, + true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, + false, true, false + }; static readonly Dictionary headers; static WebHeaderCollection() { headers = new Dictionary(StringComparer.OrdinalIgnoreCase) { - { "Allow", HeaderInfo.MultiValue }, - { "Accept", HeaderInfo.Request | HeaderInfo.MultiValue }, - { "Accept-Charset", HeaderInfo.MultiValue }, - { "Accept-Encoding", HeaderInfo.MultiValue }, - { "Accept-Language", HeaderInfo.MultiValue }, - { "Accept-Ranges", HeaderInfo.MultiValue }, - { "Age", HeaderInfo.Response }, - { "Authorization", HeaderInfo.MultiValue }, - { "Cache-Control", HeaderInfo.MultiValue }, - { "Cookie", HeaderInfo.MultiValue }, - { "Connection", HeaderInfo.Request | HeaderInfo.MultiValue }, - { "Content-Encoding", HeaderInfo.MultiValue }, - { "Content-Length", HeaderInfo.Request | HeaderInfo.Response }, - { "Content-Type", HeaderInfo.Request }, - { "Content-Language", HeaderInfo.MultiValue }, - { "Date", HeaderInfo.Request }, - { "Expect", HeaderInfo.Request | HeaderInfo.MultiValue}, - { "Host", HeaderInfo.Request }, - { "If-Match", HeaderInfo.MultiValue }, - { "If-Modified-Since", HeaderInfo.Request }, - { "If-None-Match", HeaderInfo.MultiValue }, - { "Keep-Alive", HeaderInfo.Response }, - { "Pragma", HeaderInfo.MultiValue }, - { "Proxy-Authenticate", HeaderInfo.MultiValue }, - { "Proxy-Authorization", HeaderInfo.MultiValue }, - { "Proxy-Connection", HeaderInfo.Request | HeaderInfo.MultiValue }, - { "Range", HeaderInfo.Request | HeaderInfo.MultiValue }, - { "Referer", HeaderInfo.Request }, - { "Set-Cookie", HeaderInfo.MultiValue }, - { "Set-Cookie2", HeaderInfo.MultiValue }, - { "Server", HeaderInfo.Response }, - { "TE", HeaderInfo.MultiValue }, - { "Trailer", HeaderInfo.MultiValue }, - { "Transfer-Encoding", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo.MultiValue }, - { "Translate", HeaderInfo.Request | HeaderInfo.Response }, - { "Upgrade", HeaderInfo.MultiValue }, - { "User-Agent", HeaderInfo.Request }, - { "Vary", HeaderInfo.MultiValue }, - { "Via", HeaderInfo.MultiValue }, - { "Warning", HeaderInfo.MultiValue }, - { "WWW-Authenticate", HeaderInfo.Response | HeaderInfo. MultiValue }, - { "SecWebSocketAccept", HeaderInfo.Response }, - { "SecWebSocketExtensions", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo. MultiValue }, - { "SecWebSocketKey", HeaderInfo.Request }, - { "Sec-WebSocket-Protocol", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo. MultiValue }, - { "SecWebSocketVersion", HeaderInfo.Response | HeaderInfo. MultiValue } - }; + { "Allow", HeaderInfo.MultiValue }, + { "Accept", HeaderInfo.Request | HeaderInfo.MultiValue }, + { "Accept-Charset", HeaderInfo.MultiValue }, + { "Accept-Encoding", HeaderInfo.MultiValue }, + { "Accept-Language", HeaderInfo.MultiValue }, + { "Accept-Ranges", HeaderInfo.MultiValue }, + { "Age", HeaderInfo.Response }, + { "Authorization", HeaderInfo.MultiValue }, + { "Cache-Control", HeaderInfo.MultiValue }, + { "Cookie", HeaderInfo.MultiValue }, + { "Connection", HeaderInfo.Request | HeaderInfo.MultiValue }, + { "Content-Encoding", HeaderInfo.MultiValue }, + { "Content-Length", HeaderInfo.Request | HeaderInfo.Response }, + { "Content-Type", HeaderInfo.Request }, + { "Content-Language", HeaderInfo.MultiValue }, + { "Date", HeaderInfo.Request }, + { "Expect", HeaderInfo.Request | HeaderInfo.MultiValue}, + { "Host", HeaderInfo.Request }, + { "If-Match", HeaderInfo.MultiValue }, + { "If-Modified-Since", HeaderInfo.Request }, + { "If-None-Match", HeaderInfo.MultiValue }, + { "Keep-Alive", HeaderInfo.Response }, + { "Pragma", HeaderInfo.MultiValue }, + { "Proxy-Authenticate", HeaderInfo.MultiValue }, + { "Proxy-Authorization", HeaderInfo.MultiValue }, + { "Proxy-Connection", HeaderInfo.Request | HeaderInfo.MultiValue }, + { "Range", HeaderInfo.Request | HeaderInfo.MultiValue }, + { "Referer", HeaderInfo.Request }, + { "Set-Cookie", HeaderInfo.MultiValue }, + { "Set-Cookie2", HeaderInfo.MultiValue }, + { "Server", HeaderInfo.Response }, + { "TE", HeaderInfo.MultiValue }, + { "Trailer", HeaderInfo.MultiValue }, + { "Transfer-Encoding", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo.MultiValue }, + { "Translate", HeaderInfo.Request | HeaderInfo.Response }, + { "Upgrade", HeaderInfo.MultiValue }, + { "User-Agent", HeaderInfo.Request }, + { "Vary", HeaderInfo.MultiValue }, + { "Via", HeaderInfo.MultiValue }, + { "Warning", HeaderInfo.MultiValue }, + { "WWW-Authenticate", HeaderInfo.Response | HeaderInfo. MultiValue }, + { "SecWebSocketAccept", HeaderInfo.Response }, + { "SecWebSocketExtensions", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo. MultiValue }, + { "SecWebSocketKey", HeaderInfo.Request }, + { "Sec-WebSocket-Protocol", HeaderInfo.Request | HeaderInfo.Response | HeaderInfo. MultiValue }, + { "SecWebSocketVersion", HeaderInfo.Response | HeaderInfo. MultiValue } + }; } // Methods From bd169e4fd4f5586ab8dad323a520cbcc10de54fe Mon Sep 17 00:00:00 2001 From: hawken Date: Mon, 7 Jan 2019 23:27:46 +0000 Subject: [PATCH 037/140] remove trailing whitespace --- BDInfo/Properties/AssemblyInfo.cs | 6 +- BDInfo/TSCodecDTS.cs | 2 +- BDInfo/TSCodecDTSHD.cs | 10 +- BDInfo/TSCodecMPEG2.cs | 4 +- BDInfo/TSCodecTrueHD.cs | 12 +- BDInfo/TSCodecVC1.cs | 6 +- BDInfo/TSPlaylistFile.cs | 24 +- BDInfo/TSStream.cs | 16 +- BDInfo/TSStreamClipFile.cs | 10 +- BDInfo/TSStreamFile.cs | 140 +-- DvdLib/Ifo/ProgramChain.cs | 2 +- DvdLib/Ifo/Title.cs | 2 +- DvdLib/Properties/AssemblyInfo.cs | 6 +- Emby.Dlna/Common/Argument.cs | 2 +- .../ServiceActionListBuilder.cs | 2 +- .../ContentDirectoryXmlBuilder.cs | 2 +- .../ServiceActionListBuilder.cs | 2 +- Emby.Dlna/IUpnpService.cs | 2 +- Emby.Dlna/Main/DlnaEntryPoint.cs | 40 +- Emby.Dlna/PlayTo/Device.cs | 2 +- Emby.Dlna/PlayTo/SsdpHttpClient.cs | 26 +- Emby.Dlna/PlayTo/TransportCommands.cs | 2 +- Emby.Dlna/PlayTo/uBaseObject.cs | 2 +- Emby.Dlna/PlayTo/uParser.cs | 2 +- Emby.Dlna/Profiles/SonyBravia2010Profile.cs | 2 +- Emby.Dlna/Properties/AssemblyInfo.cs | 6 +- Emby.Dlna/Service/BaseService.cs | 2 +- Emby.Dlna/Service/ControlErrorHandler.cs | 2 +- Emby.Dlna/Ssdp/DeviceDiscovery.cs | 4 +- Emby.Drawing.Skia/Properties/AssemblyInfo.cs | 4 +- Emby.Drawing/ImageProcessor.cs | 2 +- Emby.Drawing/Properties/AssemblyInfo.cs | 8 +- .../IsoMounter/LinuxIsoManager.cs | 10 +- Emby.IsoMounting/IsoMounter/LinuxMount.cs | 2 +- Emby.Naming/AudioBook/AudioBookInfo.cs | 2 +- Emby.Naming/AudioBook/AudioBookResolver.cs | 2 +- Emby.Naming/Common/NamingOptions.cs | 2 +- Emby.Naming/TV/EpisodeResolver.cs | 2 +- Emby.Naming/Video/CleanDateTimeParser.cs | 2 +- Emby.Naming/Video/StackResolver.cs | 2 +- Emby.Naming/Video/StubResolver.cs | 2 +- Emby.Naming/Video/VideoFileInfo.cs | 2 +- Emby.Naming/Video/VideoInfo.cs | 2 +- Emby.Naming/Video/VideoListResolver.cs | 4 +- Emby.Photos/Properties/AssemblyInfo.cs | 10 +- .../ApplicationHost.cs | 22 +- .../Browser/BrowserLauncher.cs | 2 +- .../Channels/ChannelManager.cs | 2 +- .../Channels/RefreshChannelsScheduledTask.cs | 4 +- .../Data/SqliteItemRepository.cs | 6 +- .../Devices/DeviceManager.cs | 2 +- .../EntryPoints/LibraryChangedNotifier.cs | 2 +- .../FFMpeg/FFMpegLoader.cs | 2 +- .../HttpServer/FileWriter.cs | 2 +- .../HttpServer/HttpListenerHost.cs | 2 +- .../HttpServer/HttpResultFactory.cs | 2 +- .../HttpServer/IHttpListener.cs | 2 +- .../Security/AuthorizationContext.cs | 2 +- .../IO/FileRefresher.cs | 2 +- .../IO/ManagedFileSystem.cs | 2 +- .../Library/LibraryManager.cs | 4 +- .../Library/Resolvers/Audio/AudioResolver.cs | 2 +- .../Resolvers/Audio/MusicAlbumResolver.cs | 2 +- .../Resolvers/Audio/MusicArtistResolver.cs | 2 +- .../Library/Resolvers/BaseVideoResolver.cs | 8 +- .../Library/Resolvers/Books/BookResolver.cs | 6 +- .../Library/Resolvers/Movies/MovieResolver.cs | 2 +- .../Library/Resolvers/TV/EpisodeResolver.cs | 6 +- .../Library/UserViewManager.cs | 2 +- .../Library/Validators/ArtistsValidator.cs | 2 +- .../LiveTv/EmbyTV/EmbyTV.cs | 2 +- .../LiveTv/EmbyTV/EncodedRecorder.cs | 14 +- .../LiveTv/LiveTvManager.cs | 2 +- .../LiveTv/RefreshChannelsScheduledTask.cs | 4 +- .../TunerHosts/HdHomerun/HdHomerunHost.cs | 2 +- .../Localization/TextLocalizer.cs | 2 +- .../Networking/IPNetwork/BigIntegerExt.cs | 20 +- .../Properties/AssemblyInfo.cs | 6 +- .../ScheduledTasks/PeopleValidationTask.cs | 4 +- .../ScheduledTasks/RefreshMediaLibraryTask.cs | 4 +- .../Tasks/DeleteCacheFileTask.cs | 4 +- .../ScheduledTasks/Tasks/DeleteLogFileTask.cs | 4 +- .../Security/MBLicenseFile.cs | 2 +- .../Services/ServiceHandler.cs | 2 +- .../Services/ServicePath.cs | 2 +- .../Services/UrlExtensions.cs | 2 +- .../Sorting/DatePlayedComparer.cs | 2 +- .../Sorting/PlayCountComparer.cs | 2 +- .../Sorting/PremiereDateComparer.cs | 2 +- .../Extensions/StringExtensions.cs | 2 +- .../TextEncoding/TextEncodingDetect.cs | 8 +- .../UniversalDetector/CharsetDetector.cs | 32 +- .../UniversalDetector/Core/Big5Prober.cs | 18 +- .../UniversalDetector/Core/BitPackage.cs | 20 +- .../UniversalDetector/Core/CharsetProber.cs | 44 +- .../UniversalDetector/Core/Charsets.cs | 44 +- .../Core/CodingStateMachine.cs | 34 +- .../UniversalDetector/Core/EUCJPProber.cs | 18 +- .../UniversalDetector/Core/EUCKRProber.cs | 14 +- .../UniversalDetector/Core/EUCTWProber.cs | 18 +- .../Core/EscCharsetProber.cs | 14 +- .../UniversalDetector/Core/EscSM.cs | 356 ++++---- .../UniversalDetector/Core/GB18030Prober.cs | 20 +- .../UniversalDetector/Core/HebrewProber.cs | 130 +-- .../Core/JapaneseContextAnalyser.cs | 68 +- .../Core/LangBulgarianModel.cs | 28 +- .../Core/LangCyrillicModel.cs | 36 +- .../UniversalDetector/Core/LangGreekModel.cs | 22 +- .../UniversalDetector/Core/LangHebrewModel.cs | 16 +- .../Core/LangHungarianModel.cs | 20 +- .../UniversalDetector/Core/LangThaiModel.cs | 16 +- .../UniversalDetector/Core/Latin1Prober.cs | 38 +- .../UniversalDetector/Core/MBCSGroupProber.cs | 16 +- .../UniversalDetector/Core/MBCSSM.cs | 834 +++++++++--------- .../UniversalDetector/Core/SBCSGroupProber.cs | 28 +- .../UniversalDetector/Core/SBCharsetProber.cs | 44 +- .../UniversalDetector/Core/SJISProber.cs | 20 +- .../UniversalDetector/Core/SMModel.cs | 12 +- .../UniversalDetector/Core/SequenceModel.cs | 30 +- .../UniversalDetector/Core/UTF8Prober.cs | 10 +- .../Core/UniversalDetector.cs | 60 +- .../UniversalDetector/DetectionConfidence.cs | 20 +- .../UniversalDetector/ICharsetDetector.cs | 20 +- Emby.Server.Implementations/Udp/UdpServer.cs | 2 +- .../Updates/InstallationManager.cs | 2 +- .../UserViews/FolderImageProvider.cs | 2 +- Emby.XmlTv/Emby.XmlTv.Console/Program.cs | 2 +- .../Properties/AssemblyInfo.cs | 10 +- .../Properties/AssemblyInfo.cs | 10 +- .../XmlTvReaderDateTimeTests.cs | 2 +- .../Emby.XmlTv/Entities/XmlTvEpisode.cs | 2 +- .../Emby.XmlTv/Entities/XmlTvProgram.cs | 2 +- .../Emby.XmlTv/Properties/AssemblyInfo.cs | 10 +- MediaBrowser.Api/ApiEntryPoint.cs | 4 +- MediaBrowser.Api/DisplayPreferencesService.cs | 2 +- MediaBrowser.Api/EnvironmentService.cs | 2 +- .../Playback/BaseStreamingService.cs | 2 +- .../Playback/Hls/BaseHlsService.cs | 2 +- MediaBrowser.Api/Playback/MediaInfoService.cs | 6 +- MediaBrowser.Api/Playback/StreamRequest.cs | 2 +- MediaBrowser.Api/Playback/StreamState.cs | 2 +- MediaBrowser.Api/PluginService.cs | 2 +- MediaBrowser.Api/Properties/AssemblyInfo.cs | 8 +- .../ScheduledTasks/ScheduledTaskService.cs | 2 +- .../System/ActivityLogWebSocketListener.cs | 2 +- .../UserLibrary/BaseItemsRequest.cs | 4 +- MediaBrowser.Api/UserLibrary/GenresService.cs | 2 +- .../UserLibrary/MusicGenresService.cs | 2 +- MediaBrowser.Api/UserLibrary/YearsService.cs | 2 +- MediaBrowser.Common/Net/HttpResponseInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 8 +- MediaBrowser.Controller/Dlna/IDlnaManager.cs | 8 +- .../Drawing/ImageProcessorExtensions.cs | 2 +- MediaBrowser.Controller/Entities/BaseItem.cs | 4 +- .../Entities/BaseItemExtensions.cs | 8 +- MediaBrowser.Controller/Entities/Folder.cs | 2 +- .../Entities/ISupportsBoxSetGrouping.cs | 2 +- .../Entities/InternalItemsQuery.cs | 2 +- MediaBrowser.Controller/Entities/User.cs | 2 +- .../Entities/UserItemData.cs | 2 +- .../IServerApplicationHost.cs | 2 +- .../IServerApplicationPaths.cs | 2 +- .../Library/IUserManager.cs | 4 +- .../Library/ItemResolveArgs.cs | 2 +- MediaBrowser.Controller/LiveTv/ChannelInfo.cs | 2 +- .../LiveTv/ILiveTvService.cs | 2 +- .../LiveTv/LiveTvServiceStatusInfo.cs | 2 +- .../LiveTv/LiveTvTunerInfo.cs | 6 +- .../LiveTv/RecordingInfo.cs | 6 +- .../LiveTv/SeriesTimerInfo.cs | 8 +- .../MediaEncoding/ImageEncodingOptions.cs | 4 +- .../Net/AuthorizationInfo.cs | 4 +- .../Net/BasePeriodicWebSocketListener.cs | 2 +- .../Net/IAuthorizationContext.cs | 2 +- .../Net/ISessionContext.cs | 2 +- .../Plugins/ILocalizablePlugin.cs | 2 +- .../Properties/AssemblyInfo.cs | 8 +- .../Providers/ILocalMetadataProvider.cs | 2 +- .../Providers/IPreRefreshProvider.cs | 2 +- .../Providers/IRemoteImageProvider.cs | 2 +- .../Resolvers/IItemResolver.cs | 2 +- .../Security/AuthenticationInfo.cs | 2 +- .../Security/AuthenticationInfoQuery.cs | 4 +- .../Session/ISessionManager.cs | 8 +- .../Properties/AssemblyInfo.cs | 10 +- .../Encoder/EncodingJob.cs | 2 +- .../Encoder/EncodingJobFactory.cs | 4 +- .../Encoder/MediaEncoder.cs | 8 +- .../Probing/InternalMediaInfoResult.cs | 2 +- .../Probing/ProbeResultNormalizer.cs | 8 +- .../Properties/AssemblyInfo.cs | 10 +- .../Subtitles/AssParser.cs | 4 +- .../Subtitles/SrtParser.cs | 4 +- .../Subtitles/SsaParser.cs | 4 +- .../Subtitles/TtmlWriter.cs | 2 +- .../Channels/ChannelFeatures.cs | 2 +- MediaBrowser.Model/Channels/ChannelQuery.cs | 2 +- .../BaseApplicationConfiguration.cs | 2 +- MediaBrowser.Model/Dlna/AudioOptions.cs | 2 +- MediaBrowser.Model/Dlna/CodecProfile.cs | 2 +- MediaBrowser.Model/Dlna/ConditionProcessor.cs | 2 +- MediaBrowser.Model/Dlna/ProfileCondition.cs | 2 +- MediaBrowser.Model/Dlna/SearchCriteria.cs | 2 +- MediaBrowser.Model/Dlna/SortCriteria.cs | 2 +- MediaBrowser.Model/Dlna/StreamBuilder.cs | 2 +- MediaBrowser.Model/Dto/BaseItemDto.cs | 2 +- MediaBrowser.Model/Dto/GameSystemSummary.cs | 2 +- MediaBrowser.Model/Dto/ImageOptions.cs | 2 +- MediaBrowser.Model/Dto/NameValuePair.cs | 2 +- MediaBrowser.Model/Dto/UserDto.cs | 4 +- MediaBrowser.Model/Entities/MediaStream.cs | 4 +- .../Entities/ProviderIdsExtensions.cs | 4 +- .../Extensions/LinqExtensions.cs | 6 +- .../LiveTv/LiveTvChannelQuery.cs | 2 +- MediaBrowser.Model/Net/HttpException.cs | 2 +- .../Notifications/NotificationOption.cs | 2 +- MediaBrowser.Model/Properties/AssemblyInfo.cs | 4 +- .../Providers/RemoteImageInfo.cs | 2 +- .../Querying/AllThemeMediaResult.cs | 2 +- MediaBrowser.Model/Querying/EpisodeQuery.cs | 2 +- MediaBrowser.Model/Querying/ItemFields.cs | 2 +- MediaBrowser.Model/Querying/NextUpQuery.cs | 4 +- MediaBrowser.Model/Search/SearchHint.cs | 12 +- .../Serialization/IXmlSerializer.cs | 2 +- .../Services/ApiMemberAttribute.cs | 4 +- .../Services/IHasRequestFilter.cs | 2 +- MediaBrowser.Model/Services/IHttpResponse.cs | 2 +- .../Session/PlaybackProgressInfo.cs | 2 +- MediaBrowser.Model/System/SystemInfo.cs | 2 +- MediaBrowser.Model/Tasks/ITaskManager.cs | 4 +- MediaBrowser.Model/Tasks/TaskResult.cs | 2 +- MediaBrowser.Model/Updates/PackageInfo.cs | 2 +- .../BoxSets/MovieDbBoxSetImageProvider.cs | 2 +- .../BoxSets/MovieDbBoxSetProvider.cs | 4 +- .../Manager/GenericPriorityQueue.cs | 4 +- .../Manager/IPriorityQueue.cs | 4 +- MediaBrowser.Providers/Manager/ImageSaver.cs | 2 +- .../Manager/SimplePriorityQueue.cs | 4 +- .../MediaInfo/SubtitleScheduledTask.cs | 4 +- .../Movies/GenericMovieDbInfo.cs | 2 +- .../Movies/MovieDbImageProvider.cs | 2 +- .../Music/AlbumMetadataService.cs | 2 +- .../Music/AudioDbAlbumImageProvider.cs | 4 +- .../Music/AudioDbArtistImageProvider.cs | 2 +- MediaBrowser.Providers/Music/Extensions.cs | 2 +- .../Music/FanArtAlbumProvider.cs | 2 +- .../Music/FanArtArtistProvider.cs | 2 +- .../Properties/AssemblyInfo.cs | 8 +- .../Studios/StudiosImageProvider.cs | 2 +- .../TV/FanArt/FanArtSeasonProvider.cs | 2 +- .../TV/FanArt/FanartSeriesProvider.cs | 2 +- .../TheMovieDb/MovieDbEpisodeImageProvider.cs | 2 +- .../TV/TheMovieDb/MovieDbEpisodeProvider.cs | 2 +- .../TheMovieDb/MovieDbSeriesImageProvider.cs | 2 +- .../TV/TheTVDB/TvdbSeasonImageProvider.cs | 2 +- .../TV/TheTVDB/TvdbSeriesImageProvider.cs | 2 +- .../TV/TheTVDB/TvdbSeriesProvider.cs | 2 +- .../MediaEncoding/Subtitles/VttWriterTest.cs | 2 +- MediaBrowser.Tests/Properties/AssemblyInfo.cs | 10 +- .../Api/DashboardService.cs | 2 +- .../Properties/AssemblyInfo.cs | 8 +- .../Parsers/EpisodeNfoParser.cs | 2 +- .../Properties/AssemblyInfo.cs | 10 +- .../Savers/AlbumNfoSaver.cs | 6 +- .../Savers/ArtistNfoSaver.cs | 4 +- .../Savers/SeriesNfoSaver.cs | 2 +- Mono.Nat/ISearcher.cs | 4 +- Mono.Nat/Pmp/PmpNatDevice.cs | 4 +- Mono.Nat/Properties/AssemblyInfo.cs | 10 +- Mono.Nat/Upnp/Messages/GetServicesMessage.cs | 4 +- .../Requests/CreatePortMappingMessage.cs | 4 +- Mono.Nat/Upnp/Messages/UpnpMessage.cs | 4 +- Mono.Nat/Upnp/UpnpNatDevice.cs | 4 +- OpenSubtitlesHandler/Console/OSHConsole.cs | 2 +- .../MethodResponseAutoUpdate.cs | 8 +- .../MethodResponseMovieDetails.cs | 2 +- .../MethodResponseServerInfo.cs | 18 +- OpenSubtitlesHandler/OpenSubtitles.cs | 110 +-- .../Properties/AssemblyInfo.cs | 10 +- .../SubtitleTypes/SubtitleSearchParameters.cs | 2 +- .../XML-RPC/XmlRpcGenerator.cs | 2 +- RSSDP/Properties/AssemblyInfo.cs | 6 +- RSSDP/SsdpDeviceLocator.cs | 2 +- SocketHttpListener/Net/ChunkedInputStream.cs | 4 +- .../Net/HttpEndPointListener.cs | 6 +- SocketHttpListener/Net/HttpListener.cs | 2 +- .../Net/HttpListenerRequestUriBuilder.cs | 12 +- .../Net/WebSockets/HttpWebSocket.cs | 10 +- .../Net/WebSockets/WebSocketCloseStatus.cs | 6 +- SocketHttpListener/Properties/AssemblyInfo.cs | 10 +- 290 files changed, 1708 insertions(+), 1708 deletions(-) diff --git a/BDInfo/Properties/AssemblyInfo.cs b/BDInfo/Properties/AssemblyInfo.cs index aa44da1909..5396452959 100644 --- a/BDInfo/Properties/AssemblyInfo.cs +++ b/BDInfo/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("BDInfo")] @@ -19,11 +19,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] \ No newline at end of file diff --git a/BDInfo/TSCodecDTS.cs b/BDInfo/TSCodecDTS.cs index 58eb60fc59..904dcd986c 100644 --- a/BDInfo/TSCodecDTS.cs +++ b/BDInfo/TSCodecDTS.cs @@ -148,7 +148,7 @@ namespace BDInfo stream.IsVBR = true; stream.IsInitialized = true; break; - + default: stream.IsVBR = false; stream.IsInitialized = true; diff --git a/BDInfo/TSCodecDTSHD.cs b/BDInfo/TSCodecDTSHD.cs index 169a8077f2..3c5ad85cc5 100644 --- a/BDInfo/TSCodecDTSHD.cs +++ b/BDInfo/TSCodecDTSHD.cs @@ -22,9 +22,9 @@ namespace BDInfo { public abstract class TSCodecDTSHD { - private static int[] SampleRates = new int[] + private static int[] SampleRates = new int[] { 0x1F40, 0x3E80, 0x7D00, 0x0FA00, 0x1F400, 0x5622, 0x0AC44, 0x15888, 0x2B110, 0x56220, 0x2EE0, 0x5DC0, 0x0BB80, 0x17700, 0x2EE00, 0x5DC00 }; - + public static void Scan( TSAudioStream stream, TSStreamBuffer buffer, @@ -131,7 +131,7 @@ namespace BDInfo else { AssetSizes[i] = buffer.ReadBits(16) + 1; - } + } } for (int i = 0; i < nuNumAssets; i++) { @@ -189,7 +189,7 @@ namespace BDInfo } stream.SampleRate = SampleRates[nuMaxSampleRate]; stream.BitDepth = nuBitResolution; - + stream.LFE = 0; if ((nuSpkrActivityMask & 0x8) == 0x8) { @@ -240,7 +240,7 @@ namespace BDInfo stream.IsInitialized = true; } stream.IsInitialized = (stream.BitRate > 0 ? true : false); - } + } } } } diff --git a/BDInfo/TSCodecMPEG2.cs b/BDInfo/TSCodecMPEG2.cs index 3413a06e92..1d523528e0 100644 --- a/BDInfo/TSCodecMPEG2.cs +++ b/BDInfo/TSCodecMPEG2.cs @@ -33,7 +33,7 @@ namespace BDInfo int pictureParse = 0; int sequenceHeaderParse = 0; int extensionParse = 0; - int sequenceExtensionParse = 0; + int sequenceExtensionParse = 0; for (int i = 0; i < buffer.Length; i++) { @@ -189,7 +189,7 @@ namespace BDInfo #if DEBUG if (sequenceExtensionParse == 0) { - uint sequenceExtension = + uint sequenceExtension = ((parse & 0x8) >> 3); if (sequenceExtension == 0) { diff --git a/BDInfo/TSCodecTrueHD.cs b/BDInfo/TSCodecTrueHD.cs index baf4fa3dfe..6ea78614cf 100644 --- a/BDInfo/TSCodecTrueHD.cs +++ b/BDInfo/TSCodecTrueHD.cs @@ -36,7 +36,7 @@ namespace BDInfo for (int i = 0; i < buffer.Length; i++) { sync = (sync << 8) + buffer.ReadByte(); - if (sync == 0xF8726FBA) + if (sync == 0xF8726FBA) { syncFound = true; break; @@ -63,7 +63,7 @@ namespace BDInfo int ratebits = buffer.ReadBits(4); if (ratebits != 0xF) { - stream.SampleRate = + stream.SampleRate = (((ratebits & 8) > 0 ? 44100 : 48000) << (ratebits & 7)); } int temp1 = buffer.ReadBits(8); @@ -149,9 +149,9 @@ namespace BDInfo int peak_bitrate = buffer.ReadBits(15); peak_bitrate = (peak_bitrate * stream.SampleRate) >> 4; - double peak_bitdepth = - (double)peak_bitrate / - (stream.ChannelCount + stream.LFE) / + double peak_bitdepth = + (double)peak_bitrate / + (stream.ChannelCount + stream.LFE) / stream.SampleRate; if (peak_bitdepth > 14) { @@ -164,7 +164,7 @@ namespace BDInfo #if DEBUG System.Diagnostics.Debug.WriteLine(string.Format( - "{0}\t{1}\t{2:F2}", + "{0}\t{1}\t{2:F2}", stream.PID, peak_bitrate, peak_bitdepth)); #endif /* diff --git a/BDInfo/TSCodecVC1.cs b/BDInfo/TSCodecVC1.cs index 164ef8c47e..ce9eabdb91 100644 --- a/BDInfo/TSCodecVC1.cs +++ b/BDInfo/TSCodecVC1.cs @@ -50,18 +50,18 @@ namespace BDInfo { if ((parse & 0x80000000) == 0) { - pictureType = + pictureType = (uint)((parse & 0x78000000) >> 13); } else { - pictureType = + pictureType = (uint)((parse & 0x3c000000) >> 12); } } else { - pictureType = + pictureType = (uint)((parse & 0xf0000000) >> 14); } diff --git a/BDInfo/TSPlaylistFile.cs b/BDInfo/TSPlaylistFile.cs index da6fd37cc0..c4e8d62ec3 100644 --- a/BDInfo/TSPlaylistFile.cs +++ b/BDInfo/TSPlaylistFile.cs @@ -42,7 +42,7 @@ namespace BDInfo public List Chapters = new List(); - public Dictionary Streams = + public Dictionary Streams = new Dictionary(); public Dictionary PlaylistStreams = new Dictionary(); @@ -50,19 +50,19 @@ namespace BDInfo new List(); public List> AngleStreams = new List>(); - public List> AngleClips = + public List> AngleClips = new List>(); public int AngleCount = 0; - public List SortedStreams = + public List SortedStreams = new List(); - public List VideoStreams = + public List VideoStreams = new List(); - public List AudioStreams = + public List AudioStreams = new List(); - public List TextStreams = + public List TextStreams = new List(); - public List GraphicsStreams = + public List GraphicsStreams = new List(); public TSPlaylistFile( @@ -388,8 +388,8 @@ namespace BDInfo #if DEBUG Debug.WriteLine(string.Format( - "{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}", - Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG, + "{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}", + Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG, streamCountSecondaryAudio, streamCountSecondaryVideo, streamCountPIP)); #endif @@ -427,7 +427,7 @@ namespace BDInfo } /* * TODO - * + * for (int i = 0; i < streamCountPIP; i++) { TSStream stream = CreatePlaylistStream(data, ref pos); @@ -955,7 +955,7 @@ namespace BDInfo } public int CompareVideoStreams( - TSVideoStream x, + TSVideoStream x, TSVideoStream y) { if (x == null && y == null) @@ -996,7 +996,7 @@ namespace BDInfo } public int CompareAudioStreams( - TSAudioStream x, + TSAudioStream x, TSAudioStream y) { if (x == y) diff --git a/BDInfo/TSStream.cs b/BDInfo/TSStream.cs index 5afb81c5e4..250308b1a8 100644 --- a/BDInfo/TSStream.cs +++ b/BDInfo/TSStream.cs @@ -109,7 +109,7 @@ namespace BDInfo public TSDescriptor Clone() { - TSDescriptor descriptor = + TSDescriptor descriptor = new TSDescriptor(Name, (byte)Value.Length); Value.CopyTo(descriptor.Value, 0); return descriptor; @@ -153,15 +153,15 @@ namespace BDInfo private string _LanguageCode; public string LanguageCode { - get + get { - return _LanguageCode; + return _LanguageCode; } - set + set { _LanguageCode = value; LanguageName = LanguageCodes.GetName(value); - } + } } public bool IsVideoStream @@ -407,7 +407,7 @@ namespace BDInfo } public abstract TSStream Clone(); - + protected void CopyTo(TSStream stream) { stream.PID = PID; @@ -435,7 +435,7 @@ namespace BDInfo public int Width; public int Height; - public bool IsInterlaced; + public bool IsInterlaced; public int FrameRateEnumerator; public int FrameRateDenominator; public TSAspectRatio AspectRatio; @@ -581,7 +581,7 @@ namespace BDInfo stream.FrameRate = _FrameRate; stream.Width = Width; stream.Height = Height; - stream.IsInterlaced = IsInterlaced; + stream.IsInterlaced = IsInterlaced; stream.FrameRateEnumerator = FrameRateEnumerator; stream.FrameRateDenominator = FrameRateDenominator; stream.AspectRatio = AspectRatio; diff --git a/BDInfo/TSStreamClipFile.cs b/BDInfo/TSStreamClipFile.cs index f2accb88d8..f311dd8390 100644 --- a/BDInfo/TSStreamClipFile.cs +++ b/BDInfo/TSStreamClipFile.cs @@ -69,7 +69,7 @@ namespace BDInfo byte[] fileType = new byte[8]; Array.Copy(data, 0, fileType, 0, fileType.Length); - + FileType = _textEncoding.GetASCIIEncoding().GetString(fileType, 0, fileType.Length); if (FileType != "HDMV0100" && FileType != "HDMV0200") @@ -78,7 +78,7 @@ namespace BDInfo "Clip info file {0} has an unknown file type {1}.", FileInfo.Name, FileType)); } -#if DEBUG +#if DEBUG Debug.WriteLine(string.Format( "\tFileType: {0}", FileType)); #endif @@ -110,9 +110,9 @@ namespace BDInfo TSStream stream = null; ushort PID = (ushort) - ((clipData[streamOffset] << 8) + + ((clipData[streamOffset] << 8) + clipData[streamOffset + 1]); - + streamOffset += 2; TSStreamType streamType = (TSStreamType) @@ -240,7 +240,7 @@ namespace BDInfo } streamOffset += clipData[streamOffset] + 1; - } + } IsValid = true; } finally diff --git a/BDInfo/TSStreamFile.cs b/BDInfo/TSStreamFile.cs index cfd402434d..00e6b338e0 100644 --- a/BDInfo/TSStreamFile.cs +++ b/BDInfo/TSStreamFile.cs @@ -391,7 +391,7 @@ namespace BDInfo } Dictionary playlistStreams = playlist.Streams; - if (clip.AngleIndex > 0 && + if (clip.AngleIndex > 0 && clip.AngleIndex < playlist.AngleStreams.Count + 1) { playlistStreams = playlist.AngleStreams[clip.AngleIndex - 1]; @@ -428,7 +428,7 @@ namespace BDInfo TSStream stream = Streams[PID]; stream.PayloadBytes += streamState.WindowBytes; stream.PacketCount += streamState.WindowPackets; - + if (stream.IsVideoStream) { TSStreamDiagnostics diag = new TSStreamDiagnostics(); @@ -457,7 +457,7 @@ namespace BDInfo int dataSize = 16384; Stream fileStream = null; try - { + { string fileName; if (BDInfoSettings.EnableSSIF && InterleavedFile != null) @@ -482,13 +482,13 @@ namespace BDInfo StreamStates.Clear(); StreamDiagnostics.Clear(); - TSPacketParser parser = + TSPacketParser parser = new TSPacketParser(); - + long fileLength = (uint)fileStream.Length; byte[] buffer = new byte[dataSize]; int bufferLength = 0; - while ((bufferLength = + while ((bufferLength = fileStream.Read(buffer, 0, buffer.Length)) > 0) { int offset = 0; @@ -598,8 +598,8 @@ namespace BDInfo parser.StreamState.TransferCount++; bool isFinished = ScanStream( - parser.Stream, - parser.StreamState, + parser.Stream, + parser.StreamState, parser.StreamState.StreamBuffer); if (!isFullScan && isFinished) @@ -680,10 +680,10 @@ namespace BDInfo for (int k = 0; k < (parser.PATOffset - 4); k += 4) { uint programNumber = (uint) - ((parser.PAT[k] << 8) + + ((parser.PAT[k] << 8) + parser.PAT[k + 1]); - ushort programPID = (ushort) + ushort programPID = (ushort) (((parser.PAT[k + 2] & 0x1F) << 8) + parser.PAT[k + 3]); @@ -985,7 +985,7 @@ namespace BDInfo parser.PMTProgramDescriptorLength = buffer[i]; parser.PMTProgramDescriptors.Add( new TSDescriptor( - parser.PMTProgramDescriptor, + parser.PMTProgramDescriptor, parser.PMTProgramDescriptorLength)); break; } @@ -998,7 +998,7 @@ namespace BDInfo parser.PMTProgramDescriptors.Count - 1]; int valueIndex = - descriptor.Value.Length - + descriptor.Value.Length - parser.PMTProgramDescriptorLength - 1; descriptor.Value[valueIndex] = buffer[i]; @@ -1020,8 +1020,8 @@ namespace BDInfo parser.SyncState = false; } } - else if (parser.Stream != null && - parser.StreamState != null && + else if (parser.Stream != null && + parser.StreamState != null && parser.TransportScramblingControl == 0) { TSStream stream = parser.Stream; @@ -1032,7 +1032,7 @@ namespace BDInfo if (streamState.TransferState) { - if ((bufferLength - i) >= streamState.PacketLength && + if ((bufferLength - i) >= streamState.PacketLength && streamState.PacketLength > 0) { offset = streamState.PacketLength; @@ -1085,7 +1085,7 @@ namespace BDInfo --parser.PacketLength; bool headerFound = false; - if (stream.IsVideoStream && + if (stream.IsVideoStream && streamState.Parse == 0x000001FD) { headerFound = true; @@ -1170,18 +1170,18 @@ namespace BDInfo (byte)(streamState.Parse & 0xFF); #endif break; - + case 1: - streamState.PESHeaderFlags = + streamState.PESHeaderFlags = (byte)(streamState.Parse & 0xFF); #if DEBUG streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 0: - streamState.PESHeaderLength = + streamState.PESHeaderLength = (byte)(streamState.Parse & 0xFF); #if DEBUG streamState.PESHeader[streamState.PESHeaderIndex++] = @@ -1211,48 +1211,48 @@ namespace BDInfo switch (streamState.PTSParse) { case 4: - streamState.PTSTemp = + streamState.PTSTemp = ((streamState.Parse & 0xE) << 29); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif break; - + case 3: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFF) << 22); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 2: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFE) << 14); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 1: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFF) << 7); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 0: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFE) >> 1); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); -#endif +#endif streamState.PTS = streamState.PTSTemp; if (streamState.PTS > streamState.PTSLast) @@ -1260,13 +1260,13 @@ namespace BDInfo if (streamState.PTSLast > 0) { streamState.PTSTransfer = (streamState.PTS - streamState.PTSLast); - } + } streamState.PTSLast = streamState.PTS; } streamState.PTSDiff = streamState.PTS - streamState.DTSPrev; - if (streamState.PTSCount > 0 && + if (streamState.PTSCount > 0 && stream.IsVideoStream) { UpdateStreamBitrates(stream.PID, streamState.PTS, streamState.PTSDiff); @@ -1280,7 +1280,7 @@ namespace BDInfo } Length = (double)(parser.PTSLast - parser.PTSFirst) / 90000; } - + streamState.DTSPrev = streamState.PTS; streamState.PTSCount++; if (streamState.PESHeaderLength == 0) @@ -1299,46 +1299,46 @@ namespace BDInfo switch (streamState.DTSParse) { case 9: - streamState.PTSTemp = + streamState.PTSTemp = ((streamState.Parse & 0xE) << 29); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 8: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFF) << 22); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 7: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFE) << 14); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif break; - + case 6: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFF) << 7); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 5: - streamState.PTSTemp |= + streamState.PTSTemp |= ((streamState.Parse & 0xFE) >> 1); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif streamState.PTS = streamState.PTSTemp; @@ -1347,48 +1347,48 @@ namespace BDInfo streamState.PTSLast = streamState.PTS; } break; - + case 4: - streamState.DTSTemp = + streamState.DTSTemp = ((streamState.Parse & 0xE) << 29); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif break; - + case 3: - streamState.DTSTemp |= + streamState.DTSTemp |= ((streamState.Parse & 0xFF) << 22); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif break; - + case 2: - streamState.DTSTemp |= + streamState.DTSTemp |= ((streamState.Parse & 0xFE) << 14); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif break; - + case 1: - streamState.DTSTemp |= + streamState.DTSTemp |= ((streamState.Parse & 0xFF) << 7); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xFF); #endif break; - + case 0: - streamState.DTSTemp |= + streamState.DTSTemp |= ((streamState.Parse & 0xFE) >> 1); #if DEBUG - streamState.PESHeader[streamState.PESHeaderIndex++] = + streamState.PESHeader[streamState.PESHeaderIndex++] = (byte)(streamState.Parse & 0xff); #endif streamState.PTSDiff = streamState.DTSTemp - streamState.DTSPrev; @@ -1482,8 +1482,8 @@ namespace BDInfo } private TSStream CreateStream( - ushort streamPID, - byte streamType, + ushort streamPID, + byte streamType, List streamDescriptors) { TSStream stream = null; @@ -1548,6 +1548,6 @@ namespace BDInfo } return stream; - } + } } } diff --git a/DvdLib/Ifo/ProgramChain.cs b/DvdLib/Ifo/ProgramChain.cs index 6b4e5fa32f..85dfcea057 100644 --- a/DvdLib/Ifo/ProgramChain.cs +++ b/DvdLib/Ifo/ProgramChain.cs @@ -68,7 +68,7 @@ namespace DvdLib.Ifo ProhibitedUserOperations = (UserOperation)br.ReadUInt32(); AudioStreamControl = br.ReadBytes(16); SubpictureStreamControl = br.ReadBytes(128); - + _nextProgramNumber = br.ReadUInt16(); _prevProgramNumber = br.ReadUInt16(); _goupProgramNumber = br.ReadUInt16(); diff --git a/DvdLib/Ifo/Title.cs b/DvdLib/Ifo/Title.cs index 70deb45bfa..6ef83b4fb1 100644 --- a/DvdLib/Ifo/Title.cs +++ b/DvdLib/Ifo/Title.cs @@ -20,7 +20,7 @@ namespace DvdLib.Ifo public ProgramChain EntryProgramChain { get; private set; } public readonly List ProgramChains; - public readonly List Chapters; + public readonly List Chapters; public Title(uint titleNum) { diff --git a/DvdLib/Properties/AssemblyInfo.cs b/DvdLib/Properties/AssemblyInfo.cs index cca792684f..08c0ed88c5 100644 --- a/DvdLib/Properties/AssemblyInfo.cs +++ b/DvdLib/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("DvdLib")] @@ -19,11 +19,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] \ No newline at end of file diff --git a/Emby.Dlna/Common/Argument.cs b/Emby.Dlna/Common/Argument.cs index 7e61c3d6d5..e6a220a7f4 100644 --- a/Emby.Dlna/Common/Argument.cs +++ b/Emby.Dlna/Common/Argument.cs @@ -1,6 +1,6 @@  namespace Emby.Dlna.Common -{ +{ public class Argument { public string Name { get; set; } diff --git a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs index 9b22b77734..a37f81242b 100644 --- a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs @@ -77,7 +77,7 @@ namespace Emby.Dlna.ConnectionManager return action; } - + private ServiceAction GetCurrentConnectionInfo() { var action = new ServiceAction diff --git a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs index facc252146..05de8259ca 100644 --- a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs @@ -8,7 +8,7 @@ namespace Emby.Dlna.ContentDirectory { public string GetXml() { - return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), + return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables()); } diff --git a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs index 8e5c07ce2f..26f5b671dc 100644 --- a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs @@ -334,7 +334,7 @@ namespace Emby.Dlna.ContentDirectory return action; } - + private ServiceAction GetXSetBookmarkAction() { var action = new ServiceAction diff --git a/Emby.Dlna/IUpnpService.cs b/Emby.Dlna/IUpnpService.cs index caae87ba36..0a52e9acfc 100644 --- a/Emby.Dlna/IUpnpService.cs +++ b/Emby.Dlna/IUpnpService.cs @@ -10,7 +10,7 @@ namespace Emby.Dlna /// The headers. /// System.String. string GetServiceXml(IDictionary headers); - + /// /// Processes the control request. /// diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index 6ab0767a5a..eae3f22de4 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -75,11 +75,11 @@ namespace Emby.Dlna.Main IUserDataManager userDataManager, ILocalizationManager localizationManager, IMediaSourceManager mediaSourceManager, - IDeviceDiscovery deviceDiscovery, - IMediaEncoder mediaEncoder, - ISocketFactory socketFactory, - ITimerFactory timerFactory, - IEnvironmentInfo environmentInfo, + IDeviceDiscovery deviceDiscovery, + IMediaEncoder mediaEncoder, + ISocketFactory socketFactory, + ITimerFactory timerFactory, + IEnvironmentInfo environmentInfo, INetworkManager networkManager, IUserViewManager userViewManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, @@ -104,19 +104,19 @@ namespace Emby.Dlna.Main _networkManager = networkManager; _logger = loggerFactory.CreateLogger("Dlna"); - ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager, - userDataManager, - imageProcessor, - libraryManager, - config, - userManager, - _logger, - httpClient, - localizationManager, - mediaSourceManager, + ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager, + userDataManager, + imageProcessor, + libraryManager, + config, + userManager, + _logger, + httpClient, + localizationManager, + mediaSourceManager, userViewManager, - mediaEncoder, - xmlReaderSettingsFactory, + mediaEncoder, + xmlReaderSettingsFactory, tvSeriesManager); ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory); @@ -271,12 +271,12 @@ namespace Emby.Dlna.Main var device = new SsdpRootDevice { CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info. - Location = uri, // Must point to the URL that serves your devices UPnP description document. + Location = uri, // Must point to the URL that serves your devices UPnP description document. FriendlyName = "Jellyfin", Manufacturer = "Jellyfin", ModelName = "Jellyfin Server", Uuid = udn - // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. + // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. }; SetProperies(device, fullService); @@ -297,7 +297,7 @@ namespace Emby.Dlna.Main Manufacturer = device.Manufacturer, ModelName = device.ModelName, Uuid = udn - // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. + // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. }; SetProperies(embeddedDevice, subDevice); diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index 13bed6b2fd..fdd3045779 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -739,7 +739,7 @@ namespace Emby.Dlna.PlayTo if (track == null) { - //If track is null, some vendors do this, use GetMediaInfo instead + //If track is null, some vendors do this, use GetMediaInfo instead return new Tuple(true, null); } diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs index bfd163bf16..818744ba89 100644 --- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs +++ b/Emby.Dlna/PlayTo/SsdpHttpClient.cs @@ -25,10 +25,10 @@ namespace Emby.Dlna.PlayTo _config = config; } - public async Task SendCommandAsync(string baseUrl, - DeviceService service, - string command, - string postData, + public async Task SendCommandAsync(string baseUrl, + DeviceService service, + string command, + string postData, bool logRequest = true, string header = null) { @@ -62,12 +62,12 @@ namespace Emby.Dlna.PlayTo } private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - - public async Task SubscribeAsync(string url, - string ip, - int port, - string localIp, - int eventport, + + public async Task SubscribeAsync(string url, + string ip, + int port, + string localIp, + int eventport, int timeOut = 3600) { var options = new HttpRequestOptions @@ -121,9 +121,9 @@ namespace Emby.Dlna.PlayTo } } - private Task PostSoapDataAsync(string url, - string soapAction, - string postData, + private Task PostSoapDataAsync(string url, + string soapAction, + string postData, string header, bool logRequest, CancellationToken cancellationToken) diff --git a/Emby.Dlna/PlayTo/TransportCommands.cs b/Emby.Dlna/PlayTo/TransportCommands.cs index 9e055f7921..09a8f07341 100644 --- a/Emby.Dlna/PlayTo/TransportCommands.cs +++ b/Emby.Dlna/PlayTo/TransportCommands.cs @@ -171,7 +171,7 @@ namespace Emby.Dlna.PlayTo if (state != null) { var sendValue = state.AllowedValues.FirstOrDefault(a => string.Equals(a, commandParameter, StringComparison.OrdinalIgnoreCase)) ?? - state.AllowedValues.FirstOrDefault() ?? + state.AllowedValues.FirstOrDefault() ?? value; return string.Format("<{0} xmlns:dt=\"urn:schemas-microsoft-com:datatypes\" dt:dt=\"{1}\">{2}", argument.Name, state.DataType ?? "string", sendValue); diff --git a/Emby.Dlna/PlayTo/uBaseObject.cs b/Emby.Dlna/PlayTo/uBaseObject.cs index 1de46317eb..0107b63c5a 100644 --- a/Emby.Dlna/PlayTo/uBaseObject.cs +++ b/Emby.Dlna/PlayTo/uBaseObject.cs @@ -2,7 +2,7 @@ namespace Emby.Dlna.PlayTo { - public class uBaseObject + public class uBaseObject { public string Id { get; set; } diff --git a/Emby.Dlna/PlayTo/uParser.cs b/Emby.Dlna/PlayTo/uParser.cs index 5caf83a9a6..36ebdbf5c4 100644 --- a/Emby.Dlna/PlayTo/uParser.cs +++ b/Emby.Dlna/PlayTo/uParser.cs @@ -20,7 +20,7 @@ namespace Emby.Dlna.PlayTo if (document == null) return list; - + var item = (from result in document.Descendants("Result") select result).FirstOrDefault(); if (item == null) diff --git a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs index 75382067ff..7b452c536c 100644 --- a/Emby.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/Emby.Dlna/Profiles/SonyBravia2010Profile.cs @@ -41,7 +41,7 @@ namespace Emby.Dlna.Profiles EnableSingleAlbumArtLimit = true; EnableAlbumArtInDidl = true; - + TranscodingProfiles = new[] { new TranscodingProfile diff --git a/Emby.Dlna/Properties/AssemblyInfo.cs b/Emby.Dlna/Properties/AssemblyInfo.cs index 6f924f9e96..6ee7177ced 100644 --- a/Emby.Dlna/Properties/AssemblyInfo.cs +++ b/Emby.Dlna/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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")] @@ -19,11 +19,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] diff --git a/Emby.Dlna/Service/BaseService.cs b/Emby.Dlna/Service/BaseService.cs index 92b81a7acc..10ef12c6c2 100644 --- a/Emby.Dlna/Service/BaseService.cs +++ b/Emby.Dlna/Service/BaseService.cs @@ -14,7 +14,7 @@ namespace Emby.Dlna.Service protected BaseService(ILogger logger, IHttpClient httpClient) { Logger = logger; - HttpClient = httpClient; + HttpClient = httpClient; EventManager = new EventManager(Logger, HttpClient); } diff --git a/Emby.Dlna/Service/ControlErrorHandler.cs b/Emby.Dlna/Service/ControlErrorHandler.cs index a3cd77f0fb..431dea9320 100644 --- a/Emby.Dlna/Service/ControlErrorHandler.cs +++ b/Emby.Dlna/Service/ControlErrorHandler.cs @@ -10,7 +10,7 @@ namespace Emby.Dlna.Service public class ControlErrorHandler { private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/"; - + public ControlResponse GetResponse(Exception ex) { var settings = new XmlWriterSettings diff --git a/Emby.Dlna/Ssdp/DeviceDiscovery.cs b/Emby.Dlna/Ssdp/DeviceDiscovery.cs index d91f711d2f..e01ff81497 100644 --- a/Emby.Dlna/Ssdp/DeviceDiscovery.cs +++ b/Emby.Dlna/Ssdp/DeviceDiscovery.cs @@ -83,8 +83,8 @@ namespace Emby.Dlna.Ssdp { _deviceLocator = new SsdpDeviceLocator(_commsServer, _timerFactory); - // (Optional) Set the filter so we only see notifications for devices we care about - // (can be any search target value i.e device type, uuid value etc - any value that appears in the + // (Optional) Set the filter so we only see notifications for devices we care about + // (can be any search target value i.e device type, uuid value etc - any value that appears in the // DiscoverdSsdpDevice.NotificationType property or that is used with the searchTarget parameter of the Search method). //_DeviceLocator.NotificationFilter = "upnp:rootdevice"; diff --git a/Emby.Drawing.Skia/Properties/AssemblyInfo.cs b/Emby.Drawing.Skia/Properties/AssemblyInfo.cs index c0dc7c5b4b..b8799f986c 100644 --- a/Emby.Drawing.Skia/Properties/AssemblyInfo.cs +++ b/Emby.Drawing.Skia/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.Drawing.Skia")] @@ -19,7 +19,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // \ No newline at end of file diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 6a67be56d1..32f0559c68 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -103,7 +103,7 @@ namespace Emby.Drawing "crw", // Remove until supported - //"nef", + //"nef", "orf", "pef", "arw", diff --git a/Emby.Drawing/Properties/AssemblyInfo.cs b/Emby.Drawing/Properties/AssemblyInfo.cs index b9e9c2ff77..aa5619f979 100644 --- a/Emby.Drawing/Properties/AssemblyInfo.cs +++ b/Emby.Drawing/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.Drawing")] @@ -13,8 +13,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -24,7 +24,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // \ No newline at end of file diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs index faaed482a0..ea44170718 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs @@ -315,9 +315,9 @@ namespace IsoMounter ); } else { - + throw new ArgumentNullException(nameof(isoPath)); - + } try @@ -397,9 +397,9 @@ namespace IsoMounter ); } else { - + throw new ArgumentNullException(nameof(mount)); - + } if (GetUID() == 0) { @@ -444,7 +444,7 @@ namespace IsoMounter } #endregion - + #region Internal Methods internal void OnUnmount(LinuxMount mount) diff --git a/Emby.IsoMounting/IsoMounter/LinuxMount.cs b/Emby.IsoMounting/IsoMounter/LinuxMount.cs index edd26f08d4..da2eb19835 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxMount.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxMount.cs @@ -48,7 +48,7 @@ namespace IsoMounter if (disposed) { return; } - + if (disposing) { // diff --git a/Emby.Naming/AudioBook/AudioBookInfo.cs b/Emby.Naming/AudioBook/AudioBookInfo.cs index e039e5359a..d7af63d915 100644 --- a/Emby.Naming/AudioBook/AudioBookInfo.cs +++ b/Emby.Naming/AudioBook/AudioBookInfo.cs @@ -29,7 +29,7 @@ namespace Emby.Naming.AudioBook /// /// The alternate versions. public List AlternateVersions { get; set; } - + public AudioBookInfo() { Files = new List(); diff --git a/Emby.Naming/AudioBook/AudioBookResolver.cs b/Emby.Naming/AudioBook/AudioBookResolver.cs index a206ee30bf..53abbedb2e 100644 --- a/Emby.Naming/AudioBook/AudioBookResolver.cs +++ b/Emby.Naming/AudioBook/AudioBookResolver.cs @@ -46,7 +46,7 @@ namespace Emby.Naming.AudioBook var parsingResult = new AudioBookFilePathParser(_options) .Parse(path, IsDirectory); - + return new AudioBookFileInfo { Path = path, diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index 9e65440d08..014f4ebde6 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -282,7 +282,7 @@ namespace Emby.Naming.Common new EpisodeExpression(@".*(\\|\/)(?((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?[0-9]+)[][ ._-]*[Ee](?[0-9]+)([^\\/]*)$") { IsNamed = true - }, + }, // new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"), new EpisodeExpression("([0-9]{4})[\\.-]([0-9]{2})[\\.-]([0-9]{2})", true) diff --git a/Emby.Naming/TV/EpisodeResolver.cs b/Emby.Naming/TV/EpisodeResolver.cs index 2007d13077..cce4e73b80 100644 --- a/Emby.Naming/TV/EpisodeResolver.cs +++ b/Emby.Naming/TV/EpisodeResolver.cs @@ -53,7 +53,7 @@ namespace Emby.Naming.TV var parsingResult = new EpisodePathParser(_options) .Parse(path, IsDirectory, isNamed, isOptimistic, supportsAbsoluteNumbers, fillExtendedInfo); - + return new EpisodeInfo { Path = path, diff --git a/Emby.Naming/Video/CleanDateTimeParser.cs b/Emby.Naming/Video/CleanDateTimeParser.cs index 572dd1c600..e2a2d921c2 100644 --- a/Emby.Naming/Video/CleanDateTimeParser.cs +++ b/Emby.Naming/Video/CleanDateTimeParser.cs @@ -38,7 +38,7 @@ namespace Emby.Naming.Video } catch (ArgumentException) { - + } var result = _options.CleanDateTimeRegexes.Select(i => Clean(name, i)) diff --git a/Emby.Naming/Video/StackResolver.cs b/Emby.Naming/Video/StackResolver.cs index 2a71255368..995e95d421 100644 --- a/Emby.Naming/Video/StackResolver.cs +++ b/Emby.Naming/Video/StackResolver.cs @@ -126,7 +126,7 @@ namespace Emby.Naming.Video } stack.Files.Add(file2.FullName); } - else + else { // Sequel offset = 0; diff --git a/Emby.Naming/Video/StubResolver.cs b/Emby.Naming/Video/StubResolver.cs index 69f1f50fa0..33d6baefd3 100644 --- a/Emby.Naming/Video/StubResolver.cs +++ b/Emby.Naming/Video/StubResolver.cs @@ -18,7 +18,7 @@ namespace Emby.Naming.Video { var result = new StubResult(); var extension = Path.GetExtension(path) ?? string.Empty; - + if (_options.StubFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase)) { result.IsStub = true; diff --git a/Emby.Naming/Video/VideoFileInfo.cs b/Emby.Naming/Video/VideoFileInfo.cs index 96839c31ef..3cdc483ff3 100644 --- a/Emby.Naming/Video/VideoFileInfo.cs +++ b/Emby.Naming/Video/VideoFileInfo.cs @@ -55,7 +55,7 @@ namespace Emby.Naming.Video /// Gets or sets the type of the stub. /// /// The type of the stub. - public string StubType { get; set; } + public string StubType { get; set; } /// /// Gets or sets the type. /// diff --git a/Emby.Naming/Video/VideoInfo.cs b/Emby.Naming/Video/VideoInfo.cs index f4d311b975..033a8ae2d0 100644 --- a/Emby.Naming/Video/VideoInfo.cs +++ b/Emby.Naming/Video/VideoInfo.cs @@ -32,7 +32,7 @@ namespace Emby.Naming.Video /// /// The alternate versions. public List AlternateVersions { get; set; } - + public VideoInfo() { Files = new List(); diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index 47be28104d..b052c79295 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -55,9 +55,9 @@ namespace Emby.Naming.Video info.Year = info.Files.First().Year; - var extraBaseNames = new List + var extraBaseNames = new List { - stack.Name, + stack.Name, Path.GetFileNameWithoutExtension(stack.Files[0]) }; diff --git a/Emby.Photos/Properties/AssemblyInfo.cs b/Emby.Photos/Properties/AssemblyInfo.cs index 49ac833457..20e7d952d9 100644 --- a/Emby.Photos/Properties/AssemblyInfo.cs +++ b/Emby.Photos/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.Photos")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -25,10 +25,10 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.*")] \ No newline at end of file diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index fb053f0e4a..ab8a858060 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1647,25 +1647,25 @@ namespace Emby.Server.Implementations // Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that // This will prevent the .dll file from getting locked, and allow us to replace it when needed - // Include composable parts in the Api assembly + // Include composable parts in the Api assembly list.Add(GetAssembly(typeof(ApiEntryPoint))); - // Include composable parts in the Dashboard assembly + // Include composable parts in the Dashboard assembly list.Add(GetAssembly(typeof(DashboardService))); - // Include composable parts in the Model assembly + // Include composable parts in the Model assembly list.Add(GetAssembly(typeof(SystemInfo))); - // Include composable parts in the Common assembly + // Include composable parts in the Common assembly list.Add(GetAssembly(typeof(IApplicationHost))); - // Include composable parts in the Controller assembly + // Include composable parts in the Controller assembly list.Add(GetAssembly(typeof(IServerApplicationHost))); - // Include composable parts in the Providers assembly + // Include composable parts in the Providers assembly list.Add(GetAssembly(typeof(ProviderUtils))); - // Include composable parts in the Photos assembly + // Include composable parts in the Photos assembly list.Add(GetAssembly(typeof(PhotoProvider))); // Emby.Server implementations @@ -1674,16 +1674,16 @@ namespace Emby.Server.Implementations // MediaEncoding list.Add(GetAssembly(typeof(MediaBrowser.MediaEncoding.Encoder.MediaEncoder))); - // Dlna + // Dlna list.Add(GetAssembly(typeof(DlnaEntryPoint))); - // Local metadata + // Local metadata list.Add(GetAssembly(typeof(BoxSetXmlSaver))); // Notifications list.Add(GetAssembly(typeof(NotificationManager))); - // Xbmc + // Xbmc list.Add(GetAssembly(typeof(ArtistNfoProvider))); list.AddRange(GetAssembliesWithPartsInternal().Select(i => new Tuple(i, null))); @@ -2219,7 +2219,7 @@ namespace Emby.Server.Implementations } /// - /// This returns localhost in the case of no external dns, and the hostname if the + /// This returns localhost in the case of no external dns, and the hostname if the /// dns is prefixed with a valid Uri prefix. /// /// The external dns prefix to get the hostname of. diff --git a/Emby.Server.Implementations/Browser/BrowserLauncher.cs b/Emby.Server.Implementations/Browser/BrowserLauncher.cs index 007f60a9bb..4c9f442d19 100644 --- a/Emby.Server.Implementations/Browser/BrowserLauncher.cs +++ b/Emby.Server.Implementations/Browser/BrowserLauncher.cs @@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.Browser } catch (NotSupportedException) { - + } catch (Exception) { diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index c2160d3384..3986999775 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -902,7 +902,7 @@ namespace Emby.Server.Implementations.Channels where T : BaseItem, new() { var id = _libraryManager.GetNewItemId(GetIdToHash(idString, channelName), typeof(T)); - + T item = null; try diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index ab6acf3c57..3e270dabc8 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -70,8 +70,8 @@ namespace Emby.Server.Implementations.Channels /// public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} }; diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 0f9770e8f7..f18a0ba088 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -4038,7 +4038,7 @@ namespace Emby.Server.Implementations.Data if (query.PersonIds.Length > 0) { - // TODO: Should this query with CleanName ? + // TODO: Should this query with CleanName ? var clauses = new List(); var index = 0; @@ -5399,7 +5399,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type var itemIdBlob = itemId.ToGuidBlob(); - // First delete + // First delete deleteAncestorsStatement.Reset(); deleteAncestorsStatement.TryBind("@ItemId", itemIdBlob); deleteAncestorsStatement.MoveNext(); @@ -5927,7 +5927,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type var guidBlob = itemId.ToGuidBlob(); - // First delete + // First delete db.Execute("delete from ItemValues where ItemId=@Id", guidBlob); InsertItemValues(guidBlob, values, db); diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index f5314df6e1..d95222e26c 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -144,7 +144,7 @@ namespace Emby.Server.Implementations.Devices HasUser = true }).Items; - + // TODO: DeviceQuery doesn't seem to be used from client. Not even Swagger. if (query.SupportsSync.HasValue) { diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs index bb8ef52f18..bc72228bde 100644 --- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs @@ -471,7 +471,7 @@ namespace Emby.Server.Implementations.EntryPoints LibraryUpdateTimer.Dispose(); LibraryUpdateTimer = null; } - + _libraryManager.ItemAdded -= libraryManager_ItemAdded; _libraryManager.ItemUpdated -= libraryManager_ItemUpdated; _libraryManager.ItemRemoved -= libraryManager_ItemRemoved; diff --git a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs index 5f043e1275..83e3cb7206 100644 --- a/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs +++ b/Emby.Server.Implementations/FFMpeg/FFMpegLoader.cs @@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.FFMpeg { var encoderFilename = Path.GetFileName(info.EncoderPath); var probeFilename = Path.GetFileName(info.ProbePath); - + foreach (var directory in _fileSystem.GetDirectoryPaths(rootEncoderPath) .ToList()) { diff --git a/Emby.Server.Implementations/HttpServer/FileWriter.cs b/Emby.Server.Implementations/HttpServer/FileWriter.cs index 1a875e5334..4b864eea59 100644 --- a/Emby.Server.Implementations/HttpServer/FileWriter.cs +++ b/Emby.Server.Implementations/HttpServer/FileWriter.cs @@ -148,7 +148,7 @@ namespace Emby.Server.Implementations.HttpServer } } - private string[] SkipLogExtensions = new string[] + private string[] SkipLogExtensions = new string[] { ".js", ".html", diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 69ca0f85b6..27aa2e9f47 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -103,7 +103,7 @@ namespace Emby.Server.Implementations.HttpServer } /// - /// Applies the request filters. Returns whether or not the request has been handled + /// Applies the request filters. Returns whether or not the request has been handled /// and no more processing should be done. /// /// diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 73b2afe640..b3244640d0 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -265,7 +265,7 @@ namespace Emby.Server.Implementations.HttpServer } /// - /// Returns the optimized result for the IRequestContext. + /// Returns the optimized result for the IRequestContext. /// Does not use or store results in any cache. /// /// diff --git a/Emby.Server.Implementations/HttpServer/IHttpListener.cs b/Emby.Server.Implementations/HttpServer/IHttpListener.cs index e21607ebd6..d50d7df6b9 100644 --- a/Emby.Server.Implementations/HttpServer/IHttpListener.cs +++ b/Emby.Server.Implementations/HttpServer/IHttpListener.cs @@ -33,7 +33,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The web socket connecting. Action WebSocketConnecting { get; set; } - + /// /// Starts this instance. /// diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs index c3e2d31708..56e1095f68 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs @@ -115,7 +115,7 @@ namespace Emby.Server.Implementations.HttpServer.Security { info.Device = tokenInfo.DeviceName; } - + else if (!string.Equals(info.Device, tokenInfo.DeviceName, StringComparison.OrdinalIgnoreCase)) { if (allowTokenInfoUpdate) diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 34c711324b..3212c41e97 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -164,7 +164,7 @@ namespace Emby.Server.Implementations.IO } catch (IOException ex) { - // For now swallow and log. + // For now swallow and log. // Research item: If an IOException occurs, the item may be in a disconnected state (media unavailable) // Should we remove it from it's parent? Logger.LogError(ex, "Error refreshing {name}", item.Name); diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 0f85e0642b..1e89c13704 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -159,7 +159,7 @@ namespace Emby.Server.Implementations.IO var firstChar = filePath[0]; if (firstChar == '/') { - // For this we don't really know. + // For this we don't really know. return filePath; } if (firstChar == '\\') //relative path diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 451f16bef8..3d3ef43b82 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -818,7 +818,7 @@ namespace Emby.Server.Implementations.Library public BaseItem FindByPath(string path, bool? isFolder) { - // If this returns multiple items it could be tricky figuring out which one is correct. + // If this returns multiple items it could be tricky figuring out which one is correct. // In most cases, the newest one will be and the others obsolete but not yet cleaned up if (string.IsNullOrEmpty(path)) @@ -1699,7 +1699,7 @@ namespace Emby.Server.Implementations.Library { try { - // Try to resolve the path into a video + // Try to resolve the path into a video video = ResolvePath(_fileSystem.GetFileSystemInfo(info.Path)) as Video; if (video == null) diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index 8872bd641e..9b030c0b7e 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -231,7 +231,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio } var firstMedia = resolvedItem.Files.First(); - + var libraryItem = new T { Path = firstMedia.Path, diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index dbfcf41e8b..47d7521291 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -42,7 +42,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio { // Behind special folder resolver return ResolverPriority.Second; - } + } } /// diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs index 71ccd7da8e..c887cbd40a 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs @@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio { // Behind special folder resolver return ResolverPriority.Second; - } + } } /// diff --git a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index 143af40767..b9ac2056fc 100644 --- a/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library.Resolvers where TVideoType : Video, new() { var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions(); - + // If the path is a file check for a matching extensions var parser = new Emby.Naming.Video.VideoResolver(namingOptions); @@ -120,7 +120,7 @@ namespace Emby.Server.Implementations.Library.Resolvers if (video != null) { - video.Name = parseName ? + video.Name = parseName ? videoInfo.Name : Path.GetFileName(args.Path); @@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.Library.Resolvers }; SetVideoType(video, videoInfo); - + video.Name = parseName ? videoInfo.Name : Path.GetFileNameWithoutExtension(args.Path); @@ -281,7 +281,7 @@ namespace Emby.Server.Implementations.Library.Resolvers { return string.Equals(name, "video_ts.ifo", StringComparison.OrdinalIgnoreCase); } - + /// /// Determines whether [is blu ray directory] [the specified directory name]. /// diff --git a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs index 7aa4c299ff..d7f80b3f41 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Books/BookResolver.cs @@ -8,14 +8,14 @@ using MediaBrowser.Model.Entities; namespace Emby.Server.Implementations.Library.Resolvers.Books { /// - /// + /// /// public class BookResolver : MediaBrowser.Controller.Resolvers.ItemResolver { private readonly string[] _validExtensions = { ".pdf", ".epub", ".mobi", ".cbr", ".cbz", ".azw3" }; /// - /// + /// /// /// /// @@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Books } /// - /// + /// /// /// /// diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 68b6c57ae6..dd383f195d 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies get { // Give plugins a chance to catch iso's first - // Also since we have to loop through child files looking for videos, + // Also since we have to loop through child files looking for videos, // see if we can avoid some of that by letting other resolvers claim folders first // Also run after series resolver return ResolverPriority.Third; diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs index 7d1c4d65a5..4e5ac959ca 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs @@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV } var season = parent as Season; - // Just in case the user decided to nest episodes. + // Just in case the user decided to nest episodes. // Not officially supported but in some cases we can handle it. if (season == null) { @@ -36,8 +36,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV // If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something // Also handle flat tv folders - if (season != null || - string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) || + if (season != null || + string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) || args.HasParent()) { var episode = ResolveVideo(args, false); diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs index aae5751de1..d616e12095 100644 --- a/Emby.Server.Implementations/Library/UserViewManager.cs +++ b/Emby.Server.Implementations/Library/UserViewManager.cs @@ -282,7 +282,7 @@ namespace Emby.Server.Implementations.Library if (includeItemTypes.Length == 0) { - // Handle situations with the grouping setting, e.g. movies showing up in tv, etc. + // Handle situations with the grouping setting, e.g. movies showing up in tv, etc. // Thanks to mixed content libraries included in the UserView var hasCollectionType = parents.OfType().ToArray(); if (hasCollectionType.Length > 0) diff --git a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs index 1686dc23c1..278c0cc7ad 100644 --- a/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs +++ b/Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs @@ -94,7 +94,7 @@ namespace Emby.Server.Implementations.Library.Validators { continue; } - + _logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name); _libraryManager.DeleteItem(item, new DeleteOptions diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 81a47bfea1..ccd6cebca7 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1055,7 +1055,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { _logger.LogInformation("Streaming Channel " + channelId); - var result = string.IsNullOrEmpty(streamId) ? + var result = string.IsNullOrEmpty(streamId) ? null : currentLiveStreams.FirstOrDefault(i => string.Equals(i.OriginalStreamId, streamId, StringComparison.OrdinalIgnoreCase)); diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 4ea83b7acd..a6222a4692 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -214,13 +214,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var outputParam = string.Empty; - var commandLineArgs = string.Format("-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"", - inputTempFile, - targetFile, - videoArgs, - GetAudioArgs(mediaSource), - subtitleArgs, - durationParam, + var commandLineArgs = string.Format("-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"", + inputTempFile, + targetFile, + videoArgs, + GetAudioArgs(mediaSource), + subtitleArgs, + durationParam, outputParam); return inputModifier + " " + commandLineArgs; diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index b597a935a2..63e940ac2b 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1993,7 +1993,7 @@ namespace Emby.Server.Implementations.LiveTv Name = program.Name, OfficialRating = program.OfficialRating }; - } + } if (service == null) { diff --git a/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs index 225360159b..8e4fcc0991 100644 --- a/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs @@ -48,8 +48,8 @@ namespace Emby.Server.Implementations.LiveTv /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} }; diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index be090df0c9..edeafdd932 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun for (int i = 0; i < model.TunerCount; ++i) { var name = String.Format("Tuner {0}", i + 1); - var currentChannel = "none"; /// @todo Get current channel and map back to Station Id + var currentChannel = "none"; /// @todo Get current channel and map back to Station Id var isAvailable = await manager.CheckTunerAvailability(ipInfo, i, cancellationToken).ConfigureAwait(false); LiveTvTunerStatus status = isAvailable ? LiveTvTunerStatus.Available : LiveTvTunerStatus.LiveTv; tuners.Add(new LiveTvTunerInfo diff --git a/Emby.Server.Implementations/Localization/TextLocalizer.cs b/Emby.Server.Implementations/Localization/TextLocalizer.cs index 5188a959e3..3ea04265dd 100644 --- a/Emby.Server.Implementations/Localization/TextLocalizer.cs +++ b/Emby.Server.Implementations/Localization/TextLocalizer.cs @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Localization catch (ArgumentException) { // will throw if input contains invalid unicode chars - // https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/ + // https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/ text = StripInvalidUnicodeCharacters(text); return Normalize(text, form, false); } diff --git a/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs b/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs index afb202fa39..4da9c08d0a 100644 --- a/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs +++ b/Emby.Server.Implementations/Networking/IPNetwork/BigIntegerExt.cs @@ -122,28 +122,28 @@ namespace System.Net } /// - /// + /// /// Reverse a Positive BigInteger ONLY /// Bitwise ~ operator - /// + /// /// Input : FF FF FF FF /// Width : 4 - /// Result : 00 00 00 00 - /// - /// + /// Result : 00 00 00 00 + /// + /// /// Input : 00 00 00 00 /// Width : 4 - /// Result : FF FF FF FF - /// + /// Result : FF FF FF FF + /// /// Input : FF FF FF FF /// Width : 8 /// Result : FF FF FF FF 00 00 00 00 - /// - /// + /// + /// /// Input : 00 00 00 00 /// Width : 8 /// Result : FF FF FF FF FF FF FF FF - /// + /// /// /// /// diff --git a/Emby.Server.Implementations/Properties/AssemblyInfo.cs b/Emby.Server.Implementations/Properties/AssemblyInfo.cs index 28ffcbac64..5987db0eb4 100644 --- a/Emby.Server.Implementations/Properties/AssemblyInfo.cs +++ b/Emby.Server.Implementations/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.Server.Implementations")] @@ -19,10 +19,10 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.*")] \ No newline at end of file diff --git a/Emby.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs b/Emby.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs index 02568fe3ac..db81243e0a 100644 --- a/Emby.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs @@ -35,8 +35,8 @@ namespace Emby.Server.Implementations.ScheduledTasks /// public IEnumerable GetDefaultTriggers() { - return new[] - { + return new[] + { // Every so often new TaskTriggerInfo { diff --git a/Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs b/Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs index fb07b8e99a..c58af68c83 100644 --- a/Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs @@ -36,8 +36,8 @@ namespace Emby.Server.Implementations.ScheduledTasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(12).Ticks} }; diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs index c60f59ce47..c6a807521d 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs @@ -42,8 +42,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} }; diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs index b754d7cb52..c3ef81f148 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs @@ -38,8 +38,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} }; diff --git a/Emby.Server.Implementations/Security/MBLicenseFile.cs b/Emby.Server.Implementations/Security/MBLicenseFile.cs index 1810cbcd25..485aaba46c 100644 --- a/Emby.Server.Implementations/Security/MBLicenseFile.cs +++ b/Emby.Server.Implementations/Security/MBLicenseFile.cs @@ -171,7 +171,7 @@ namespace Emby.Server.Implementations.Security //build our array var lines = new List { - RegKey, + RegKey, // Legacy key string.Empty diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.cs index f5fcb5fe6b..5590c51b62 100644 --- a/Emby.Server.Implementations/Services/ServiceHandler.cs +++ b/Emby.Server.Implementations/Services/ServiceHandler.cs @@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Services return deserializer(requestType, httpReq.InputStream); } } - return Task.FromResult(host.CreateInstance(requestType)); + return Task.FromResult(host.CreateInstance(requestType)); } public static RestPath FindMatchingRestPath(string httpMethod, string pathInfo, out string contentType) diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs index ac2af3eaf9..ce779a2087 100644 --- a/Emby.Server.Implementations/Services/ServicePath.cs +++ b/Emby.Server.Implementations/Services/ServicePath.cs @@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Services public int PathComponentsCount { get; set; } /// - /// The total number of segments after subparts have been exploded ('.') + /// The total number of segments after subparts have been exploded ('.') /// e.g. /path/to/here.ext == 4 /// public int TotalComponentsCount { get; set; } diff --git a/Emby.Server.Implementations/Services/UrlExtensions.cs b/Emby.Server.Implementations/Services/UrlExtensions.cs index ba9889c413..898dcac3e9 100644 --- a/Emby.Server.Implementations/Services/UrlExtensions.cs +++ b/Emby.Server.Implementations/Services/UrlExtensions.cs @@ -5,7 +5,7 @@ namespace Emby.Server.Implementations.Services /// /// Donated by Ivan Korneliuk from his post: /// http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html - /// + /// /// Modified to only allow using routes matching the supplied HTTP Verb /// public static class UrlExtensions diff --git a/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs b/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs index 388d2772e8..5939a94422 100644 --- a/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs +++ b/Emby.Server.Implementations/Sorting/DatePlayedComparer.cs @@ -28,7 +28,7 @@ namespace Emby.Server.Implementations.Sorting /// /// The user data repository. public IUserDataManager UserDataRepository { get; set; } - + /// /// Compares the specified x. /// diff --git a/Emby.Server.Implementations/Sorting/PlayCountComparer.cs b/Emby.Server.Implementations/Sorting/PlayCountComparer.cs index aecad7c580..6acec80124 100644 --- a/Emby.Server.Implementations/Sorting/PlayCountComparer.cs +++ b/Emby.Server.Implementations/Sorting/PlayCountComparer.cs @@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Sorting /// /// The user data repository. public IUserDataManager UserDataRepository { get; set; } - + /// /// Gets or sets the user manager. /// diff --git a/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs b/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs index d7219c86f4..b42aabe255 100644 --- a/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs +++ b/Emby.Server.Implementations/Sorting/PremiereDateComparer.cs @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Sorting { return x.PremiereDate.Value; } - + if (x.ProductionYear.HasValue) { try diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs index fc6c58a95b..1ea92232bf 100644 --- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs +++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs @@ -18,7 +18,7 @@ namespace NLangDetect.Core.Extensions if (end < 0) throw new ArgumentOutOfRangeException("end", "Argument must not be negative."); if (end > s.Length) throw new ArgumentOutOfRangeException("end", "Argument must not be greater than the input string's length."); if (start > end) throw new ArgumentOutOfRangeException("start", "Argument must not be greater than the 'end' argument."); - + return s.Substring(start, end - start); } } diff --git a/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs b/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs index a0395a21b9..441606e2ca 100644 --- a/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs +++ b/Emby.Server.Implementations/TextEncoding/TextEncodingDetect.cs @@ -1,15 +1,15 @@ namespace Emby.Server.Implementations.TextEncoding { // Copyright 2015-2016 Jonathan Bennett - // - // https://www.autoitscript.com + // + // https://www.autoitscript.com // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 - // + // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -166,7 +166,7 @@ return encoding; } - // Now try UTF16 + // Now try UTF16 encoding = CheckUtf16NewlineChars(buffer, size); if (encoding != CharacterEncoding.None) { diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs index 942fda8d1e..18b3b306e0 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs @@ -41,7 +41,7 @@ using System.IO; namespace UniversalDetector { /// - /// Default implementation of charset detection interface. + /// Default implementation of charset detection interface. /// The detector can be fed by a System.IO.Stream: /// /// @@ -52,9 +52,9 @@ namespace UniversalDetector /// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence); /// /// - /// + /// /// or by a byte a array: - /// + /// /// /// /// byte[] buff = new byte[1024]; @@ -64,23 +64,23 @@ namespace UniversalDetector /// cdet.DataEnd(); /// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence); /// - /// - /// + /// + /// public class CharsetDetector : Core.UniversalDetector, ICharsetDetector { private string charset; - + private float confidence; - + //public event DetectorFinished Finished; - + public CharsetDetector() : base(FILTER_ALL) { - + } public void Feed(Stream stream) - { + { byte[] buff = new byte[1024]; int read; while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !done) @@ -88,19 +88,19 @@ namespace UniversalDetector Feed(buff, 0, read); } } - - public bool IsDone() + + public bool IsDone() { return done; } - + public override void Reset() { this.charset = null; this.confidence = 0.0f; base.Reset(); } - + public string Charset { get { return charset; } } @@ -108,7 +108,7 @@ namespace UniversalDetector public float Confidence { get { return confidence; } } - + protected override void Report(string charset, float confidence) { this.charset = charset; @@ -118,7 +118,7 @@ namespace UniversalDetector // } } } - + //public delegate void DetectorFinished(string charset, float confidence); } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Big5Prober.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Big5Prober.cs index 760fca9bd5..19152a7acc 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Big5Prober.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Big5Prober.cs @@ -44,12 +44,12 @@ namespace UniversalDetector.Core private CodingStateMachine codingSM; private BIG5DistributionAnalyser distributionAnalyser; private byte[] lastChar = new byte[2]; - + public Big5Prober() { this.codingSM = new CodingStateMachine(new BIG5SMModel()); this.distributionAnalyser = new BIG5DistributionAnalyser(); - this.Reset(); + this.Reset(); } public override ProbingState HandleData(byte[] buf, int offset, int len) @@ -73,7 +73,7 @@ namespace UniversalDetector.Core lastChar[1] = buf[offset]; distributionAnalyser.HandleOneChar(lastChar, 0, charLen); } else { - distributionAnalyser.HandleOneChar(buf, i-1, charLen); + distributionAnalyser.HandleOneChar(buf, i-1, charLen); } } } @@ -84,23 +84,23 @@ namespace UniversalDetector.Core state = ProbingState.FoundIt; return state; } - + public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; distributionAnalyser.Reset(); } - + public override string GetCharsetName() { - return "Big-5"; + return "Big-5"; } - + public override float GetConfidence() { return distributionAnalyser.GetConfidence(); } - + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/BitPackage.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/BitPackage.cs index 16483e661a..19bcdc7792 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/BitPackage.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/BitPackage.cs @@ -43,15 +43,15 @@ namespace UniversalDetector.Core public static int INDEX_SHIFT_4BITS = 3; public static int INDEX_SHIFT_8BITS = 2; public static int INDEX_SHIFT_16BITS = 1; - + public static int SHIFT_MASK_4BITS = 7; public static int SHIFT_MASK_8BITS = 3; public static int SHIFT_MASK_16BITS = 1; - + public static int BIT_SHIFT_4BITS = 2; public static int BIT_SHIFT_8BITS = 3; public static int BIT_SHIFT_16BITS = 4; - + public static int UNIT_MASK_4BITS = 0x0000000F; public static int UNIT_MASK_8BITS = 0x000000FF; public static int UNIT_MASK_16BITS = 0x0000FFFF; @@ -61,7 +61,7 @@ namespace UniversalDetector.Core private int bitShift; private int unitMask; private int[] data; - + public BitPackage(int indexShift, int shiftMask, int bitShift, int unitMask, int[] data) { @@ -71,27 +71,27 @@ namespace UniversalDetector.Core this.unitMask = unitMask; this.data = data; } - + public static int Pack16bits(int a, int b) { return ((b << 16) | a); } - + public static int Pack8bits(int a, int b, int c, int d) { return Pack16bits((b << 8) | a, (d << 8) | c); } - - public static int Pack4bits(int a, int b, int c, int d, + + public static int Pack4bits(int a, int b, int c, int d, int e, int f, int g, int h) { return Pack8bits((b << 4) | a, (d << 4) | c, (f << 4) | e, (h << 4) | g); } - + public int Unpack(int i) { - return (data[i >> indexShift] >> + return (data[i >> indexShift] >> ((i & shiftMask) << bitShift)) & unitMask; } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs index 3369dd4304..cc4539058d 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CharsetProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -40,10 +40,10 @@ using System.IO; namespace UniversalDetector.Core { - public enum ProbingState { + public enum ProbingState { Detecting = 0, // no sure answer yet, but caller can ask for confidence FoundIt = 1, // positive answer - NotMe = 2 // negative answer + NotMe = 2 // negative answer }; public abstract class CharsetProber @@ -51,16 +51,16 @@ namespace UniversalDetector.Core protected const float SHORTCUT_THRESHOLD = 0.95F; protected ProbingState state; - + // ASCII codes private const byte SPACE = 0x20; private const byte CAPITAL_A = 0x41; private const byte CAPITAL_Z = 0x5A; private const byte SMALL_A = 0x61; private const byte SMALL_Z = 0x7A; - private const byte LESS_THAN = 0x3C; + private const byte LESS_THAN = 0x3C; private const byte GREATER_THAN = 0x3E; - + /// /// Feed data to the prober /// @@ -71,44 +71,44 @@ namespace UniversalDetector.Core /// A /// public abstract ProbingState HandleData(byte[] buf, int offset, int len); - + /// /// Reset prober state /// public abstract void Reset(); public abstract string GetCharsetName(); - + public abstract float GetConfidence(); - + public virtual ProbingState GetState() { return state; } public virtual void SetOption() - { - + { + } public virtual void DumpStatus() - { - + { + } // // Helper functions used in the Latin1 and Group probers // /// - /// + /// /// /// filtered buffer - protected static byte[] FilterWithoutEnglishLetters(byte[] buf, int offset, int len) + protected static byte[] FilterWithoutEnglishLetters(byte[] buf, int offset, int len) { byte[] result = null; using (MemoryStream ms = new MemoryStream(buf.Length)) { - + bool meetMSB = false; int max = offset + len; int prev = offset; @@ -140,8 +140,8 @@ namespace UniversalDetector.Core } /// - /// Do filtering to reduce load to probers (Remove ASCII symbols, - /// collapse spaces). This filter applies to all scripts which contain + /// Do filtering to reduce load to probers (Remove ASCII symbols, + /// collapse spaces). This filter applies to all scripts which contain /// both English characters and upper ASCII characters. /// /// a filtered copy of the input buffer @@ -150,16 +150,16 @@ namespace UniversalDetector.Core byte[] result = null; using (MemoryStream ms = new MemoryStream(buf.Length)) { - + bool inTag = false; int max = offset + len; int prev = offset; int cur = offset; while (cur < max) { - + byte b = buf[cur]; - + if (b == GREATER_THAN) inTag = false; else if (b == LESS_THAN) @@ -177,7 +177,7 @@ namespace UniversalDetector.Core cur++; } - // If the current segment contains more than just a symbol + // If the current segment contains more than just a symbol // and it is not inside a tag then keep it. if (!inTag && cur > prev) ms.Write(buf, prev, cur - prev); diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Charsets.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Charsets.cs index a7c1be92ab..00cd8826f6 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Charsets.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Charsets.cs @@ -20,7 +20,7 @@ * * Contributor(s): * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -40,47 +40,47 @@ namespace UniversalDetector.Core public static class Charsets { public const string ASCII = "ASCII"; - + public const string UTF8 = "UTF-8"; - + public const string UTF16_LE = "UTF-16LE"; - + public const string UTF16_BE = "UTF-16BE"; - + public const string UTF32_BE = "UTF-32BE"; - + public const string UTF32_LE = "UTF-32LE"; /// /// Unusual BOM (3412 order) /// public const string UCS4_3412 = "X-ISO-10646-UCS-4-3412"; - + /// /// Unusual BOM (2413 order) /// public const string UCS4_2413 = "X-ISO-10646-UCS-4-2413"; - + /// /// Cyrillic (based on bulgarian and russian data) /// public const string WIN1251 = "windows-1251"; - + /// /// Latin-1, almost identical to ISO-8859-1 /// public const string WIN1252 = "windows-1252"; - + /// /// Greek /// public const string WIN1253 = "windows-1253"; - + /// /// Logical hebrew (includes ISO-8859-8-I and most of x-mac-hebrew) /// public const string WIN1255 = "windows-1255"; - + /// /// Traditional chinese /// @@ -89,7 +89,7 @@ namespace UniversalDetector.Core public const string EUCKR = "EUC-KR"; public const string EUCJP = "EUC-JP"; - + public const string EUCTW = "EUC-TW"; /// @@ -98,11 +98,11 @@ namespace UniversalDetector.Core public const string GB18030 = "gb18030"; public const string ISO2022_JP = "ISO-2022-JP"; - + public const string ISO2022_CN = "ISO-2022-CN"; - + public const string ISO2022_KR = "ISO-2022-KR"; - + /// /// Simplified chinese /// @@ -111,15 +111,15 @@ namespace UniversalDetector.Core public const string SHIFT_JIS = "Shift-JIS"; public const string MAC_CYRILLIC = "x-mac-cyrillic"; - + public const string KOI8R = "KOI8-R"; - + public const string IBM855 = "IBM855"; - + public const string IBM866 = "IBM866"; /// - /// East-Europe. Disabled because too similar to windows-1252 + /// East-Europe. Disabled because too similar to windows-1252 /// (latin-1). Should use tri-grams models to discriminate between /// these two charsets. /// @@ -141,9 +141,9 @@ namespace UniversalDetector.Core public const string ISO8859_8 = "ISO-8859-8"; /// - /// Thai. This recognizer is not enabled yet. + /// Thai. This recognizer is not enabled yet. /// public const string TIS620 = "TIS620"; - + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CodingStateMachine.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CodingStateMachine.cs index f837dd9668..484bbca368 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CodingStateMachine.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/CodingStateMachine.cs @@ -22,7 +22,7 @@ * Shy Shalom * Kohei TAKETA (Java port) * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -48,8 +48,8 @@ namespace UniversalDetector.Core private SMModel model; private int currentCharLen; private int currentBytePos; - - public CodingStateMachine(SMModel model) + + public CodingStateMachine(SMModel model) { this.currentState = SMModel.START; this.model = model; @@ -57,34 +57,34 @@ namespace UniversalDetector.Core public int NextState(byte b) { - // for each byte we get its class, if it is first byte, + // for each byte we get its class, if it is first byte, // we also get byte length int byteCls = model.GetClass(b); - if (currentState == SMModel.START) { + if (currentState == SMModel.START) { currentBytePos = 0; currentCharLen = model.charLenTable[byteCls]; } - - // from byte's class and stateTable, we get its next state + + // from byte's class and stateTable, we get its next state currentState = model.stateTable.Unpack( currentState * model.ClassFactor + byteCls); currentBytePos++; return currentState; } - - public void Reset() - { - currentState = SMModel.START; + + public void Reset() + { + currentState = SMModel.START; } - public int CurrentCharLen - { - get { return currentCharLen; } + public int CurrentCharLen + { + get { return currentCharLen; } } - public string ModelName - { - get { return model.Name; } + public string ModelName + { + get { return model.Name; } } } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs index 050a9d9ce4..eac67fe956 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs @@ -43,25 +43,25 @@ namespace UniversalDetector.Core private EUCJPContextAnalyser contextAnalyser; private EUCJPDistributionAnalyser distributionAnalyser; private byte[] lastChar = new byte[2]; - + public EUCJPProber() { codingSM = new CodingStateMachine(new EUCJPSMModel()); distributionAnalyser = new EUCJPDistributionAnalyser(); - contextAnalyser = new EUCJPContextAnalyser(); + contextAnalyser = new EUCJPContextAnalyser(); Reset(); } - public override string GetCharsetName() + public override string GetCharsetName() { return "EUC-JP"; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState; int max = offset + len; - + for (int i = offset; i < max; i++) { codingState = codingSM.NextState(buf[i]); if (codingState == SMModel.ERROR) { @@ -83,7 +83,7 @@ namespace UniversalDetector.Core distributionAnalyser.HandleOneChar(buf, i-1, charLen); } } - } + } lastChar[0] = buf[max-1]; if (state == ProbingState.Detecting) if (contextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) @@ -93,18 +93,18 @@ namespace UniversalDetector.Core public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; contextAnalyser.Reset(); distributionAnalyser.Reset(); } - + public override float GetConfidence() { float contxtCf = contextAnalyser.GetConfidence(); float distribCf = distributionAnalyser.GetConfidence(); return (contxtCf > distribCf ? contxtCf : distribCf); } - + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCKRProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCKRProber.cs index 67d4b0a721..b1543dae16 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCKRProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCKRProber.cs @@ -46,15 +46,15 @@ namespace UniversalDetector.Core public EUCKRProber() { codingSM = new CodingStateMachine(new EUCKRSMModel()); - distributionAnalyser = new EUCKRDistributionAnalyser(); + distributionAnalyser = new EUCKRDistributionAnalyser(); Reset(); } - + public override string GetCharsetName() { - return "EUC-KR"; + return "EUC-KR"; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState; @@ -81,12 +81,12 @@ namespace UniversalDetector.Core } } lastChar[0] = buf[max-1]; - + if (state == ProbingState.Detecting) if (distributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) state = ProbingState.FoundIt; return state; - + } public override float GetConfidence() @@ -96,7 +96,7 @@ namespace UniversalDetector.Core public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; distributionAnalyser.Reset(); //mContextAnalyser.Reset(); diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCTWProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCTWProber.cs index a4e0b486ec..65a521760a 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCTWProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCTWProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -50,7 +50,7 @@ namespace UniversalDetector.Core this.distributionAnalyser = new EUCTWDistributionAnalyser(); this.Reset(); } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState; @@ -77,21 +77,21 @@ namespace UniversalDetector.Core } } lastChar[0] = buf[max-1]; - + if (state == ProbingState.Detecting) if (distributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) state = ProbingState.FoundIt; return state; } - + public override string GetCharsetName() { - return "x-euc-tw"; + return "x-euc-tw"; } - + public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; distributionAnalyser.Reset(); } @@ -100,7 +100,7 @@ namespace UniversalDetector.Core { return distributionAnalyser.GetConfidence(); } - - + + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs index e9cefa9bcc..f457bf4902 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs @@ -41,19 +41,19 @@ namespace UniversalDetector.Core { private const int CHARSETS_NUM = 4; private string detectedCharset; - private CodingStateMachine[] codingSM; + private CodingStateMachine[] codingSM; int activeSM; public EscCharsetProber() { - codingSM = new CodingStateMachine[CHARSETS_NUM]; + codingSM = new CodingStateMachine[CHARSETS_NUM]; codingSM[0] = new CodingStateMachine(new HZSMModel()); codingSM[1] = new CodingStateMachine(new ISO2022CNSMModel()); codingSM[2] = new CodingStateMachine(new ISO2022JPSMModel()); codingSM[3] = new CodingStateMachine(new ISO2022KRSMModel()); Reset(); } - + public override void Reset() { state = ProbingState.Detecting; @@ -66,7 +66,7 @@ namespace UniversalDetector.Core public override ProbingState HandleData(byte[] buf, int offset, int len) { int max = offset + len; - + for (int i = offset; i < max && state == ProbingState.Detecting; i++) { for (int j = activeSM - 1; j >= 0; j--) { // byte is feed to all active state machine @@ -94,12 +94,12 @@ namespace UniversalDetector.Core public override string GetCharsetName() { - return detectedCharset; + return detectedCharset; } - + public override float GetConfidence() { return 0.99f; - } + } } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscSM.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscSM.cs index 61ac5545fb..6ebfa8a4ca 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscSM.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscSM.cs @@ -44,59 +44,59 @@ namespace UniversalDetector.Core public class HZSMModel : SMModel { private readonly static int[] HZ_cls = { - BitPackage.Pack4bits(1,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,4,0,5,2,0), // 78 - 7f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 80 - 87 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 88 - 8f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 90 - 97 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 98 - 9f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // a0 - a7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // a8 - af - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b0 - b7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b8 - bf - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // c0 - c7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // c8 - cf - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // d0 - d7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // d8 - df - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // e0 - e7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // e8 - ef - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // f0 - f7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1) // f8 - ff + BitPackage.Pack4bits(1,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,4,0,5,2,0), // 78 - 7f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 80 - 87 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 88 - 8f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 90 - 97 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 98 - 9f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // a0 - a7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // a8 - af + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b0 - b7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b8 - bf + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // c0 - c7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // c8 - cf + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // d0 - d7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // d8 - df + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // e0 - e7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // e8 - ef + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // f0 - f7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1) // f8 - ff }; private readonly static int[] HZ_st = { - BitPackage.Pack4bits(START, ERROR, 3, START, START, START, ERROR, ERROR),//00-07 - BitPackage.Pack4bits(ERROR, ERROR, ERROR, ERROR, ITSME, ITSME, ITSME, ITSME),//08-0f - BitPackage.Pack4bits(ITSME, ITSME, ERROR, ERROR, START, START, 4, ERROR),//10-17 - BitPackage.Pack4bits( 5, ERROR, 6, ERROR, 5, 5, 4, ERROR),//18-1f - BitPackage.Pack4bits( 4, ERROR, 4, 4, 4, ERROR, 4, ERROR),//20-27 - BitPackage.Pack4bits( 4, ITSME, START, START, START, START, START, START) //28-2f + BitPackage.Pack4bits(START, ERROR, 3, START, START, START, ERROR, ERROR),//00-07 + BitPackage.Pack4bits(ERROR, ERROR, ERROR, ERROR, ITSME, ITSME, ITSME, ITSME),//08-0f + BitPackage.Pack4bits(ITSME, ITSME, ERROR, ERROR, START, START, 4, ERROR),//10-17 + BitPackage.Pack4bits( 5, ERROR, 6, ERROR, 5, 5, 4, ERROR),//18-1f + BitPackage.Pack4bits( 4, ERROR, 4, 4, 4, ERROR, 4, ERROR),//20-27 + BitPackage.Pack4bits( 4, ITSME, START, START, START, START, START, START) //28-2f }; private readonly static int[] HZCharLenTable = {0, 0, 0, 0, 0, 0}; - + public HZSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, HZ_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, HZ_st), HZCharLenTable, "HZ-GB-2312") @@ -104,65 +104,65 @@ namespace UniversalDetector.Core } } - + public class ISO2022CNSMModel : SMModel { private readonly static int[] ISO2022CN_cls = { - BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 - BitPackage.Pack4bits(0,3,0,0,0,0,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(0,0,0,4,0,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff + BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 + BitPackage.Pack4bits(0,3,0,0,0,0,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(0,0,0,4,0,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff }; private readonly static int[] ISO2022CN_st = { - BitPackage.Pack4bits(START, 3,ERROR,START,START,START,START,START),//00-07 - BitPackage.Pack4bits(START,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//08-0f - BitPackage.Pack4bits(ERROR,ERROR,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//10-17 - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ERROR,ERROR,ERROR, 4,ERROR),//18-1f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//20-27 - BitPackage.Pack4bits( 5, 6,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//28-2f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//30-37 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ERROR,START) //38-3f + BitPackage.Pack4bits(START, 3,ERROR,START,START,START,START,START),//00-07 + BitPackage.Pack4bits(START,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//08-0f + BitPackage.Pack4bits(ERROR,ERROR,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//10-17 + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ERROR,ERROR,ERROR, 4,ERROR),//18-1f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//20-27 + BitPackage.Pack4bits( 5, 6,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//28-2f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//30-37 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ERROR,START) //38-3f }; private readonly static int[] ISO2022CNCharLenTable = {0, 0, 0, 0, 0, 0, 0, 0, 0}; public ISO2022CNSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022CN_cls), 9, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022CN_st), ISO2022CNCharLenTable, "ISO-2022-CN") @@ -170,130 +170,130 @@ namespace UniversalDetector.Core } } - + public class ISO2022JPSMModel : SMModel { private readonly static int[] ISO2022JP_cls = { - BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,0,0,0,0,2,2), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,7,0,0,0), // 20 - 27 - BitPackage.Pack4bits(3,0,0,0,0,0,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(6,0,4,0,8,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,9,5,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff + BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,0,0,0,0,2,2), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,7,0,0,0), // 20 - 27 + BitPackage.Pack4bits(3,0,0,0,0,0,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(6,0,4,0,8,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,9,5,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff }; private readonly static int[] ISO2022JP_st = { - BitPackage.Pack4bits(START, 3, ERROR,START,START,START,START,START),//00-07 - BitPackage.Pack4bits(START, START, ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//08-0f - BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//10-17 - BitPackage.Pack4bits(ITSME, ITSME, ITSME,ITSME,ITSME,ITSME,ERROR,ERROR),//18-1f - BitPackage.Pack4bits(ERROR, 5, ERROR,ERROR,ERROR, 4,ERROR,ERROR),//20-27 - BitPackage.Pack4bits(ERROR, ERROR, ERROR, 6,ITSME,ERROR,ITSME,ERROR),//28-2f - BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//30-37 - BitPackage.Pack4bits(ERROR, ERROR, ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//38-3f - BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ITSME,ERROR,START,START) //40-47 + BitPackage.Pack4bits(START, 3, ERROR,START,START,START,START,START),//00-07 + BitPackage.Pack4bits(START, START, ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//08-0f + BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//10-17 + BitPackage.Pack4bits(ITSME, ITSME, ITSME,ITSME,ITSME,ITSME,ERROR,ERROR),//18-1f + BitPackage.Pack4bits(ERROR, 5, ERROR,ERROR,ERROR, 4,ERROR,ERROR),//20-27 + BitPackage.Pack4bits(ERROR, ERROR, ERROR, 6,ITSME,ERROR,ITSME,ERROR),//28-2f + BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//30-37 + BitPackage.Pack4bits(ERROR, ERROR, ERROR,ITSME,ERROR,ERROR,ERROR,ERROR),//38-3f + BitPackage.Pack4bits(ERROR, ERROR, ERROR,ERROR,ITSME,ERROR,START,START) //40-47 }; private readonly static int[] ISO2022JPCharLenTable = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; public ISO2022JPSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022JP_cls), 10, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022JP_st), ISO2022JPCharLenTable, "ISO-2022-JP") { } - + } - + public class ISO2022KRSMModel : SMModel - { + { private readonly static int[] ISO2022KR_cls = { - BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,3,0,0,0), // 20 - 27 - BitPackage.Pack4bits(0,4,0,0,0,0,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(0,0,0,5,0,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff + BitPackage.Pack4bits(2,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,1,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,3,0,0,0), // 20 - 27 + BitPackage.Pack4bits(0,4,0,0,0,0,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(0,0,0,5,0,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 80 - 87 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 88 - 8f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 90 - 97 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 98 - 9f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2) // f8 - ff }; private readonly static int[] ISO2022KR_st = { - BitPackage.Pack4bits(START, 3,ERROR,START,START,START,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME,ERROR,ERROR,ERROR, 4,ERROR,ERROR),//10-17 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR, 5,ERROR,ERROR,ERROR),//18-1f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,START,START,START,START) //20-27 + BitPackage.Pack4bits(START, 3,ERROR,START,START,START,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME,ERROR,ERROR,ERROR, 4,ERROR,ERROR),//10-17 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR, 5,ERROR,ERROR,ERROR),//18-1f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ITSME,START,START,START,START) //20-27 }; private readonly static int[] ISO2022KRCharLenTable = {0, 0, 0, 0, 0, 0}; public ISO2022KRSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022KR_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, ISO2022KR_st), ISO2022KRCharLenTable, "ISO-2022-KR") diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/GB18030Prober.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/GB18030Prober.cs index ac237c5cd8..0d2ebd8c73 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/GB18030Prober.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/GB18030Prober.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -38,7 +38,7 @@ namespace UniversalDetector.Core { - // We use gb18030 to replace gb2312, because 18030 is a superset. + // We use gb18030 to replace gb2312, because 18030 is a superset. public class GB18030Prober : CharsetProber { private CodingStateMachine codingSM; @@ -52,18 +52,18 @@ namespace UniversalDetector.Core analyser = new GB18030DistributionAnalyser(); Reset(); } - + public override string GetCharsetName() { - return "gb18030"; + return "gb18030"; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState = SMModel.START; int max = offset + len; - + for (int i = offset; i < max; i++) { codingState = codingSM.NextState(buf[i]); if (codingState == SMModel.ERROR) { @@ -91,18 +91,18 @@ namespace UniversalDetector.Core if (analyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) state = ProbingState.FoundIt; } - + return state; } - + public override float GetConfidence() { return analyser.GetConfidence(); } - + public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; analyser.Reset(); } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/HebrewProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/HebrewProber.cs index 92974d3a81..2cbf33075c 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/HebrewProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/HebrewProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -43,40 +43,40 @@ using System; * * Four main charsets exist in Hebrew: * "ISO-8859-8" - Visual Hebrew - * "windows-1255" - Logical Hebrew + * "windows-1255" - Logical Hebrew * "ISO-8859-8-I" - Logical Hebrew * "x-mac-hebrew" - ?? Logical Hebrew ?? * * Both "ISO" charsets use a completely identical set of code points, whereas - * "windows-1255" and "x-mac-hebrew" are two different proper supersets of + * "windows-1255" and "x-mac-hebrew" are two different proper supersets of * these code points. windows-1255 defines additional characters in the range - * 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific + * 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific * diacritics and additional 'Yiddish' ligature letters in the range 0xc0-0xd6. - * x-mac-hebrew defines similar additional code points but with a different + * x-mac-hebrew defines similar additional code points but with a different * mapping. * - * As far as an average Hebrew text with no diacritics is concerned, all four - * charsets are identical with respect to code points. Meaning that for the - * main Hebrew alphabet, all four map the same values to all 27 Hebrew letters + * As far as an average Hebrew text with no diacritics is concerned, all four + * charsets are identical with respect to code points. Meaning that for the + * main Hebrew alphabet, all four map the same values to all 27 Hebrew letters * (including final letters). * * The dominant difference between these charsets is their directionality. * "Visual" directionality means that the text is ordered as if the renderer is - * not aware of a BIDI rendering algorithm. The renderer sees the text and - * draws it from left to right. The text itself when ordered naturally is read + * not aware of a BIDI rendering algorithm. The renderer sees the text and + * draws it from left to right. The text itself when ordered naturally is read * backwards. A buffer of Visual Hebrew generally looks like so: * "[last word of first line spelled backwards] [whole line ordered backwards - * and spelled backwards] [first word of first line spelled backwards] + * and spelled backwards] [first word of first line spelled backwards] * [end of line] [last word of second line] ... etc' " * adding punctuation marks, numbers and English text to visual text is * naturally also "visual" and from left to right. - * + * * "Logical" directionality means the text is ordered "naturally" according to - * the order it is read. It is the responsibility of the renderer to display - * the text from right to left. A BIDI algorithm is used to place general + * the order it is read. It is the responsibility of the renderer to display + * the text from right to left. A BIDI algorithm is used to place general * punctuation marks, numbers and English text in the text. * - * Texts in x-mac-hebrew are almost impossible to find on the Internet. From + * Texts in x-mac-hebrew are almost impossible to find on the Internet. From * what little evidence I could find, it seems that its general directionality * is Logical. * @@ -84,17 +84,17 @@ using System; * charsets: * Visual Hebrew - "ISO-8859-8" - backwards text - Words and sentences are * backwards while line order is natural. For charset recognition purposes - * the line order is unimportant (In fact, for this implementation, even + * the line order is unimportant (In fact, for this implementation, even * word order is unimportant). * Logical Hebrew - "windows-1255" - normal, naturally ordered text. * - * "ISO-8859-8-I" is a subset of windows-1255 and doesn't need to be + * "ISO-8859-8-I" is a subset of windows-1255 and doesn't need to be * specifically identified. * "x-mac-hebrew" is also identified as windows-1255. A text in x-mac-hebrew * that contain special punctuation marks or diacritics is displayed with * some unconverted characters showing as question marks. This problem might * be corrected using another model prober for x-mac-hebrew. Due to the fact - * that x-mac-hebrew texts are so rare, writing another model prober isn't + * that x-mac-hebrew texts are so rare, writing another model prober isn't * worth the effort and performance hit. * * *** The Prober *** @@ -136,7 +136,7 @@ using System; */ namespace UniversalDetector.Core { - + /// /// This prober doesn't actually recognize a language or a charset. /// It is a helper prober for the use of the Hebrew model probers @@ -165,49 +165,49 @@ namespace UniversalDetector.Core protected const string VISUAL_HEBREW_NAME = "ISO-8859-8"; protected const string LOGICAL_HEBREW_NAME = "windows-1255"; - + // owned by the group prober. protected CharsetProber logicalProber, visualProber; - protected int finalCharLogicalScore, finalCharVisualScore; - + protected int finalCharLogicalScore, finalCharVisualScore; + // The two last bytes seen in the previous buffer. protected byte prev, beforePrev; - + public HebrewProber() { Reset(); } - - public void SetModelProbers(CharsetProber logical, CharsetProber visual) - { - logicalProber = logical; - visualProber = visual; + + public void SetModelProbers(CharsetProber logical, CharsetProber visual) + { + logicalProber = logical; + visualProber = visual; } - - /** + + /** * Final letter analysis for logical-visual decision. - * Look for evidence that the received buffer is either logical Hebrew or + * Look for evidence that the received buffer is either logical Hebrew or * visual Hebrew. * The following cases are checked: - * 1) A word longer than 1 letter, ending with a final letter. This is an - * indication that the text is laid out "naturally" since the final letter + * 1) A word longer than 1 letter, ending with a final letter. This is an + * indication that the text is laid out "naturally" since the final letter * really appears at the end. +1 for logical score. * 2) A word longer than 1 letter, ending with a Non-Final letter. In normal * Hebrew, words ending with Kaf, Mem, Nun, Pe or Tsadi, should not end with * the Non-Final form of that letter. Exceptions to this rule are mentioned * above in isNonFinal(). This is an indication that the text is laid out * backwards. +1 for visual score - * 3) A word longer than 1 letter, starting with a final letter. Final letters - * should not appear at the beginning of a word. This is an indication that + * 3) A word longer than 1 letter, starting with a final letter. Final letters + * should not appear at the beginning of a word. This is an indication that * the text is laid out backwards. +1 for visual score. * - * The visual score and logical score are accumulated throughout the text and + * The visual score and logical score are accumulated throughout the text and * are finally checked against each other in GetCharSetName(). * No checking for final letters in the middle of words is done since that case * is not an indication for either Logical or Visual text. * * The input buffer should not contain any white spaces that are not (' ') - * or any low-ascii punctuation marks. + * or any low-ascii punctuation marks. */ public override ProbingState HandleData(byte[] buf, int offset, int len) { @@ -218,31 +218,31 @@ namespace UniversalDetector.Core int max = offset + len; for (int i = offset; i < max; i++) { - + byte b = buf[i]; - + // a word just ended if (b == 0x20) { // *(curPtr-2) was not a space so prev is not a 1 letter word if (beforePrev != 0x20) { // case (1) [-2:not space][-1:final letter][cur:space] - if (IsFinal(prev)) + if (IsFinal(prev)) finalCharLogicalScore++; - // case (2) [-2:not space][-1:Non-Final letter][cur:space] + // case (2) [-2:not space][-1:Non-Final letter][cur:space] else if (IsNonFinal(prev)) finalCharVisualScore++; } - + } else { // case (3) [-2:space][-1:final letter][cur:not space] - if ((beforePrev == 0x20) && (IsFinal(prev)) && (b != ' ')) + if ((beforePrev == 0x20) && (IsFinal(prev)) && (b != ' ')) ++finalCharVisualScore; } beforePrev = prev; prev = b; } - // Forever detecting, till the end or until both model probers + // Forever detecting, till the end or until both model probers // return NotMe (handled above). return ProbingState.Detecting; } @@ -252,7 +252,7 @@ namespace UniversalDetector.Core { // If the final letter score distance is dominant enough, rely on it. int finalsub = finalCharLogicalScore - finalCharVisualScore; - if (finalsub >= MIN_FINAL_CHAR_DISTANCE) + if (finalsub >= MIN_FINAL_CHAR_DISTANCE) return LOGICAL_HEBREW_NAME; if (finalsub <= -(MIN_FINAL_CHAR_DISTANCE)) return VISUAL_HEBREW_NAME; @@ -263,9 +263,9 @@ namespace UniversalDetector.Core return LOGICAL_HEBREW_NAME; if (modelsub < -(MIN_MODEL_DISTANCE)) return VISUAL_HEBREW_NAME; - + // Still no good, back to final letter distance, maybe it'll save the day. - if (finalsub < 0) + if (finalsub < 0) return VISUAL_HEBREW_NAME; // (finalsub > 0 - Logical) or (don't know what to do) default to Logical. @@ -280,10 +280,10 @@ namespace UniversalDetector.Core beforePrev = 0x20; } - public override ProbingState GetState() + public override ProbingState GetState() { // Remain active as long as any of the model probers are active. - if (logicalProber.GetState() == ProbingState.NotMe && + if (logicalProber.GetState() == ProbingState.NotMe && visualProber.GetState() == ProbingState.NotMe) return ProbingState.NotMe; return ProbingState.Detecting; @@ -293,31 +293,31 @@ namespace UniversalDetector.Core { //Console.WriteLine(" HEB: {0} - {1} [Logical-Visual score]", finalCharLogicalScore, finalCharVisualScore); } - + public override float GetConfidence() - { + { return 0.0f; } - + protected static bool IsFinal(byte b) { - return (b == FINAL_KAF || b == FINAL_MEM || b == FINAL_NUN - || b == FINAL_PE || b == FINAL_TSADI); + return (b == FINAL_KAF || b == FINAL_MEM || b == FINAL_NUN + || b == FINAL_PE || b == FINAL_TSADI); } - + protected static bool IsNonFinal(byte b) { - // The normal Tsadi is not a good Non-Final letter due to words like - // 'lechotet' (to chat) containing an apostrophe after the tsadi. This - // apostrophe is converted to a space in FilterWithoutEnglishLetters causing - // the Non-Final tsadi to appear at an end of a word even though this is not + // The normal Tsadi is not a good Non-Final letter due to words like + // 'lechotet' (to chat) containing an apostrophe after the tsadi. This + // apostrophe is converted to a space in FilterWithoutEnglishLetters causing + // the Non-Final tsadi to appear at an end of a word even though this is not // the case in the original text. - // The letters Pe and Kaf rarely display a related behavior of not being a - // good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' for - // example legally end with a Non-Final Pe or Kaf. However, the benefit of - // these letters as Non-Final letters outweighs the damage since these words - // are quite rare. - return (b == NORMAL_KAF || b == NORMAL_MEM || b == NORMAL_NUN + // The letters Pe and Kaf rarely display a related behavior of not being a + // good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' for + // example legally end with a Non-Final Pe or Kaf. However, the benefit of + // these letters as Non-Final letters outweighs the damage since these words + // are quite rare. + return (b == NORMAL_KAF || b == NORMAL_MEM || b == NORMAL_NUN || b == NORMAL_PE); } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/JapaneseContextAnalyser.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/JapaneseContextAnalyser.cs index 93b9d7580c..7d28224c55 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/JapaneseContextAnalyser.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/JapaneseContextAnalyser.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -48,7 +48,7 @@ namespace UniversalDetector.Core // hiragana frequency category table // This is hiragana 2-char sequence table, the number in each cell represents its frequency category - protected static byte[,] jp2CharContext = { + protected static byte[,] jp2CharContext = { { 0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,}, { 2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4,}, { 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,}, @@ -133,35 +133,35 @@ namespace UniversalDetector.Core { 0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3,}, { 0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1,}, }; - + // category counters, each integer counts sequence in its category int[] relSample = new int[CATEGORIES_NUM]; // total sequence received int totalRel; - + // The order of previous char int lastCharOrder; - // if last byte in current buffer is not the last byte of a character, + // if last byte in current buffer is not the last byte of a character, // we need to know how many byte to skip in next buffer. int needToSkipCharNum; - // If this flag is set to true, detection is done and conclusion has + // If this flag is set to true, detection is done and conclusion has // been made bool done; - + public JapaneseContextAnalyser() { - Reset(); + Reset(); } - + public float GetConfidence() { // This is just one way to calculate confidence. It works well for me. if (totalRel > MINIMUM_DATA_THRESHOLD) return ((float)(totalRel - relSample[0]))/totalRel; - else + else return DONT_KNOW; } @@ -170,15 +170,15 @@ namespace UniversalDetector.Core int charLen = 0; int max = offset + len; - + if (done) return; - // The buffer we got is byte oriented, and a character may span + // The buffer we got is byte oriented, and a character may span // more than one buffer. In case the last one or two byte in last - // buffer is not complete, we record how many byte needed to + // buffer is not complete, we record how many byte needed to // complete that character and skip these bytes here. We can choose - // to record those bytes as well and analyse the character once it + // to record those bytes as well and analyse the character once it // is complete, but since a character will not make much difference, // skipping it will simplify our logic and improve performance. for (int i = needToSkipCharNum+offset; i < max; ) { @@ -200,14 +200,14 @@ namespace UniversalDetector.Core } } } - + public void HandleOneChar(byte[] buf, int offset, int charLen) { - if (totalRel > MAX_REL_THRESHOLD) + if (totalRel > MAX_REL_THRESHOLD) done = true; - if (done) + if (done) return; - + // Only 2-bytes characters are of our interest int order = (charLen == 2) ? GetOrder(buf, offset) : -1; if (order != -1 && lastCharOrder != -1) { @@ -217,7 +217,7 @@ namespace UniversalDetector.Core } lastCharOrder = order; } - + public void Reset() { totalRel = 0; @@ -228,18 +228,18 @@ namespace UniversalDetector.Core done = false; } } - + protected abstract int GetOrder(byte[] buf, int offset, out int charLen); - + protected abstract int GetOrder(byte[] buf, int offset); - - public bool GotEnoughData() + + public bool GotEnoughData() { return totalRel > ENOUGH_REL_THRESHOLD; } - + } - + public class SJISContextAnalyser : JapaneseContextAnalyser { private const byte HIRAGANA_FIRST_BYTE = 0x82; @@ -247,10 +247,10 @@ namespace UniversalDetector.Core protected override int GetOrder(byte[] buf, int offset, out int charLen) { //find out current char's byte length - if (buf[offset] >= 0x81 && buf[offset] <= 0x9F + if (buf[offset] >= 0x81 && buf[offset] <= 0x9F || buf[offset] >= 0xe0 && buf[offset] <= 0xFC) charLen = 2; - else + else charLen = 1; // return its order if it is hiragana @@ -259,7 +259,7 @@ namespace UniversalDetector.Core if (low >= 0x9F && low <= 0xF1) return low - 0x9F; } - return -1; + return -1; } protected override int GetOrder(byte[] buf, int offset) @@ -274,15 +274,15 @@ namespace UniversalDetector.Core } } - + public class EUCJPContextAnalyser : JapaneseContextAnalyser { private const byte HIRAGANA_FIRST_BYTE = 0xA4; - + protected override int GetOrder(byte[] buf, int offset, out int charLen) { byte high = buf[offset]; - + //find out current char's byte length if (high == 0x8E || high >= 0xA1 && high <= 0xFE) charLen = 2; @@ -297,9 +297,9 @@ namespace UniversalDetector.Core if (low >= 0xA1 && low <= 0xF3) return low - 0xA1; } - return -1; + return -1; } - + protected override int GetOrder(byte[] buf, int offset) { // We are only interested in Hiragana @@ -309,7 +309,7 @@ namespace UniversalDetector.Core return low - 0xA1; } return -1; - } + } } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangBulgarianModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangBulgarianModel.cs index 4b6729ed30..5b18480d24 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangBulgarianModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangBulgarianModel.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -37,15 +37,15 @@ * ***** END LICENSE BLOCK ***** */ namespace UniversalDetector.Core -{ +{ public abstract class BulgarianModel : SequenceModel { - //Model Table: + //Model Table: //total sequences: 100% //first 512 sequences: 96.9392% //first 1024 sequences:3.0618% //rest sequences: 0.2992% - //negative sequences: 0.0020% + //negative sequences: 0.0020% private static byte[] BULGARIAN_LANG_MODEL = { 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2, @@ -175,15 +175,15 @@ namespace UniversalDetector.Core 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, - + }; - public BulgarianModel(byte[] charToOrderMap, string name) + public BulgarianModel(byte[] charToOrderMap, string name) : base(charToOrderMap, BULGARIAN_LANG_MODEL, 0.969392f, false, name) { - } + } } - + public class Latin5BulgarianModel : BulgarianModel { //255: Control characters that usually does not exist in any text @@ -191,7 +191,7 @@ namespace UniversalDetector.Core //253: symbol (punctuation) that does not belong to word //252: 0 - 9 // Character Mapping Table: - // this table is modified base on win1251BulgarianCharToOrderMap, so + // this table is modified base on win1251BulgarianCharToOrderMap, so // only number <64 is sure valid private static byte[] LATIN5_CHAR_TO_ORDER_MAP = { 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, //00 @@ -209,14 +209,14 @@ namespace UniversalDetector.Core 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,239, 67,240, 60, 56, //c0 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, //d0 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,241, 42, 16, //e0 - 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,252,253, //f0 + 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,252,253, //f0 }; - + public Latin5BulgarianModel() : base(LATIN5_CHAR_TO_ORDER_MAP, "ISO-8859-5") { } } - + public class Win1251BulgarianModel : BulgarianModel { private static byte[] WIN1251__CHAR_TO_ORDER_MAP = { @@ -236,8 +236,8 @@ namespace UniversalDetector.Core 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,251, 67,252, 60, 56, //d0 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, //e0 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,253, 42, 16, //f0 - }; - + }; + public Win1251BulgarianModel() : base(WIN1251__CHAR_TO_ORDER_MAP, "windows-1251") { } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangCyrillicModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangCyrillicModel.cs index 5e55a48390..1210b6d5d1 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangCyrillicModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangCyrillicModel.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -40,12 +40,12 @@ namespace UniversalDetector.Core { public abstract class CyrillicModel : SequenceModel { - // Model Table: + // Model Table: // total sequences: 100% // first 512 sequences: 97.6601% // first 1024 sequences: 2.3389% // rest sequences: 0.1237% - // negative sequences: 0.0009% + // negative sequences: 0.0009% protected readonly static byte[] RUSSIAN_LANG_MODEL = { 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2, @@ -176,13 +176,13 @@ namespace UniversalDetector.Core 0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, }; - - public CyrillicModel(byte[] charToOrderMap, string name) + + public CyrillicModel(byte[] charToOrderMap, string name) : base(charToOrderMap, RUSSIAN_LANG_MODEL, 0.976601f, false, name) { } } - + public class Koi8rModel : CyrillicModel { private readonly static byte[] KOI8R_CHAR_TO_ORDER_MAP = { @@ -203,12 +203,12 @@ namespace UniversalDetector.Core 59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34, //e0 35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70, //f0 }; - + public Koi8rModel() : base(KOI8R_CHAR_TO_ORDER_MAP, "KOI8-R") { } } - + public class Win1251Model : CyrillicModel { private readonly static byte[] WIN1251_CHAR_TO_ORDER_MAP = { @@ -229,12 +229,12 @@ namespace UniversalDetector.Core 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, }; - + public Win1251Model() : base(WIN1251_CHAR_TO_ORDER_MAP, "windows-1251") { } } - + public class Latin5Model : CyrillicModel { private readonly static byte[] LATIN5_CHAR_TO_ORDER_MAP = { @@ -254,13 +254,13 @@ namespace UniversalDetector.Core 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, - }; - + }; + public Latin5Model() : base(LATIN5_CHAR_TO_ORDER_MAP, "ISO-8859-5") { } } - + public class MacCyrillicModel : CyrillicModel { private readonly static byte[] MACCYRILLIC_CHAR_TO_ORDER_MAP = { @@ -281,7 +281,7 @@ namespace UniversalDetector.Core 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,255, }; - + public MacCyrillicModel() : base(MACCYRILLIC_CHAR_TO_ORDER_MAP, "x-mac-cyrillic") { @@ -308,7 +308,7 @@ namespace UniversalDetector.Core 43, 9, 45, 7, 32, 6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249, 250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,252,255, }; - + public Ibm855Model() : base(IBM855_BYTE_TO_ORDER_MAP, "IBM855") { } @@ -334,12 +334,12 @@ namespace UniversalDetector.Core 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, 239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, }; - + public Ibm866Model() : base(IBM866_CHAR_TO_ORDER_MAP, "IBM866") { } } - - + + } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangGreekModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangGreekModel.cs index 563ba52c20..2fe1e97c08 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangGreekModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangGreekModel.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -37,15 +37,15 @@ * ***** END LICENSE BLOCK ***** */ namespace UniversalDetector.Core -{ +{ public abstract class GreekModel : SequenceModel { - // Model Table: + // Model Table: // total sequences: 100% // first 512 sequences: 98.2851% // first 1024 sequences:1.7001% // rest sequences: 0.0359% - // negative sequences: 0.0148% + // negative sequences: 0.0148% private readonly static byte[] GREEK_LANG_MODEL = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -177,12 +177,12 @@ namespace UniversalDetector.Core 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; - public GreekModel(byte[] charToOrderMap, string name) + public GreekModel(byte[] charToOrderMap, string name) : base(charToOrderMap, GREEK_LANG_MODEL, 0.982851f, false, name) { - } + } } - + public class Latin7Model : GreekModel { /**************************************************************** @@ -210,12 +210,12 @@ namespace UniversalDetector.Core 124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, //e0 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, //f0 }; - + public Latin7Model() : base(LATIN7_CHAR_TO_ORDER_MAP, "ISO-8859-7") { } } - + public class Win1253Model : GreekModel { private readonly static byte[] WIN1253__CHAR_TO_ORDER_MAP = { @@ -235,8 +235,8 @@ namespace UniversalDetector.Core 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, //d0 124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, //e0 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, //f0 - }; - + }; + public Win1253Model() : base(WIN1253__CHAR_TO_ORDER_MAP, "windows-1253") { } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHebrewModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHebrewModel.cs index 030fcc5988..180ab8a637 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHebrewModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHebrewModel.cs @@ -37,15 +37,15 @@ * ***** END LICENSE BLOCK ***** */ namespace UniversalDetector.Core -{ +{ public abstract class HebrewModel : SequenceModel { - //Model Table: + //Model Table: //total sequences: 100% //first 512 sequences: 98.4004% //first 1024 sequences: 1.5981% //rest sequences: 0.087% - //negative sequences: 0.0015% + //negative sequences: 0.0015% private readonly static byte[] HEBREW_LANG_MODEL = { 0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0, 3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1, @@ -177,12 +177,12 @@ namespace UniversalDetector.Core 0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0, }; - public HebrewModel(byte[] charToOrderMap, string name) + public HebrewModel(byte[] charToOrderMap, string name) : base(charToOrderMap, HEBREW_LANG_MODEL, 0.984004f, false, name) { - } + } } - + public class Win1255Model : HebrewModel { /* @@ -192,7 +192,7 @@ namespace UniversalDetector.Core 252: 0 - 9 */ //Windows-1255 language model - //Character Mapping Table: + //Character Mapping Table: private readonly static byte[] WIN1255_CHAR_TO_ORDER_MAP = { 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, //00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, //10 @@ -211,7 +211,7 @@ namespace UniversalDetector.Core 9, 8, 20, 16, 3, 2, 24, 14, 22, 1, 25, 15, 4, 11, 6, 23, 12, 19, 13, 26, 18, 27, 21, 17, 7, 10, 5,251,252,128, 96,253, }; - + public Win1255Model() : base(WIN1255_CHAR_TO_ORDER_MAP, "windows-1255") { } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHungarianModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHungarianModel.cs index d7eee2251b..d95ec4c8e5 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHungarianModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangHungarianModel.cs @@ -36,15 +36,15 @@ * ***** END LICENSE BLOCK ***** */ namespace UniversalDetector.Core -{ +{ public abstract class HungarianModel : SequenceModel { - //Model Table: + //Model Table: //total sequences: 100% //first 512 sequences: 94.7368% //first 1024 sequences:5.2623% //rest sequences: 0.8894% - //negative sequences: 0.0009% + //negative sequences: 0.0009% private readonly static byte[] HUNGARIAN_LANG_MODEL = { 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2, @@ -176,13 +176,13 @@ namespace UniversalDetector.Core 0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0, }; - public HungarianModel(byte[] charToOrderMap, string name) - : base(charToOrderMap, HUNGARIAN_LANG_MODEL, 0.947368f, + public HungarianModel(byte[] charToOrderMap, string name) + : base(charToOrderMap, HUNGARIAN_LANG_MODEL, 0.947368f, false, name) { - } + } } - + public class Latin2HungarianModel : HungarianModel { private readonly static byte[] LATIN2_CHAR_TO_ORDER_MAP = { @@ -203,12 +203,12 @@ namespace UniversalDetector.Core 82, 14, 74,242, 70, 80,243, 72,244, 15, 83, 77, 84, 30, 76, 85, 245,246,247, 25, 73, 42, 24,248,249,250, 31, 56, 29,251,252,253, }; - + public Latin2HungarianModel() : base(LATIN2_CHAR_TO_ORDER_MAP, "ISO-8859-2") { } } - + public class Win1250HungarianModel : HungarianModel { private readonly static byte[] WIN1250_CHAR_TO_ORDER_MAP = { @@ -229,7 +229,7 @@ namespace UniversalDetector.Core 84, 14, 75,242, 71, 82,243, 73,244, 15, 85, 79, 86, 30, 77, 87, 245,246,247, 25, 74, 42, 24,248,249,250, 31, 56, 29,251,252,253, }; - + public Win1250HungarianModel() : base(WIN1250_CHAR_TO_ORDER_MAP, "windows-1250") { } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangThaiModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangThaiModel.cs index bdda20f142..b5dae7a341 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangThaiModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/LangThaiModel.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -37,7 +37,7 @@ * ***** END LICENSE BLOCK ***** */ namespace UniversalDetector.Core -{ +{ public class ThaiModel : SequenceModel { /**************************************************************** @@ -46,7 +46,7 @@ namespace UniversalDetector.Core 253: symbol (punctuation) that does not belong to word 252: 0 - 9 *****************************************************************/ - // The following result for thai was collected from a limited sample (1M) + // The following result for thai was collected from a limited sample (1M) private readonly static byte[] TIS620_CHAR_TO_ORDER_MAP = { 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, //00 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, //10 @@ -66,12 +66,12 @@ namespace UniversalDetector.Core 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253, }; - //Model Table: + //Model Table: //total sequences: 100% //first 512 sequences: 92.6386% //first 1024 sequences:7.3177% //rest sequences: 1.0230% - //negative sequences: 0.0436% + //negative sequences: 0.0436% private readonly static byte[] THAI_LANG_MODEL = { 0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3, 0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2, @@ -203,11 +203,11 @@ namespace UniversalDetector.Core 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; - public ThaiModel(byte[] charToOrderMap, string name) - : base(TIS620_CHAR_TO_ORDER_MAP, THAI_LANG_MODEL, + public ThaiModel(byte[] charToOrderMap, string name) + : base(TIS620_CHAR_TO_ORDER_MAP, THAI_LANG_MODEL, 0.926386f, false, "TIS-620") { - } + } } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs index c79a10aa77..5d57e30e1f 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -40,7 +40,7 @@ using System; namespace UniversalDetector.Core { - // TODO: Using trigrams the detector should be able to discriminate between + // TODO: Using trigrams the detector should be able to discriminate between // latin-1 and iso8859-2 public class Latin1Prober : CharsetProber { @@ -54,9 +54,9 @@ namespace UniversalDetector.Core private const int ACO = 5; // accent capital other private const int ASV = 6; // accent small vowel private const int ASO = 7; // accent small other - + private const int CLASS_NUM = 8; // total classes - + private readonly static byte[] Latin1_CharToClass = { OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, // 00 - 07 OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, // 08 - 0F @@ -92,36 +92,36 @@ namespace UniversalDetector.Core ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO, // F8 - FF }; - /* 0 : illegal - 1 : very unlikely - 2 : normal + /* 0 : illegal + 1 : very unlikely + 2 : normal 3 : very likely */ private readonly static byte[] Latin1ClassModel = { /* UDF OTH ASC ASS ACV ACO ASV ASO */ /*UDF*/ 0, 0, 0, 0, 0, 0, 0, 0, /*OTH*/ 0, 3, 3, 3, 3, 3, 3, 3, - /*ASC*/ 0, 3, 3, 3, 3, 3, 3, 3, + /*ASC*/ 0, 3, 3, 3, 3, 3, 3, 3, /*ASS*/ 0, 3, 3, 3, 1, 1, 3, 3, /*ACV*/ 0, 3, 3, 3, 1, 2, 1, 2, - /*ACO*/ 0, 3, 3, 3, 3, 3, 3, 3, - /*ASV*/ 0, 3, 1, 3, 1, 1, 1, 3, + /*ACO*/ 0, 3, 3, 3, 3, 3, 3, 3, + /*ASV*/ 0, 3, 1, 3, 1, 1, 1, 3, /*ASO*/ 0, 3, 1, 3, 1, 1, 3, 3, }; private byte lastCharClass; private int[] freqCounter = new int[FREQ_CAT_NUM]; - + public Latin1Prober() { Reset(); } - public override string GetCharsetName() + public override string GetCharsetName() { return "windows-1252"; } - + public override void Reset() { state = ProbingState.Detecting; @@ -129,12 +129,12 @@ namespace UniversalDetector.Core for (int i = 0; i < FREQ_CAT_NUM; i++) freqCounter[i] = 0; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { byte[] newbuf = FilterWithEnglishLetters(buf, offset, len); byte charClass, freq; - + for (int i = 0; i < newbuf.Length; i++) { charClass = Latin1_CharToClass[newbuf[i]]; freq = Latin1ClassModel[lastCharClass * CLASS_NUM + charClass]; @@ -152,21 +152,21 @@ namespace UniversalDetector.Core { if (state == ProbingState.NotMe) return 0.01f; - + float confidence = 0.0f; int total = 0; for (int i = 0; i < FREQ_CAT_NUM; i++) { total += freqCounter[i]; } - + if (total <= 0) { confidence = 0.0f; } else { confidence = freqCounter[3] * 1.0f / total; confidence -= freqCounter[1] * 20.0f / total; } - - // lower the confidence of latin1 so that other more accurate detector + + // lower the confidence of latin1 so that other more accurate detector // can take priority. return confidence < 0.0f ? 0.0f : confidence * 0.5f; } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs index abf49aacd0..b4f6928a46 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSGroupProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -46,13 +46,13 @@ namespace UniversalDetector.Core public class MBCSGroupProber : CharsetProber { private const int PROBERS_NUM = 7; - private readonly static string[] ProberName = + private readonly static string[] ProberName = { "UTF8", "SJIS", "EUCJP", "GB18030", "EUCKR", "Big5", "EUCTW" }; private CharsetProber[] probers = new CharsetProber[PROBERS_NUM]; private bool[] isActive = new bool[PROBERS_NUM]; private int bestGuess; private int activeNum; - + public MBCSGroupProber() { probers[0] = new UTF8Prober(); @@ -62,7 +62,7 @@ namespace UniversalDetector.Core probers[4] = new EUCKRProber(); probers[5] = new Big5Prober(); probers[6] = new EUCTWProber(); - Reset(); + Reset(); } public override string GetCharsetName() @@ -99,7 +99,7 @@ namespace UniversalDetector.Core //assume previous is not ascii, it will do no harm except add some noise bool keepNext = true; int max = offset + len; - + for (int i = offset; i < max; i++) { if ((buf[i] & 0x80) != 0) { highbyteBuf[hptr++] = buf[i]; @@ -112,9 +112,9 @@ namespace UniversalDetector.Core } } } - + ProbingState st = ProbingState.NotMe; - + for (int i = 0; i < probers.Length; i++) { if (!isActive[i]) continue; @@ -139,7 +139,7 @@ namespace UniversalDetector.Core { float bestConf = 0.0f; float cf = 0.0f; - + if (state == ProbingState.FoundIt) { return 0.99f; } else if (state == ProbingState.NotMe) { diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSSM.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSSM.cs index 7aa8581bca..65e04292ab 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSSM.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/MBCSSM.cs @@ -42,79 +42,79 @@ namespace UniversalDetector.Core { private readonly static int[] UTF8_cls = { BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 - BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 40 - 47 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 48 - 4f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 50 - 57 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 58 - 5f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 60 - 67 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 68 - 6f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 70 - 77 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 78 - 7f - BitPackage.Pack4bits(2,2,2,2,3,3,3,3), // 80 - 87 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 88 - 8f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 90 - 97 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 98 - 9f - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // a0 - a7 - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // a8 - af - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // b0 - b7 - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // b8 - bf - BitPackage.Pack4bits(0,0,6,6,6,6,6,6), // c0 - c7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c8 - cf - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d0 - d7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d8 - df - BitPackage.Pack4bits(7,8,8,8,8,8,8,8), // e0 - e7 - BitPackage.Pack4bits(8,8,8,8,8,9,8,8), // e8 - ef - BitPackage.Pack4bits(10,11,11,11,11,11,11,11), // f0 - f7 - BitPackage.Pack4bits(12,13,13,13,14,15,0,0) // f8 - ff + BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 + BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 40 - 47 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 48 - 4f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 50 - 57 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 58 - 5f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 60 - 67 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 68 - 6f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 70 - 77 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 78 - 7f + BitPackage.Pack4bits(2,2,2,2,3,3,3,3), // 80 - 87 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 88 - 8f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 90 - 97 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 98 - 9f + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // a0 - a7 + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // a8 - af + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // b0 - b7 + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // b8 - bf + BitPackage.Pack4bits(0,0,6,6,6,6,6,6), // c0 - c7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c8 - cf + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d0 - d7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d8 - df + BitPackage.Pack4bits(7,8,8,8,8,8,8,8), // e0 - e7 + BitPackage.Pack4bits(8,8,8,8,8,9,8,8), // e8 - ef + BitPackage.Pack4bits(10,11,11,11,11,11,11,11), // f0 - f7 + BitPackage.Pack4bits(12,13,13,13,14,15,0,0) // f8 - ff }; private readonly static int[] UTF8_st = { - BitPackage.Pack4bits(ERROR,START,ERROR,ERROR,ERROR,ERROR, 12, 10),//00-07 - BitPackage.Pack4bits( 9, 11, 8, 7, 6, 5, 4, 3),//08-0f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//10-17 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//18-1f - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//20-27 - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//28-2f - BitPackage.Pack4bits(ERROR,ERROR, 5, 5, 5, 5,ERROR,ERROR),//30-37 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//38-3f - BitPackage.Pack4bits(ERROR,ERROR,ERROR, 5, 5, 5,ERROR,ERROR),//40-47 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//48-4f - BitPackage.Pack4bits(ERROR,ERROR, 7, 7, 7, 7,ERROR,ERROR),//50-57 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//58-5f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR, 7, 7,ERROR,ERROR),//60-67 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//68-6f - BitPackage.Pack4bits(ERROR,ERROR, 9, 9, 9, 9,ERROR,ERROR),//70-77 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//78-7f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR, 9,ERROR,ERROR),//80-87 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//88-8f - BitPackage.Pack4bits(ERROR,ERROR, 12, 12, 12, 12,ERROR,ERROR),//90-97 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//98-9f - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR, 12,ERROR,ERROR),//a0-a7 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//a8-af - BitPackage.Pack4bits(ERROR,ERROR, 12, 12, 12,ERROR,ERROR,ERROR),//b0-b7 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//b8-bf - BitPackage.Pack4bits(ERROR,ERROR,START,START,START,START,ERROR,ERROR),//c0-c7 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR) //c8-cf + BitPackage.Pack4bits(ERROR,START,ERROR,ERROR,ERROR,ERROR, 12, 10),//00-07 + BitPackage.Pack4bits( 9, 11, 8, 7, 6, 5, 4, 3),//08-0f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//10-17 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//18-1f + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//20-27 + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME,ITSME),//28-2f + BitPackage.Pack4bits(ERROR,ERROR, 5, 5, 5, 5,ERROR,ERROR),//30-37 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//38-3f + BitPackage.Pack4bits(ERROR,ERROR,ERROR, 5, 5, 5,ERROR,ERROR),//40-47 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//48-4f + BitPackage.Pack4bits(ERROR,ERROR, 7, 7, 7, 7,ERROR,ERROR),//50-57 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//58-5f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR, 7, 7,ERROR,ERROR),//60-67 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//68-6f + BitPackage.Pack4bits(ERROR,ERROR, 9, 9, 9, 9,ERROR,ERROR),//70-77 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//78-7f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR, 9,ERROR,ERROR),//80-87 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//88-8f + BitPackage.Pack4bits(ERROR,ERROR, 12, 12, 12, 12,ERROR,ERROR),//90-97 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//98-9f + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR, 12,ERROR,ERROR),//a0-a7 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//a8-af + BitPackage.Pack4bits(ERROR,ERROR, 12, 12, 12,ERROR,ERROR,ERROR),//b0-b7 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR),//b8-bf + BitPackage.Pack4bits(ERROR,ERROR,START,START,START,START,ERROR,ERROR),//c0-c7 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR) //c8-cf }; - private readonly static int[] UTF8CharLenTable = + private readonly static int[] UTF8CharLenTable = {0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6 }; - + public UTF8SMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UTF8_cls), 16, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UTF8_st), UTF8CharLenTable, "UTF-8") @@ -122,68 +122,68 @@ namespace UniversalDetector.Core } } - + public class GB18030SMModel : SMModel { private readonly static int[] GB18030_cls = { - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 - BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 30 - 37 - BitPackage.Pack4bits(3,3,1,1,1,1,1,1), // 38 - 3f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 - BitPackage.Pack4bits(2,2,2,2,2,2,2,4), // 78 - 7f - BitPackage.Pack4bits(5,6,6,6,6,6,6,6), // 80 - 87 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 88 - 8f - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 90 - 97 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 98 - 9f - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // a0 - a7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // a8 - af - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // b0 - b7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // b8 - bf - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c0 - c7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c8 - cf - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d0 - d7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d8 - df - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // e0 - e7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // e8 - ef - BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // f0 - f7 - BitPackage.Pack4bits(6,6,6,6,6,6,6,0) // f8 - ff + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 + BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 + BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 30 - 37 + BitPackage.Pack4bits(3,3,1,1,1,1,1,1), // 38 - 3f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 + BitPackage.Pack4bits(2,2,2,2,2,2,2,4), // 78 - 7f + BitPackage.Pack4bits(5,6,6,6,6,6,6,6), // 80 - 87 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 88 - 8f + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 90 - 97 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // 98 - 9f + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // a0 - a7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // a8 - af + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // b0 - b7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // b8 - bf + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c0 - c7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // c8 - cf + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d0 - d7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // d8 - df + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // e0 - e7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // e8 - ef + BitPackage.Pack4bits(6,6,6,6,6,6,6,6), // f0 - f7 + BitPackage.Pack4bits(6,6,6,6,6,6,6,0) // f8 - ff }; private readonly static int[] GB18030_st = { - BitPackage.Pack4bits(ERROR,START,START,START,START,START, 3,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ERROR,ERROR,START),//10-17 - BitPackage.Pack4bits( 4,ERROR,START,START,ERROR,ERROR,ERROR,ERROR),//18-1f - BitPackage.Pack4bits(ERROR,ERROR, 5,ERROR,ERROR,ERROR,ITSME,ERROR),//20-27 - BitPackage.Pack4bits(ERROR,ERROR,START,START,START,START,START,START) //28-2f + BitPackage.Pack4bits(ERROR,START,START,START,START,START, 3,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ERROR,ERROR,START),//10-17 + BitPackage.Pack4bits( 4,ERROR,START,START,ERROR,ERROR,ERROR,ERROR),//18-1f + BitPackage.Pack4bits(ERROR,ERROR, 5,ERROR,ERROR,ERROR,ITSME,ERROR),//20-27 + BitPackage.Pack4bits(ERROR,ERROR,START,START,START,START,START,START) //28-2f }; - // To be accurate, the length of class 6 can be either 2 or 4. - // But it is not necessary to discriminate between the two since - // it is used for frequency analysis only, and we are validating - // each code range there as well. So it is safe to set it to be - // 2 here. + // To be accurate, the length of class 6 can be either 2 or 4. + // But it is not necessary to discriminate between the two since + // it is used for frequency analysis only, and we are validating + // each code range there as well. So it is safe to set it to be + // 2 here. private readonly static int[] GB18030CharLenTable = {0, 1, 1, 1, 1, 1, 2}; - + public GB18030SMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, GB18030_cls), 7, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, GB18030_st), GB18030CharLenTable, "GB18030") @@ -191,60 +191,60 @@ namespace UniversalDetector.Core } } - + public class BIG5SMModel : SMModel { private readonly static int[] BIG5_cls = { BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 - BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 - BitPackage.Pack4bits(2,2,2,2,2,2,2,1), // 78 - 7f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 80 - 87 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 88 - 8f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 90 - 97 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 98 - 9f - BitPackage.Pack4bits(4,3,3,3,3,3,3,3), // a0 - a7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // a8 - af - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // b0 - b7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // b8 - bf - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c0 - c7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c8 - cf - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d0 - d7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d8 - df - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e8 - ef - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // f0 - f7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,0) // f8 - ff + BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 + BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 + BitPackage.Pack4bits(2,2,2,2,2,2,2,1), // 78 - 7f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 80 - 87 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 88 - 8f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 90 - 97 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 98 - 9f + BitPackage.Pack4bits(4,3,3,3,3,3,3,3), // a0 - a7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // a8 - af + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // b0 - b7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // b8 - bf + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c0 - c7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c8 - cf + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d0 - d7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d8 - df + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e8 - ef + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // f0 - f7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,0) // f8 - ff }; private readonly static int[] BIG5_st = { - BitPackage.Pack4bits(ERROR,START,START, 3,ERROR,ERROR,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ITSME,ITSME,ITSME,ITSME,ITSME,ERROR),//08-0f - BitPackage.Pack4bits(ERROR,START,START,START,START,START,START,START) //10-17 + BitPackage.Pack4bits(ERROR,START,START, 3,ERROR,ERROR,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ITSME,ITSME,ITSME,ITSME,ITSME,ERROR),//08-0f + BitPackage.Pack4bits(ERROR,START,START,START,START,START,START,START) //10-17 }; private readonly static int[] BIG5CharLenTable = {0, 1, 1, 2, 0}; - + public BIG5SMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, BIG5_cls), 5, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, BIG5_st), BIG5CharLenTable, "Big5") @@ -252,63 +252,63 @@ namespace UniversalDetector.Core } } - + public class EUCJPSMModel : SMModel { private readonly static int[] EUCJP_cls = { - //BitPacket.Pack4bits(5,4,4,4,4,4,4,4), // 00 - 07 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 00 - 07 - BitPackage.Pack4bits(4,4,4,4,4,4,5,5), // 08 - 0f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 10 - 17 - BitPackage.Pack4bits(4,4,4,5,4,4,4,4), // 18 - 1f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 20 - 27 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 28 - 2f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 30 - 37 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 38 - 3f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 40 - 47 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 48 - 4f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 50 - 57 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 58 - 5f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 60 - 67 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 68 - 6f - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 70 - 77 - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 78 - 7f - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 80 - 87 - BitPackage.Pack4bits(5,5,5,5,5,5,1,3), // 88 - 8f - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 90 - 97 - BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 98 - 9f - BitPackage.Pack4bits(5,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,5) // f8 - ff + //BitPacket.Pack4bits(5,4,4,4,4,4,4,4), // 00 - 07 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 00 - 07 + BitPackage.Pack4bits(4,4,4,4,4,4,5,5), // 08 - 0f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 10 - 17 + BitPackage.Pack4bits(4,4,4,5,4,4,4,4), // 18 - 1f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 20 - 27 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 28 - 2f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 30 - 37 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 38 - 3f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 40 - 47 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 48 - 4f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 50 - 57 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 58 - 5f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 60 - 67 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 68 - 6f + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 70 - 77 + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // 78 - 7f + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 80 - 87 + BitPackage.Pack4bits(5,5,5,5,5,5,1,3), // 88 - 8f + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 90 - 97 + BitPackage.Pack4bits(5,5,5,5,5,5,5,5), // 98 - 9f + BitPackage.Pack4bits(5,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,5) // f8 - ff }; private readonly static int[] EUCJP_st = { - BitPackage.Pack4bits( 3, 4, 3, 5,START,ERROR,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME,START,ERROR,START,ERROR,ERROR,ERROR),//10-17 - BitPackage.Pack4bits(ERROR,ERROR,START,ERROR,ERROR,ERROR, 3,ERROR),//18-1f - BitPackage.Pack4bits( 3,ERROR,ERROR,ERROR,START,START,START,START) //20-27 + BitPackage.Pack4bits( 3, 4, 3, 5,START,ERROR,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME,START,ERROR,START,ERROR,ERROR,ERROR),//10-17 + BitPackage.Pack4bits(ERROR,ERROR,START,ERROR,ERROR,ERROR, 3,ERROR),//18-1f + BitPackage.Pack4bits( 3,ERROR,ERROR,ERROR,START,START,START,START) //20-27 }; private readonly static int[] EUCJPCharLenTable = { 2, 2, 2, 3, 1, 0 }; - + public EUCJPSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCJP_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCJP_st), EUCJPCharLenTable, "EUC-JP") @@ -316,60 +316,60 @@ namespace UniversalDetector.Core } } - + public class EUCKRSMModel : SMModel { private readonly static int[] EUCKR_cls = { - //BitPacket.Pack4bits(0,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 - BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 40 - 47 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 48 - 4f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 50 - 57 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 58 - 5f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 60 - 67 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 68 - 6f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 70 - 77 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 78 - 7f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f - BitPackage.Pack4bits(0,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,3,3,3), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,3,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,0) // f8 - ff + //BitPacket.Pack4bits(0,1,1,1,1,1,1,1), // 00 - 07 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 + BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 + BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 40 - 47 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 48 - 4f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 50 - 57 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 58 - 5f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 60 - 67 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 68 - 6f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 70 - 77 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 78 - 7f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f + BitPackage.Pack4bits(0,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,3,3,3), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,3,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e0 - e7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // e8 - ef + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // f0 - f7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,0) // f8 - ff }; private readonly static int[] EUCKR_st = { - BitPackage.Pack4bits(ERROR,START, 3,ERROR,ERROR,ERROR,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ERROR,ERROR,START,START) //08-0f + BitPackage.Pack4bits(ERROR,START, 3,ERROR,ERROR,ERROR,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ERROR,ERROR,START,START) //08-0f }; private readonly static int[] EUCKRCharLenTable = { 0, 1, 2, 0 }; - + public EUCKRSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCKR_cls), 4, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCKR_st), EUCKRCharLenTable, "EUC-KR") @@ -377,127 +377,127 @@ namespace UniversalDetector.Core } } - + public class EUCTWSMModel : SMModel { private readonly static int[] EUCTW_cls = { - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 00 - 07 - BitPackage.Pack4bits(2,2,2,2,2,2,0,0), // 08 - 0f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 10 - 17 - BitPackage.Pack4bits(2,2,2,0,2,2,2,2), // 18 - 1f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 20 - 27 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 28 - 2f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 30 - 37 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 38 - 3f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 78 - 7f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 - BitPackage.Pack4bits(0,0,0,0,0,0,6,0), // 88 - 8f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f - BitPackage.Pack4bits(0,3,4,4,4,4,4,4), // a0 - a7 - BitPackage.Pack4bits(5,5,1,1,1,1,1,1), // a8 - af - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b0 - b7 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b8 - bf - BitPackage.Pack4bits(1,1,3,1,3,3,3,3), // c0 - c7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c8 - cf - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d0 - d7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d8 - df - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e8 - ef - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // f0 - f7 - BitPackage.Pack4bits(3,3,3,3,3,3,3,0) // f8 - ff + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 00 - 07 + BitPackage.Pack4bits(2,2,2,2,2,2,0,0), // 08 - 0f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 10 - 17 + BitPackage.Pack4bits(2,2,2,0,2,2,2,2), // 18 - 1f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 20 - 27 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 28 - 2f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 30 - 37 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 38 - 3f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 78 - 7f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 + BitPackage.Pack4bits(0,0,0,0,0,0,6,0), // 88 - 8f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f + BitPackage.Pack4bits(0,3,4,4,4,4,4,4), // a0 - a7 + BitPackage.Pack4bits(5,5,1,1,1,1,1,1), // a8 - af + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b0 - b7 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // b8 - bf + BitPackage.Pack4bits(1,1,3,1,3,3,3,3), // c0 - c7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // c8 - cf + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d0 - d7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // d8 - df + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e8 - ef + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // f0 - f7 + BitPackage.Pack4bits(3,3,3,3,3,3,3,0) // f8 - ff }; private readonly static int[] EUCTW_st = { - BitPackage.Pack4bits(ERROR,ERROR,START, 3, 3, 3, 4,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ERROR,START,ERROR),//10-17 - BitPackage.Pack4bits(START,START,START,ERROR,ERROR,ERROR,ERROR,ERROR),//18-1f - BitPackage.Pack4bits( 5,ERROR,ERROR,ERROR,START,ERROR,START,START),//20-27 - BitPackage.Pack4bits(START,ERROR,START,START,START,START,START,START) //28-2f + BitPackage.Pack4bits(ERROR,ERROR,START, 3, 3, 3, 4,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME,ITSME,ITSME,ITSME,ERROR,START,ERROR),//10-17 + BitPackage.Pack4bits(START,START,START,ERROR,ERROR,ERROR,ERROR,ERROR),//18-1f + BitPackage.Pack4bits( 5,ERROR,ERROR,ERROR,START,ERROR,START,START),//20-27 + BitPackage.Pack4bits(START,ERROR,START,START,START,START,START,START) //28-2f }; private readonly static int[] EUCTWCharLenTable = { 0, 0, 1, 2, 2, 2, 3 }; - + public EUCTWSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCTW_cls), 7, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, EUCTW_st), EUCTWCharLenTable, "EUC-TW") { } - } - + } + public class SJISSMModel : SMModel { private readonly static int[] SJIS_cls = { - //BitPacket.Pack4bits(0,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 - BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 - BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 - BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 - BitPackage.Pack4bits(2,2,2,2,2,2,2,1), // 78 - 7f - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 80 - 87 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 88 - 8f - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 90 - 97 - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 98 - 9f - //0xa0 is illegal in sjis encoding, but some pages does + //BitPacket.Pack4bits(0,1,1,1,1,1,1,1), // 00 - 07 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 00 - 07 + BitPackage.Pack4bits(1,1,1,1,1,1,0,0), // 08 - 0f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 10 - 17 + BitPackage.Pack4bits(1,1,1,0,1,1,1,1), // 18 - 1f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 20 - 27 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 28 - 2f + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 30 - 37 + BitPackage.Pack4bits(1,1,1,1,1,1,1,1), // 38 - 3f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 40 - 47 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 48 - 4f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 50 - 57 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 58 - 5f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 60 - 67 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 68 - 6f + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // 70 - 77 + BitPackage.Pack4bits(2,2,2,2,2,2,2,1), // 78 - 7f + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 80 - 87 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 88 - 8f + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 90 - 97 + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // 98 - 9f + //0xa0 is illegal in sjis encoding, but some pages does //contain such byte. We need to be more error forgiven. - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 - BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df - BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 - BitPackage.Pack4bits(3,3,3,3,3,4,4,4), // e8 - ef - BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // f0 - f7 - BitPackage.Pack4bits(4,4,4,4,4,0,0,0) // f8 - ff + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a0 - a7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // a8 - af + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b0 - b7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // b8 - bf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c0 - c7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // c8 - cf + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d0 - d7 + BitPackage.Pack4bits(2,2,2,2,2,2,2,2), // d8 - df + BitPackage.Pack4bits(3,3,3,3,3,3,3,3), // e0 - e7 + BitPackage.Pack4bits(3,3,3,3,3,4,4,4), // e8 - ef + BitPackage.Pack4bits(4,4,4,4,4,4,4,4), // f0 - f7 + BitPackage.Pack4bits(4,4,4,4,4,0,0,0) // f8 - ff }; private readonly static int[] SJIS_st = { - BitPackage.Pack4bits(ERROR,START,START, 3,ERROR,ERROR,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME,ERROR,ERROR,START,START,START,START) //10-17 + BitPackage.Pack4bits(ERROR,START,START, 3,ERROR,ERROR,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME,ERROR,ERROR,START,START,START,START) //10-17 }; private readonly static int[] SJISCharLenTable = { 0, 1, 1, 2, 0, 0 }; - + public SJISSMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, SJIS_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, SJIS_st), SJISCharLenTable, "Shift_JIS") @@ -505,64 +505,64 @@ namespace UniversalDetector.Core } } - + public class UCS2BESMModel : SMModel { private readonly static int[] UCS2BE_cls = { - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,1,0,0,2,0,0), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,3,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 - BitPackage.Pack4bits(0,3,3,3,3,3,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a0 - a7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a8 - af - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b0 - b7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b8 - bf - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c0 - c7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c8 - cf - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d0 - d7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d8 - df - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 - BitPackage.Pack4bits(0,0,0,0,0,0,4,5) // f8 - ff + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,1,0,0,2,0,0), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,3,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 + BitPackage.Pack4bits(0,3,3,3,3,3,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a0 - a7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a8 - af + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b0 - b7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b8 - bf + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c0 - c7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c8 - cf + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d0 - d7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d8 - df + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 + BitPackage.Pack4bits(0,0,0,0,0,0,4,5) // f8 - ff }; private readonly static int[] UCS2BE_st = { - BitPackage.Pack4bits( 5, 7, 7,ERROR, 4, 3,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME, 6, 6, 6, 6,ERROR,ERROR),//10-17 - BitPackage.Pack4bits( 6, 6, 6, 6, 6,ITSME, 6, 6),//18-1f - BitPackage.Pack4bits( 6, 6, 6, 6, 5, 7, 7,ERROR),//20-27 - BitPackage.Pack4bits( 5, 8, 6, 6,ERROR, 6, 6, 6),//28-2f - BitPackage.Pack4bits( 6, 6, 6, 6,ERROR,ERROR,START,START) //30-37 + BitPackage.Pack4bits( 5, 7, 7,ERROR, 4, 3,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME, 6, 6, 6, 6,ERROR,ERROR),//10-17 + BitPackage.Pack4bits( 6, 6, 6, 6, 6,ITSME, 6, 6),//18-1f + BitPackage.Pack4bits( 6, 6, 6, 6, 5, 7, 7,ERROR),//20-27 + BitPackage.Pack4bits( 5, 8, 6, 6,ERROR, 6, 6, 6),//28-2f + BitPackage.Pack4bits( 6, 6, 6, 6,ERROR,ERROR,START,START) //30-37 }; private readonly static int[] UCS2BECharLenTable = { 2, 2, 2, 0, 2, 2 }; - + public UCS2BESMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UCS2BE_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UCS2BE_st), UCS2BECharLenTable, "UTF-16BE") @@ -570,64 +570,64 @@ namespace UniversalDetector.Core } } - + public class UCS2LESMModel : SMModel { private readonly static int[] UCS2LE_cls = { - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 00 - 07 - BitPackage.Pack4bits(0,0,1,0,0,2,0,0), // 08 - 0f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 - BitPackage.Pack4bits(0,0,0,3,0,0,0,0), // 18 - 1f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 - BitPackage.Pack4bits(0,3,3,3,3,3,0,0), // 28 - 2f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a0 - a7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a8 - af - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b0 - b7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b8 - bf - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c0 - c7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c8 - cf - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d0 - d7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d8 - df - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef - BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 - BitPackage.Pack4bits(0,0,0,0,0,0,4,5) // f8 - ff + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 00 - 07 + BitPackage.Pack4bits(0,0,1,0,0,2,0,0), // 08 - 0f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 10 - 17 + BitPackage.Pack4bits(0,0,0,3,0,0,0,0), // 18 - 1f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 20 - 27 + BitPackage.Pack4bits(0,3,3,3,3,3,0,0), // 28 - 2f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 30 - 37 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 38 - 3f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 40 - 47 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 48 - 4f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 50 - 57 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 58 - 5f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 60 - 67 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 68 - 6f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 70 - 77 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 78 - 7f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 80 - 87 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 88 - 8f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 90 - 97 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // 98 - 9f + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a0 - a7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // a8 - af + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b0 - b7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // b8 - bf + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c0 - c7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // c8 - cf + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d0 - d7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // d8 - df + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e0 - e7 + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // e8 - ef + BitPackage.Pack4bits(0,0,0,0,0,0,0,0), // f0 - f7 + BitPackage.Pack4bits(0,0,0,0,0,0,4,5) // f8 - ff }; private readonly static int[] UCS2LE_st = { - BitPackage.Pack4bits( 6, 6, 7, 6, 4, 3,ERROR,ERROR),//00-07 - BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f - BitPackage.Pack4bits(ITSME,ITSME, 5, 5, 5,ERROR,ITSME,ERROR),//10-17 - BitPackage.Pack4bits( 5, 5, 5,ERROR, 5,ERROR, 6, 6),//18-1f - BitPackage.Pack4bits( 7, 6, 8, 8, 5, 5, 5,ERROR),//20-27 - BitPackage.Pack4bits( 5, 5, 5,ERROR,ERROR,ERROR, 5, 5),//28-2f - BitPackage.Pack4bits( 5, 5, 5,ERROR, 5,ERROR,START,START) //30-37 + BitPackage.Pack4bits( 6, 6, 7, 6, 4, 3,ERROR,ERROR),//00-07 + BitPackage.Pack4bits(ERROR,ERROR,ERROR,ERROR,ITSME,ITSME,ITSME,ITSME),//08-0f + BitPackage.Pack4bits(ITSME,ITSME, 5, 5, 5,ERROR,ITSME,ERROR),//10-17 + BitPackage.Pack4bits( 5, 5, 5,ERROR, 5,ERROR, 6, 6),//18-1f + BitPackage.Pack4bits( 7, 6, 8, 8, 5, 5, 5,ERROR),//20-27 + BitPackage.Pack4bits( 5, 5, 5,ERROR,ERROR,ERROR, 5, 5),//28-2f + BitPackage.Pack4bits( 5, 5, 5,ERROR, 5,ERROR,START,START) //30-37 }; private readonly static int[] UCS2LECharLenTable = { 2, 2, 2, 2, 2, 2 }; - + public UCS2LESMModel() : base( - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UCS2LE_cls), 6, - new BitPackage(BitPackage.INDEX_SHIFT_4BITS, - BitPackage.SHIFT_MASK_4BITS, + new BitPackage(BitPackage.INDEX_SHIFT_4BITS, + BitPackage.SHIFT_MASK_4BITS, BitPackage.BIT_SHIFT_4BITS, BitPackage.UNIT_MASK_4BITS, UCS2LE_st), UCS2LECharLenTable, "UTF-16LE") @@ -635,6 +635,6 @@ namespace UniversalDetector.Core } } - - + + } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs index d8f496474b..640b19c4a4 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCSGroupProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -43,11 +43,11 @@ namespace UniversalDetector.Core public class SBCSGroupProber : CharsetProber { private const int PROBERS_NUM = 13; - private CharsetProber[] probers = new CharsetProber[PROBERS_NUM]; + private CharsetProber[] probers = new CharsetProber[PROBERS_NUM]; private bool[] isActive = new bool[PROBERS_NUM]; private int bestGuess; private int activeNum; - + public SBCSGroupProber() { probers[0] = new SingleByteCharSetProber(new Win1251Model()); @@ -62,24 +62,24 @@ namespace UniversalDetector.Core probers[9] = new SingleByteCharSetProber(new Win1251BulgarianModel()); HebrewProber hebprober = new HebrewProber(); probers[10] = hebprober; - // Logical - probers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebprober); + // Logical + probers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebprober); // Visual - probers[12] = new SingleByteCharSetProber(new Win1255Model(), true, hebprober); + probers[12] = new SingleByteCharSetProber(new Win1255Model(), true, hebprober); hebprober.SetModelProbers(probers[11], probers[12]); - // disable latin2 before latin1 is available, otherwise all latin1 + // disable latin2 before latin1 is available, otherwise all latin1 // will be detected as latin2 because of their similarity. //probers[13] = new SingleByteCharSetProber(new Latin2HungarianModel()); - //probers[14] = new SingleByteCharSetProber(new Win1250HungarianModel()); + //probers[14] = new SingleByteCharSetProber(new Win1250HungarianModel()); Reset(); } - - public override ProbingState HandleData(byte[] buf, int offset, int len) + + public override ProbingState HandleData(byte[] buf, int offset, int len) { ProbingState st = ProbingState.NotMe; - + //apply filter to original buffer, and we got new buffer back - //depend on what script it is, we will feed them the new buffer + //depend on what script it is, we will feed them the new buffer //we got after applying proper filter //this is done without any consideration to KeepEnglishLetters //of each prober since as of now, there are no probers here which @@ -87,12 +87,12 @@ namespace UniversalDetector.Core byte[] newBuf = FilterWithoutEnglishLetters(buf, offset, len); if (newBuf.Length == 0) return state; // Nothing to see here, move on. - + for (int i = 0; i < PROBERS_NUM; i++) { if (!isActive[i]) continue; st = probers[i].HandleData(newBuf, 0, newBuf.Length); - + if (st == ProbingState.FoundIt) { bestGuess = i; state = ProbingState.FoundIt; diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCharsetProber.cs index 5a3496075b..65c0f8ca81 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCharsetProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SBCharsetProber.cs @@ -20,7 +20,7 @@ * * Contributor(s): * Shy Shalom - * Rudi Pettazzi (C# port) + * Rudi Pettazzi (C# port) * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -51,11 +51,11 @@ namespace UniversalDetector.Core private const int NUMBER_OF_SEQ_CAT = 4; private const int POSITIVE_CAT = NUMBER_OF_SEQ_CAT-1; private const int NEGATIVE_CAT = 0; - + protected SequenceModel model; - - // true if we need to reverse every pair in the model lookup - bool reversed; + + // true if we need to reverse every pair in the model lookup + bool reversed; // char order of last character byte lastOrder; @@ -63,38 +63,38 @@ namespace UniversalDetector.Core int totalSeqs; int totalChar; int[] seqCounters = new int[NUMBER_OF_SEQ_CAT]; - + // characters that fall in our sampling range int freqChar; - + // Optional auxiliary prober for name decision. created and destroyed by the GroupProber - CharsetProber nameProber; - - public SingleByteCharSetProber(SequenceModel model) + CharsetProber nameProber; + + public SingleByteCharSetProber(SequenceModel model) : this(model, false, null) { - + } - - public SingleByteCharSetProber(SequenceModel model, bool reversed, + + public SingleByteCharSetProber(SequenceModel model, bool reversed, CharsetProber nameProber) { this.model = model; this.reversed = reversed; this.nameProber = nameProber; - Reset(); + Reset(); } public override ProbingState HandleData(byte[] buf, int offset, int len) { int max = offset + len; - + for (int i = offset; i < max; i++) { byte order = model.GetOrder(buf[i]); if (order < SYMBOL_CAT_ORDER) totalChar++; - + if (order < SAMPLE_SIZE) { freqChar++; @@ -120,7 +120,7 @@ namespace UniversalDetector.Core } return state; } - + public override void DumpStatus() { //Console.WriteLine(" SBCS: {0} [{1}]", GetConfidence(), GetCharsetName()); @@ -146,9 +146,9 @@ namespace UniversalDetector.Core r = 0.99f; return r; } - return 0.01f; + return 0.01f; } - + public override void Reset() { state = ProbingState.Detecting; @@ -159,12 +159,12 @@ namespace UniversalDetector.Core totalChar = 0; freqChar = 0; } - - public override string GetCharsetName() + + public override string GetCharsetName() { return (nameProber == null) ? model.CharsetName : nameProber.GetCharsetName(); } - + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs index 515cd2498f..e1fbb873e4 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -50,25 +50,25 @@ namespace UniversalDetector.Core private SJISContextAnalyser contextAnalyser; private SJISDistributionAnalyser distributionAnalyser; private byte[] lastChar = new byte[2]; - + public SJISProber() { codingSM = new CodingStateMachine(new SJISSMModel()); distributionAnalyser = new SJISDistributionAnalyser(); - contextAnalyser = new SJISContextAnalyser(); + contextAnalyser = new SJISContextAnalyser(); Reset(); } - + public override string GetCharsetName() { - return "Shift-JIS"; + return "Shift-JIS"; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState; int max = offset + len; - + for (int i = offset; i < max; i++) { codingState = codingSM.NextState(buf[i]); if (codingState == SMModel.ERROR) { @@ -90,7 +90,7 @@ namespace UniversalDetector.Core distributionAnalyser.HandleOneChar(buf, i-1, charLen); } } - } + } lastChar[0] = buf[max-1]; if (state == ProbingState.Detecting) if (contextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) @@ -100,12 +100,12 @@ namespace UniversalDetector.Core public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; contextAnalyser.Reset(); distributionAnalyser.Reset(); } - + public override float GetConfidence() { float contxtCf = contextAnalyser.GetConfidence(); diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SMModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SMModel.cs index 2321ecad2e..451a3e59c2 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SMModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SMModel.cs @@ -52,9 +52,9 @@ namespace UniversalDetector.Core public BitPackage classTable; public BitPackage stateTable; public int[] charLenTable; - + private string name; - + public string Name { get { return name; } } @@ -74,10 +74,10 @@ namespace UniversalDetector.Core this.charLenTable = charLenTable; this.name = name; } - + public int GetClass(byte b) - { - return classTable.Unpack((int)b); + { + return classTable.Unpack((int)b); } - } + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs index 9048796b57..fc824b5a20 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SequenceModel.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -39,36 +39,36 @@ using System; namespace UniversalDetector.Core -{ +{ public abstract class SequenceModel { // [256] table use to find a char's order protected byte[] charToOrderMap; - - // [SAMPLE_SIZE][SAMPLE_SIZE] table to find a 2-char sequence's - // frequency + + // [SAMPLE_SIZE][SAMPLE_SIZE] table to find a 2-char sequence's + // frequency protected byte[] precedenceMatrix; - + // freqSeqs / totalSeqs protected float typicalPositiveRatio; - + public float TypicalPositiveRatio { get { return typicalPositiveRatio; } } - - // not used + + // not used protected bool keepEnglishLetter; - + public bool KeepEnglishLetter { get { return keepEnglishLetter; } } - + protected String charsetName; public string CharsetName { get { return charsetName; } } - + public SequenceModel( byte[] charToOrderMap, byte[] precedenceMatrix, @@ -82,16 +82,16 @@ namespace UniversalDetector.Core this.keepEnglishLetter = keepEnglishLetter; this.charsetName = charsetName; } - + public byte GetOrder(byte b) { return charToOrderMap[b]; } - + public byte GetPrecedence(int pos) { return precedenceMatrix[pos]; } - + } } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UTF8Prober.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UTF8Prober.cs index 084797c5ec..a469e2a0c6 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UTF8Prober.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UTF8Prober.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -46,11 +46,11 @@ namespace UniversalDetector.Core public UTF8Prober() { - numOfMBChar = 0; + numOfMBChar = 0; codingSM = new CodingStateMachine(new UTF8SMModel()); Reset(); } - + public override string GetCharsetName() { return "UTF-8"; } @@ -66,7 +66,7 @@ namespace UniversalDetector.Core { int codingState = SMModel.START; int max = offset + len; - + for (int i = offset; i < max; i++) { codingState = codingSM.NextState(buf[i]); @@ -97,7 +97,7 @@ namespace UniversalDetector.Core { float unlike = 0.99f; float confidence = 0.0f; - + if (numOfMBChar < 6) { for (int i = 0; i < numOfMBChar; i++) unlike *= ONE_CHAR_PROB; diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs index 0c9a4ee607..4dcb282cc9 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/UniversalDetector.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -41,7 +41,7 @@ namespace UniversalDetector.Core enum InputState { PureASCII=0, EscASCII=1, Highbyte=2 }; - public abstract class UniversalDetector + public abstract class UniversalDetector { protected const int FILTER_CHINESE_SIMPLIFIED = 1; protected const int FILTER_CHINESE_TRADITIONAL = 2; @@ -49,12 +49,12 @@ namespace UniversalDetector.Core protected const int FILTER_KOREAN = 8; protected const int FILTER_NON_CJK = 16; protected const int FILTER_ALL = 31; - protected static int FILTER_CHINESE = + protected static int FILTER_CHINESE = FILTER_CHINESE_SIMPLIFIED | FILTER_CHINESE_TRADITIONAL; - protected static int FILTER_CJK = - FILTER_JAPANESE | FILTER_KOREAN | FILTER_CHINESE_SIMPLIFIED + protected static int FILTER_CJK = + FILTER_JAPANESE | FILTER_KOREAN | FILTER_CHINESE_SIMPLIFIED | FILTER_CHINESE_TRADITIONAL; - + protected const float SHORTCUT_THRESHOLD = 0.95f; protected const float MINIMUM_THRESHOLD = 0.20f; @@ -70,16 +70,16 @@ namespace UniversalDetector.Core protected CharsetProber escCharsetProber; protected string detectedCharset; - public UniversalDetector(int languageFilter) { + public UniversalDetector(int languageFilter) { this.start = true; this.inputState = InputState.PureASCII; - this.lastChar = 0x00; + this.lastChar = 0x00; this.bestGuess = -1; this.languageFilter = languageFilter; } public virtual void Feed(byte[] buf, int offset, int len) - { + { if (done) { return; } @@ -125,7 +125,7 @@ namespace UniversalDetector.Core } for (int i = 0; i < len; i++) { - + // other than 0xa0, if every other character is ascii, the page is ascii if ((buf[i] & 0x80) != 0 && buf[i] != 0xA0) { // we got a non-ascii byte (high-byte) @@ -143,9 +143,9 @@ namespace UniversalDetector.Core if (charsetProbers[1] == null) charsetProbers[1] = new SBCSGroupProber(); if (charsetProbers[2] == null) - charsetProbers[2] = new Latin1Prober(); + charsetProbers[2] = new Latin1Prober(); } - } else { + } else { if (inputState == InputState.PureASCII && (buf[i] == 0x33 || (buf[i] == 0x7B && lastChar == 0x7E))) { // found escape character or HZ "~{" @@ -154,9 +154,9 @@ namespace UniversalDetector.Core lastChar = buf[i]; } } - + ProbingState st = ProbingState.NotMe; - + switch (inputState) { case InputState.EscASCII: if (escCharsetProber == null) { @@ -172,18 +172,18 @@ namespace UniversalDetector.Core for (int i = 0; i < PROBERS_NUM; i++) { if (charsetProbers[i] != null) { st = charsetProbers[i].HandleData(buf, offset, len); - #if DEBUG + #if DEBUG charsetProbers[i].DumpStatus(); - #endif + #endif if (st == ProbingState.FoundIt) { done = true; detectedCharset = charsetProbers[i].GetCharsetName(); return; - } + } } } break; - default: + default: // pure ascii break; } @@ -191,13 +191,13 @@ namespace UniversalDetector.Core } /// - /// Notify detector that no further data is available. + /// Notify detector that no further data is available. /// public virtual void DataEnd() { if (!gotData) { - // we haven't got any data yet, return immediately - // caller program sometimes call DataEnd before anything has + // we haven't got any data yet, return immediately + // caller program sometimes call DataEnd before anything has // been sent to detector return; } @@ -206,7 +206,7 @@ namespace UniversalDetector.Core done = true; Report(detectedCharset, 1.0f); return; - } + } if (inputState == InputState.Highbyte) { float proberConfidence = 0.0f; @@ -221,22 +221,22 @@ namespace UniversalDetector.Core } } } - + if (maxProberConfidence > MINIMUM_THRESHOLD) { Report(charsetProbers[maxProber].GetCharsetName(), maxProberConfidence); - } - + } + } else if (inputState == InputState.PureASCII) { Report("ASCII", 1.0f); - } + } } /// /// Clear internal state of charset detector. - /// In the original interface this method is protected. + /// In the original interface this method is protected. /// - public virtual void Reset() - { + public virtual void Reset() + { done = false; start = true; detectedCharset = null; @@ -250,7 +250,7 @@ namespace UniversalDetector.Core if (charsetProbers[i] != null) charsetProbers[i].Reset(); } - + protected abstract void Report(string charset, float confidence); } diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/DetectionConfidence.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/DetectionConfidence.cs index 6dfa55f6c2..ea96c28033 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/DetectionConfidence.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/DetectionConfidence.cs @@ -21,7 +21,7 @@ * * Contributor(s): * Rudi Pettazzi (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -40,26 +40,26 @@ namespace UniversalDetector { /// /// Indicate how confident the detection module about the return result. - /// - /// NoAnswerYet: the detector have not find out a answer yet based on + /// + /// NoAnswerYet: the detector have not find out a answer yet based on /// the data it received. - /// - /// BestAnswer: the answer the detector returned is the best one within - /// the knowledge of the detector. In other words, the test to all + /// + /// BestAnswer: the answer the detector returned is the best one within + /// the knowledge of the detector. In other words, the test to all /// other candidates fail. /// For example, the (Shift_JIS/EUC-JP/ISO-2022-JP) detection - /// module may return this with answer "Shift_JIS " if it receive - /// bytes > 0x80 (which make ISO-2022-JP test failed) and byte + /// module may return this with answer "Shift_JIS " if it receive + /// bytes > 0x80 (which make ISO-2022-JP test failed) and byte /// 0x82 (which may EUC-JP test failed) /// /// SureAnswer: the detector is 100% sure about the answer. - /// + /// /// Example 1: the Shift_JIS/ISO-2022-JP/EUC-JP detector return /// this w/ ISO-2022-JP when it hit one of the following ESC seq /// ESC ( J /// ESC $ @ /// ESC $ B - /// + /// /// Example 2: the detector which can detect UCS2 return w/ UCS2 /// when the first 2 byte are BOM mark. /// Example 3: the Korean detector return ISO-2022-KR when it diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/ICharsetDetector.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/ICharsetDetector.cs index c0c35a59eb..fbf8376bd0 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/ICharsetDetector.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/ICharsetDetector.cs @@ -47,31 +47,31 @@ namespace UniversalDetector /// The detected charset. It can be null. /// string Charset { get; } - + /// - /// The confidence of the detected charset, if any + /// The confidence of the detected charset, if any /// float Confidence { get; } - + /// - /// Feed a block of bytes to the detector. + /// Feed a block of bytes to the detector. /// /// input buffer /// offset into buffer /// number of available bytes void Feed(byte[] buf, int offset, int len); - + /// - /// Feed a bytes stream to the detector. + /// Feed a bytes stream to the detector. /// /// an input stream void Feed(Stream stream); /// - /// Resets the state of the detector. - /// + /// Resets the state of the detector. + /// void Reset(); - + /// /// Returns true if the detector has found a result and it is sure about it. /// @@ -83,6 +83,6 @@ namespace UniversalDetector /// decision. /// void DataEnd(); - + } } diff --git a/Emby.Server.Implementations/Udp/UdpServer.cs b/Emby.Server.Implementations/Udp/UdpServer.cs index 275bd83ea9..7db814c4a4 100644 --- a/Emby.Server.Implementations/Udp/UdpServer.cs +++ b/Emby.Server.Implementations/Udp/UdpServer.cs @@ -182,7 +182,7 @@ namespace Emby.Server.Implementations.Udp { return; } - + try { var socketResult = _udpClient.EndReceive(result); diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 82b61c15a0..4943d0ccc3 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -597,7 +597,7 @@ namespace Emby.Server.Implementations.Updates cancellationToken.ThrowIfCancellationRequested(); - // Success - move it to the real target + // Success - move it to the real target try { _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(target)); diff --git a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs b/Emby.Server.Implementations/UserViews/FolderImageProvider.cs index abd6810b0b..057d22aece 100644 --- a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs +++ b/Emby.Server.Implementations/UserViews/FolderImageProvider.cs @@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Photos Parent = item, DtoOptions = new DtoOptions(true), ImageTypes = new ImageType[] { ImageType.Primary }, - OrderBy = new System.ValueTuple[] + OrderBy = new System.ValueTuple[] { new System.ValueTuple(ItemSortBy.IsFolder, SortOrder.Ascending), new System.ValueTuple(ItemSortBy.SortName, SortOrder.Ascending) diff --git a/Emby.XmlTv/Emby.XmlTv.Console/Program.cs b/Emby.XmlTv/Emby.XmlTv.Console/Program.cs index c57c45297a..e72d94bf56 100644 --- a/Emby.XmlTv/Emby.XmlTv.Console/Program.cs +++ b/Emby.XmlTv/Emby.XmlTv.Console/Program.cs @@ -25,7 +25,7 @@ namespace Emby.XmlTv.Console var timer = Stopwatch.StartNew(); System.Console.WriteLine("Running XMLTv Parsing"); - var resultsFile = String.Format("C:\\Temp\\{0}_Results_{1:HHmmss}.txt", + var resultsFile = String.Format("C:\\Temp\\{0}_Results_{1:HHmmss}.txt", Path.GetFileNameWithoutExtension(filename), DateTimeOffset.UtcNow); diff --git a/Emby.XmlTv/Emby.XmlTv.Console/Properties/AssemblyInfo.cs b/Emby.XmlTv/Emby.XmlTv.Console/Properties/AssemblyInfo.cs index cd1fcce685..4178a27a1e 100644 --- a/Emby.XmlTv/Emby.XmlTv.Console/Properties/AssemblyInfo.cs +++ b/Emby.XmlTv/Emby.XmlTv.Console/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.XmlTv.Console")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -25,11 +25,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] diff --git a/Emby.XmlTv/Emby.XmlTv.Test/Properties/AssemblyInfo.cs b/Emby.XmlTv/Emby.XmlTv.Test/Properties/AssemblyInfo.cs index b6fc4c8e2b..e79fda8a89 100644 --- a/Emby.XmlTv/Emby.XmlTv.Test/Properties/AssemblyInfo.cs +++ b/Emby.XmlTv/Emby.XmlTv.Test/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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.XmlTv.Test")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -25,11 +25,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] diff --git a/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderDateTimeTests.cs b/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderDateTimeTests.cs index dbbd352ee7..2e4516be56 100644 --- a/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderDateTimeTests.cs +++ b/Emby.XmlTv/Emby.XmlTv.Test/XmlTvReaderDateTimeTests.cs @@ -16,7 +16,7 @@ namespace Emby.XmlTv.Test { var testFile = Path.GetFullPath(@"MultilanguageData.xml"); var reader = new XmlTvReader(testFile, "es"); - + Assert.AreEqual(Parse("01 Jan 2016 00:00:00"), reader.ParseDate("2016")); Assert.AreEqual(Parse("01 Jan 2016 00:00:00"), reader.ParseDate("201601")); Assert.AreEqual(Parse("01 Jan 2016 00:00:00"), reader.ParseDate("20160101")); diff --git a/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvEpisode.cs b/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvEpisode.cs index afcfb909ee..98a0354679 100644 --- a/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvEpisode.cs +++ b/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvEpisode.cs @@ -49,5 +49,5 @@ namespace Emby.XmlTv.Entities } } - + } diff --git a/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvProgram.cs b/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvProgram.cs index b5aa6cf7a9..b6614afc15 100644 --- a/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvProgram.cs +++ b/Emby.XmlTv/Emby.XmlTv/Entities/XmlTvProgram.cs @@ -13,7 +13,7 @@ namespace Emby.XmlTv.Entities public DateTimeOffset EndDate { get; set; } public string Title { get; set; } - + public string Description { get; set; } public string ProgramId { get; set; } public string Quality { get; set; } diff --git a/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs b/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs index f33433c93d..d852584198 100644 --- a/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs +++ b/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("XmlTv")] @@ -14,19 +14,19 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index ed0a0c81a9..7f7e48a3ae 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -397,7 +397,7 @@ namespace MediaBrowser.Api lock (_activeTranscodingJobs) { - // This is really only needed for HLS. + // This is really only needed for HLS. // Progressive streams can stop on their own reliably jobs = _activeTranscodingJobs.Where(j => string.Equals(playSessionId, j.PlaySessionId, StringComparison.OrdinalIgnoreCase)).ToList(); } @@ -499,7 +499,7 @@ namespace MediaBrowser.Api lock (_activeTranscodingJobs) { - // This is really only needed for HLS. + // This is really only needed for HLS. // Progressive streams can stop on their own reliably jobs.AddRange(_activeTranscodingJobs.Where(killJob)); } diff --git a/MediaBrowser.Api/DisplayPreferencesService.cs b/MediaBrowser.Api/DisplayPreferencesService.cs index 6bc2f7e4af..eea83490ad 100644 --- a/MediaBrowser.Api/DisplayPreferencesService.cs +++ b/MediaBrowser.Api/DisplayPreferencesService.cs @@ -41,7 +41,7 @@ namespace MediaBrowser.Api [ApiMember(Name = "Client", Description = "Client", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public string Client { get; set; } } - + /// /// Class DisplayPreferencesService /// diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index ea3920d38d..6794a93044 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -98,7 +98,7 @@ namespace MediaBrowser.Api [Route("/Environment/DefaultDirectoryBrowser", "GET", Summary = "Gets the parent path of a given path")] public class GetDefaultDirectoryBrowser : IReturn { - + } /// diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index fa6502bda1..9cddcde491 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -882,7 +882,7 @@ namespace MediaBrowser.Api.Playback if (profile == null) { - // Don't use settings from the default profile. + // Don't use settings from the default profile. // Only use a specific profile if it was requested. return; } diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 7ef7b81e63..954963b2f8 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -296,7 +296,7 @@ namespace MediaBrowser.Api.Playback.Hls ).Trim(); } - // add when stream copying? + // add when stream copying? // -avoid_negative_ts make_zero -fflags +genpts var args = string.Format("{0} {1} {2} -map_metadata -1 -map_chapters -1 -threads {3} {4} {5} -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero {6} -hls_time {7} -individual_header_trailer 0 -start_number {8} -hls_list_size {9}{10} -y \"{11}\"", diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 6dafe134ce..a0b0b2ceda 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -118,7 +118,7 @@ namespace MediaBrowser.Api.Playback var authInfo = _authContext.GetAuthorizationInfo(Request); var result = await _mediaSourceManager.OpenLiveStream(request, CancellationToken.None).ConfigureAwait(false); - + var profile = request.DeviceProfile; if (profile == null) { @@ -386,10 +386,10 @@ namespace MediaBrowser.Api.Playback } else { - Logger.LogInformation("User policy for {0}. EnablePlaybackRemuxing: {1} EnableVideoPlaybackTranscoding: {2} EnableAudioPlaybackTranscoding: {3}", + Logger.LogInformation("User policy for {0}. EnablePlaybackRemuxing: {1} EnableVideoPlaybackTranscoding: {2} EnableAudioPlaybackTranscoding: {3}", user.Name, user.Policy.EnablePlaybackRemuxing, - user.Policy.EnableVideoPlaybackTranscoding, + user.Policy.EnableVideoPlaybackTranscoding, user.Policy.EnableAudioPlaybackTranscoding); } diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index d95c30d657..6b0725f317 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -19,7 +19,7 @@ namespace MediaBrowser.Api.Playback [ApiMember(Name = "MediaSourceId", Description = "The media version id, if playing an alternate version", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public string MediaSourceId { get; set; } - + [ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public string DeviceId { get; set; } diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 67fb04d0c2..73741d527b 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -117,7 +117,7 @@ namespace MediaBrowser.Api.Playback public string UserAgent { get; set; } - public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType) + public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType) : base(logger, mediaSourceManager, transcodingType) { _mediaSourceManager = mediaSourceManager; diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index 1f1bb36144..12488b7127 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -225,7 +225,7 @@ namespace MediaBrowser.Api { var pkg = packages.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.guid) && new Guid(plugin.Id).Equals(new Guid(i.guid))); return pkg != null && pkg.enableInAppStore; - + }) .ToArray(); } diff --git a/MediaBrowser.Api/Properties/AssemblyInfo.cs b/MediaBrowser.Api/Properties/AssemblyInfo.cs index c689522916..2755924c87 100644 --- a/MediaBrowser.Api/Properties/AssemblyInfo.cs +++ b/MediaBrowser.Api/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.Api")] @@ -13,8 +13,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -24,7 +24,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs index 959bdcd550..ef9b3c1ae0 100644 --- a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs +++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs @@ -155,7 +155,7 @@ namespace MediaBrowser.Api.ScheduledTasks return isEnabled == val; }); } - + var infos = result .Select(ScheduledTaskHelpers.GetTaskInfo) .ToArray(); diff --git a/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs b/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs index b61ff8d932..29f01eab93 100644 --- a/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs +++ b/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs @@ -47,7 +47,7 @@ namespace MediaBrowser.Api.System { return Task.FromResult(new List()); } - + protected override void Dispose(bool dispose) { diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs index 11c12c718f..2ce9b0aec4 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs @@ -214,7 +214,7 @@ namespace MediaBrowser.Api.UserLibrary public string Genres { get; set; } public string GenreIds { get; set; } - + [ApiMember(Name = "OfficialRatings", Description = "Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string OfficialRatings { get; set; } @@ -412,7 +412,7 @@ namespace MediaBrowser.Api.UserLibrary return val.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(v => (VideoType)Enum.Parse(typeof(VideoType), v, true)).ToArray(); } - + /// /// Gets the filters. /// diff --git a/MediaBrowser.Api/UserLibrary/GenresService.cs b/MediaBrowser.Api/UserLibrary/GenresService.cs index 0bb7d7865a..c897ba300f 100644 --- a/MediaBrowser.Api/UserLibrary/GenresService.cs +++ b/MediaBrowser.Api/UserLibrary/GenresService.cs @@ -69,7 +69,7 @@ namespace MediaBrowser.Api.UserLibrary var dtoOptions = GetDtoOptions(AuthorizationContext, request); var item = GetGenre(request.Name, LibraryManager, dtoOptions); - + if (!request.UserId.Equals(Guid.Empty)) { var user = UserManager.GetUserById(request.UserId); diff --git a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs b/MediaBrowser.Api/UserLibrary/MusicGenresService.cs index d4f1b3fa8d..9583dacb26 100644 --- a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs +++ b/MediaBrowser.Api/UserLibrary/MusicGenresService.cs @@ -60,7 +60,7 @@ namespace MediaBrowser.Api.UserLibrary var dtoOptions = GetDtoOptions(AuthorizationContext, request); var item = GetMusicGenre(request.Name, LibraryManager, dtoOptions); - + if (!request.UserId.Equals(Guid.Empty)) { var user = UserManager.GetUserById(request.UserId); diff --git a/MediaBrowser.Api/UserLibrary/YearsService.cs b/MediaBrowser.Api/UserLibrary/YearsService.cs index 30ac88e00f..528406aa43 100644 --- a/MediaBrowser.Api/UserLibrary/YearsService.cs +++ b/MediaBrowser.Api/UserLibrary/YearsService.cs @@ -66,7 +66,7 @@ namespace MediaBrowser.Api.UserLibrary private BaseItemDto GetItem(GetYear request) { var item = LibraryManager.GetYear(request.Year); - + var dtoOptions = GetDtoOptions(AuthorizationContext, request); if (!request.UserId.Equals(Guid.Empty)) diff --git a/MediaBrowser.Common/Net/HttpResponseInfo.cs b/MediaBrowser.Common/Net/HttpResponseInfo.cs index ed941a4474..a36550a281 100644 --- a/MediaBrowser.Common/Net/HttpResponseInfo.cs +++ b/MediaBrowser.Common/Net/HttpResponseInfo.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Common.Net /// /// The response URL. public string ResponseUrl { get; set; } - + /// /// Gets or sets the content. /// diff --git a/MediaBrowser.Common/Properties/AssemblyInfo.cs b/MediaBrowser.Common/Properties/AssemblyInfo.cs index 09fd68f93a..1a7112ad9a 100644 --- a/MediaBrowser.Common/Properties/AssemblyInfo.cs +++ b/MediaBrowser.Common/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.Common")] @@ -13,15 +13,15 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // \ No newline at end of file diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs index 2f64cd1946..70529d0624 100644 --- a/MediaBrowser.Controller/Dlna/IDlnaManager.cs +++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs @@ -30,26 +30,26 @@ namespace MediaBrowser.Controller.Dlna /// /// The profile. void CreateProfile(DeviceProfile profile); - + /// /// Updates the profile. /// /// The profile. void UpdateProfile(DeviceProfile profile); - + /// /// Deletes the profile. /// /// The identifier. void DeleteProfile(string id); - + /// /// Gets the profile. /// /// The identifier. /// DeviceProfile. DeviceProfile GetProfile(string id); - + /// /// Gets the profile. /// diff --git a/MediaBrowser.Controller/Drawing/ImageProcessorExtensions.cs b/MediaBrowser.Controller/Drawing/ImageProcessorExtensions.cs index 948219bf55..1b1e386e5c 100644 --- a/MediaBrowser.Controller/Drawing/ImageProcessorExtensions.cs +++ b/MediaBrowser.Controller/Drawing/ImageProcessorExtensions.cs @@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Drawing { return processor.GetImageCacheTag(item, imageType, 0); } - + public static string GetImageCacheTag(this IImageProcessor processor, BaseItem item, ImageType imageType, int imageIndex) { var imageInfo = item.GetImageInfo(imageType, imageIndex); diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index a268e6d765..4703b9d407 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -2100,7 +2100,7 @@ namespace MediaBrowser.Controller.Entities } else { - var list = + var list = Studios = current.Concat(new [] { name }).ToArray(); } } @@ -2915,7 +2915,7 @@ namespace MediaBrowser.Controller.Entities return GetExtras(); } - public virtual bool IsHD { + public virtual bool IsHD { get { return Height >= 720; diff --git a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs b/MediaBrowser.Controller/Entities/BaseItemExtensions.cs index 8ab1788b57..bfd832d34d 100644 --- a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs +++ b/MediaBrowser.Controller/Entities/BaseItemExtensions.cs @@ -62,13 +62,13 @@ namespace MediaBrowser.Controller.Entities item.SetImagePath(imageType, BaseItem.FileSystem.GetFileInfo(file)); } } - + /// /// Copies all properties on object. Skips properties that do not exist. /// /// The source object. /// The destination object. - public static void DeepCopy(this T source, TU dest) + public static void DeepCopy(this T source, TU dest) where T : BaseItem where TU : BaseItem { @@ -82,7 +82,7 @@ namespace MediaBrowser.Controller.Entities if (destProps.Any(x => x.Name == sourceProp.Name)) { var p = destProps.First(x => x.Name == sourceProp.Name); - p.SetValue(dest, sourceProp.GetValue(source, null), null); + p.SetValue(dest, sourceProp.GetValue(source, null), null); } } @@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.Entities /// Copies all properties on newly created object. Skips properties that do not exist. /// /// The source object. - public static TU DeepCopy(this T source) + public static TU DeepCopy(this T source) where T : BaseItem where TU : BaseItem, new() { diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index dbe30f9a51..a2522cf5d0 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1705,7 +1705,7 @@ namespace MediaBrowser.Controller.Entities { get { - // These are just far too slow. + // These are just far too slow. if (this is ICollectionFolder) { return false; diff --git a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs index fbe5a06d0e..7eede67085 100644 --- a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs +++ b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs @@ -3,7 +3,7 @@ namespace MediaBrowser.Controller.Entities { /// /// Marker interface to denote a class that supports being hidden underneath it's boxset. - /// Just about anything can be placed into a boxset, + /// Just about anything can be placed into a boxset, /// but movies should also only appear underneath and not outside separately (subject to configuration). /// public interface ISupportsBoxSetGrouping diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index bb99c0a84e..b35e36e1b2 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -158,7 +158,7 @@ namespace MediaBrowser.Controller.Entities public bool EnableGroupByMetadataKey { get; set; } public bool? HasChapterImages { get; set; } - public ValueTuple[] OrderBy { get; set; } + public ValueTuple[] OrderBy { get; set; } public DateTime? MinDateCreated { get; set; } public DateTime? MinDateLastSaved { get; set; } diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index f569c80219..1cecfe44ec 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -19,7 +19,7 @@ namespace MediaBrowser.Controller.Entities public static IXmlSerializer XmlSerializer { get; set; } /// - /// From now on all user paths will be Id-based. + /// From now on all user paths will be Id-based. /// This is for backwards compatibility. /// public bool UsesIdForConfigurationPath { get; set; } diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs index 0e13269499..fd118be9e9 100644 --- a/MediaBrowser.Controller/Entities/UserItemData.cs +++ b/MediaBrowser.Controller/Entities/UserItemData.cs @@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Entities public int? SubtitleStreamIndex { get; set; } public const double MinLikeValue = 6.5; - + /// /// This is an interpreted property to indicate likes or dislikes /// This should never be serialized. diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 4dc5590312..57a3bbc0a8 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -37,7 +37,7 @@ namespace MediaBrowser.Controller /// /// The HTTPS port. int HttpsPort { get; } - + /// /// Gets a value indicating whether [supports HTTPS]. /// diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 5fb7968dd9..7f2605fab0 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Controller /// /// The application resources path. string ApplicationResourcesPath { get; } - + /// /// Gets the path to the default user view directory. Used if no specific user view is defined. /// diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index d29b164ef6..154ef3b059 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Library /// The user. /// Task. void ResetEasyPassword(User user); - + /// /// Changes the password. /// @@ -133,7 +133,7 @@ namespace MediaBrowser.Controller.Library /// Changes the easy password. /// void ChangeEasyPassword(User user, string newPassword, string newPasswordSha1); - + /// /// Gets the user dto. /// diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 9812802e7f..238dd28800 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -126,7 +126,7 @@ namespace MediaBrowser.Controller.Library { var item = parent as T; - // Just in case the user decided to nest episodes. + // Just in case the user decided to nest episodes. // Not officially supported but in some cases we can handle it. if (item == null) { diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index c000da8528..f45c7b71ab 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The tuner host identifier. public string TunerHostId { get; set; } - + /// /// Gets or sets the type of the channel. /// diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 601fb69aa3..5986474d86 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -99,7 +99,7 @@ namespace MediaBrowser.Controller.LiveTv /// The program. /// Task{SeriesTimerInfo}. Task GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null); - + /// /// Gets the series timers asynchronous. /// diff --git a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs index 4da238acf5..20e5d228b8 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs @@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance is visible; otherwise, false. public bool IsVisible { get; set; } - + public LiveTvServiceStatusInfo() { Tuners = new List(); diff --git a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs index 5c001f2883..ade25abdc6 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs @@ -28,7 +28,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The URL. public string Url { get; set; } - + /// /// Gets or sets the status. /// @@ -52,7 +52,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The name of the program. public string ProgramName { get; set; } - + /// /// Gets or sets the clients. /// @@ -64,7 +64,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance can reset; otherwise, false. public bool CanReset { get; set; } - + public LiveTvTunerInfo() { Clients = new List(); diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index 3006b9bbef..0ca4749d75 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The timer identifier. public string TimerId { get; set; } - + /// /// ChannelId of the recording. /// @@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The type of the channel. public ChannelType ChannelType { get; set; } - + /// /// Name of the recording. /// @@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The URL. public string Url { get; set; } - + /// /// Gets or sets the overview. /// diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs index 5c73ed833f..a9bb9f4e86 100644 --- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs @@ -15,13 +15,13 @@ namespace MediaBrowser.Controller.LiveTv /// ChannelId of the recording. /// public string ChannelId { get; set; } - + /// /// Gets or sets the program identifier. /// /// The program identifier. public string ProgramId { get; set; } - + /// /// Name of the recording. /// @@ -66,7 +66,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if [record new only]; otherwise, false. public bool RecordNewOnly { get; set; } - + /// /// Gets or sets the days. /// @@ -108,7 +108,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The series identifier. public string SeriesId { get; set; } - + public SeriesTimerInfo() { Days = new List(); diff --git a/MediaBrowser.Controller/MediaEncoding/ImageEncodingOptions.cs b/MediaBrowser.Controller/MediaEncoding/ImageEncodingOptions.cs index a8d1e5a0f1..d69c2e47df 100644 --- a/MediaBrowser.Controller/MediaEncoding/ImageEncodingOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/ImageEncodingOptions.cs @@ -4,7 +4,7 @@ namespace MediaBrowser.Controller.MediaEncoding public class ImageEncodingOptions { public string InputPath { get; set; } - + public int? Width { get; set; } public int? Height { get; set; } @@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.MediaEncoding public int? MaxHeight { get; set; } public int? Quality { get; set; } - + public string Format { get; set; } } } diff --git a/MediaBrowser.Controller/Net/AuthorizationInfo.cs b/MediaBrowser.Controller/Net/AuthorizationInfo.cs index 848d8fa15c..86c7b7e0f5 100644 --- a/MediaBrowser.Controller/Net/AuthorizationInfo.cs +++ b/MediaBrowser.Controller/Net/AuthorizationInfo.cs @@ -9,12 +9,12 @@ namespace MediaBrowser.Controller.Net /// Gets or sets the user identifier. /// /// The user identifier. - public Guid UserId { + public Guid UserId { get { return User == null ? Guid.Empty : User.Id; } } - + /// /// Gets or sets the device identifier. /// diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs index 31ec149bf9..7bcd66e56f 100644 --- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs +++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs @@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.Net protected virtual void ParseMessageParams(string[] values) { - + } /// diff --git a/MediaBrowser.Controller/Net/IAuthorizationContext.cs b/MediaBrowser.Controller/Net/IAuthorizationContext.cs index 5a9d0aa30c..9b9b2226ad 100644 --- a/MediaBrowser.Controller/Net/IAuthorizationContext.cs +++ b/MediaBrowser.Controller/Net/IAuthorizationContext.cs @@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Net /// The request context. /// AuthorizationInfo. AuthorizationInfo GetAuthorizationInfo(object requestContext); - + /// /// Gets the authorization information. /// diff --git a/MediaBrowser.Controller/Net/ISessionContext.cs b/MediaBrowser.Controller/Net/ISessionContext.cs index 37ddbc2b39..40e76c252d 100644 --- a/MediaBrowser.Controller/Net/ISessionContext.cs +++ b/MediaBrowser.Controller/Net/ISessionContext.cs @@ -5,7 +5,7 @@ using MediaBrowser.Model.Services; namespace MediaBrowser.Controller.Net { - public interface ISessionContext + public interface ISessionContext { SessionInfo GetSession(object requestContext); User GetUser(object requestContext); diff --git a/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs b/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs index d294107d74..e914fc2000 100644 --- a/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs +++ b/MediaBrowser.Controller/Plugins/ILocalizablePlugin.cs @@ -15,6 +15,6 @@ namespace MediaBrowser.Controller.Plugins // Find all dictionaries using GetManifestResourceNames, start start with the prefix // Return the one for the culture if exists, otherwise return the default return null; - } + } } } diff --git a/MediaBrowser.Controller/Properties/AssemblyInfo.cs b/MediaBrowser.Controller/Properties/AssemblyInfo.cs index 844b93f37d..a28296c18a 100644 --- a/MediaBrowser.Controller/Properties/AssemblyInfo.cs +++ b/MediaBrowser.Controller/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.Controller")] @@ -13,15 +13,15 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // \ No newline at end of file diff --git a/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs b/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs index fc4cca19c8..68f1ae589b 100644 --- a/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs +++ b/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Providers /// The directory service. /// The cancellation token. /// Task{MetadataResult{`0}}. - Task> GetMetadata(ItemInfo info, + Task> GetMetadata(ItemInfo info, IDirectoryService directoryService, CancellationToken cancellationToken); } diff --git a/MediaBrowser.Controller/Providers/IPreRefreshProvider.cs b/MediaBrowser.Controller/Providers/IPreRefreshProvider.cs index 6086749052..4170bb3752 100644 --- a/MediaBrowser.Controller/Providers/IPreRefreshProvider.cs +++ b/MediaBrowser.Controller/Providers/IPreRefreshProvider.cs @@ -2,6 +2,6 @@ namespace MediaBrowser.Controller.Providers { public interface IPreRefreshProvider : ICustomMetadataProvider { - + } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs b/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs index 5db5ddbb28..32f51c650f 100644 --- a/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs +++ b/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs @@ -19,7 +19,7 @@ namespace MediaBrowser.Controller.Providers /// The item. /// IEnumerable{ImageType}. IEnumerable GetSupportedImages(BaseItem item); - + /// /// Gets the images. /// diff --git a/MediaBrowser.Controller/Resolvers/IItemResolver.cs b/MediaBrowser.Controller/Resolvers/IItemResolver.cs index 3af5d5f7f6..298ec248aa 100644 --- a/MediaBrowser.Controller/Resolvers/IItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/IItemResolver.cs @@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Resolvers public interface IMultiItemResolver { MultiItemResolverResult ResolveMultiple(Folder parent, - List files, + List files, string collectionType, IDirectoryService directoryService); } diff --git a/MediaBrowser.Controller/Security/AuthenticationInfo.cs b/MediaBrowser.Controller/Security/AuthenticationInfo.cs index c75bf89e41..ecb3866d0a 100644 --- a/MediaBrowser.Controller/Security/AuthenticationInfo.cs +++ b/MediaBrowser.Controller/Security/AuthenticationInfo.cs @@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Security /// /// The application version. public string AppVersion { get; set; } - + /// /// Gets or sets the name of the device. /// diff --git a/MediaBrowser.Controller/Security/AuthenticationInfoQuery.cs b/MediaBrowser.Controller/Security/AuthenticationInfoQuery.cs index 125534c46b..2fa988ec14 100644 --- a/MediaBrowser.Controller/Security/AuthenticationInfoQuery.cs +++ b/MediaBrowser.Controller/Security/AuthenticationInfoQuery.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.Security /// /// The access token. public string AccessToken { get; set; } - + /// /// Gets or sets a value indicating whether this instance is active. /// @@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Security /// /// null if [has user] contains no value, true if [has user]; otherwise, false. public bool? HasUser { get; set; } - + /// /// Gets or sets the start index. /// diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index eca345cbcb..1b51ddc161 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Controller.Session event EventHandler SessionEnded; event EventHandler SessionActivity; - + /// /// Occurs when [capabilities changed]. /// @@ -58,7 +58,7 @@ namespace MediaBrowser.Controller.Session /// Occurs when [authentication succeeded]. /// event EventHandler> AuthenticationSucceeded; - + /// /// Gets the sessions. /// @@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Session /// The cancellation token. /// Task. Task SendGeneralCommand(string controllingSessionId, string sessionId, GeneralCommand command, CancellationToken cancellationToken); - + /// /// Sends the message command. /// @@ -189,7 +189,7 @@ namespace MediaBrowser.Controller.Session /// The cancellation token. /// Task. Task SendMessageToUserDeviceSessions(string deviceId, string name, T data, CancellationToken cancellationToken); - + /// /// Sends the restart required message. /// diff --git a/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs b/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs index 0d5a8003e4..bffe0469f1 100644 --- a/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs +++ b/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.LocalMetadata")] @@ -13,8 +13,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -24,10 +24,10 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.*")] \ No newline at end of file diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs index 9761de98fb..1edc5c2011 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs @@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Encoder private readonly ILogger _logger; private readonly IMediaSourceManager _mediaSourceManager; - public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) : + public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) : base(logger, mediaSourceManager, TranscodingJobType.Progressive) { _logger = logger; diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs index 4e6ee89e1b..34bc8d1b93 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs @@ -25,7 +25,7 @@ namespace MediaBrowser.MediaEncoding.Encoder private readonly IMediaEncoder _mediaEncoder; protected static readonly CultureInfo UsCulture = new CultureInfo("en-US"); - + public EncodingJobFactory(ILogger logger, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder) { _logger = logger; @@ -255,7 +255,7 @@ namespace MediaBrowser.MediaEncoding.Encoder if (profile == null) { - // Don't use settings from the default profile. + // Don't use settings from the default profile. // Only use a specific profile if it was requested. return; } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index a93dd97421..96fe416b25 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -362,7 +362,7 @@ namespace MediaBrowser.MediaEncoding.Encoder private Tuple GetPathsFromDirectory(string path) { - // Since we can't predict the file extension, first try directly within the folder + // Since we can't predict the file extension, first try directly within the folder // If that doesn't pan out, then do a recursive search var files = FileSystem.GetFilePaths(path); @@ -525,7 +525,7 @@ namespace MediaBrowser.MediaEncoding.Encoder CreateNoWindow = true, UseShellExecute = false, - // Must consume both or ffmpeg may hang due to deadlocks. See comments below. + // Must consume both or ffmpeg may hang due to deadlocks. See comments below. RedirectStandardOutput = true, FileName = FFProbePath, Arguments = string.Format(args, probeSizeArgument, inputPath).Trim(), @@ -648,7 +648,7 @@ namespace MediaBrowser.MediaEncoding.Encoder var tempExtractPath = Path.Combine(ConfigurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid() + ".jpg"); FileSystem.CreateDirectory(FileSystem.GetDirectoryName(tempExtractPath)); - // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600. + // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600. // This filter chain may have adverse effects on recorded tv thumbnails if ar changes during presentation ex. commercials @ diff ar var vf = "scale=600:trunc(600/dar/2)*2"; @@ -676,7 +676,7 @@ namespace MediaBrowser.MediaEncoding.Encoder break; } } - + var mapArg = imageStreamIndex.HasValue ? (" -map 0:v:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty; var enableThumbnail = !new List { "wtv" }.Contains(container ?? string.Empty, StringComparer.OrdinalIgnoreCase); diff --git a/MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs b/MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs index eef2732509..350a2e3e5a 100644 --- a/MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs +++ b/MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs @@ -149,7 +149,7 @@ namespace MediaBrowser.MediaEncoding.Probing /// /// The bits_per_raw_sample. public int bits_per_raw_sample { get; set; } - + /// /// Gets or sets the r_frame_rate. /// diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 5367a87f7b..0b168f10e8 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -132,7 +132,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (!string.IsNullOrWhiteSpace(iTunEXTC)) { var parts = iTunEXTC.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); - // Example + // Example // mpaa|G|100|For crude humor if (parts.Length > 1) { @@ -423,7 +423,7 @@ namespace MediaBrowser.MediaEncoding.Probing Type = PersonType.Writer }); } - + } else if (string.Equals(key, "producers", StringComparison.OrdinalIgnoreCase)) { @@ -619,7 +619,7 @@ namespace MediaBrowser.MediaEncoding.Probing else if (string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase)) { // How to differentiate between video and embedded image? - // The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates + // The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates if (!string.IsNullOrWhiteSpace(stream.CodecTag)) { stream.Type = MediaStreamType.Video; @@ -1054,7 +1054,7 @@ namespace MediaBrowser.MediaEncoding.Probing /// System.String[][]. private IEnumerable Split(string val, bool allowCommaDelimiter) { - // Only use the comma as a delimeter if there are no slashes or pipes. + // Only use the comma as a delimeter if there are no slashes or pipes. // We want to be careful not to split names that have commas in them var delimeter = !allowCommaDelimiter || _nameDelimiters.Any(i => val.IndexOf(i) != -1) ? _nameDelimiters : diff --git a/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs b/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs index 53f4eb4035..2f26648d0d 100644 --- a/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs +++ b/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.MediaEncoding")] @@ -13,8 +13,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -24,10 +24,10 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.*")] \ No newline at end of file diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs index 71fefba44a..73df2b1e0b 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs @@ -29,7 +29,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles while ((line = reader.ReadLine()) != null) { cancellationToken.ThrowIfCancellationRequested(); - + if (string.IsNullOrWhiteSpace(line)) { continue; @@ -49,7 +49,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles RemoteNativeFormatting(subEvent); subEvent.Text = subEvent.Text.Replace("\\n", ParserValues.NewLine, StringComparison.OrdinalIgnoreCase); - + subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase); trackEvents.Add(subEvent); diff --git a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs index 7ca8aa1fd8..e9f9c6f58a 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles { continue; } - + var time = Regex.Split(line, @"[\t ]*-->[\t ]*"); if (time.Length < 2) @@ -85,7 +85,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles TimeSpan span; return TimeSpan.TryParseExact(time, @"hh\:mm\:ss\.fff", _usCulture, out span) ? span.Ticks - : (TimeSpan.TryParseExact(time, @"hh\:mm\:ss\,fff", _usCulture, out span) + : (TimeSpan.TryParseExact(time, @"hh\:mm\:ss\,fff", _usCulture, out span) ? span.Ticks : 0); } } diff --git a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs index a2cee77935..022fca1c8f 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs @@ -129,8 +129,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles } } } - } - + } + //if (header.Length > 0) //subtitle.Header = header.ToString(); diff --git a/MediaBrowser.MediaEncoding/Subtitles/TtmlWriter.cs b/MediaBrowser.MediaEncoding/Subtitles/TtmlWriter.cs index c32005f897..f0cf3b31ad 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/TtmlWriter.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/TtmlWriter.cs @@ -45,7 +45,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles writer.WriteLine(""); writer.WriteLine(""); - + writer.WriteLine(""); } } diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs index d4caf499ba..259370b7ee 100644 --- a/MediaBrowser.Model/Channels/ChannelFeatures.cs +++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs @@ -61,7 +61,7 @@ namespace MediaBrowser.Model.Channels /// /// true if [supports latest media]; otherwise, false. public bool SupportsLatestMedia { get; set; } - + /// /// Gets or sets a value indicating whether this instance can filter. /// diff --git a/MediaBrowser.Model/Channels/ChannelQuery.cs b/MediaBrowser.Model/Channels/ChannelQuery.cs index 6b5e95d698..9651cb6c26 100644 --- a/MediaBrowser.Model/Channels/ChannelQuery.cs +++ b/MediaBrowser.Model/Channels/ChannelQuery.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Channels public bool? EnableImages { get; set; } public int? ImageTypeLimit { get; set; } public ImageType[] EnableImageTypes { get; set; } - + /// /// Gets or sets the user identifier. /// diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs index 08bf2379f6..76b5924e96 100644 --- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs +++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.Model.Configuration /// /// The cache path. public string CachePath { get; set; } - + /// /// Initializes a new instance of the class. /// diff --git a/MediaBrowser.Model/Dlna/AudioOptions.cs b/MediaBrowser.Model/Dlna/AudioOptions.cs index 189f646350..9480311b53 100644 --- a/MediaBrowser.Model/Dlna/AudioOptions.cs +++ b/MediaBrowser.Model/Dlna/AudioOptions.cs @@ -55,7 +55,7 @@ namespace MediaBrowser.Model.Dlna /// /// The audio transcoding bitrate. public int? AudioTranscodingBitrate { get; set; } - + /// /// Gets the maximum bitrate. /// diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index 6d143962dd..c40408e9b5 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -9,7 +9,7 @@ namespace MediaBrowser.Model.Dlna { [XmlAttribute("type")] public CodecType Type { get; set; } - + public ProfileCondition[] Conditions { get; set; } public ProfileCondition[] ApplyConditions { get; set; } diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index a550ee9826..5bcee6de29 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -98,7 +98,7 @@ namespace MediaBrowser.Model.Dlna public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, - int? audioSampleRate, + int? audioSampleRate, int? audioBitDepth, string audioProfile, bool? isSecondaryTrack) diff --git a/MediaBrowser.Model/Dlna/ProfileCondition.cs b/MediaBrowser.Model/Dlna/ProfileCondition.cs index 9234a27136..39f99b92ee 100644 --- a/MediaBrowser.Model/Dlna/ProfileCondition.cs +++ b/MediaBrowser.Model/Dlna/ProfileCondition.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Model.Dlna public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value) : this(condition, property, value, false) { - + } public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired) diff --git a/MediaBrowser.Model/Dlna/SearchCriteria.cs b/MediaBrowser.Model/Dlna/SearchCriteria.cs index 533605d892..4f931d1b1b 100644 --- a/MediaBrowser.Model/Dlna/SearchCriteria.cs +++ b/MediaBrowser.Model/Dlna/SearchCriteria.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Dlna if (subFactors.Length == 3) { - if (StringHelper.EqualsIgnoreCase("upnp:class", subFactors[0]) && + if (StringHelper.EqualsIgnoreCase("upnp:class", subFactors[0]) && (StringHelper.EqualsIgnoreCase("=", subFactors[1]) || StringHelper.EqualsIgnoreCase("derivedfrom", subFactors[1]))) { if (StringHelper.EqualsIgnoreCase("\"object.item.imageItem\"", subFactors[2]) || StringHelper.EqualsIgnoreCase("\"object.item.imageItem.photo\"", subFactors[2])) diff --git a/MediaBrowser.Model/Dlna/SortCriteria.cs b/MediaBrowser.Model/Dlna/SortCriteria.cs index 600a2f58e9..ecaf32614c 100644 --- a/MediaBrowser.Model/Dlna/SortCriteria.cs +++ b/MediaBrowser.Model/Dlna/SortCriteria.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Model.Dlna public SortCriteria(string value) { - + } } } diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 41306b4c38..b4021e9999 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -951,7 +951,7 @@ namespace MediaBrowser.Model.Dlna if (audioStream != null) { - // Seeing webm encoding failures when source has 1 audio channel and 22k bitrate. + // Seeing webm encoding failures when source has 1 audio channel and 22k bitrate. // Any attempts to transcode over 64k will fail if (audioStream.Channels.HasValue && audioStream.Channels.Value == 1) diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 746d38679a..7ff8837986 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -46,7 +46,7 @@ namespace MediaBrowser.Model.Dto /// /// The type of the source. public string SourceType { get; set; } - + /// /// Gets or sets the playlist item identifier. /// diff --git a/MediaBrowser.Model/Dto/GameSystemSummary.cs b/MediaBrowser.Model/Dto/GameSystemSummary.cs index 0f21533a0d..b42e988420 100644 --- a/MediaBrowser.Model/Dto/GameSystemSummary.cs +++ b/MediaBrowser.Model/Dto/GameSystemSummary.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Dto /// /// The name. public string DisplayName { get; set; } - + /// /// Gets or sets the game count. /// diff --git a/MediaBrowser.Model/Dto/ImageOptions.cs b/MediaBrowser.Model/Dto/ImageOptions.cs index 98bd0279a7..e98d544353 100644 --- a/MediaBrowser.Model/Dto/ImageOptions.cs +++ b/MediaBrowser.Model/Dto/ImageOptions.cs @@ -92,7 +92,7 @@ namespace MediaBrowser.Model.Dto /// /// The un played count. public int? UnPlayedCount { get; set; } - + /// /// Gets or sets the color of the background. /// diff --git a/MediaBrowser.Model/Dto/NameValuePair.cs b/MediaBrowser.Model/Dto/NameValuePair.cs index a6e6879491..564e32dcdb 100644 --- a/MediaBrowser.Model/Dto/NameValuePair.cs +++ b/MediaBrowser.Model/Dto/NameValuePair.cs @@ -5,7 +5,7 @@ namespace MediaBrowser.Model.Dto { public NameValuePair() { - + } public NameValuePair(string name, string value) diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs index 8d7679fdb5..eb49796326 100644 --- a/MediaBrowser.Model/Dto/UserDto.cs +++ b/MediaBrowser.Model/Dto/UserDto.cs @@ -44,13 +44,13 @@ namespace MediaBrowser.Model.Dto /// /// The type of the connect link. public UserLinkType? ConnectLinkType { get; set; } - + /// /// Gets or sets the id. /// /// The id. public Guid Id { get; set; } - + /// /// Gets or sets the primary image tag. /// diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 35369fbbb9..454e6ff162 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -420,7 +420,7 @@ namespace MediaBrowser.Model.Entities var fromCodec = Codec; - // Can't convert from this + // Can't convert from this if (StringHelper.EqualsIgnoreCase(fromCodec, "ass")) { return false; @@ -430,7 +430,7 @@ namespace MediaBrowser.Model.Entities return false; } - // Can't convert to this + // Can't convert to this if (StringHelper.EqualsIgnoreCase(toCodec, "ass")) { return false; diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs index e10232baa9..35900b5449 100644 --- a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs +++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Entities { return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); } - + /// /// Gets a provider id /// @@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Entities { throw new ArgumentNullException("instance"); } - + // If it's null remove the key from the dictionary if (string.IsNullOrEmpty(value)) { diff --git a/MediaBrowser.Model/Extensions/LinqExtensions.cs b/MediaBrowser.Model/Extensions/LinqExtensions.cs index 1223e689e3..d50b570eaa 100644 --- a/MediaBrowser.Model/Extensions/LinqExtensions.cs +++ b/MediaBrowser.Model/Extensions/LinqExtensions.cs @@ -6,13 +6,13 @@ namespace MediaBrowser.Model.Extensions { // MoreLINQ - Extensions to LINQ to Objects // Copyright (c) 2008 Jonathan Skeet. All rights reserved. - // + // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at - // + // // http://www.apache.org/licenses/LICENSE-2.0 - // + // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs index 5fe77d41ec..a9546bb95b 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs @@ -37,7 +37,7 @@ namespace MediaBrowser.Model.LiveTv /// /// true if [enable favorite sorting]; otherwise, false. public bool EnableFavoriteSorting { get; set; } - + /// /// Gets or sets the user identifier. /// diff --git a/MediaBrowser.Model/Net/HttpException.cs b/MediaBrowser.Model/Net/HttpException.cs index 698b1bc7e1..2f45299e38 100644 --- a/MediaBrowser.Model/Net/HttpException.cs +++ b/MediaBrowser.Model/Net/HttpException.cs @@ -28,7 +28,7 @@ namespace MediaBrowser.Model.Net public HttpException(string message, Exception innerException) : base(message, innerException) { - + } /// diff --git a/MediaBrowser.Model/Notifications/NotificationOption.cs b/MediaBrowser.Model/Notifications/NotificationOption.cs index ce49ae2090..51a07370f0 100644 --- a/MediaBrowser.Model/Notifications/NotificationOption.cs +++ b/MediaBrowser.Model/Notifications/NotificationOption.cs @@ -21,7 +21,7 @@ namespace MediaBrowser.Model.Notifications /// /// true if enabled; otherwise, false. public bool Enabled { get; set; } - + /// /// Gets or sets the disabled services. /// diff --git a/MediaBrowser.Model/Properties/AssemblyInfo.cs b/MediaBrowser.Model/Properties/AssemblyInfo.cs index fabfd908ba..e34472f08f 100644 --- a/MediaBrowser.Model/Properties/AssemblyInfo.cs +++ b/MediaBrowser.Model/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Resources; -// General Information about an assembly is controlled through the following +// 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("MediaBrowser.Model")] @@ -17,7 +17,7 @@ using System.Resources; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // \ No newline at end of file diff --git a/MediaBrowser.Model/Providers/RemoteImageInfo.cs b/MediaBrowser.Model/Providers/RemoteImageInfo.cs index 6db7f77bdb..90c1ba0af2 100644 --- a/MediaBrowser.Model/Providers/RemoteImageInfo.cs +++ b/MediaBrowser.Model/Providers/RemoteImageInfo.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Model.Providers /// Gets a url used for previewing a smaller version /// public string ThumbnailUrl { get; set; } - + /// /// Gets or sets the height. /// diff --git a/MediaBrowser.Model/Querying/AllThemeMediaResult.cs b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs index 89640eb65b..57114cc4af 100644 --- a/MediaBrowser.Model/Querying/AllThemeMediaResult.cs +++ b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs @@ -7,7 +7,7 @@ public ThemeMediaResult ThemeSongsResult { get; set; } public ThemeMediaResult SoundtrackSongsResult { get; set; } - + public AllThemeMediaResult() { ThemeVideosResult = new ThemeMediaResult(); diff --git a/MediaBrowser.Model/Querying/EpisodeQuery.cs b/MediaBrowser.Model/Querying/EpisodeQuery.cs index 78fe943e33..cae87b852c 100644 --- a/MediaBrowser.Model/Querying/EpisodeQuery.cs +++ b/MediaBrowser.Model/Querying/EpisodeQuery.cs @@ -53,7 +53,7 @@ namespace MediaBrowser.Model.Querying /// /// The start item identifier. public string StartItemId { get; set; } - + public EpisodeQuery() { Fields = new ItemFields[] { }; diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 92fa3822b6..ceccf5ee5d 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -41,7 +41,7 @@ /// The custom rating /// CustomRating, - + /// /// The date created of the item /// diff --git a/MediaBrowser.Model/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs index d20ff99c2c..2af8738d7b 100644 --- a/MediaBrowser.Model/Querying/NextUpQuery.cs +++ b/MediaBrowser.Model/Querying/NextUpQuery.cs @@ -16,13 +16,13 @@ namespace MediaBrowser.Model.Querying /// /// The parent identifier. public string ParentId { get; set; } - + /// /// Gets or sets the series id. /// /// The series id. public string SeriesId { get; set; } - + /// /// Skips over a given number of items within the results. Use for paging. /// diff --git a/MediaBrowser.Model/Search/SearchHint.cs b/MediaBrowser.Model/Search/SearchHint.cs index daa3566cfc..48da8e4bc5 100644 --- a/MediaBrowser.Model/Search/SearchHint.cs +++ b/MediaBrowser.Model/Search/SearchHint.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Search public Guid ItemId { get; set; } public Guid Id { get; set; } - + /// /// Gets or sets the name. /// @@ -26,7 +26,7 @@ namespace MediaBrowser.Model.Search /// /// The matched term. public string MatchedTerm { get; set; } - + /// /// Gets or sets the index number. /// @@ -38,7 +38,7 @@ namespace MediaBrowser.Model.Search /// /// The production year. public int? ProductionYear { get; set; } - + /// /// Gets or sets the parent index number. /// @@ -74,7 +74,7 @@ namespace MediaBrowser.Model.Search /// /// The backdrop image item identifier. public string BackdropImageItemId { get; set; } - + /// /// Gets or sets the type. /// @@ -82,13 +82,13 @@ namespace MediaBrowser.Model.Search public string Type { get; set; } public bool? IsFolder { get; set; } - + /// /// Gets or sets the run time ticks. /// /// The run time ticks. public long? RunTimeTicks { get; set; } - + /// /// Gets or sets the type of the media. /// diff --git a/MediaBrowser.Model/Serialization/IXmlSerializer.cs b/MediaBrowser.Model/Serialization/IXmlSerializer.cs index b26b673f3e..eb23d784fe 100644 --- a/MediaBrowser.Model/Serialization/IXmlSerializer.cs +++ b/MediaBrowser.Model/Serialization/IXmlSerializer.cs @@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Serialization /// The file. /// System.Object. object DeserializeFromFile(Type type, string file); - + /// /// Deserializes from bytes. /// diff --git a/MediaBrowser.Model/Services/ApiMemberAttribute.cs b/MediaBrowser.Model/Services/ApiMemberAttribute.cs index 4a28317757..9e5faad29f 100644 --- a/MediaBrowser.Model/Services/ApiMemberAttribute.cs +++ b/MediaBrowser.Model/Services/ApiMemberAttribute.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Model.Services public string ParameterType { get; set; } /// - /// Gets or sets unique name for the parameter. Each name must be unique, even if they are associated with different paramType values. + /// Gets or sets unique name for the parameter. Each name must be unique, even if they are associated with different paramType values. /// /// /// @@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Services public bool AllowMultiple { get; set; } /// - /// Gets or sets route to which applies attribute, matches using StartsWith. By default applies to all routes. + /// Gets or sets route to which applies attribute, matches using StartsWith. By default applies to all routes. /// public string Route { get; set; } diff --git a/MediaBrowser.Model/Services/IHasRequestFilter.cs b/MediaBrowser.Model/Services/IHasRequestFilter.cs index 2164179d50..90cfc2a310 100644 --- a/MediaBrowser.Model/Services/IHasRequestFilter.cs +++ b/MediaBrowser.Model/Services/IHasRequestFilter.cs @@ -4,7 +4,7 @@ namespace MediaBrowser.Model.Services public interface IHasRequestFilter { /// - /// Order in which Request Filters are executed. + /// Order in which Request Filters are executed. /// <0 Executed before global request filters /// >0 Executed after global request filters /// diff --git a/MediaBrowser.Model/Services/IHttpResponse.cs b/MediaBrowser.Model/Services/IHttpResponse.cs index cd9c07d46a..9d77eefc98 100644 --- a/MediaBrowser.Model/Services/IHttpResponse.cs +++ b/MediaBrowser.Model/Services/IHttpResponse.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Model.Services void SetCookie(Cookie cookie); /// - /// Removes all pending Set-Cookie instructions + /// Removes all pending Set-Cookie instructions /// void ClearCookies(); } diff --git a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs index ce6b2875ea..dfdd42c363 100644 --- a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs @@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Session /// /// The item identifier. public Guid ItemId { get; set; } - + /// /// Gets or sets the session id. /// diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs index a63ce5e66c..5d019932ad 100644 --- a/MediaBrowser.Model/System/SystemInfo.cs +++ b/MediaBrowser.Model/System/SystemInfo.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Model.System public string OperatingSystemDisplayName { get; set; } public string PackageName { get; set; } - + /// /// Gets or sets a value indicating whether this instance has pending restart. /// diff --git a/MediaBrowser.Model/Tasks/ITaskManager.cs b/MediaBrowser.Model/Tasks/ITaskManager.cs index cbc18032c1..dd29cdb650 100644 --- a/MediaBrowser.Model/Tasks/ITaskManager.cs +++ b/MediaBrowser.Model/Tasks/ITaskManager.cs @@ -52,7 +52,7 @@ namespace MediaBrowser.Model.Tasks void QueueIfNotRunning() where T : IScheduledTask; - + /// /// Queues the scheduled task. /// @@ -69,7 +69,7 @@ namespace MediaBrowser.Model.Tasks void Execute() where T : IScheduledTask; - + event EventHandler> TaskExecuting; event EventHandler TaskCompleted; diff --git a/MediaBrowser.Model/Tasks/TaskResult.cs b/MediaBrowser.Model/Tasks/TaskResult.cs index 39eacdf664..9cc45a16b2 100644 --- a/MediaBrowser.Model/Tasks/TaskResult.cs +++ b/MediaBrowser.Model/Tasks/TaskResult.cs @@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Tasks /// /// The key. public string Key { get; set; } - + /// /// Gets or sets the id. /// diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs index e46d59fc07..464ea295d5 100644 --- a/MediaBrowser.Model/Updates/PackageInfo.cs +++ b/MediaBrowser.Model/Updates/PackageInfo.cs @@ -164,7 +164,7 @@ namespace MediaBrowser.Model.Updates /// /// The installs. public int installs { get; set; } - + /// /// Initializes a new instance of the class. /// diff --git a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs index 7298972904..79b9aaf988 100644 --- a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs +++ b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs @@ -42,7 +42,7 @@ namespace MediaBrowser.Providers.BoxSets { return new List { - ImageType.Primary, + ImageType.Primary, ImageType.Backdrop }; } diff --git a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs index d58aa336b0..eacc983d58 100644 --- a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs +++ b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.BoxSets } private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - + public async Task> GetSearchResults(BoxSetInfo searchInfo, CancellationToken cancellationToken) { var tmdbId = searchInfo.GetProviderId(MetadataProviders.Tmdb); @@ -73,7 +73,7 @@ namespace MediaBrowser.Providers.BoxSets Name = info.name, SearchProviderName = Name, - + ImageUrl = images.Count == 0 ? null : (tmdbImageUrl + images[0].file_path) }; diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs index 0e6c073577..fa080397b5 100644 --- a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs +++ b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs @@ -303,7 +303,7 @@ namespace Priority_Queue } /// - /// This method must be called on a node every time its priority changes while it is in the queue. + /// This method must be called on a node every time its priority changes while it is in the queue. /// Forgetting to call this method will result in a corrupted queue! /// Calling this method on a node not in the queue results in undefined behavior /// O(log n) @@ -344,7 +344,7 @@ namespace Priority_Queue } /// - /// Removes a node from the queue. The node does not need to be the head of the queue. + /// Removes a node from the queue. The node does not need to be the head of the queue. /// If the node is not in the queue, the result is undefined. If unsure, check Contains() first /// O(log n) /// diff --git a/MediaBrowser.Providers/Manager/IPriorityQueue.cs b/MediaBrowser.Providers/Manager/IPriorityQueue.cs index 23f08a13e2..efc9fc2efb 100644 --- a/MediaBrowser.Providers/Manager/IPriorityQueue.cs +++ b/MediaBrowser.Providers/Manager/IPriorityQueue.cs @@ -36,12 +36,12 @@ namespace Priority_Queue bool Contains(TItem node); /// - /// Removes a node from the queue. The node does not need to be the head of the queue. + /// Removes a node from the queue. The node does not need to be the head of the queue. /// void Remove(TItem node); /// - /// Call this method to change the priority of a node. + /// Call this method to change the priority of a node. /// void UpdatePriority(TItem node, TPriority priority); diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.cs index 6790f9b331..047c590285 100644 --- a/MediaBrowser.Providers/Manager/ImageSaver.cs +++ b/MediaBrowser.Providers/Manager/ImageSaver.cs @@ -174,7 +174,7 @@ namespace MediaBrowser.Providers.Manager } catch (FileNotFoundException) { - + } finally { diff --git a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs b/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs index 879ae1dca4..36f2605fad 100644 --- a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs +++ b/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs @@ -167,9 +167,9 @@ namespace Priority_Queue } /// - /// Removes an item from the queue. The item does not need to be the head of the queue. + /// Removes an item from the queue. The item does not need to be the head of the queue. /// If the item is not in the queue, an exception is thrown. If unsure, check Contains() first. - /// If multiple copies of the item are enqueued, only the first one is removed. + /// If multiple copies of the item are enqueued, only the first one is removed. /// O(n) /// public void Remove(TItem item) diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs index 81abedeb95..02fb50ae98 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs @@ -210,8 +210,8 @@ namespace MediaBrowser.Providers.MediaInfo public IEnumerable GetDefaultTriggers() { - return new[] { - + return new[] { + // Every so often new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks} }; diff --git a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs index 1fce01903f..039f2efaf5 100644 --- a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs +++ b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Providers.Movies var tmdbId = itemId.GetProviderId(MetadataProviders.Tmdb); var imdbId = itemId.GetProviderId(MetadataProviders.Imdb); - // Don't search for music video id's because it is very easy to misidentify. + // Don't search for music video id's because it is very easy to misidentify. if (string.IsNullOrEmpty(tmdbId) && string.IsNullOrEmpty(imdbId) && typeof(T) != typeof(MusicVideo)) { var searchResults = await new MovieDbSearch(_logger, _jsonSerializer, _libraryManager).GetMovieSearchResults(itemId, cancellationToken).ConfigureAwait(false); diff --git a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs index ad45c8432b..ae466c47e7 100644 --- a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs @@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.Movies { return new List { - ImageType.Primary, + ImageType.Primary, ImageType.Backdrop }; } diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.cs index ae81545a6b..a035dd7580 100644 --- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs +++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs @@ -79,7 +79,7 @@ namespace MediaBrowser.Providers.Music private ItemUpdateType SetAlbumArtistFromSongs(MusicAlbum item, IEnumerable public string MovieHash { get { return movieHash; } set { movieHash = value; } } /// - /// Size of video file in bytes + /// Size of video file in bytes /// public long MovieByteSize { get { return movieByteSize; } set { movieByteSize = value; } } /// diff --git a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs b/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs index 06fc945a8e..1efa3dd5ba 100644 --- a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs +++ b/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs @@ -250,7 +250,7 @@ namespace XmlRpcHandler } return reader.ReadContentAsString(); } - + private static IXmlRpcValue ReadValue(XmlReader xmlReader, bool skipRead = false) { while (skipRead || xmlReader.Read()) diff --git a/RSSDP/Properties/AssemblyInfo.cs b/RSSDP/Properties/AssemblyInfo.cs index 1ce64b159d..f0584fa1a5 100644 --- a/RSSDP/Properties/AssemblyInfo.cs +++ b/RSSDP/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("RSSDP2")] @@ -19,11 +19,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.cs index 32289822f9..c7daf359d4 100644 --- a/RSSDP/SsdpDeviceLocator.cs +++ b/RSSDP/SsdpDeviceLocator.cs @@ -53,7 +53,7 @@ namespace Rssdp.Infrastructure #region Events /// - /// Raised for when + /// Raised for when /// /// An 'alive' notification is received that a device, regardless of whether or not that device is not already in the cache or has previously raised this event. /// For each item found during a device (cached or not), allowing clients to respond to found devices before the entire search is complete. diff --git a/SocketHttpListener/Net/ChunkedInputStream.cs b/SocketHttpListener/Net/ChunkedInputStream.cs index c3bbff82d0..4d6d96a6cb 100644 --- a/SocketHttpListener/Net/ChunkedInputStream.cs +++ b/SocketHttpListener/Net/ChunkedInputStream.cs @@ -23,10 +23,10 @@ namespace SocketHttpListener.Net // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: - // + // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. - // + // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/SocketHttpListener/Net/HttpEndPointListener.cs b/SocketHttpListener/Net/HttpEndPointListener.cs index fb093314c8..35f60a9fb8 100644 --- a/SocketHttpListener/Net/HttpEndPointListener.cs +++ b/SocketHttpListener/Net/HttpEndPointListener.cs @@ -177,9 +177,9 @@ namespace SocketHttpListener.Net } } - // This method is the callback method associated with Socket.AcceptAsync - // operations and is invoked when an accept operation is complete - // + // This method is the callback method associated with Socket.AcceptAsync + // operations and is invoked when an accept operation is complete + // private static void OnAccept(object sender, SocketAsyncEventArgs e) { ProcessAccept(e); diff --git a/SocketHttpListener/Net/HttpListener.cs b/SocketHttpListener/Net/HttpListener.cs index 941b99f35e..4c4832336d 100644 --- a/SocketHttpListener/Net/HttpListener.cs +++ b/SocketHttpListener/Net/HttpListener.cs @@ -35,7 +35,7 @@ namespace SocketHttpListener.Net bool listening; bool disposed; - Dictionary registry; // Dictionary + Dictionary registry; // Dictionary Dictionary connections; private ILogger _logger; private X509Certificate _certificate; diff --git a/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs b/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs index 34b5eaf74b..63790d7962 100644 --- a/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs +++ b/SocketHttpListener/Net/HttpListenerRequestUriBuilder.cs @@ -28,11 +28,11 @@ namespace SocketHttpListener.Net // The raw path is parsed by looping through all characters from left to right. 'rawOctets' // is used to store consecutive percent encoded octets as actual byte values: e.g. for path /pa%C3%84th%2F/ // rawOctets will be set to { 0xC3, 0x84 } when we reach character 't' and it will be { 0x2F } when - // we reach the final '/'. I.e. after a sequence of percent encoded octets ends, we use rawOctets as + // we reach the final '/'. I.e. after a sequence of percent encoded octets ends, we use rawOctets as // input to the encoding and percent encode the resulting string into UTF-8 octets. // // When parsing ANSI (Latin 1) encoded path '/pa%C4th/', %C4 will be added to rawOctets and when - // we reach 't', the content of rawOctets { 0xC4 } will be fed into the ANSI encoding. The resulting + // we reach 't', the content of rawOctets { 0xC4 } will be fed into the ANSI encoding. The resulting // string 'Ä' will be percent encoded into UTF-8 octets and appended to requestUriString. The final // path will be '/pa%C3%84th/', where '%C3%84' is the UTF-8 percent encoded character 'Ä'. private List _rawOctets; @@ -146,7 +146,7 @@ namespace SocketHttpListener.Net if (!Uri.TryCreate(_requestUriString.ToString(), UriKind.Absolute, out _requestUri)) { - // If we can't create a Uri from the string, this is an invalid string and it doesn't make + // If we can't create a Uri from the string, this is an invalid string and it doesn't make // sense to try another encoding. result = ParsingResult.InvalidString; } @@ -196,7 +196,7 @@ namespace SocketHttpListener.Net } else { - // We found '%', but not followed by 'u', i.e. we have a percent encoded octed: %XX + // We found '%', but not followed by 'u', i.e. we have a percent encoded octed: %XX if (!AddPercentEncodedOctetToRawOctetsList(encoding, _rawPath.Substring(index, 2))) { return ParsingResult.InvalidString; @@ -207,7 +207,7 @@ namespace SocketHttpListener.Net else { // We found a non-'%' character: decode the content of rawOctets into percent encoded - // UTF-8 characters and append it to the result. + // UTF-8 characters and append it to the result. if (!EmptyDecodeAndAppendRawOctetsList(encoding)) { return ParsingResult.EncodingError; @@ -402,7 +402,7 @@ namespace SocketHttpListener.Net // Find end of path: The path is terminated by // - the first '?' character - // - the first '#' character: This is never the case here, since http.sys won't accept + // - the first '#' character: This is never the case here, since http.sys won't accept // Uris containing fragments. Also, RFC2616 doesn't allow fragments in request Uris. // - end of Uri string int queryIndex = uriString.IndexOf('?'); diff --git a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs b/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs index 9dc9143f84..1649050d9e 100644 --- a/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs +++ b/SocketHttpListener/Net/WebSockets/HttpWebSocket.cs @@ -30,7 +30,7 @@ namespace SocketHttpListener.Net.WebSockets return retVal; } - // return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server. + // return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server. internal static bool ProcessWebSocketProtocolHeader(string clientSecWebSocketProtocol, string subProtocol, out string acceptProtocol) @@ -44,7 +44,7 @@ namespace SocketHttpListener.Net.WebSockets // If the server specified _anything_ this isn't valid. throw new WebSocketException("UnsupportedProtocol"); } - // Treat empty and null from the server as the same thing here, server should not send headers. + // Treat empty and null from the server as the same thing here, server should not send headers. return false; } @@ -52,7 +52,7 @@ namespace SocketHttpListener.Net.WebSockets if (subProtocol == null) { - // client specified some protocols, server specified 'null'. So server should send headers. + // client specified some protocols, server specified 'null'. So server should send headers. return true; } @@ -63,8 +63,8 @@ namespace SocketHttpListener.Net.WebSockets StringSplitOptions.RemoveEmptyEntries); acceptProtocol = subProtocol; - // client specified protocols, serverOptions has exactly 1 non-empty entry. Check that - // this exists in the list the client specified. + // client specified protocols, serverOptions has exactly 1 non-empty entry. Check that + // this exists in the list the client specified. for (int i = 0; i < requestProtocols.Length; i++) { string currentRequestProtocol = requestProtocols[i].Trim(); diff --git a/SocketHttpListener/Net/WebSockets/WebSocketCloseStatus.cs b/SocketHttpListener/Net/WebSockets/WebSocketCloseStatus.cs index 0f43b7b800..b83b6cd0f7 100644 --- a/SocketHttpListener/Net/WebSockets/WebSocketCloseStatus.cs +++ b/SocketHttpListener/Net/WebSockets/WebSocketCloseStatus.cs @@ -22,9 +22,9 @@ namespace SocketHttpListener.Net.WebSockets // 0 - 999 Status codes in the range 0-999 are not used. // 1000 - 1999 Status codes in the range 1000-1999 are reserved for definition by this protocol. // 2000 - 2999 Status codes in the range 2000-2999 are reserved for use by extensions. - // 3000 - 3999 Status codes in the range 3000-3999 MAY be used by libraries and frameworks. The - // interpretation of these codes is undefined by this protocol. End applications MUST - // NOT use status codes in this range. + // 3000 - 3999 Status codes in the range 3000-3999 MAY be used by libraries and frameworks. The + // interpretation of these codes is undefined by this protocol. End applications MUST + // NOT use status codes in this range. // 4000 - 4999 Status codes in the range 4000-4999 MAY be used by application code. The interpretation // of these codes is undefined by this protocol. } diff --git a/SocketHttpListener/Properties/AssemblyInfo.cs b/SocketHttpListener/Properties/AssemblyInfo.cs index 8876cea4fe..4151e83e34 100644 --- a/SocketHttpListener/Properties/AssemblyInfo.cs +++ b/SocketHttpListener/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("SocketHttpListener")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// 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 +// 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)] @@ -25,10 +25,10 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.*")] From f9e52fed81feb21fb89d5dcdad99fc3c6db6800d Mon Sep 17 00:00:00 2001 From: LeoVerto Date: Tue, 8 Jan 2019 03:26:05 +0000 Subject: [PATCH 038/140] Fix CONTRIBUTORS.md formatting --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6517b63cd4..80c1723091 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,7 +10,7 @@ - [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) # Emby Contributors From f520ddc9662ec65538374d40f516c5fe6c67bb16 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 8 Jan 2019 17:29:34 +0100 Subject: [PATCH 039/140] Remove useless properties from IEnvironmentInfo --- .../IsoMounter/LinuxIsoManager.cs | 56 +++++++++---------- .../ApplicationHost.cs | 25 ++++----- .../EnvironmentInfo/EnvironmentInfo.cs | 25 --------- .../Encoder/MediaEncoder.cs | 45 ++------------- MediaBrowser.Model/System/IEnvironmentInfo.cs | 4 -- 5 files changed, 45 insertions(+), 110 deletions(-) diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs index faaed482a0..d82d2f2fb8 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs @@ -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( @@ -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) @@ -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))) { return FileSystem.GetFullPath(path); } - } - return String.Empty; - + return string.Empty; } private uint GetUID() @@ -315,9 +315,9 @@ namespace IsoMounter ); } else { - + throw new ArgumentNullException(nameof(isoPath)); - + } try @@ -397,9 +397,9 @@ namespace IsoMounter ); } else { - + throw new ArgumentNullException(nameof(mount)); - + } if (GetUID() == 0) { @@ -444,7 +444,7 @@ namespace IsoMounter } #endregion - + #region Internal Methods internal void OnUnmount(LinuxMount mount) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index fb053f0e4a..b020b33c31 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1188,8 +1188,7 @@ namespace Emby.Server.Implementations HttpClient, ZipClient, ProcessFactory, - 5000, - EnvironmentInfo); + 5000); MediaEncoder = mediaEncoder; RegisterSingleInstance(MediaEncoder); @@ -1647,25 +1646,25 @@ namespace Emby.Server.Implementations // Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that // This will prevent the .dll file from getting locked, and allow us to replace it when needed - // Include composable parts in the Api assembly + // Include composable parts in the Api assembly list.Add(GetAssembly(typeof(ApiEntryPoint))); - // Include composable parts in the Dashboard assembly + // Include composable parts in the Dashboard assembly list.Add(GetAssembly(typeof(DashboardService))); - // Include composable parts in the Model assembly + // Include composable parts in the Model assembly list.Add(GetAssembly(typeof(SystemInfo))); - // Include composable parts in the Common assembly + // Include composable parts in the Common assembly list.Add(GetAssembly(typeof(IApplicationHost))); - // Include composable parts in the Controller assembly + // Include composable parts in the Controller assembly list.Add(GetAssembly(typeof(IServerApplicationHost))); - // Include composable parts in the Providers assembly + // Include composable parts in the Providers assembly list.Add(GetAssembly(typeof(ProviderUtils))); - // Include composable parts in the Photos assembly + // Include composable parts in the Photos assembly list.Add(GetAssembly(typeof(PhotoProvider))); // Emby.Server implementations @@ -1674,16 +1673,16 @@ namespace Emby.Server.Implementations // MediaEncoding list.Add(GetAssembly(typeof(MediaBrowser.MediaEncoding.Encoder.MediaEncoder))); - // Dlna + // Dlna list.Add(GetAssembly(typeof(DlnaEntryPoint))); - // Local metadata + // Local metadata list.Add(GetAssembly(typeof(BoxSetXmlSaver))); // Notifications list.Add(GetAssembly(typeof(NotificationManager))); - // Xbmc + // Xbmc list.Add(GetAssembly(typeof(ArtistNfoProvider))); list.AddRange(GetAssembliesWithPartsInternal().Select(i => new Tuple(i, null))); @@ -2219,7 +2218,7 @@ namespace Emby.Server.Implementations } /// - /// This returns localhost in the case of no external dns, and the hostname if the + /// This returns localhost in the case of no external dns, and the hostname if the /// dns is prefixed with a valid Uri prefix. /// /// The external dns prefix to get the hostname of. diff --git a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs index 03e10e7ea3..655867577b 100644 --- a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs +++ b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs @@ -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) @@ -39,29 +37,6 @@ namespace Emby.Server.Implementations.EnvironmentInfo } } - 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); - } } } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index a93dd97421..a137955488 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -70,7 +70,6 @@ namespace MediaBrowser.MediaEncoding.Encoder private readonly string _originalFFMpegPath; private readonly string _originalFFProbePath; private readonly int DefaultImageExtractionTimeoutMs; - private readonly IEnvironmentInfo _environmentInfo; public MediaEncoder(ILogger logger, IJsonSerializer jsonSerializer, @@ -89,8 +88,7 @@ namespace MediaBrowser.MediaEncoding.Encoder IHttpClient httpClient, IZipClient zipClient, IProcessFactory processFactory, - int defaultImageExtractionTimeoutMs, - IEnvironmentInfo environmentInfo) + int defaultImageExtractionTimeoutMs) { _logger = logger; _jsonSerializer = jsonSerializer; @@ -107,46 +105,13 @@ namespace MediaBrowser.MediaEncoding.Encoder _zipClient = zipClient; _processFactory = processFactory; DefaultImageExtractionTimeoutMs = defaultImageExtractionTimeoutMs; - _environmentInfo = environmentInfo; FFProbePath = ffProbePath; FFMpegPath = ffMpegPath; _originalFFProbePath = ffProbePath; _originalFFMpegPath = ffMpegPath; - _hasExternalEncoder = hasExternalEncoder; } - private readonly object _logLock = new object(); - public void SetLogFilename(string name) - { - lock (_logLock) - { - try - { - _environmentInfo.SetProcessEnvironmentVariable("FFREPORT", "file=" + name + ":level=32"); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error setting FFREPORT environment variable"); - } - } - } - - public void ClearLogFilename() - { - lock (_logLock) - { - try - { - _environmentInfo.SetProcessEnvironmentVariable("FFREPORT", null); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error setting FFREPORT environment variable"); - } - } - } - public string EncoderLocationType { get @@ -362,7 +327,7 @@ namespace MediaBrowser.MediaEncoding.Encoder private Tuple GetPathsFromDirectory(string path) { - // Since we can't predict the file extension, first try directly within the folder + // Since we can't predict the file extension, first try directly within the folder // If that doesn't pan out, then do a recursive search var files = FileSystem.GetFilePaths(path); @@ -525,7 +490,7 @@ namespace MediaBrowser.MediaEncoding.Encoder CreateNoWindow = true, UseShellExecute = false, - // Must consume both or ffmpeg may hang due to deadlocks. See comments below. + // Must consume both or ffmpeg may hang due to deadlocks. See comments below. RedirectStandardOutput = true, FileName = FFProbePath, Arguments = string.Format(args, probeSizeArgument, inputPath).Trim(), @@ -648,7 +613,7 @@ namespace MediaBrowser.MediaEncoding.Encoder var tempExtractPath = Path.Combine(ConfigurationManager.ApplicationPaths.TempDirectory, Guid.NewGuid() + ".jpg"); FileSystem.CreateDirectory(FileSystem.GetDirectoryName(tempExtractPath)); - // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600. + // apply some filters to thumbnail extracted below (below) crop any black lines that we made and get the correct ar then scale to width 600. // This filter chain may have adverse effects on recorded tv thumbnails if ar changes during presentation ex. commercials @ diff ar var vf = "scale=600:trunc(600/dar/2)*2"; @@ -676,7 +641,7 @@ namespace MediaBrowser.MediaEncoding.Encoder break; } } - + var mapArg = imageStreamIndex.HasValue ? (" -map 0:v:" + imageStreamIndex.Value.ToString(CultureInfo.InvariantCulture)) : string.Empty; var enableThumbnail = !new List { "wtv" }.Contains(container ?? string.Empty, StringComparer.OrdinalIgnoreCase); diff --git a/MediaBrowser.Model/System/IEnvironmentInfo.cs b/MediaBrowser.Model/System/IEnvironmentInfo.cs index 6af514dc8e..faf9f0a422 100644 --- a/MediaBrowser.Model/System/IEnvironmentInfo.cs +++ b/MediaBrowser.Model/System/IEnvironmentInfo.cs @@ -8,10 +8,6 @@ namespace MediaBrowser.Model.System string OperatingSystemName { get; } string OperatingSystemVersion { get; } Architecture SystemArchitecture { get; } - string GetEnvironmentVariable(string name); - void SetProcessEnvironmentVariable(string name, string value); - string StackTrace { get; } - char PathSeparator { get; } } public enum OperatingSystem From 7f4a073b05ac9c4ce4ef6d499cd5bfba40f72415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Tue, 8 Jan 2019 18:56:55 +0100 Subject: [PATCH 040/140] Add %post script to move exitsting config to /etc/jellyfin and symlink it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.spec | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index c55d1d2605..f6585a3d34 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -95,7 +95,7 @@ EOF %attr(755,root,root) %{_libexecdir}/%{name}/restart.sh %attr(644,root,root) %{_prefix}/lib/firewalld/service/%{name}.xml %attr(755,jellyfin,jellyfin) %dir %{_sysconfdir}/%{name} -%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %attr(600,root,root) %{_sysconfdir}/sudoers.d/%{name}-sudoers %config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %config(noreplace) %attr(644,jellyfin,jellyfin) %{_sysconfdir}/%{name}/logging.json @@ -115,6 +115,21 @@ getent passwd jellyfin >/dev/null || \ exit 0 %post +# Move existing configuration to /etc/jellyfin and symlink config to /etc/jellyfin +if [ $1 -gt 1 ] ; then + if [ ! -L %{_sharedstatedir}/%{name}/config ]; then + service_state=$(systemctl is-active jellyfin.service) + if [ "${service_state}" = "active" ]; then + systemctl stop jellyfin.service + fi + mv %{_sharedstatedir}/%{name}/config/* %{_sysconfdir}/%{name}/ + rmdir %{_sharedstatedir}/%{name}/config + ln -sf %{_sysconfdir}/%{name} %{_sharedstatedir}/%{name}/config + if [ "${service_state}" = "active" ]; then + systemctl start jellyfin.service + fi + fi +fi %systemd_post jellyfin.service %preun @@ -127,6 +142,7 @@ exit 0 * Mon Jan 07 2019 Thomas Büttner - 10.0.0-1 - Bump version to 10.0.0 - Add logging and config directories +- Add %post script to move exitsting config to /etc/jellyfin and symlink it. * Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 - Add firewalld service.xml From ad36f9ec8951de61a605ceb247296a884e81f6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Tue, 8 Jan 2019 19:04:52 +0100 Subject: [PATCH 041/140] Add rpm build script for fedora and update README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/Dockerfile.fedora_package | 17 +++++++++++++++++ rpm-package/README.md | 16 ++++++++++------ rpm-package/build-fedora-rpm.sh | 24 ++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 rpm-package/Dockerfile.fedora_package create mode 100755 rpm-package/build-fedora-rpm.sh diff --git a/rpm-package/Dockerfile.fedora_package b/rpm-package/Dockerfile.fedora_package new file mode 100644 index 0000000000..35650106d1 --- /dev/null +++ b/rpm-package/Dockerfile.fedora_package @@ -0,0 +1,17 @@ +FROM fedora:29 +ARG HOME=/build +RUN mkdir /build && \ + dnf install -y @buildsys-build rpmdevtools dnf-plugins-core && \ + dnf copr enable -y @dotnet-sig/dotnet && \ + rpmdev-setuptree + +WORKDIR /build/rpmbuild +COPY jellyfin.spec SPECS +COPY . SOURCES + +RUN spectool -g -R SPECS/jellyfin.spec && \ + rpmbuild -bs SPECS/jellyfin.spec && \ + dnf build-dep -y SRPMS/jellyfin-*.src.rpm && \ + rpmbuild -bb SPECS/jellyfin.spec && \ + mkdir /jellyfin && \ + find . -name 'jellyfin-*.rpm' -print -exec cp {} /jellyfin \; \ No newline at end of file diff --git a/rpm-package/README.md b/rpm-package/README.md index 84aded8c6a..5944f9e9b0 100644 --- a/rpm-package/README.md +++ b/rpm-package/README.md @@ -1,29 +1,33 @@ -# unoffical jellyfin RPM +# Jellyfin RPM - +## Build Fedora Package with docker + +Change into this directory `cd rpm-package` +Run the build script `./build-fedora-rpm.sh`. +Resulting RPM and src.rpm will be in `../../jellyfin-*.rpm` ## ffmpeg -The RPM package for Fedora/CentOS requires some additional repos as ffmpeg is not in the main repositories. +The RPM package for Fedora/CentOS requires some additional repositories as ffmpeg is not in the main repositories. ```shell # ffmpeg from RPMfusion free # Fedora $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -# CentOS 7 +# CentOS 7 $ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm ``` ## ISO mounting -To allow jellyfin to mount/umonut ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` +To allow Jellyfin to mount/umonut ISO files uncomment these two lines in `/etc/sudoers.d/jellyfin-sudoers` ``` # %jellyfin ALL=(ALL) NOPASSWD: /bin/mount # %jellyfin ALL=(ALL) NOPASSWD: /bin/umount ``` - ## Database patching + You may need to install sqlite since CentOS has no `Recommends:` with `yum install sqlite`. To fix the paths in the emby database for a migration to jellyfin run the script: ```shell diff --git a/rpm-package/build-fedora-rpm.sh b/rpm-package/build-fedora-rpm.sh new file mode 100755 index 0000000000..87c94e0812 --- /dev/null +++ b/rpm-package/build-fedora-rpm.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +# Build a Jellyfin .rpm file with Docker on Linux +# Places the output .rpm file in the parent directory + +set -o errexit +set -o xtrace +set -o nounset + +package_temporary_dir="`mktemp -d`" +current_user="`whoami`" +image_name="jellyfin-rpmbuild" + +cleanup() { + set +o errexit + docker image rm $image_name --force + rm -rf "$package_temporary_dir" +} +trap cleanup EXIT INT + +docker build . -t "$image_name" -f ./Dockerfile.fedora_package +docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /jellyfin /temp/ +sudo chown -R "$current_user" "$package_temporary_dir" +mv "$package_temporary_dir"/jellyfin/*.rpm ../../ From 4e7f4754917a2ec5814cbd495532e4765e165773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Tue, 8 Jan 2019 19:44:51 +0100 Subject: [PATCH 042/140] Also symlink logs to /var/log, changed changelog to lastest entry of the debian package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- rpm-package/jellyfin.spec | 45 ++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/rpm-package/jellyfin.spec b/rpm-package/jellyfin.spec index f6585a3d34..315a542e39 100644 --- a/rpm-package/jellyfin.spec +++ b/rpm-package/jellyfin.spec @@ -117,17 +117,22 @@ exit 0 %post # Move existing configuration to /etc/jellyfin and symlink config to /etc/jellyfin if [ $1 -gt 1 ] ; then + service_state=$(systemctl is-active jellyfin.service) + if [ "${service_state}" = "active" ]; then + systemctl stop jellyfin.service + fi if [ ! -L %{_sharedstatedir}/%{name}/config ]; then - service_state=$(systemctl is-active jellyfin.service) - if [ "${service_state}" = "active" ]; then - systemctl stop jellyfin.service - fi mv %{_sharedstatedir}/%{name}/config/* %{_sysconfdir}/%{name}/ rmdir %{_sharedstatedir}/%{name}/config ln -sf %{_sysconfdir}/%{name} %{_sharedstatedir}/%{name}/config - if [ "${service_state}" = "active" ]; then - systemctl start jellyfin.service - fi + fi + if [ ! -L %{_sharedstatedir}/%{name}/logs ]; then + mv %{_sharedstatedir}/%{name}/logs/* %{_var}/log/jellyfin + rmdir %{_sharedstatedir}/%{name}/logs + ln -sf %{_var}/log/jellyfin %{_sharedstatedir}/%{name}/logs + fi + if [ "${service_state}" = "active" ]; then + systemctl start jellyfin.service fi fi %systemd_post jellyfin.service @@ -139,23 +144,9 @@ fi %systemd_postun_with_restart jellyfin.service %changelog -* Mon Jan 07 2019 Thomas Büttner - 10.0.0-1 -- Bump version to 10.0.0 -- Add logging and config directories -- Add %post script to move exitsting config to /etc/jellyfin and symlink it. - -* Sat Jan 05 2019 Thomas Büttner - 3.5.2-5 -- Add firewalld service.xml - -* Sat Jan 05 2019 Thomas Büttner - 3.5.2-4 -- Re-added sudoers policy - -* Sat Jan 05 2019 Thomas Büttner - 3.5.2-3 -- Added script for database migration - -* Fri Jan 04 2019 Thomas Büttner - 3.5.2-2 -- Moved sudoers policy and added a note for In-App service control -- Set Restart=on-failure in jellyfin.service - -* Thu Jan 03 2019 Thomas Büttner - 3.5.2-1 -- Initial RPM package +* Tue Jan 08 2019 Thomas Büttner - 10.0.0-1 +- The first Jellyfin release under our new versioning scheme +- Numerous bugfixes and code readability improvements +- Updated logging configuration, including flag for it and configdir +- Updated theming including logo +- Dozens of other improvements as documented in GitHub pull request 419 From 432be01934918eb9902e61793a2276aa63c01d9f Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 8 Jan 2019 22:10:11 +0100 Subject: [PATCH 043/140] Fix the DecodeJfif function to get image sizes Added support for progressive DCT-based JPEGs. By adding a check for the SOF2 marker (C2) --- Emby.Drawing/Common/ImageHeader.cs | 31 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs index 7b819c2fd6..f37f396f59 100644 --- a/Emby.Drawing/Common/ImageHeader.cs +++ b/Emby.Drawing/Common/ImageHeader.cs @@ -121,7 +121,7 @@ namespace Emby.Drawing.Common /// /// The binary reader. /// System.Int16. - private static short ReadLittleEndianInt16(BinaryReader binaryReader) + private static short ReadLittleEndianInt16(this BinaryReader binaryReader) { var bytes = new byte[sizeof(short)]; @@ -137,7 +137,7 @@ namespace Emby.Drawing.Common /// /// The binary reader. /// System.Int32. - 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 +205,30 @@ namespace Emby.Drawing.Common /// 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 From f822d1c87192fa5a3590008638e5fa5d9f9b7490 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 8 Jan 2019 20:06:56 -0500 Subject: [PATCH 044/140] Bump version for 10.0.1 --- SharedVersion.cs | 2 +- debian/changelog | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 791d6cac55..0fbf7b9258 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("10.0.0")] +[assembly: AssemblyVersion("10.0.1")] diff --git a/debian/changelog b/debian/changelog index 61223e7253..685d31a5eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +jellyfin (10.0.1-1) unstable; urgency=medium + + * Hotfix release, corrects several small bugs from 10.0.0 + * #512: Fix CONTRIBUTORS.md formatting + * #501: Fix regression in integer divisions in latest movies category + * #498: Change contributing link in settings to readthedocs.io + * #493: Remove unused values.txt resource + * #491: Fix userprofile.js crash + * #519: Fix the DecodeJfif function to get proper image sizes + * #486: Add NuGet package info to plugin projects + + -- Joshua Boniface Tue, 08 Jan 2019 20:06:01 -0500 + jellyfin (10.0.0-1) unstable; urgency=medium * The first Jellyfin release under our new versioning scheme From 9de66e9e874bd6c18b4305687ab0dd364b472c53 Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 9 Jan 2019 23:35:05 +0900 Subject: [PATCH 045/140] add jellyfin-web as submodule --- .gitignore | 1 - .gitmodules | 3 +++ MediaBrowser.Controller/IServerApplicationPaths.cs | 1 - MediaBrowser.WebDashboard/Api/DashboardService.cs | 6 +++--- MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 2 +- MediaBrowser.WebDashboard/jellyfin-web | 1 + 6 files changed, 8 insertions(+), 6 deletions(-) create mode 160000 MediaBrowser.WebDashboard/jellyfin-web diff --git a/.gitignore b/.gitignore index befba5a20e..880e63a7f9 100644 --- a/.gitignore +++ b/.gitignore @@ -234,7 +234,6 @@ pip-log.txt #Mr Developer .mr.developer.cfg -MediaBrowser.WebDashboard/dashboard-ui/.idea/ /.vs ########## diff --git a/.gitmodules b/.gitmodules index 31a58ecf1a..7aeb94dfca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 5fb7968dd9..e97943cbee 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -12,7 +12,6 @@ namespace MediaBrowser.Controller /// /// Gets the application resources path. This is the path to the folder containing resources that are deployed as part of the application - /// For example, this folder contains dashboard-ui and swagger-ui /// /// The application resources path. string ApplicationResourcesPath { get; } diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 58d02ef044..1c57ac27aa 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -138,9 +138,9 @@ namespace MediaBrowser.WebDashboard.Api } /// - /// Gets the dashboard UI path. + /// Gets the path for the web interface. /// - /// The dashboard UI path. + /// The path for the web interface. public string DashboardUIPath { get @@ -150,7 +150,7 @@ namespace MediaBrowser.WebDashboard.Api return _serverConfigurationManager.Configuration.DashboardSourcePath; } - return Path.Combine(_serverConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "dashboard-ui"); + return Path.Combine(_serverConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web/src"); } } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 855b8b627d..c5367ba753 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -10,7 +10,7 @@ - + PreserveNewest diff --git a/MediaBrowser.WebDashboard/jellyfin-web b/MediaBrowser.WebDashboard/jellyfin-web new file mode 160000 index 0000000000..4678528d00 --- /dev/null +++ b/MediaBrowser.WebDashboard/jellyfin-web @@ -0,0 +1 @@ +Subproject commit 4678528d0028685b45c7c6daa2e24b72a363535b From f454b753f2a6e4e63d8f22ab0c354d5fa1c16e26 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Thu, 10 Jan 2019 00:23:44 +0900 Subject: [PATCH 046/140] separate path with comma Co-Authored-By: dkanada --- MediaBrowser.WebDashboard/Api/DashboardService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 1c57ac27aa..38a789580d 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -150,7 +150,7 @@ namespace MediaBrowser.WebDashboard.Api return _serverConfigurationManager.Configuration.DashboardSourcePath; } - return Path.Combine(_serverConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web/src"); + return Path.Combine(_serverConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web", "src"); } } From 909409bb6d3bf90711e981c2340a8710a3675520 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 9 Jan 2019 12:09:40 -0500 Subject: [PATCH 047/140] Update TheMovieDB API key to our own --- MediaBrowser.Providers/Movies/MovieDbProvider.cs | 2 +- MediaBrowser.Providers/Movies/MovieDbSearch.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index 1ebf56e23c..8465634bcf 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.Movies private const string TmdbConfigUrl = BaseMovieDbUrl + "3/configuration?api_key={0}"; private const string GetMovieInfo3 = BaseMovieDbUrl + @"3/movie/{0}?api_key={1}&append_to_response=casts,releases,images,keywords,trailers"; - internal static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669"; + internal static string ApiKey = "4219e299c89411838049ab0dab19ebd5"; internal static string AcceptHeader = "application/json,image/*"; /// diff --git a/MediaBrowser.Providers/Movies/MovieDbSearch.cs b/MediaBrowser.Providers/Movies/MovieDbSearch.cs index b332207e15..f92417b168 100644 --- a/MediaBrowser.Providers/Movies/MovieDbSearch.cs +++ b/MediaBrowser.Providers/Movies/MovieDbSearch.cs @@ -20,7 +20,7 @@ namespace MediaBrowser.Providers.Movies private static readonly CultureInfo EnUs = new CultureInfo("en-US"); private const string Search3 = MovieDbProvider.BaseMovieDbUrl + @"3/search/{3}?api_key={1}&query={0}&language={2}"; - internal static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669"; + internal static string ApiKey = "4219e299c89411838049ab0dab19ebd5"; internal static string AcceptHeader = "application/json,image/*"; private readonly ILogger _logger; From 41da58206ffdb553bbcf6fe503f02021fced5677 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 9 Jan 2019 12:19:10 -0500 Subject: [PATCH 048/140] Update TheAudioDB API key to our own --- MediaBrowser.Providers/Music/AudioDbArtistProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Providers/Music/AudioDbArtistProvider.cs b/MediaBrowser.Providers/Music/AudioDbArtistProvider.cs index e0d193ff16..1769bc1aeb 100644 --- a/MediaBrowser.Providers/Music/AudioDbArtistProvider.cs +++ b/MediaBrowser.Providers/Music/AudioDbArtistProvider.cs @@ -27,7 +27,7 @@ namespace MediaBrowser.Providers.Music public static AudioDbArtistProvider Current; - private const string ApiKey = "49jhsf8248yfahka89724011"; + private const string ApiKey = "195003"; public const string BaseUrl = "https://www.theaudiodb.com/api/v1/json/" + ApiKey; public AudioDbArtistProvider(IServerConfigurationManager config, IFileSystem fileSystem, IHttpClient httpClient, IJsonSerializer json) From 04ab1daa02dc9e26c03e68281f21f00f3aaf3506 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 9 Jan 2019 12:24:16 -0500 Subject: [PATCH 049/140] Update FanArt API key to our own --- MediaBrowser.Providers/Music/FanArtArtistProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs index 99a717ca18..041a2690f8 100644 --- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs @@ -28,7 +28,7 @@ namespace MediaBrowser.Providers.Music { public class FanartArtistProvider : IRemoteImageProvider, IHasOrder { - internal const string ApiKey = "5c6b04c68e904cfed1e6cbc9a9e683d4"; + internal const string ApiKey = "184e1a2b1fe3b94935365411f919f638"; private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3.1/music/{1}?api_key={0}"; private readonly CultureInfo _usCulture = new CultureInfo("en-US"); From 7603b8d0fe73bd6d0ac3d90e3abb117ce3141832 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 9 Jan 2019 12:44:48 -0500 Subject: [PATCH 050/140] Update TheTVDB API key to our own --- MediaBrowser.Controller/Library/TVUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index dc95ba1127..162ebc75e6 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Library /// /// The TVDB API key /// - public static readonly string TvdbApiKey = "B89CE93890E9419B"; + public static readonly string TvdbApiKey = "OG4V3YJ3FAP7FP2K"; public static readonly string TvdbBaseUrl = "https://www.thetvdb.com/"; /// /// The banner URL From 0abe5b6ec381677a6b28288db06a95be28d6d99a Mon Sep 17 00:00:00 2001 From: cvium Date: Thu, 10 Jan 2019 15:30:26 +0100 Subject: [PATCH 051/140] Change ItemId to Guid like all the others --- MediaBrowser.Controller/Providers/RemoteSearchQuery.cs | 4 +++- MediaBrowser.Providers/Manager/ProviderManager.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Controller/Providers/RemoteSearchQuery.cs b/MediaBrowser.Controller/Providers/RemoteSearchQuery.cs index 77cf9e2559..9fe6f96bc3 100644 --- a/MediaBrowser.Controller/Providers/RemoteSearchQuery.cs +++ b/MediaBrowser.Controller/Providers/RemoteSearchQuery.cs @@ -1,3 +1,5 @@ +using System; + namespace MediaBrowser.Controller.Providers { public class RemoteSearchQuery @@ -5,7 +7,7 @@ namespace MediaBrowser.Controller.Providers { public T SearchInfo { get; set; } - public string ItemId { get; set; } + public Guid ItemId { get; set; } /// /// If set will only search within the given provider diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index 8eed5e6266..ae3788f342 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -156,7 +156,7 @@ namespace MediaBrowser.Providers.Manager }).ConfigureAwait(false)) { - // Workaround for tvheadend channel icons + // Workaround for tvheadend channel icons // TODO: Isolate this hack into the tvh plugin if (string.IsNullOrEmpty(response.ContentType)) { From 5900ab8c6814eedd813b81e44a9ceb606cfe15fd Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Thu, 10 Jan 2019 13:26:52 -0500 Subject: [PATCH 052/140] Update OpenSubtitles User Agent to our own --- MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs index 2d29f29e3d..b62fa83985 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs @@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating; Utilities.HttpClient = httpClient; - OpenSubtitles.SetUserAgent("mediabrowser.tv"); + OpenSubtitles.SetUserAgent("jellyfin"); } private const string PasswordHashPrefix = "h:"; From 399a079dd472a0ad424884eb48a0d9e471a95c70 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Thu, 10 Jan 2019 19:45:21 +0100 Subject: [PATCH 053/140] Build scripts and build system consolidation. Squashed commit. --- .dockerignore | 3 + .drone.yml | 2 +- .gitignore | 34 +-- build-deb.sh | 24 -- debian/bin/jellyfin-sudoers | 37 --- debian/bin/restart.sh | 18 -- debian/source/options | 1 - deployment/README.md | 8 + deployment/build.sh | 23 ++ deployment/clean.sh | 21 ++ deployment/collect_all.sh | 20 ++ deployment/common.build.sh | 108 +++++++++ .../debian-package-x64/Dockerfile | 13 +- deployment/debian-package-x64/clean.sh | 7 + deployment/debian-package-x64/package.sh | 33 +++ .../debian-package-x64/pkg-src}/changelog | 0 .../debian-package-x64/pkg-src}/compat | 0 .../debian-package-x64/pkg-src}/conf/jellyfin | 0 .../pkg-src}/conf/jellyfin.service.conf | 0 .../pkg-src}/conf/logging.json | 0 .../debian-package-x64/pkg-src}/control | 0 .../debian-package-x64/pkg-src}/copyright | 0 .../debian-package-x64/pkg-src}/gbp.conf | 2 +- .../debian-package-x64/pkg-src}/install | 0 .../debian-package-x64/pkg-src}/jellyfin.init | 0 .../pkg-src}/jellyfin.service | 0 .../pkg-src}/jellyfin.upstart | 0 .../pkg-src}/po/POTFILES.in | 0 .../pkg-src}/po/templates.pot | 0 .../debian-package-x64/pkg-src}/postinst | 0 .../debian-package-x64/pkg-src}/postrm | 0 .../debian-package-x64/pkg-src}/preinst | 0 .../debian-package-x64/pkg-src}/prerm | 0 .../debian-package-x64/pkg-src}/rules | 6 +- .../pkg-src}/source.lintian-overrides | 0 .../debian-package-x64/pkg-src}/source/format | 0 .../debian-package-x64/pkg-src/source/options | 11 + deployment/debian-x64/build.sh | 7 + deployment/debian-x64/clean.sh | 7 + deployment/debian-x64/package.sh | 7 + Dockerfile => deployment/docker/Dockerfile | 4 +- .../docker/Dockerfile.aarch64 | 2 +- deployment/docker/build.sh | 7 + deployment/framework/build.sh | 8 + deployment/framework/clean.sh | 7 + deployment/framework/package.sh | 7 + deployment/linux-x64/build.sh | 7 + deployment/linux-x64/clean.sh | 7 + deployment/linux-x64/package.sh | 7 + deployment/osx-x64/build.sh | 7 + deployment/osx-x64/clean.sh | 7 + deployment/osx-x64/package.sh | 7 + deployment/ubuntu-x64/build.sh | 7 + deployment/ubuntu-x64/clean.sh | 7 + deployment/ubuntu-x64/package.sh | 7 + deployment/unraid/docker-templates/README.md | 15 ++ .../unraid/docker-templates/jellyfin.xml | 51 ++++ .../win-generic/build-jellyfin.ps1 | 220 +++++++++--------- .../win-generic/install-jellyfin.ps1 | 0 .../win-generic/install.bat | 0 deployment/win-x64/build.sh | 7 + deployment/win-x64/clean.sh | 7 + deployment/win-x64/package.sh | 9 + deployment/win-x86/build.sh | 7 + deployment/win-x86/clean.sh | 7 + deployment/win-x86/package.sh | 9 + 66 files changed, 605 insertions(+), 217 deletions(-) delete mode 100755 build-deb.sh delete mode 100644 debian/bin/jellyfin-sudoers delete mode 100644 debian/bin/restart.sh delete mode 100644 debian/source/options create mode 100644 deployment/README.md create mode 100644 deployment/build.sh create mode 100644 deployment/clean.sh create mode 100644 deployment/collect_all.sh create mode 100644 deployment/common.build.sh rename Dockerfile.debian_package => deployment/debian-package-x64/Dockerfile (75%) create mode 100644 deployment/debian-package-x64/clean.sh create mode 100644 deployment/debian-package-x64/package.sh rename {debian => deployment/debian-package-x64/pkg-src}/changelog (100%) rename {debian => deployment/debian-package-x64/pkg-src}/compat (100%) rename {debian => deployment/debian-package-x64/pkg-src}/conf/jellyfin (100%) rename {debian => deployment/debian-package-x64/pkg-src}/conf/jellyfin.service.conf (100%) rename {debian => deployment/debian-package-x64/pkg-src}/conf/logging.json (100%) rename {debian => deployment/debian-package-x64/pkg-src}/control (100%) rename {debian => deployment/debian-package-x64/pkg-src}/copyright (100%) rename {debian => deployment/debian-package-x64/pkg-src}/gbp.conf (63%) rename {debian => deployment/debian-package-x64/pkg-src}/install (100%) rename {debian => deployment/debian-package-x64/pkg-src}/jellyfin.init (100%) rename {debian => deployment/debian-package-x64/pkg-src}/jellyfin.service (100%) rename {debian => deployment/debian-package-x64/pkg-src}/jellyfin.upstart (100%) rename {debian => deployment/debian-package-x64/pkg-src}/po/POTFILES.in (100%) rename {debian => deployment/debian-package-x64/pkg-src}/po/templates.pot (100%) rename {debian => deployment/debian-package-x64/pkg-src}/postinst (100%) rename {debian => deployment/debian-package-x64/pkg-src}/postrm (100%) rename {debian => deployment/debian-package-x64/pkg-src}/preinst (100%) rename {debian => deployment/debian-package-x64/pkg-src}/prerm (100%) rename {debian => deployment/debian-package-x64/pkg-src}/rules (67%) mode change 100755 => 100644 rename {debian => deployment/debian-package-x64/pkg-src}/source.lintian-overrides (100%) rename {debian => deployment/debian-package-x64/pkg-src}/source/format (100%) create mode 100644 deployment/debian-package-x64/pkg-src/source/options create mode 100644 deployment/debian-x64/build.sh create mode 100644 deployment/debian-x64/clean.sh create mode 100644 deployment/debian-x64/package.sh rename Dockerfile => deployment/docker/Dockerfile (82%) rename Dockerfile.aarch64 => deployment/docker/Dockerfile.aarch64 (85%) create mode 100644 deployment/docker/build.sh create mode 100644 deployment/framework/build.sh create mode 100644 deployment/framework/clean.sh create mode 100644 deployment/framework/package.sh create mode 100644 deployment/linux-x64/build.sh create mode 100644 deployment/linux-x64/clean.sh create mode 100644 deployment/linux-x64/package.sh create mode 100644 deployment/osx-x64/build.sh create mode 100644 deployment/osx-x64/clean.sh create mode 100644 deployment/osx-x64/package.sh create mode 100644 deployment/ubuntu-x64/build.sh create mode 100644 deployment/ubuntu-x64/clean.sh create mode 100644 deployment/ubuntu-x64/package.sh create mode 100644 deployment/unraid/docker-templates/README.md create mode 100644 deployment/unraid/docker-templates/jellyfin.xml rename build-jellyfin.ps1 => deployment/win-generic/build-jellyfin.ps1 (97%) rename install-jellyfin.ps1 => deployment/win-generic/install-jellyfin.ps1 (100%) rename install.bat => deployment/win-generic/install.bat (100%) create mode 100644 deployment/win-x64/build.sh create mode 100644 deployment/win-x64/clean.sh create mode 100644 deployment/win-x64/package.sh create mode 100644 deployment/win-x86/build.sh create mode 100644 deployment/win-x86/clean.sh create mode 100644 deployment/win-x86/package.sh diff --git a/.dockerignore b/.dockerignore index fc4d8ed26d..54b0aa3a7e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,6 @@ Dockerfile CONTRIBUTORS.md README.md +deployment/*/dist +deployment/*/pkg-dist +deployment/collect-dist/ diff --git a/.drone.yml b/.drone.yml index c6d41b5554..98db4884bd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/.gitignore b/.gitignore index 880e63a7f9..b4b928ef27 100644 --- a/.gitignore +++ b/.gitignore @@ -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,23 +233,32 @@ pip-log.txt #Mr Developer .mr.developer.cfg -/.vs ########## # Rider ########## .idea/ +########## +# Visual Studio Code +########## +.vscode/ + ######################### -# Debian build artifacts +# Build artifacts ######################### -debian/.debhelper/ -debian/*.debhelper -debian/debhelper-build-stamp -debian/files -debian/jellyfin.substvars -debian/jellyfin/ - +# Artifacts for debian-x64 +deployment/debian-x64/pkg-src/.debhelper/ +deployment/debian-x64/pkg-src/*.debhelper +deployment/debian-x64/pkg-src/debhelper-build-stamp +deployment/debian-x64/pkg-src/files +deployment/debian-x64/pkg-src/jellyfin.substvars +deployment/debian-x64/pkg-src/jellyfin/ # Don't ignore the debian/bin folder -!debian/bin/ +!deployment/debian-x64/pkg-src/bin/ + +deployment/**/dist/ +deployment/**/pkg-dist/ +deployment/collect-dist/ + diff --git a/build-deb.sh b/build-deb.sh deleted file mode 100755 index fd14fc17db..0000000000 --- a/build-deb.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -# Build a Jellyfin .deb file with Docker on Linux -# Places the output .deb file in the parent directory - -set -o errexit -set -o xtrace -set -o nounset - -package_temporary_dir="`mktemp -d`" -current_user="`whoami`" -image_name="jellyfin-debuild" - -cleanup() { - set +o errexit - docker image rm $image_name --force - rm -rf "$package_temporary_dir" -} -trap cleanup EXIT INT - -docker build . -t "$image_name" -f ./Dockerfile.debian_package -docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /dist /temp/ -sudo chown -R "$current_user" "$package_temporary_dir" -mv "$package_temporary_dir"/dist/*.deb ../ diff --git a/debian/bin/jellyfin-sudoers b/debian/bin/jellyfin-sudoers deleted file mode 100644 index 4eb91366b4..0000000000 --- a/debian/bin/jellyfin-sudoers +++ /dev/null @@ -1,37 +0,0 @@ -#Allow jellyfin group to start, stop and restart itself -Cmnd_Alias RESTARTSERVER_SYSV = /sbin/service jellyfin restart, /usr/sbin/service jellyfin restart -Cmnd_Alias STARTSERVER_SYSV = /sbin/service jellyfin start, /usr/sbin/service jellyfin start -Cmnd_Alias STOPSERVER_SYSV = /sbin/service jellyfin stop, /usr/sbin/service jellyfin stop -Cmnd_Alias RESTARTSERVER_SYSTEMD = /usr/bin/systemctl restart jellyfin, /bin/systemctl restart jellyfin -Cmnd_Alias STARTSERVER_SYSTEMD = /usr/bin/systemctl start jellyfin, /bin/systemctl start jellyfin -Cmnd_Alias STOPSERVER_SYSTEMD = /usr/bin/systemctl stop jellyfin, /bin/systemctl stop jellyfin -Cmnd_Alias RESTARTSERVER_INITD = /etc/init.d/jellyfin restart -Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start -Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop - - -%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV -%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV -%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV -%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD -%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD -%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD -%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD -%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD -%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD - -Defaults!RESTARTSERVER_SYSV !requiretty -Defaults!STARTSERVER_SYSV !requiretty -Defaults!STOPSERVER_SYSV !requiretty -Defaults!RESTARTSERVER_SYSTEMD !requiretty -Defaults!STARTSERVER_SYSTEMD !requiretty -Defaults!STOPSERVER_SYSTEMD !requiretty -Defaults!RESTARTSERVER_INITD !requiretty -Defaults!STARTSERVER_INITD !requiretty -Defaults!STOPSERVER_INITD !requiretty - -#Allow the server to mount iso images -%jellyfin ALL=(ALL) NOPASSWD: /bin/mount -%jellyfin ALL=(ALL) NOPASSWD: /bin/umount - -Defaults:%jellyfin !requiretty diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh deleted file mode 100644 index a6f4632ba7..0000000000 --- a/debian/bin/restart.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -NAME=jellyfin - -restart_cmds=("s6-svc -t /var/run/s6/services/${NAME}" \ - "systemctl restart ${NAME}" \ - "service ${NAME} restart" \ - "/etc/init.d/${NAME} restart") - -for restart_cmd in "${restart_cmds[@]}"; do - cmd=$(echo "$restart_cmd" | awk '{print $1}') - cmd_loc=$(command -v ${cmd}) - if [[ -n "$cmd_loc" ]]; then - restart_cmd=$(echo "$restart_cmd" | sed -e "s%${cmd}%${cmd_loc}%") - echo "sleep 2; sudo $restart_cmd > /dev/null 2>&1" | at now > /dev/null 2>&1 - exit 0 - fi -done diff --git a/debian/source/options b/debian/source/options deleted file mode 100644 index 45bef47641..0000000000 --- a/debian/source/options +++ /dev/null @@ -1 +0,0 @@ -tar-ignore = ".git*" diff --git a/deployment/README.md b/deployment/README.md new file mode 100644 index 0000000000..3400fd8400 --- /dev/null +++ b/deployment/README.md @@ -0,0 +1,8 @@ +# Build scripts + +All `build.sh` and `package.sh` scripts are for *nix platforms (or WSL on Windows 10). + +After running both, check the `*/pkg-dist/` folders for the archives and packages. + +`build_all.sh` will invoke every build and package script. +Use `collect_all.sh` to copy all artifact to one directory for easy uploading. diff --git a/deployment/build.sh b/deployment/build.sh new file mode 100644 index 0000000000..0b5dae84a3 --- /dev/null +++ b/deployment/build.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Execute all build.sh and package.sh and sign.sh scripts in every folder. In that order. Script should check for artifacts themselves. +echo "Running for platforms '$@'." +for directory in */ ; do + platform=`basename "${directory}"` + if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then + echo "Processing ${platform}" + pushd "$platform" + if [ -f build.sh ]; then + echo ./build.sh + fi + if [ -f package.sh ]; then + echo ./package.sh + fi + if [ -f sign.sh ]; then + echo ./sign.sh + fi + popd + else + echo "Skipping $platform." + fi +done diff --git a/deployment/clean.sh b/deployment/clean.sh new file mode 100644 index 0000000000..7517cf8493 --- /dev/null +++ b/deployment/clean.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +# Execute every clean.sh scripts in every folder. +echo "Running for platforms '$@'." +for directory in */ ; do + platform=`basename "${directory}"` + if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then + echo "Processing ${platform}" + pushd "$platform" + if [ -f clean.sh ]; then + echo ./clean.sh + fi + popd + else + echo "Skipping $platform." + fi +done + +rm -rf ./collect-dist diff --git a/deployment/collect_all.sh b/deployment/collect_all.sh new file mode 100644 index 0000000000..d625002db2 --- /dev/null +++ b/deployment/collect_all.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +source common.build.sh + +VERSION=`get_version ..` + +COLLECT_DIR="./collect-dist" + +mkdir -p ./collect-dist + +DIRS=`find . -type d -name "pkg-dist"` + +while read directory +do + echo "Collecting everything from '$directory'.." + PLATFORM=$(basename "$(dirname "$directory")") + # Copy all artifacts with extensions tar.gz, deb, exe, zip, rpm and add the platform name to resolve any duplicates. + find $directory \( -name "jellyfin*.tar.gz" -o -name "jellyfin*.deb" -o -name "jellyfin*.rpm" -o -name "jellyfin*.zip" -o -name "jellyfin*.exe" \) -exec sh -c 'cp "$1" "'${COLLECT_DIR}'/jellyfin_'${PLATFORM}'_${1#*jellyfin_}"' _ {} \; + +done <<< "${DIRS}" diff --git a/deployment/common.build.sh b/deployment/common.build.sh new file mode 100644 index 0000000000..5996a4ec9d --- /dev/null +++ b/deployment/common.build.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset + +RED='\033[0;31m' +GREEN='\033[0;32m' +CYAN='\033[0;36m' +NC='\033[0m' # No Color + +DEFAULT_BUILD_CONTEXT="../.." +DEFAULT_ROOT="." +DEFAULT_DOTNETRUNTIME="framework" +DEFAULT_CONFIG="Release" +DEFAULT_OUTPUT_DIR="dist/jellyfin-git" +DEFAULT_PKG_DIR="pkg-dist" +DEFAULT_DOCKERFILE="Dockerfile" +DEFAULT_IMAGE_TAG="jellyfin:"`git rev-parse --abbrev-ref HEAD` + +# Run a build +build_jellyfin() +( + ROOT=${1-$DEFAULT_ROOT} + CONFIG=${2-$DEFAULT_CONFIG} + DOTNETRUNTIME=${3-$DEFAULT_DOTNETRUNTIME} + OUTPUT_DIR=${4-$DEFAULT_OUTPUT_DIR} + + echo -e "${CYAN}Building jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}" + if [[ $DOTNETRUNTIME == 'framework' ]]; then + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" + else + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} + fi + EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + echo -e "${GREEN}[DONE] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}" + else + echo -e "${RED}[FAIL] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' FAILED.${NC}" + fi +) + +# Run a docker +build_jellyfin_docker() +( + BUILD_CONTEXT=${1-$DEFAULT_BUILD_CONTEXT} + DOCKERFILE=${2-$DEFAULT_DOCKERFILE} + IMAGE_TAG=${3-$DEFAULT_IMAGE_TAG} + + echo -e "${CYAN}Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}'.${NC}" + docker build -t ${IMAGE_TAG} -f ${DOCKERFILE} ${ROOT} + EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + echo -e "${GREEN}[DONE] Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}' complete.${NC}" + else + echo -e "${RED}[FAIL] Building jellyfin docker image in '${ROOT}' with Dockerfile ${CONFIG} and tag '${IMAGE_TAG}' FAILED.${NC}" + fi +) + +# Clean a build +clean_jellyfin() +( + local ROOT=${1-$DEFAULT_ROOT} + local CONFIG=${2-$DEFAULT_CONFIG} + local OUTPUT_DIR=${3-$DEFAULT_OUTPUT_DIR} + local PKG_DIR=${4-$DEFAULT_PKG_DIR} + echo -e "${CYAN}Cleaning jellyfin in '${ROOT}'' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}" + echo -e "${CYAN}Deleting '${OUTPUT_DIR}'${NC}" + rm -rf "$OUTPUT_DIR" + echo -e "${CYAN}Deleting '${PKG_DIR}'${NC}" + rm -rf "$PKG_DIR" + dotnet clean "${ROOT}" -maxcpucount:1 --configuration ${CONFIG} + local EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + echo -e "${GREEN}[DONE] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}" + else + echo -e "${RED}[FAIL] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' failed.${NC}" + fi +) + +# Parse the version from the AssemblyVersion +get_version() +( + local ROOT=${1-$DEFAULT_ROOT} + grep "AssemblyVersion" ${ROOT}/SharedVersion.cs | sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' | sed -E 's/.0$//' +) + +# Packages the output folder into an archive. +package_portable() +( + local ROOT=${1-$DEFAULT_ROOT} + local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR} + local PKG_DIR=${3-$DEFAULT_PKG_DIR} + # Package portable build result + if [ -d ${OUTPUT_DIR} ]; then + echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}" + mkdir -p ${PKG_DIR} + tar -zcvf "${PKG_DIR}/`basename "${OUTPUT_DIR}"`.portable.tar.gz" -C "`dirname "${OUTPUT_DIR}"`" "`basename "${OUTPUT_DIR}"`" + local EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}" + else + echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}" + fi + else + echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}" + fi +) + diff --git a/Dockerfile.debian_package b/deployment/debian-package-x64/Dockerfile similarity index 75% rename from Dockerfile.debian_package rename to deployment/debian-package-x64/Dockerfile index c5c631b71a..0de62f72bc 100644 --- a/Dockerfile.debian_package +++ b/deployment/debian-package-x64/Dockerfile @@ -1,4 +1,6 @@ FROM debian:9 +ARG SOURCEDIR=/repo +ENV DEB_BUILD_OPTIONS=noddebs # https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current RUN apt-get update \ @@ -11,12 +13,11 @@ RUN apt-get update \ && chown root:root /etc/apt/sources.list.d/microsoft-prod.list \ && apt-get update -WORKDIR /repo +WORKDIR ${SOURCEDIR} COPY . . +COPY ./deployment/debian-x64/pkg-src ./debian -RUN yes|mk-build-deps -i \ - && dpkg-buildpackage -us -uc \ - && mkdir /dist \ - && mv /jellyfin*deb /dist +RUN yes | mk-build-deps -i debian/control \ + && dpkg-buildpackage -us -uc -WORKDIR /dist +WORKDIR / diff --git a/deployment/debian-package-x64/clean.sh b/deployment/debian-package-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/debian-package-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/debian-package-x64/package.sh b/deployment/debian-package-x64/package.sh new file mode 100644 index 0000000000..7909b0a84e --- /dev/null +++ b/deployment/debian-package-x64/package.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +# TODO get the version in the package automatically. And using the changelog to decide the debian package suffix version. + +# Build a Jellyfin .deb file with Docker on Linux +# Places the output .deb file in the parent directory + +package_temporary_dir="`pwd`/pkg-dist-tmp" +output_dir="`pwd`/pkg-dist" +current_user="`whoami`" +image_name="jellyfin-debuild" + +cleanup() { + set +o errexit + docker image rm $image_name --force + rm -rf "$package_temporary_dir" +} +trap cleanup EXIT INT + +docker build ../.. -t "$image_name" -f ./Dockerfile --build-arg SOURCEDIR="/jellyfin-${VERSION}" +mkdir -p "$package_temporary_dir" +mkdir -p "$output_dir" +docker run --rm -v "$package_temporary_dir:/temp" "$image_name" sh -c 'find / -maxdepth 1 -type f -name "jellyfin*" -exec mv {} /temp \;' +chown -R "$current_user" "$package_temporary_dir" +if [ $? -ne 0 ]; then + # Some platforms need this to chown the file properly. (Platforms with native docker, not just the client) + sudo chown -R "$current_user" "$package_temporary_dir" +fi +mv "$package_temporary_dir"/* "$output_dir" diff --git a/debian/changelog b/deployment/debian-package-x64/pkg-src/changelog similarity index 100% rename from debian/changelog rename to deployment/debian-package-x64/pkg-src/changelog diff --git a/debian/compat b/deployment/debian-package-x64/pkg-src/compat similarity index 100% rename from debian/compat rename to deployment/debian-package-x64/pkg-src/compat diff --git a/debian/conf/jellyfin b/deployment/debian-package-x64/pkg-src/conf/jellyfin similarity index 100% rename from debian/conf/jellyfin rename to deployment/debian-package-x64/pkg-src/conf/jellyfin diff --git a/debian/conf/jellyfin.service.conf b/deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf similarity index 100% rename from debian/conf/jellyfin.service.conf rename to deployment/debian-package-x64/pkg-src/conf/jellyfin.service.conf diff --git a/debian/conf/logging.json b/deployment/debian-package-x64/pkg-src/conf/logging.json similarity index 100% rename from debian/conf/logging.json rename to deployment/debian-package-x64/pkg-src/conf/logging.json diff --git a/debian/control b/deployment/debian-package-x64/pkg-src/control similarity index 100% rename from debian/control rename to deployment/debian-package-x64/pkg-src/control diff --git a/debian/copyright b/deployment/debian-package-x64/pkg-src/copyright similarity index 100% rename from debian/copyright rename to deployment/debian-package-x64/pkg-src/copyright diff --git a/debian/gbp.conf b/deployment/debian-package-x64/pkg-src/gbp.conf similarity index 63% rename from debian/gbp.conf rename to deployment/debian-package-x64/pkg-src/gbp.conf index f131b973c2..60b3d28723 100644 --- a/debian/gbp.conf +++ b/deployment/debian-package-x64/pkg-src/gbp.conf @@ -3,4 +3,4 @@ pristine-tar = False cleaner = fakeroot debian/rules clean [import-orig] -filter = [ ".git*", ".hg*" ] +filter = [ ".git*", ".hg*", ".vs*", ".vscode*" ] diff --git a/debian/install b/deployment/debian-package-x64/pkg-src/install similarity index 100% rename from debian/install rename to deployment/debian-package-x64/pkg-src/install diff --git a/debian/jellyfin.init b/deployment/debian-package-x64/pkg-src/jellyfin.init similarity index 100% rename from debian/jellyfin.init rename to deployment/debian-package-x64/pkg-src/jellyfin.init diff --git a/debian/jellyfin.service b/deployment/debian-package-x64/pkg-src/jellyfin.service similarity index 100% rename from debian/jellyfin.service rename to deployment/debian-package-x64/pkg-src/jellyfin.service diff --git a/debian/jellyfin.upstart b/deployment/debian-package-x64/pkg-src/jellyfin.upstart similarity index 100% rename from debian/jellyfin.upstart rename to deployment/debian-package-x64/pkg-src/jellyfin.upstart diff --git a/debian/po/POTFILES.in b/deployment/debian-package-x64/pkg-src/po/POTFILES.in similarity index 100% rename from debian/po/POTFILES.in rename to deployment/debian-package-x64/pkg-src/po/POTFILES.in diff --git a/debian/po/templates.pot b/deployment/debian-package-x64/pkg-src/po/templates.pot similarity index 100% rename from debian/po/templates.pot rename to deployment/debian-package-x64/pkg-src/po/templates.pot diff --git a/debian/postinst b/deployment/debian-package-x64/pkg-src/postinst similarity index 100% rename from debian/postinst rename to deployment/debian-package-x64/pkg-src/postinst diff --git a/debian/postrm b/deployment/debian-package-x64/pkg-src/postrm similarity index 100% rename from debian/postrm rename to deployment/debian-package-x64/pkg-src/postrm diff --git a/debian/preinst b/deployment/debian-package-x64/pkg-src/preinst similarity index 100% rename from debian/preinst rename to deployment/debian-package-x64/pkg-src/preinst diff --git a/debian/prerm b/deployment/debian-package-x64/pkg-src/prerm similarity index 100% rename from debian/prerm rename to deployment/debian-package-x64/pkg-src/prerm diff --git a/debian/rules b/deployment/debian-package-x64/pkg-src/rules old mode 100755 new mode 100644 similarity index 67% rename from debian/rules rename to deployment/debian-package-x64/pkg-src/rules index 10a3a84864..ce98cb8f86 --- a/debian/rules +++ b/deployment/debian-package-x64/pkg-src/rules @@ -2,7 +2,7 @@ CONFIG := Release TERM := xterm SHELL := /bin/bash -DOTNETRUNTIME := linux-x64 +DOTNETRUNTIME := debian-x64 export DH_VERBOSE=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1 @@ -16,8 +16,8 @@ override_dh_auto_test: override_dh_clistrip: override_dh_auto_build: - dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) + dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) Jellyfin.Server override_dh_auto_clean: - dotnet clean -maxcpucount:1 --configuration $(CONFIG) || true + dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true rm -rf '$(CURDIR)/usr' diff --git a/debian/source.lintian-overrides b/deployment/debian-package-x64/pkg-src/source.lintian-overrides similarity index 100% rename from debian/source.lintian-overrides rename to deployment/debian-package-x64/pkg-src/source.lintian-overrides diff --git a/debian/source/format b/deployment/debian-package-x64/pkg-src/source/format similarity index 100% rename from debian/source/format rename to deployment/debian-package-x64/pkg-src/source/format diff --git a/deployment/debian-package-x64/pkg-src/source/options b/deployment/debian-package-x64/pkg-src/source/options new file mode 100644 index 0000000000..17b5373d5e --- /dev/null +++ b/deployment/debian-package-x64/pkg-src/source/options @@ -0,0 +1,11 @@ +tar-ignore='.git*' +tar-ignore='**/.git' +tar-ignore='**/.hg' +tar-ignore='**/.vs' +tar-ignore='**/.vscode' +tar-ignore='deployment' +tar-ignore='**/bin' +tar-ignore='**/obj' +tar-ignore='**/.nuget' +tar-ignore='*.deb' +tar-ignore='ThirdParty' diff --git a/deployment/debian-x64/build.sh b/deployment/debian-x64/build.sh new file mode 100644 index 0000000000..47cfb53270 --- /dev/null +++ b/deployment/debian-x64/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release debian-x64 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/debian-x64/clean.sh b/deployment/debian-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/debian-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/debian-x64/package.sh b/deployment/debian-x64/package.sh new file mode 100644 index 0000000000..13b943ea8f --- /dev/null +++ b/deployment/debian-x64/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} diff --git a/Dockerfile b/deployment/docker/Dockerfile similarity index 82% rename from Dockerfile rename to deployment/docker/Dockerfile index 75700e6f52..c32cdcf9b8 100644 --- a/Dockerfile +++ b/deployment/docker/Dockerfile @@ -15,7 +15,7 @@ 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 @@ -24,5 +24,5 @@ COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/ EXPOSE 8096 VOLUME /config /media RUN apt update \ - && apt install -y libfontconfig1 # needed for Skia + && apt install -y libfontconfig1 --no-install-recommends # needed for Skia ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config diff --git a/Dockerfile.aarch64 b/deployment/docker/Dockerfile.aarch64 similarity index 85% rename from Dockerfile.aarch64 rename to deployment/docker/Dockerfile.aarch64 index da4acc8412..d1423dda2b 100644 --- a/Dockerfile.aarch64 +++ b/deployment/docker/Dockerfile.aarch64 @@ -6,7 +6,7 @@ COPY . . 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 diff --git a/deployment/docker/build.sh b/deployment/docker/build.sh new file mode 100644 index 0000000000..b75cedc013 --- /dev/null +++ b/deployment/docker/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin_docker ../.. Dockerfile jellyfin:${VERSION} \ No newline at end of file diff --git a/deployment/framework/build.sh b/deployment/framework/build.sh new file mode 100644 index 0000000000..4f2e6363ee --- /dev/null +++ b/deployment/framework/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +#Magic word framework will create a non self contained build +build_jellyfin ../../Jellyfin.Server Release framework `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/framework/clean.sh b/deployment/framework/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/framework/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/framework/package.sh b/deployment/framework/package.sh new file mode 100644 index 0000000000..13b943ea8f --- /dev/null +++ b/deployment/framework/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/linux-x64/build.sh b/deployment/linux-x64/build.sh new file mode 100644 index 0000000000..1f0fb62d36 --- /dev/null +++ b/deployment/linux-x64/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release linux-x64 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/linux-x64/clean.sh b/deployment/linux-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/linux-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/linux-x64/package.sh b/deployment/linux-x64/package.sh new file mode 100644 index 0000000000..13b943ea8f --- /dev/null +++ b/deployment/linux-x64/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/osx-x64/build.sh b/deployment/osx-x64/build.sh new file mode 100644 index 0000000000..d6bfb9f5e3 --- /dev/null +++ b/deployment/osx-x64/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release osx-x64 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/osx-x64/clean.sh b/deployment/osx-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/osx-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/osx-x64/package.sh b/deployment/osx-x64/package.sh new file mode 100644 index 0000000000..13b943ea8f --- /dev/null +++ b/deployment/osx-x64/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/ubuntu-x64/build.sh b/deployment/ubuntu-x64/build.sh new file mode 100644 index 0000000000..870bac7805 --- /dev/null +++ b/deployment/ubuntu-x64/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release ubuntu-x64 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/ubuntu-x64/clean.sh b/deployment/ubuntu-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/ubuntu-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/ubuntu-x64/package.sh b/deployment/ubuntu-x64/package.sh new file mode 100644 index 0000000000..13b943ea8f --- /dev/null +++ b/deployment/ubuntu-x64/package.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/unraid/docker-templates/README.md b/deployment/unraid/docker-templates/README.md new file mode 100644 index 0000000000..2c268e8b3e --- /dev/null +++ b/deployment/unraid/docker-templates/README.md @@ -0,0 +1,15 @@ +# docker-templates + +### Installation: + +Open unRaid GUI (at least unRaid 6.5) + +Click on the Docker tab + +Add the following line under "Template Repositories" + +https://github.com/jellyfin/jellyfin/blob/master/deployment/unraid/docker-templates + +Click save than click on Add Container and select jellyfin. + +Adjust to your paths to your liking and off you go! diff --git a/deployment/unraid/docker-templates/jellyfin.xml b/deployment/unraid/docker-templates/jellyfin.xml new file mode 100644 index 0000000000..be11884248 --- /dev/null +++ b/deployment/unraid/docker-templates/jellyfin.xml @@ -0,0 +1,51 @@ + + + https://raw.githubusercontent.com/jellyfin/jellyfin/deployment/unraid/docker-templates/jellyfin.xml + False + MediaApp:Video MediaApp:Music MediaApp:Photos MediaServer:Video MediaServer:Music MediaServer:Photos + JellyFin + + JellyFin is The Free Software Media Browser Converted By Community Applications Always verify this template (and values) against the dockerhub support page for the container!![br][br] + You can add as many mount points as needed for recordings, movies ,etc. [br][br] + [b][span style='color: #E80000;']Directions:[/span][/b][br] + [b]/config[/b] : this is where Jellyfin will store it's databases and configuration.[br][br] + [b]Port[/b] : This is the default port for Jellyfin. (Will add ssl port later)[br][br] + [b]Media[/b] : This is the mounting point of your media. When you access it in Jellyfin it will be /media or whatever you chose for a mount point + [b]Tip:[/b] You can add more volume mappings if you wish Jellyfin has access to it. + + + Jellyfin Server is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono and will remain completely free! + + https://www.reddit.com/r/jellyfin/ + https://hub.docker.com/r/jellyfin/jellyfin/ + https://github.com/jellyfin/jellyfin/> + jellyfin/jellyfin + https://jellyfin.media/ + true + false + + host + + + 8096 + 8096 + tcp + + + + + + /mnt/cache/appdata/config + /config + rw + + + /mnt/user + /media + rw + + + http://[IP]:[PORT:8096]/ + https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/images/emby-icon.png + + diff --git a/build-jellyfin.ps1 b/deployment/win-generic/build-jellyfin.ps1 similarity index 97% rename from build-jellyfin.ps1 rename to deployment/win-generic/build-jellyfin.ps1 index 2247166211..4f0f925256 100644 --- a/build-jellyfin.ps1 +++ b/deployment/win-generic/build-jellyfin.ps1 @@ -1,110 +1,110 @@ -[CmdletBinding()] -param( - [switch]$InstallFFMPEG, - [switch]$InstallNSSM, - [switch]$GenerateZip, - [string]$InstallLocation = "$Env:AppData/Jellyfin-Server/", - [ValidateSet('Debug','Release')][string]$BuildType = 'Release', - [ValidateSet('Quiet','Minimal', 'Normal')][string]$DotNetVerbosity = 'Minimal', - [ValidateSet('win','win7', 'win8','win81','win10')][string]$WindowsVersion = 'win', - [ValidateSet('x64','x86', 'arm', 'arm64')][string]$Architecture = 'x64' -) - -#PowershellCore and *nix check to make determine which temp dir to use. -if(($PSVersionTable.PSEdition -eq 'Core') -and (-not $IsWindows)){ - $TempDir = mktemp -d -}else{ - $TempDir = $env:Temp -} - -function Build-JellyFin { - if(($Architecture -eq 'arm64') -and ($WindowsVersion -ne 'win10')){ - Write-Error "arm64 only supported with Windows10 Version" - exit - } - if(($Architecture -eq 'arm') -and ($WindowsVersion -notin @('win10','win81','win8'))){ - Write-Error "arm only supported with Windows 8 or higher" - exit - } - dotnet publish -c $BuildType -r "$windowsversion-$Architecture" MediaBrowser.sln -o $InstallLocation -v $DotNetVerbosity -} - -function Install-FFMPEG { - param( - [string]$InstallLocation, - [string]$Architecture - ) - Write-Verbose "Checking Architecture" - if($Architecture -notin @('x86','x64')){ - Write-Warning "No builds available for your selected architecture of $Architecture" - Write-Warning "FFMPEG will not be installed" - }elseif($Architecture -eq 'x64'){ - Write-Verbose "Downloading 64 bit FFMPEG" - Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1-win64-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose - }else{ - Write-Verbose "Downloading 32 bit FFMPEG" - Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.1-win32-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose - } - - Expand-Archive "$tempdir/fmmpeg.zip" -DestinationPath "$tempdir/ffmpeg/" | Write-Verbose - if($Architecture -eq 'x64'){ - Write-Verbose "Copying Binaries to Jellyfin location" - Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win64-static/bin" | ForEach-Object { - Copy-Item $_.FullName -Destination $installLocation | Write-Verbose - } - }else{ - Write-Verbose "Copying Binaries to Jellyfin location" - Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win32-static/bin" | ForEach-Object { - Copy-Item $_.FullName -Destination $installLocation | Write-Verbose - } - } - Remove-Item "$tempdir/ffmpeg/" -Recurse -Force -ErrorAction Continue | Write-Verbose - Remove-Item "$tempdir/fmmpeg.zip" -Force -ErrorAction Continue | Write-Verbose -} - -function Install-NSSM { - param( - [string]$InstallLocation, - [string]$Architecture - ) - Write-Verbose "Checking Architecture" - if($Architecture -notin @('x86','x64')){ - Write-Warning "No builds available for your selected architecture of $Architecture" - Write-Warning "NSSM will not be installed" - }else{ - Write-Verbose "Downloading NSSM" - Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -UseBasicParsing -OutFile "$tempdir/nssm.zip" | Write-Verbose - } - - Expand-Archive "$tempdir/nssm.zip" -DestinationPath "$tempdir/nssm/" | Write-Verbose - if($Architecture -eq 'x64'){ - Write-Verbose "Copying Binaries to Jellyfin location" - Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win64" | ForEach-Object { - Copy-Item $_.FullName -Destination $installLocation | Write-Verbose - } - }else{ - Write-Verbose "Copying Binaries to Jellyfin location" - Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win32" | ForEach-Object { - Copy-Item $_.FullName -Destination $installLocation | Write-Verbose - } - } - Remove-Item "$tempdir/nssm/" -Recurse -Force -ErrorAction Continue | Write-Verbose - Remove-Item "$tempdir/nssm.zip" -Force -ErrorAction Continue | Write-Verbose -} - -Write-Verbose "Starting Build Process: Selected Environment is $WindowsVersion-$Architecture" -Build-JellyFin -if($InstallFFMPEG.IsPresent -or ($InstallFFMPEG -eq $true)){ - Write-Verbose "Starting FFMPEG Install" - Install-FFMPEG $InstallLocation $Architecture -} -if($InstallNSSM.IsPresent -or ($InstallNSSM -eq $true)){ - Write-Verbose "Starting NSSM Install" - Install-NSSM $InstallLocation $Architecture -} -Copy-Item .\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1 -Copy-Item .\install.bat $InstallLocation\install.bat -if($GenerateZip.IsPresent -or ($GenerateZip -eq $true)){ - Compress-Archive -Path $InstallLocation -DestinationPath "$InstallLocation/jellyfin.zip" -Force -} -Write-Verbose "Finished" +[CmdletBinding()] +param( + [switch]$InstallFFMPEG, + [switch]$InstallNSSM, + [switch]$GenerateZip, + [string]$InstallLocation = "$Env:AppData/Jellyfin-Server/", + [ValidateSet('Debug','Release')][string]$BuildType = 'Release', + [ValidateSet('Quiet','Minimal', 'Normal')][string]$DotNetVerbosity = 'Minimal', + [ValidateSet('win','win7', 'win8','win81','win10')][string]$WindowsVersion = 'win', + [ValidateSet('x64','x86', 'arm', 'arm64')][string]$Architecture = 'x64' +) + +#PowershellCore and *nix check to make determine which temp dir to use. +if(($PSVersionTable.PSEdition -eq 'Core') -and (-not $IsWindows)){ + $TempDir = mktemp -d +}else{ + $TempDir = $env:Temp +} + +function Build-JellyFin { + if(($Architecture -eq 'arm64') -and ($WindowsVersion -ne 'win10')){ + Write-Error "arm64 only supported with Windows10 Version" + exit + } + if(($Architecture -eq 'arm') -and ($WindowsVersion -notin @('win10','win81','win8'))){ + Write-Error "arm only supported with Windows 8 or higher" + exit + } + dotnet publish -c $BuildType -r "$windowsversion-$Architecture" MediaBrowser.sln -o $InstallLocation -v $DotNetVerbosity +} + +function Install-FFMPEG { + param( + [string]$InstallLocation, + [string]$Architecture + ) + Write-Verbose "Checking Architecture" + if($Architecture -notin @('x86','x64')){ + Write-Warning "No builds available for your selected architecture of $Architecture" + Write-Warning "FFMPEG will not be installed" + }elseif($Architecture -eq 'x64'){ + Write-Verbose "Downloading 64 bit FFMPEG" + Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1-win64-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose + }else{ + Write-Verbose "Downloading 32 bit FFMPEG" + Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.1-win32-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose + } + + Expand-Archive "$tempdir/fmmpeg.zip" -DestinationPath "$tempdir/ffmpeg/" | Write-Verbose + if($Architecture -eq 'x64'){ + Write-Verbose "Copying Binaries to Jellyfin location" + Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win64-static/bin" | ForEach-Object { + Copy-Item $_.FullName -Destination $installLocation | Write-Verbose + } + }else{ + Write-Verbose "Copying Binaries to Jellyfin location" + Get-ChildItem "$tempdir/ffmpeg/ffmpeg-4.1-win32-static/bin" | ForEach-Object { + Copy-Item $_.FullName -Destination $installLocation | Write-Verbose + } + } + Remove-Item "$tempdir/ffmpeg/" -Recurse -Force -ErrorAction Continue | Write-Verbose + Remove-Item "$tempdir/fmmpeg.zip" -Force -ErrorAction Continue | Write-Verbose +} + +function Install-NSSM { + param( + [string]$InstallLocation, + [string]$Architecture + ) + Write-Verbose "Checking Architecture" + if($Architecture -notin @('x86','x64')){ + Write-Warning "No builds available for your selected architecture of $Architecture" + Write-Warning "NSSM will not be installed" + }else{ + Write-Verbose "Downloading NSSM" + Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -UseBasicParsing -OutFile "$tempdir/nssm.zip" | Write-Verbose + } + + Expand-Archive "$tempdir/nssm.zip" -DestinationPath "$tempdir/nssm/" | Write-Verbose + if($Architecture -eq 'x64'){ + Write-Verbose "Copying Binaries to Jellyfin location" + Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win64" | ForEach-Object { + Copy-Item $_.FullName -Destination $installLocation | Write-Verbose + } + }else{ + Write-Verbose "Copying Binaries to Jellyfin location" + Get-ChildItem "$tempdir/nssm/nssm-2.24-101-g897c7ad/win32" | ForEach-Object { + Copy-Item $_.FullName -Destination $installLocation | Write-Verbose + } + } + Remove-Item "$tempdir/nssm/" -Recurse -Force -ErrorAction Continue | Write-Verbose + Remove-Item "$tempdir/nssm.zip" -Force -ErrorAction Continue | Write-Verbose +} + +Write-Verbose "Starting Build Process: Selected Environment is $WindowsVersion-$Architecture" +Build-JellyFin +if($InstallFFMPEG.IsPresent -or ($InstallFFMPEG -eq $true)){ + Write-Verbose "Starting FFMPEG Install" + Install-FFMPEG $InstallLocation $Architecture +} +if($InstallNSSM.IsPresent -or ($InstallNSSM -eq $true)){ + Write-Verbose "Starting NSSM Install" + Install-NSSM $InstallLocation $Architecture +} +Copy-Item .\install-jellyfin.ps1 $InstallLocation\install-jellyfin.ps1 +Copy-Item .\install.bat $InstallLocation\install.bat +if($GenerateZip.IsPresent -or ($GenerateZip -eq $true)){ + Compress-Archive -Path $InstallLocation -DestinationPath "$InstallLocation/jellyfin.zip" -Force +} +Write-Verbose "Finished" diff --git a/install-jellyfin.ps1 b/deployment/win-generic/install-jellyfin.ps1 similarity index 100% rename from install-jellyfin.ps1 rename to deployment/win-generic/install-jellyfin.ps1 diff --git a/install.bat b/deployment/win-generic/install.bat similarity index 100% rename from install.bat rename to deployment/win-generic/install.bat diff --git a/deployment/win-x64/build.sh b/deployment/win-x64/build.sh new file mode 100644 index 0000000000..0b30462038 --- /dev/null +++ b/deployment/win-x64/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release win-x64 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/win-x64/clean.sh b/deployment/win-x64/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/win-x64/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/win-x64/package.sh b/deployment/win-x64/package.sh new file mode 100644 index 0000000000..e8410e8c23 --- /dev/null +++ b/deployment/win-x64/package.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} + +#TODO setup and maybe change above code to produce the Windows native zip format. diff --git a/deployment/win-x86/build.sh b/deployment/win-x86/build.sh new file mode 100644 index 0000000000..610db356a5 --- /dev/null +++ b/deployment/win-x86/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +build_jellyfin ../../Jellyfin.Server Release win-x86 `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/win-x86/clean.sh b/deployment/win-x86/clean.sh new file mode 100644 index 0000000000..3df2d7796e --- /dev/null +++ b/deployment/win-x86/clean.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION} diff --git a/deployment/win-x86/package.sh b/deployment/win-x86/package.sh new file mode 100644 index 0000000000..e8410e8c23 --- /dev/null +++ b/deployment/win-x86/package.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +source ../common.build.sh + +VERSION=`get_version ../..` + +package_portable ../.. `pwd`/dist/jellyfin_${VERSION} + +#TODO setup and maybe change above code to produce the Windows native zip format. From ec1f5dc317182582ebff843c9e8a4d5277405469 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 6 Jan 2019 21:50:43 +0100 Subject: [PATCH 054/140] Mayor code cleanup Add Argument*Exceptions now use proper nameof operators. Added exception messages to quite a few Argument*Exceptions. Fixed rethorwing to be proper syntax. Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling) Added some TODOs to log certain exceptions. Fix sln again. Fixed all AssemblyInfo's and added proper copyright (where I could find them) We live in *current year*. Fixed the use of braces. Fixed a ton of properties, and made a fair amount of functions static that should be and can be static. Made more Methods that should be static static. You can now use static to find bad functions! Removed unused variable. And added one more proper XML comment. --- .editorconfig | 4 +- BDInfo/BDInfo.csproj | 4 + BDInfo/BDROM.cs | 10 +- BDInfo/Properties/AssemblyInfo.cs | 24 +-- DvdLib/DvdLib.csproj | 4 + DvdLib/Ifo/Dvd.cs | 2 +- DvdLib/Ifo/DvdTime.cs | 4 +- DvdLib/Properties/AssemblyInfo.cs | 24 +-- .../ConnectionManagerXmlBuilder.cs | 4 +- .../ServiceActionListBuilder.cs | 6 +- .../ContentDirectoryXmlBuilder.cs | 4 +- .../ServiceActionListBuilder.cs | 12 +- Emby.Dlna/Didl/DidlBuilder.cs | 6 +- Emby.Dlna/DlnaManager.cs | 6 +- Emby.Dlna/Emby.Dlna.csproj | 4 + .../MediaReceiverRegistrar/ControlHandler.cs | 6 +- .../MediaReceiverRegistrarXmlBuilder.cs | 4 +- .../ServiceActionListBuilder.cs | 10 +- Emby.Dlna/PlayTo/Device.cs | 14 +- Emby.Dlna/PlayTo/PlayToController.cs | 8 +- Emby.Dlna/PlayTo/PlaylistItemFactory.cs | 4 +- Emby.Dlna/PlayTo/SsdpHttpClient.cs | 4 +- Emby.Dlna/PlayTo/TransportCommands.cs | 2 +- Emby.Dlna/PlayTo/UpnpContainer.cs | 2 +- Emby.Dlna/PlayTo/uBaseObject.cs | 2 +- Emby.Dlna/PlayTo/uParser.cs | 2 +- Emby.Dlna/Properties/AssemblyInfo.cs | 13 +- Emby.Dlna/Server/DescriptionXmlBuilder.cs | 11 +- Emby.Dlna/Service/ServiceXmlBuilder.cs | 6 +- Emby.Drawing.Skia/Properties/AssemblyInfo.cs | 20 +-- Emby.Drawing.Skia/SkiaEncoder.cs | 10 +- Emby.Drawing.Skia/StripCollageBuilder.cs | 7 +- Emby.Drawing/Common/ImageHeader.cs | 2 +- Emby.Drawing/ImageProcessor.cs | 20 +-- Emby.Drawing/Properties/AssemblyInfo.cs | 10 +- Emby.IsoMounting/IsoMounter/IsoMounter.csproj | 4 + .../IsoMounter/LinuxIsoManager.cs | 6 +- .../IsoMounter/Properties/AssemblyInfo.cs | 21 +++ Emby.Naming/AudioBook/AudioBookResolver.cs | 2 +- Emby.Naming/Emby.Naming.csproj | 4 + Emby.Naming/Properties/AssemblyInfo.cs | 21 +++ Emby.Naming/Subtitles/SubtitleParser.cs | 4 +- Emby.Naming/TV/EpisodePathParser.cs | 4 +- Emby.Naming/TV/EpisodeResolver.cs | 2 +- Emby.Naming/Video/CleanDateTimeParser.cs | 4 +- Emby.Naming/Video/CleanStringParser.cs | 4 +- Emby.Naming/Video/FlagParser.cs | 2 +- Emby.Naming/Video/Format3DParser.cs | 4 +- Emby.Naming/Video/VideoListResolver.cs | 2 +- Emby.Naming/Video/VideoResolver.cs | 2 +- Emby.Notifications/Emby.Notifications.csproj | 4 + Emby.Notifications/Properties/AssemblyInfo.cs | 27 +--- Emby.Photos/Properties/AssemblyInfo.cs | 29 +--- .../Activity/ActivityLogEntryPoint.cs | 8 +- .../Activity/ActivityRepository.cs | 8 +- .../AppBase/BaseApplicationPaths.cs | 71 ++------- .../AppBase/BaseConfigurationManager.cs | 5 +- .../AppBase/ConfigurationHelper.cs | 3 +- .../ApplicationHost.cs | 86 +++------- .../Channels/ChannelImageProvider.cs | 5 +- .../Channels/ChannelManager.cs | 23 ++- .../Channels/RefreshChannelsScheduledTask.cs | 35 +--- .../ServerConfigurationManager.cs | 15 +- .../Data/BaseSqliteRepository.cs | 33 +--- .../SqliteDisplayPreferencesRepository.cs | 16 +- .../Data/SqliteExtensions.cs | 4 +- .../Data/SqliteItemRepository.cs | 68 ++++---- .../Data/SqliteUserDataRepository.cs | 44 ++---- .../Data/SqliteUserRepository.cs | 15 +- .../Data/TypeMapper.cs | 2 +- .../Devices/DeviceId.cs | 16 +- .../Devices/DeviceManager.cs | 11 +- .../Diagnostics/CommonProcess.cs | 25 +-- Emby.Server.Implementations/Dto/DtoService.cs | 18 +-- .../EntryPoints/ExternalPortForwarding.cs | 4 +- .../EntryPoints/LibraryChangedNotifier.cs | 6 +- .../EntryPoints/RecordingNotifier.cs | 4 +- .../EntryPoints/RefreshUsersMetadata.cs | 5 +- .../EnvironmentInfo/EnvironmentInfo.cs | 10 +- .../HttpClientManager/HttpClientManager.cs | 26 +-- .../HttpServer/FileWriter.cs | 11 +- .../HttpServer/HttpListenerHost.cs | 33 ++-- .../HttpServer/HttpResultFactory.cs | 24 +-- .../HttpServer/RangeRequestWriter.cs | 15 +- .../HttpServer/Security/AuthService.cs | 6 +- .../Security/AuthorizationContext.cs | 4 +- .../HttpServer/StreamWriter.cs | 9 +- .../HttpServer/WebSocketConnection.cs | 22 ++- .../IO/FileRefresher.cs | 4 +- Emby.Server.Implementations/IO/IsoManager.cs | 2 +- .../IO/LibraryMonitor.cs | 10 +- .../IO/ManagedFileSystem.cs | 50 +++--- .../IO/MbLinkShortcutHandler.cs | 11 +- .../IO/ThrottledStream.cs | 59 ++----- .../Images/BaseDynamicImageProvider.cs | 19 +-- .../Library/DefaultAuthenticationProvider.cs | 2 +- .../Library/LibraryManager.cs | 61 ++++--- .../Library/MediaSourceManager.cs | 19 +-- .../Library/PathExtensions.cs | 4 +- .../Library/ResolverHelper.cs | 6 +- .../Library/Resolvers/Audio/AudioResolver.cs | 11 +- .../Resolvers/Audio/MusicAlbumResolver.cs | 9 +- .../Resolvers/Audio/MusicArtistResolver.cs | 9 +- .../Library/Resolvers/FolderResolver.cs | 5 +- .../Library/Resolvers/ItemResolver.cs | 8 +- .../Resolvers/Movies/BoxSetResolver.cs | 4 +- .../Library/Resolvers/Movies/MovieResolver.cs | 20 +-- .../Library/Resolvers/PhotoAlbumResolver.cs | 9 +- .../Resolvers/SpecialFolderResolver.cs | 5 +- .../Library/Resolvers/TV/SeasonResolver.cs | 5 +- .../Library/Resolvers/TV/SeriesResolver.cs | 14 +- .../Library/SearchEngine.cs | 6 +- .../Library/UserDataManager.cs | 10 +- .../Library/UserManager.cs | 45 +++--- .../LiveTv/EmbyTV/EmbyTV.cs | 41 ++--- .../LiveTv/EmbyTV/EncodedRecorder.cs | 16 +- .../LiveTv/EmbyTV/ItemDataProvider.cs | 6 +- .../LiveTv/EmbyTV/TimerManager.cs | 4 +- .../LiveTv/Listings/SchedulesDirect.cs | 35 ++-- .../LiveTv/Listings/XmlTvListingsProvider.cs | 26 ++- .../LiveTv/LiveTvDtoService.cs | 11 +- .../LiveTv/LiveTvManager.cs | 24 +-- .../LiveTv/RefreshChannelsScheduledTask.cs | 35 +--- .../LiveTv/TunerHosts/BaseTunerHost.cs | 23 +-- .../TunerHosts/HdHomerun/HdHomerunHost.cs | 31 +--- .../TunerHosts/HdHomerun/HdHomerunManager.cs | 28 ++-- .../HdHomerun/HdHomerunUdpStream.cs | 62 ++------ .../LiveTv/TunerHosts/LiveStream.cs | 8 +- .../LiveTv/TunerHosts/M3UTunerHost.cs | 10 +- .../LiveTv/TunerHosts/M3uParser.cs | 8 +- .../Localization/LocalizationManager.cs | 18 +-- .../Localization/TextLocalizer.cs | 4 +- .../MediaEncoder/EncodingManager.cs | 6 +- .../Net/DisposableManagedObjectBase.cs | 8 +- .../Net/SocketFactory.cs | 46 +++--- Emby.Server.Implementations/Net/UdpSocket.cs | 9 +- .../IPNetwork/IPAddressCollection.cs | 20 +-- .../Networking/IPNetwork/IPNetwork.cs | 142 ++++++----------- .../IPNetwork/IPNetworkCollection.cs | 36 ++--- .../Networking/NetworkManager.cs | 37 ++--- .../Playlists/ManualPlaylistsFolder.cs | 21 +-- .../Playlists/PlaylistManager.cs | 17 +- .../Properties/AssemblyInfo.cs | 23 +-- .../ScheduledTasks/ChapterImagesTask.cs | 27 +--- .../ScheduledTasks/PeopleValidationTask.cs | 26 +-- .../ScheduledTasks/RefreshMediaLibraryTask.cs | 23 +-- .../ScheduledTasks/ScheduledTaskWorker.cs | 44 ++---- .../Tasks/DeleteCacheFileTask.cs | 38 +---- .../ScheduledTasks/Tasks/DeleteLogFileTask.cs | 38 +---- .../Security/AuthenticationRepository.cs | 16 +- .../Security/EncryptionManager.cs | 16 +- .../Security/MBLicenseFile.cs | 10 +- .../Security/PluginSecurityManager.cs | 19 +-- .../Serialization/JsonSerializer.cs | 40 ++--- .../ServerApplicationPaths.cs | 149 +++--------------- .../Services/HttpResult.cs | 4 +- .../Services/ServicePath.cs | 26 ++- .../Session/HttpSessionController.cs | 25 +-- .../Session/SessionManager.cs | 43 +++-- .../Session/SessionWebSocketListener.cs | 5 +- .../Session/WebSocketController.cs | 18 +-- .../Sorting/AiredEpisodeOrderComparer.cs | 23 ++- .../Sorting/AlbumArtistComparer.cs | 9 +- .../Sorting/AlbumComparer.cs | 7 +- .../Sorting/ArtistComparer.cs | 7 +- .../Sorting/CommunityRatingComparer.cs | 12 +- .../Sorting/CriticRatingComparer.cs | 7 +- .../Sorting/DateCreatedComparer.cs | 11 +- .../Sorting/DateLastMediaAddedComparer.cs | 9 +- .../Sorting/DatePlayedComparer.cs | 5 +- .../Sorting/GameSystemComparer.cs | 7 +- .../Sorting/IsFavoriteOrLikeComparer.cs | 5 +- .../Sorting/IsFolderComparer.cs | 7 +- .../Sorting/IsPlayedComparer.cs | 5 +- .../Sorting/IsUnplayedComparer.cs | 5 +- .../Sorting/NameComparer.cs | 11 +- .../Sorting/OfficialRatingComparer.cs | 12 +- .../Sorting/PlayCountComparer.cs | 5 +- .../Sorting/PlayersComparer.cs | 7 +- .../Sorting/PremiereDateComparer.cs | 7 +- .../Sorting/ProductionYearComparer.cs | 7 +- .../Sorting/RandomComparer.cs | 5 +- .../Sorting/RuntimeComparer.cs | 12 +- .../Sorting/SeriesSortNameComparer.cs | 9 +- .../Sorting/SortNameComparer.cs | 11 +- .../Sorting/StartDateComparer.cs | 7 +- .../Sorting/StudioComparer.cs | 11 +- .../TV/TVSeriesManager.cs | 8 +- .../NLangDetect/Extensions/CharExtensions.cs | 2 +- .../Extensions/StringExtensions.cs | 8 +- .../NLangDetect/LanguageDetector.cs | 2 +- .../TextEncoding/TextEncoding.cs | 13 +- .../TextEncoding/TextEncodingDetect.cs | 5 +- .../UniversalDetector/CharsetDetector.cs | 10 +- .../Core/CodingStateMachine.cs | 10 +- .../UniversalDetector/Core/SMModel.cs | 10 +- .../UniversalDetector/Core/SequenceModel.cs | 22 +-- Emby.Server.Implementations/Udp/UdpServer.cs | 8 +- .../Updates/InstallationManager.cs | 23 ++- .../UserViews/DynamicImageProvider.cs | 4 +- Emby.XmlTv/Emby.XmlTv/Classes/XmlTvReader.cs | 20 +-- Emby.XmlTv/Emby.XmlTv/Emby.XmlTv.csproj | 4 + .../Emby.XmlTv/Entities/XmlTvChannel.cs | 6 +- Emby.XmlTv/Emby.XmlTv/Entities/XmlTvCredit.cs | 2 +- .../Emby.XmlTv/Entities/XmlTvEpisode.cs | 4 +- Emby.XmlTv/Emby.XmlTv/Entities/XmlTvIcon.cs | 6 +- .../Emby.XmlTv/Entities/XmlTvLanguage.cs | 4 +- Emby.XmlTv/Emby.XmlTv/Entities/XmlTvRating.cs | 6 +- .../Emby.XmlTv/Properties/AssemblyInfo.cs | 27 +--- Jellyfin.Server/Properties/AssemblyInfo.cs | 21 +++ Jellyfin.Server/SocketSharp/RequestMono.cs | 8 +- Jellyfin.Server/SocketSharp/SharpWebSocket.cs | 4 +- .../SocketSharp/WebSocketSharpListener.cs | 3 +- .../SocketSharp/WebSocketSharpRequest.cs | 4 +- MediaBrowser.Api/ApiEntryPoint.cs | 2 +- MediaBrowser.Api/EnvironmentService.cs | 4 +- .../Library/LibraryStructureService.cs | 12 +- MediaBrowser.Api/LiveTv/LiveTvService.cs | 2 +- .../Playback/BaseStreamingService.cs | 2 +- .../Playback/Hls/BaseHlsService.cs | 2 +- .../Playback/Hls/DynamicHlsService.cs | 2 +- MediaBrowser.Api/Playback/MediaInfoService.cs | 1 + MediaBrowser.Api/PluginService.cs | 2 +- MediaBrowser.Api/Properties/AssemblyInfo.cs | 25 +-- .../ScheduledTasks/ScheduledTaskService.cs | 2 +- MediaBrowser.Api/UserLibrary/ItemsService.cs | 10 +- MediaBrowser.Common/Plugins/BasePlugin.cs | 4 +- .../Properties/AssemblyInfo.cs | 22 +-- .../Authentication/AuthenticationResult.cs | 2 +- .../Channels/IChannelManager.cs | 4 +- .../Entities/AggregateFolder.cs | 4 +- MediaBrowser.Controller/Entities/BaseItem.cs | 16 +- .../Entities/Extensions.cs | 2 +- MediaBrowser.Controller/Entities/Folder.cs | 6 +- .../Entities/PeopleHelper.cs | 6 +- .../Entities/TagExtensions.cs | 2 +- MediaBrowser.Controller/Entities/User.cs | 4 +- .../Entities/UserItemData.cs | 2 +- .../Entities/UserRootFolder.cs | 4 +- .../Entities/UserViewBuilder.cs | 4 +- MediaBrowser.Controller/IO/FileData.cs | 4 +- .../Library/ILibraryManager.cs | 7 +- .../Library/ItemResolveArgs.cs | 6 +- .../MediaEncoding/EncodingHelper.cs | 8 +- .../MediaEncoding/JobLogger.cs | 3 +- .../Net/BasePeriodicWebSocketListener.cs | 15 +- .../Persistence/IUserRepository.cs | 3 +- .../Properties/AssemblyInfo.cs | 22 +-- .../Security/IAuthenticationRepository.cs | 4 +- .../Images/LocalImageProvider.cs | 4 +- .../Parsers/BaseItemXmlParser.cs | 4 +- .../Properties/AssemblyInfo.cs | 28 +--- .../BdInfo/BdInfoExaminer.cs | 4 +- .../Encoder/MediaEncoder.cs | 4 +- .../Probing/FFProbeHelpers.cs | 2 +- .../Probing/ProbeResultNormalizer.cs | 6 +- .../Properties/AssemblyInfo.cs | 28 +--- .../Subtitles/OpenSubtitleDownloader.cs | 2 +- .../Subtitles/SubtitleEncoder.cs | 18 +-- .../Diagnostics/IProcessFactory.cs | 6 +- MediaBrowser.Model/Dlna/SearchCriteria.cs | 14 +- MediaBrowser.Model/Dlna/StreamBuilder.cs | 2 +- MediaBrowser.Model/Dlna/StreamInfo.cs | 4 +- .../Entities/ProviderIdsExtensions.cs | 4 +- .../Extensions/LinqExtensions.cs | 4 +- MediaBrowser.Model/Extensions/ListHelper.cs | 2 +- MediaBrowser.Model/IO/IFileSystem.cs | 6 +- MediaBrowser.Model/IO/IIsoMounter.cs | 3 +- MediaBrowser.Model/Net/IpAddressInfo.cs | 2 +- MediaBrowser.Model/Net/MimeTypes.cs | 4 +- MediaBrowser.Model/Properties/AssemblyInfo.cs | 20 ++- .../Serialization/IJsonSerializer.cs | 18 +-- MediaBrowser.Model/Services/HttpUtility.cs | 8 +- .../Services/QueryParamCollection.cs | 8 +- .../BoxSets/MovieDbBoxSetProvider.cs | 2 +- .../Manager/GenericPriorityQueue.cs | 8 +- MediaBrowser.Providers/Manager/ImageSaver.cs | 4 +- .../Manager/ProviderManager.cs | 2 +- .../Manager/ProviderUtils.cs | 4 +- .../MediaInfo/FFProbeVideoInfo.cs | 2 +- .../Movies/MovieDbProvider.cs | 4 +- .../Music/FanArtArtistProvider.cs | 10 +- .../Music/MusicBrainzArtistProvider.cs | 6 +- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 12 +- .../Properties/AssemblyInfo.cs | 25 +-- .../TV/TheMovieDb/MovieDbProviderBase.cs | 8 +- .../TV/TheMovieDb/MovieDbSeasonProvider.cs | 8 +- .../TV/TheMovieDb/MovieDbSeriesProvider.cs | 4 +- .../TV/TheTVDB/TvdbEpisodeProvider.cs | 5 +- .../TV/TheTVDB/TvdbSeriesProvider.cs | 6 +- .../Api/PackageCreator.cs | 4 +- .../Properties/AssemblyInfo.cs | 25 +-- .../Parsers/BaseNfoParser.cs | 4 +- .../Properties/AssemblyInfo.cs | 28 +--- MediaBrowser.sln | 7 + Mono.Nat/Pmp/PmpNatDevice.cs | 2 +- Mono.Nat/Properties/AssemblyInfo.cs | 29 +--- Mono.Nat/Upnp/Searchers/UpnpSearcher.cs | 2 +- Mono.Nat/Upnp/UpnpNatDevice.cs | 2 +- OpenSubtitlesHandler/OpenSubtitles.cs | 20 +-- .../Properties/AssemblyInfo.cs | 27 +--- RSSDP/DeviceAvailableEventArgs.cs | 2 +- RSSDP/DeviceEventArgs.cs | 2 +- RSSDP/DeviceUnavailableEventArgs.cs | 2 +- RSSDP/HttpParserBase.cs | 10 +- RSSDP/HttpRequestParser.cs | 6 +- RSSDP/HttpResponseParser.cs | 8 +- RSSDP/IEnumerableExtensions.cs | 4 +- RSSDP/Properties/AssemblyInfo.cs | 26 ++- RSSDP/SsdpCommunicationsServer.cs | 8 +- RSSDP/SsdpDevice.cs | 4 +- RSSDP/SsdpDeviceLocator.cs | 6 +- RSSDP/SsdpDevicePublisher.cs | 14 +- SharedVersion.cs | 3 +- SocketHttpListener/CloseEventArgs.cs | 4 +- SocketHttpListener/Ext.cs | 24 +-- SocketHttpListener/HttpBase.cs | 2 +- SocketHttpListener/HttpResponse.cs | 6 +- SocketHttpListener/MessageEventArgs.cs | 2 +- SocketHttpListener/Net/ChunkStream.cs | 4 +- SocketHttpListener/Net/CookieHelper.cs | 6 +- .../Net/HttpEndPointListener.cs | 1 + SocketHttpListener/Net/HttpListener.cs | 2 +- .../Net/HttpListenerBasicIdentity.cs | 6 +- SocketHttpListener/Net/HttpListenerContext.cs | 4 +- .../Net/HttpListenerPrefixCollection.cs | 2 +- .../Net/HttpListenerRequest.Managed.cs | 4 +- SocketHttpListener/Net/HttpListenerRequest.cs | 2 +- .../Net/HttpListenerResponse.cs | 6 +- .../Net/HttpResponseStream.Managed.cs | 2 +- SocketHttpListener/Net/WebHeaderCollection.cs | 26 +-- .../Net/WebSockets/HttpWebSocket.cs | 12 +- SocketHttpListener/Properties/AssemblyInfo.cs | 29 +--- SocketHttpListener/WebSocket.cs | 4 +- 334 files changed, 1632 insertions(+), 2603 deletions(-) create mode 100644 Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs create mode 100644 Emby.Naming/Properties/AssemblyInfo.cs create mode 100644 Jellyfin.Server/Properties/AssemblyInfo.cs diff --git a/.editorconfig b/.editorconfig index a3b72c9af5..d3a988abc0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,11 +3,11 @@ # For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig ############################### # Core EditorConfig Options # -############################### +############################### +root = true # All files [*] indent_style = space -root = true indent_size = 4 charset = utf-8 trim_trailing_whitespace = true diff --git a/BDInfo/BDInfo.csproj b/BDInfo/BDInfo.csproj index 403ecec4e8..b64f5e7a77 100644 --- a/BDInfo/BDInfo.csproj +++ b/BDInfo/BDInfo.csproj @@ -1,5 +1,9 @@  + + + + diff --git a/BDInfo/BDROM.cs b/BDInfo/BDROM.cs index f00d9825a8..7d8268222d 100644 --- a/BDInfo/BDROM.cs +++ b/BDInfo/BDROM.cs @@ -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); diff --git a/BDInfo/Properties/AssemblyInfo.cs b/BDInfo/Properties/AssemblyInfo.cs index aa44da1909..ccb3fc4498 100644 --- a/BDInfo/Properties/AssemblyInfo.cs +++ b/BDInfo/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file +// 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)] diff --git a/DvdLib/DvdLib.csproj b/DvdLib/DvdLib.csproj index 403ecec4e8..b64f5e7a77 100644 --- a/DvdLib/DvdLib.csproj +++ b/DvdLib/DvdLib.csproj @@ -1,5 +1,9 @@  + + + + diff --git a/DvdLib/Ifo/Dvd.cs b/DvdLib/Ifo/Dvd.cs index 508c23db45..b43f0e8326 100644 --- a/DvdLib/Ifo/Dvd.cs +++ b/DvdLib/Ifo/Dvd.cs @@ -81,7 +81,7 @@ namespace DvdLib.Ifo private void ReadVTS(ushort vtsNum, List 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)); diff --git a/DvdLib/Ifo/DvdTime.cs b/DvdLib/Ifo/DvdTime.cs index f565f5fdf7..072cd8d880 100644 --- a/DvdLib/Ifo/DvdTime.cs +++ b/DvdLib/Ifo/DvdTime.cs @@ -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)); } diff --git a/DvdLib/Properties/AssemblyInfo.cs b/DvdLib/Properties/AssemblyInfo.cs index cca792684f..fd3fd0ff09 100644 --- a/DvdLib/Properties/AssemblyInfo.cs +++ b/DvdLib/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file +// 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)] diff --git a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs index 0666eda229..db18025e65 100644 --- a/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs @@ -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 GetStateVariables() + private static IEnumerable GetStateVariables() { var list = new List(); diff --git a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs index 9b22b77734..d42184f8ea 100644 --- a/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ConnectionManager/ServiceActionListBuilder.cs @@ -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 { diff --git a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs index facc252146..36b51faa60 100644 --- a/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ContentDirectoryXmlBuilder.cs @@ -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 GetStateVariables() + private static IEnumerable GetStateVariables() { var list = new List(); diff --git a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs index 8e5c07ce2f..41130a613e 100644 --- a/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs +++ b/Emby.Dlna/ContentDirectory/ServiceActionListBuilder.cs @@ -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 { diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs index 7af48ae17e..a8217c0d41 100644 --- a/Emby.Dlna/Didl/DidlBuilder.cs +++ b/Emby.Dlna/Didl/DidlBuilder.cs @@ -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 diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs index 48a33757be..a8777cbac5 100644 --- a/Emby.Dlna/DlnaManager.cs +++ b/Emby.Dlna/DlnaManager.cs @@ -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)); diff --git a/Emby.Dlna/Emby.Dlna.csproj b/Emby.Dlna/Emby.Dlna.csproj index c58144e00b..f48816453b 100644 --- a/Emby.Dlna/Emby.Dlna.csproj +++ b/Emby.Dlna/Emby.Dlna.csproj @@ -1,5 +1,9 @@  + + + + diff --git a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs index d1a595de0e..5ffa30f685 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs @@ -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> HandleIsAuthorized() + private static IEnumerable> HandleIsAuthorized() { return new Dictionary(StringComparer.OrdinalIgnoreCase) { @@ -29,7 +29,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar }; } - private IEnumerable> HandleIsValidated() + private static IEnumerable> HandleIsValidated() { return new Dictionary(StringComparer.OrdinalIgnoreCase) { diff --git a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs index bc4bee7c92..efddbc6705 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarXmlBuilder.cs @@ -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 GetStateVariables() + private static IEnumerable GetStateVariables() { var list = new List(); diff --git a/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs b/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs index bce8bfaef3..a1f3284111 100644 --- a/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs +++ b/Emby.Dlna/MediaReceiverRegistrar/ServiceActionListBuilder.cs @@ -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 { diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index 13bed6b2fd..a4baae5c48 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -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); } } } diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index c51f220ef5..c7e45b8964 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -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 diff --git a/Emby.Dlna/PlayTo/PlaylistItemFactory.cs b/Emby.Dlna/PlayTo/PlaylistItemFactory.cs index e2d6e43c04..1080320e0c 100644 --- a/Emby.Dlna/PlayTo/PlaylistItemFactory.cs +++ b/Emby.Dlna/PlayTo/PlaylistItemFactory.cs @@ -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; diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs index bfd163bf16..4b83ca65bf 100644 --- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs +++ b/Emby.Dlna/PlayTo/SsdpHttpClient.cs @@ -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)) diff --git a/Emby.Dlna/PlayTo/TransportCommands.cs b/Emby.Dlna/PlayTo/TransportCommands.cs index 9e055f7921..ba41513ffc 100644 --- a/Emby.Dlna/PlayTo/TransportCommands.cs +++ b/Emby.Dlna/PlayTo/TransportCommands.cs @@ -80,7 +80,7 @@ namespace Emby.Dlna.PlayTo { if (container == null) { - throw new ArgumentNullException("container"); + throw new ArgumentNullException(nameof(container)); } return new Argument diff --git a/Emby.Dlna/PlayTo/UpnpContainer.cs b/Emby.Dlna/PlayTo/UpnpContainer.cs index 5bfc56bff9..4c07f36053 100644 --- a/Emby.Dlna/PlayTo/UpnpContainer.cs +++ b/Emby.Dlna/PlayTo/UpnpContainer.cs @@ -10,7 +10,7 @@ namespace Emby.Dlna.PlayTo { if (container == null) { - throw new ArgumentNullException("container"); + throw new ArgumentNullException(nameof(container)); } return new uBaseObject diff --git a/Emby.Dlna/PlayTo/uBaseObject.cs b/Emby.Dlna/PlayTo/uBaseObject.cs index 1de46317eb..60dfd48a70 100644 --- a/Emby.Dlna/PlayTo/uBaseObject.cs +++ b/Emby.Dlna/PlayTo/uBaseObject.cs @@ -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); diff --git a/Emby.Dlna/PlayTo/uParser.cs b/Emby.Dlna/PlayTo/uParser.cs index 5caf83a9a6..c2d05d5a5c 100644 --- a/Emby.Dlna/PlayTo/uParser.cs +++ b/Emby.Dlna/PlayTo/uParser.cs @@ -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 }; diff --git a/Emby.Dlna/Properties/AssemblyInfo.cs b/Emby.Dlna/Properties/AssemblyInfo.cs index 6f924f9e96..ba5e0c3be2 100644 --- a/Emby.Dlna/Properties/AssemblyInfo.cs +++ b/Emby.Dlna/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Emby.Dlna/Server/DescriptionXmlBuilder.cs b/Emby.Dlna/Server/DescriptionXmlBuilder.cs index 0c0c367e43..bd57f4c43f 100644 --- a/Emby.Dlna/Server/DescriptionXmlBuilder.cs +++ b/Emby.Dlna/Server/DescriptionXmlBuilder.cs @@ -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() { diff --git a/Emby.Dlna/Service/ServiceXmlBuilder.cs b/Emby.Dlna/Service/ServiceXmlBuilder.cs index c41f1b3bed..68782ffb76 100644 --- a/Emby.Dlna/Service/ServiceXmlBuilder.cs +++ b/Emby.Dlna/Service/ServiceXmlBuilder.cs @@ -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 actions) + private static void AppendActionList(StringBuilder builder, IEnumerable actions) { builder.Append(""); @@ -59,7 +59,7 @@ namespace Emby.Dlna.Service builder.Append(""); } - private void AppendServiceStateTable(StringBuilder builder, IEnumerable stateVariables) + private static void AppendServiceStateTable(StringBuilder builder, IEnumerable stateVariables) { builder.Append(""); diff --git a/Emby.Drawing.Skia/Properties/AssemblyInfo.cs b/Emby.Drawing.Skia/Properties/AssemblyInfo.cs index c0dc7c5b4b..5c920ac161 100644 --- a/Emby.Drawing.Skia/Properties/AssemblyInfo.cs +++ b/Emby.Drawing.Skia/Properties/AssemblyInfo.cs @@ -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 -// \ No newline at end of file +// 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)] diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 0467794dc9..dc5ae77ccc 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -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) diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.cs index a98450e08b..b3e7dbb5fa 100644 --- a/Emby.Drawing.Skia/StripCollageBuilder.cs +++ b/Emby.Drawing.Skia/StripCollageBuilder.cs @@ -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") diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs index f37f396f59..592705d6cd 100644 --- a/Emby.Drawing/Common/ImageHeader.cs +++ b/Emby.Drawing/Common/ImageHeader.cs @@ -94,7 +94,7 @@ namespace Emby.Drawing.Common } } - throw new ArgumentException(ErrorMessage, "binaryReader"); + throw new ArgumentException(ErrorMessage, nameof(binaryReader)); } /// diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 6a67be56d1..c3c45def40 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -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); diff --git a/Emby.Drawing/Properties/AssemblyInfo.cs b/Emby.Drawing/Properties/AssemblyInfo.cs index b9e9c2ff77..b353ecfa6a 100644 --- a/Emby.Drawing/Properties/AssemblyInfo.cs +++ b/Emby.Drawing/Properties/AssemblyInfo.cs @@ -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("")] @@ -27,4 +27,4 @@ using System.Runtime.InteropServices; // Minor Version // Build Number // Revision -// \ No newline at end of file +// diff --git a/Emby.IsoMounting/IsoMounter/IsoMounter.csproj b/Emby.IsoMounting/IsoMounter/IsoMounter.csproj index ee67a1d946..9274f9763a 100644 --- a/Emby.IsoMounting/IsoMounter/IsoMounter.csproj +++ b/Emby.IsoMounting/IsoMounter/IsoMounter.csproj @@ -1,5 +1,9 @@ + + + + diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs index d82d2f2fb8..ab85cb721a 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs @@ -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; @@ -152,7 +152,7 @@ namespace IsoMounter return Task.FromResult(mountedISO); } else { - throw new IOException(String.Format( + throw new IOException(string.Format( "An error occurred trying to mount image [$0].", isoPath )); @@ -217,7 +217,7 @@ namespace IsoMounter { 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); } } diff --git a/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..8a26b12a2a --- /dev/null +++ b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs @@ -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)] diff --git a/Emby.Naming/AudioBook/AudioBookResolver.cs b/Emby.Naming/AudioBook/AudioBookResolver.cs index a206ee30bf..226d016d9d 100644 --- a/Emby.Naming/AudioBook/AudioBookResolver.cs +++ b/Emby.Naming/AudioBook/AudioBookResolver.cs @@ -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; diff --git a/Emby.Naming/Emby.Naming.csproj b/Emby.Naming/Emby.Naming.csproj index f1a736eccb..360ffaabe4 100644 --- a/Emby.Naming/Emby.Naming.csproj +++ b/Emby.Naming/Emby.Naming.csproj @@ -4,6 +4,10 @@ netstandard2.0 false + + + + diff --git a/Emby.Naming/Properties/AssemblyInfo.cs b/Emby.Naming/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..15311570b8 --- /dev/null +++ b/Emby.Naming/Properties/AssemblyInfo.cs @@ -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)] diff --git a/Emby.Naming/Subtitles/SubtitleParser.cs b/Emby.Naming/Subtitles/SubtitleParser.cs index fbf0f60cba..9c279cc096 100644 --- a/Emby.Naming/Subtitles/SubtitleParser.cs +++ b/Emby.Naming/Subtitles/SubtitleParser.cs @@ -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 _. diff --git a/Emby.Naming/TV/EpisodePathParser.cs b/Emby.Naming/TV/EpisodePathParser.cs index 7f8a6a70ec..813be3f7ae 100644 --- a/Emby.Naming/TV/EpisodePathParser.cs +++ b/Emby.Naming/TV/EpisodePathParser.cs @@ -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(); diff --git a/Emby.Naming/TV/EpisodeResolver.cs b/Emby.Naming/TV/EpisodeResolver.cs index 2007d13077..4548b4c35f 100644 --- a/Emby.Naming/TV/EpisodeResolver.cs +++ b/Emby.Naming/TV/EpisodeResolver.cs @@ -19,7 +19,7 @@ namespace Emby.Naming.TV { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var isStub = false; diff --git a/Emby.Naming/Video/CleanDateTimeParser.cs b/Emby.Naming/Video/CleanDateTimeParser.cs index 572dd1c600..c8eb9abf88 100644 --- a/Emby.Naming/Video/CleanDateTimeParser.cs +++ b/Emby.Naming/Video/CleanDateTimeParser.cs @@ -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(); diff --git a/Emby.Naming/Video/CleanStringParser.cs b/Emby.Naming/Video/CleanStringParser.cs index bddf9589b6..02b90310d7 100644 --- a/Emby.Naming/Video/CleanStringParser.cs +++ b/Emby.Naming/Video/CleanStringParser.cs @@ -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(); diff --git a/Emby.Naming/Video/FlagParser.cs b/Emby.Naming/Video/FlagParser.cs index a2c541eeb2..ef785ebf9d 100644 --- a/Emby.Naming/Video/FlagParser.cs +++ b/Emby.Naming/Video/FlagParser.cs @@ -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 _. diff --git a/Emby.Naming/Video/Format3DParser.cs b/Emby.Naming/Video/Format3DParser.cs index 42737b4834..e335d10554 100644 --- a/Emby.Naming/Video/Format3DParser.cs +++ b/Emby.Naming/Video/Format3DParser.cs @@ -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(); diff --git a/Emby.Naming/Video/VideoListResolver.cs b/Emby.Naming/Video/VideoListResolver.cs index 47be28104d..23e012c301 100644 --- a/Emby.Naming/Video/VideoListResolver.cs +++ b/Emby.Naming/Video/VideoListResolver.cs @@ -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; diff --git a/Emby.Naming/Video/VideoResolver.cs b/Emby.Naming/Video/VideoResolver.cs index c4951c728e..f6ab8cb87f 100644 --- a/Emby.Naming/Video/VideoResolver.cs +++ b/Emby.Naming/Video/VideoResolver.cs @@ -45,7 +45,7 @@ namespace Emby.Naming.Video { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var isStub = false; diff --git a/Emby.Notifications/Emby.Notifications.csproj b/Emby.Notifications/Emby.Notifications.csproj index 881be692b8..5b5ae445e6 100644 --- a/Emby.Notifications/Emby.Notifications.csproj +++ b/Emby.Notifications/Emby.Notifications.csproj @@ -5,6 +5,10 @@ false + + + + diff --git a/Emby.Notifications/Properties/AssemblyInfo.cs b/Emby.Notifications/Properties/AssemblyInfo.cs index d35c8b2895..fd70375515 100644 --- a/Emby.Notifications/Properties/AssemblyInfo.cs +++ b/Emby.Notifications/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Emby.Photos/Properties/AssemblyInfo.cs b/Emby.Photos/Properties/AssemblyInfo.cs index 49ac833457..cd563b24fe 100644 --- a/Emby.Photos/Properties/AssemblyInfo.cs +++ b/Emby.Photos/Properties/AssemblyInfo.cs @@ -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 +// 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.*")] \ No newline at end of file diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs index 3f7b907a9e..eca1ff0f50 100644 --- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs +++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs @@ -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 /// The name of this item (singular form) 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)); } } } diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index 91a4a5fd45..822219132e 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -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 reader) + private static ActivityLogEntry GetEntry(IReadOnlyList reader) { var index = 0; diff --git a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs index 3e12bc0b6e..3ad2d4b91f 100644 --- a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs +++ b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs @@ -55,61 +55,31 @@ namespace Emby.Server.Implementations.AppBase } private const string _virtualDataPath = "%AppDataPath%"; - public string VirtualDataPath - { - get - { - return _virtualDataPath; - } - } + public string VirtualDataPath => _virtualDataPath; /// /// Gets the image cache path. /// /// The image cache path. - public string ImageCachePath - { - get - { - return Path.Combine(CachePath, "images"); - } - } + public string ImageCachePath => Path.Combine(CachePath, "images"); /// /// Gets the path to the plugin directory /// /// The plugins path. - public string PluginsPath - { - get - { - return Path.Combine(ProgramDataPath, "plugins"); - } - } + public string PluginsPath => Path.Combine(ProgramDataPath, "plugins"); /// /// Gets the path to the plugin configurations directory /// /// The plugin configurations path. - public string PluginConfigurationsPath - { - get - { - return Path.Combine(PluginsPath, "configurations"); - } - } + public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations"); /// /// Gets the path to where temporary update files will be stored /// /// The plugin configurations path. - public string TempUpdatePath - { - get - { - return Path.Combine(ProgramDataPath, "updates"); - } - } + public string TempUpdatePath => Path.Combine(ProgramDataPath, "updates"); /// /// The _log directory @@ -133,10 +103,7 @@ namespace Emby.Server.Implementations.AppBase return _logDirectoryPath; } - set - { - _logDirectoryPath = value; - } + set => _logDirectoryPath = value; } /// @@ -161,23 +128,14 @@ namespace Emby.Server.Implementations.AppBase return _configurationDirectoryPath; } - set - { - _configurationDirectoryPath = value; - } + set => _configurationDirectoryPath = value; } /// /// Gets the path to the system configuration file /// /// The system configuration file path. - public string SystemConfigurationFilePath - { - get - { - return Path.Combine(ConfigurationDirectoryPath, "system.xml"); - } - } + public string SystemConfigurationFilePath => Path.Combine(ConfigurationDirectoryPath, "system.xml"); /// /// The _cache directory @@ -200,22 +158,13 @@ namespace Emby.Server.Implementations.AppBase return _cachePath; } - set - { - _cachePath = value; - } + set => _cachePath = value; } /// /// Gets the folder path to the temp directory within the cache folder /// /// The temp directory. - public string TempDirectory - { - get - { - return Path.Combine(CachePath, "temp"); - } - } + public string TempDirectory => Path.Combine(CachePath, "temp"); } } diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index bc5168fe83..222a93a106 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -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 /// The application paths. /// The logger factory. /// The XML serializer. + /// The file system 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); diff --git a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs index d6a41dd67b..ee6da95fe1 100644 --- a/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs +++ b/Emby.Server.Implementations/AppBase/ConfigurationHelper.cs @@ -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 /// The type. /// The path. /// The XML serializer. + /// The file system /// System.Object. public static object GetXmlConfiguration(Type type, string path, IXmlSerializer xmlSerializer, IFileSystem fileSystem) { diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index b020b33c31..386f429598 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1,4 +1,4 @@ -using Emby.Common.Implementations.Serialization; +using Emby.Common.Implementations.Serialization; using Emby.Drawing; using Emby.Photos; using Emby.Dlna; @@ -132,13 +132,7 @@ namespace Emby.Server.Implementations /// Gets or sets a value indicating whether this instance can self update. /// /// true if this instance can self update; otherwise, false. - public virtual bool CanSelfUpdate - { - get - { - return false; - } - } + public virtual bool CanSelfUpdate => false; public virtual bool CanLaunchWebBrowser { @@ -245,10 +239,7 @@ namespace Emby.Server.Implementations } } - public virtual string OperatingSystemDisplayName - { - get { return EnvironmentInfo.OperatingSystemName; } - } + public virtual string OperatingSystemDisplayName => EnvironmentInfo.OperatingSystemName; /// /// The container @@ -261,10 +252,7 @@ namespace Emby.Server.Implementations /// Gets the server configuration manager. /// /// The server configuration manager. - public IServerConfigurationManager ServerConfigurationManager - { - get { return (IServerConfigurationManager)ConfigurationManager; } - } + public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager; /// /// Gets the configuration manager. @@ -453,13 +441,7 @@ namespace Emby.Server.Implementations /// Gets the current application version /// /// The application version. - 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 @@ -479,15 +461,9 @@ namespace Emby.Server.Implementations /// Gets the name. /// /// The name. - public string Name - { - get - { - return "Emby Server"; - } - } + public string Name => "Emby Server"; - private Tuple GetAssembly(Type type) + private static Tuple GetAssembly(Type type) { var assembly = type.GetTypeInfo().Assembly; string path = null; @@ -513,7 +489,7 @@ namespace Emby.Server.Implementations /// /// Creates the instance safe. /// - /// The type. + /// The type information. /// System.Object. protected object CreateInstanceSafe(Tuple typeInfo) { @@ -1004,13 +980,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) { @@ -1049,7 +1019,7 @@ namespace Emby.Server.Implementations return name + "/" + ApplicationVersion; } - private string FormatAttribute(string str) + private static string FormatAttribute(string str) { var arr = str.ToCharArray(); @@ -1066,13 +1036,7 @@ namespace Emby.Server.Implementations return result; } - protected virtual bool SupportsDualModeSockets - { - get - { - return true; - } - } + protected virtual bool SupportsDualModeSockets => true; private X509Certificate GetCertificate(CertificateInfo info) { @@ -1927,18 +1891,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 GetLocalApiUrl(CancellationToken cancellationToken) { @@ -2132,15 +2087,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; } @@ -2177,7 +2127,7 @@ namespace Emby.Server.Implementations private bool _hasUpdateAvailable; public bool HasUpdateAvailable { - get { return _hasUpdateAvailable; } + get => _hasUpdateAvailable; set { var fireEvent = value && !_hasUpdateAvailable; diff --git a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs index a6643e83ca..7eded70c02 100644 --- a/Emby.Server.Implementations/Channels/ChannelImageProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelImageProvider.cs @@ -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) { diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs index c2160d3384..8924d57ee5 100644 --- a/Emby.Server.Implementations/Channels/ChannelManager.cs +++ b/Emby.Server.Implementations/Channels/ChannelManager.cs @@ -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 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 @@ -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() diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs index ab6acf3c57..1e7818630c 100644 --- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs +++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs @@ -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 progress) { @@ -77,9 +59,6 @@ namespace Emby.Server.Implementations.Channels }; } - public string Key - { - get { return "RefreshInternetChannels"; } - } + public string Key => "RefreshInternetChannels"; } } diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 0154211970..6180645e41 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -38,28 +38,19 @@ namespace Emby.Server.Implementations.Configuration /// Gets the type of the configuration. /// /// The type of the configuration. - protected override Type ConfigurationType - { - get { return typeof(ServerConfiguration); } - } + protected override Type ConfigurationType => typeof(ServerConfiguration); /// /// Gets the application paths. /// /// The application paths. - public IServerApplicationPaths ApplicationPaths - { - get { return (IServerApplicationPaths)CommonApplicationPaths; } - } + public IServerApplicationPaths ApplicationPaths => (IServerApplicationPaths)CommonApplicationPaths; /// /// Gets the configuration. /// /// The configuration. - public ServerConfiguration Configuration - { - get { return (ServerConfiguration)CommonConfiguration; } - } + public ServerConfiguration Configuration => (ServerConfiguration)CommonConfiguration; /// /// Called when [configuration updated]. diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index 59776c3736..c714ba91b6 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -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."); } } diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs index 00e1956cf8..49d8f79a2e 100644 --- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs @@ -32,13 +32,7 @@ namespace Emby.Server.Implementations.Data /// Gets the name of the repository /// /// The name. - public string Name - { - get - { - return "SQLite"; - } - } + public string Name => "SQLite"; /// /// 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(); diff --git a/Emby.Server.Implementations/Data/SqliteExtensions.cs b/Emby.Server.Implementations/Data/SqliteExtensions.cs index a755c65f4a..d9b2db56e7 100644 --- a/Emby.Server.Implementations/Data/SqliteExtensions.cs +++ b/Emby.Server.Implementations/Data/SqliteExtensions.cs @@ -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()) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 0f9770e8f7..96b650ee03 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -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 { @@ -558,7 +558,7 @@ namespace Emby.Server.Implementations.Data { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } SaveItems(new List { 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 /// /// Gets chapters for an item /// - /// The id. + /// The item. /// IEnumerable{ChapterInfo}. /// id public List GetChapters(BaseItem item) @@ -1996,7 +1996,7 @@ namespace Emby.Server.Implementations.Data /// /// Gets a single chapter for an item /// - /// The id. + /// The item. /// The index. /// ChapterInfo. /// id @@ -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(); diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs index 6d4ddcedd9..cf60b71d63 100644 --- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs @@ -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 /// /// The name. - public string Name - { - get - { - return "SQLite"; - } - } + public string Name => "SQLite"; /// /// 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; /// /// 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 /// /// Persists the user data. /// - /// The user id. + /// The user id. /// The key. /// The user data. /// The cancellation token. @@ -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 /// /// Gets the user data. /// - /// The user id. + /// The user id. /// The key. /// Task{UserItemData}. /// @@ -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 /// /// Return all user-data associated with the given user /// - /// + /// /// public List GetAllUserData(long internalUserId) { if (internalUserId <= 0) { - throw new ArgumentNullException("internalUserId"); + throw new ArgumentNullException(nameof(internalUserId)); } var list = new List(); diff --git a/Emby.Server.Implementations/Data/SqliteUserRepository.cs b/Emby.Server.Implementations/Data/SqliteUserRepository.cs index d490a481e4..125f254c10 100644 --- a/Emby.Server.Implementations/Data/SqliteUserRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteUserRepository.cs @@ -31,13 +31,7 @@ namespace Emby.Server.Implementations.Data /// Gets the name of the repository /// /// The name. - public string Name - { - get - { - return "SQLite"; - } - } + public string Name => "SQLite"; /// /// 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. /// /// The user. - /// The cancellation token. /// Task. /// user public void DeleteUser(User user) { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } using (WriteLock.Write()) diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.cs index f4b37749e7..e0c2de918f 100644 --- a/Emby.Server.Implementations/Data/TypeMapper.cs +++ b/Emby.Server.Implementations/Data/TypeMapper.cs @@ -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); diff --git a/Emby.Server.Implementations/Devices/DeviceId.cs b/Emby.Server.Implementations/Devices/DeviceId.cs index 90cef5d06e..d85e5c296d 100644 --- a/Emby.Server.Implementations/Devices/DeviceId.cs +++ b/Emby.Server.Implementations/Devices/DeviceId.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Text; using MediaBrowser.Common.Configuration; @@ -15,10 +15,7 @@ namespace Emby.Server.Implementations.Devices 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() { @@ -70,7 +67,7 @@ namespace Emby.Server.Implementations.Devices } } - private string GetNewId() + private static string GetNewId() { return Guid.NewGuid().ToString("N"); } @@ -93,7 +90,7 @@ namespace Emby.Server.Implementations.Devices public DeviceId(IApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem) { if (fileSystem == null) { - throw new ArgumentNullException ("fileSystem"); + throw new ArgumentNullException(nameof(fileSystem)); } _appPaths = appPaths; @@ -101,9 +98,6 @@ namespace Emby.Server.Implementations.Devices _fileSystem = fileSystem; } - public string Value - { - get { return _id ?? (_id = GetDeviceId()); } - } + public string Value => _id ?? (_id = GetDeviceId()); } } diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs index f5314df6e1..0b15daac98 100644 --- a/Emby.Server.Implementations/Devices/DeviceManager.cs +++ b/Emby.Server.Implementations/Devices/DeviceManager.cs @@ -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) { diff --git a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs index a709607bde..99871a3c6a 100644 --- a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs +++ b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs @@ -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() { diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7871d3fb3b..3d519f35dd 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -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 GetTaggedItems(IItemByName byName, User user, DtoOptions options) + private static IList 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 taggedItems, User user = null) + private static void SetItemByNameInfo(BaseItem item, BaseItemDto dto, IList 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; } diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index 6cd867921f..6c658a695f 100644 --- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -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 diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs index bb8ef52f18..5958c5a1a6 100644 --- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs @@ -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>(new Tuple(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) { diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs index 0b377dc682..c7bd03960d 100644 --- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs +++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs @@ -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) { diff --git a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs index 660ca3a941..f0b834ccb4 100644 --- a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs +++ b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs @@ -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; diff --git a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs index 655867577b..24a3456c45 100644 --- a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs +++ b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs @@ -29,14 +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 Architecture SystemArchitecture { get { return RuntimeInformation.OSArchitecture; } } + public Architecture SystemArchitecture => RuntimeInformation.OSArchitecture; } } diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs index d3ba1b683e..6494f0c6f2 100644 --- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs @@ -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 /// /// The URL. /// System.String. - 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 GetResponseAsync(WebRequest request, TimeSpan timeout) + private static Task GetResponseAsync(WebRequest request, TimeSpan timeout) { var taskCompletion = new TaskCompletionSource(); diff --git a/Emby.Server.Implementations/HttpServer/FileWriter.cs b/Emby.Server.Implementations/HttpServer/FileWriter.cs index 1a875e5334..e0e5791656 100644 --- a/Emby.Server.Implementations/HttpServer/FileWriter.cs +++ b/Emby.Server.Implementations/HttpServer/FileWriter.cs @@ -38,10 +38,7 @@ namespace Emby.Server.Implementations.HttpServer /// Gets the options. /// /// The options. - public IDictionary Headers - { - get { return _options; } - } + public IDictionary Headers => _options; public string Path { get; set; } @@ -49,7 +46,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(contentType)) { - throw new ArgumentNullException("contentType"); + throw new ArgumentNullException(nameof(contentType)); } Path = path; @@ -203,8 +200,8 @@ namespace Emby.Server.Implementations.HttpServer public HttpStatusCode StatusCode { - get { return (HttpStatusCode)Status; } - set { Status = (int)value; } + get => (HttpStatusCode)Status; + set => Status = (int)value; } public string StatusDescription { get; set; } diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 69ca0f85b6..f5c93a096e 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Net; using Microsoft.Extensions.Logging; @@ -89,13 +89,7 @@ namespace Emby.Server.Implementations.HttpServer {typeof (ArgumentException), 400} }; - protected ILogger Logger - { - get - { - return _logger; - } - } + protected ILogger Logger => _logger; public object CreateInstance(Type type) { @@ -190,10 +184,9 @@ namespace Emby.Server.Implementations.HttpServer } } - private Exception GetActualException(Exception ex) + private static Exception GetActualException(Exception ex) { - var agg = ex as AggregateException; - if (agg != null) + if (ex is AggregateException agg) { var inner = agg.InnerException; if (inner != null) @@ -346,7 +339,7 @@ namespace Emby.Server.Implementations.HttpServer return false; } - private string GetExtension(string url) + private static string GetExtension(string url) { var parts = url.Split(new[] { '?' }, 2); @@ -379,18 +372,18 @@ namespace Emby.Server.Implementations.HttpServer string pagePathWithoutQueryString = url.Split(new[] { '?' }, StringSplitOptions.RemoveEmptyEntries)[0]; return newQueryString.Count > 0 - ? String.Format("{0}?{1}", pagePathWithoutQueryString, newQueryString) + ? string.Format("{0}?{1}", pagePathWithoutQueryString, newQueryString) : pagePathWithoutQueryString; } - private string GetUrlToLog(string url) + private static string GetUrlToLog(string url) { url = RemoveQueryStringByKey(url, "api_key"); return url; } - private string NormalizeConfiguredLocalAddress(string address) + private static string NormalizeConfiguredLocalAddress(string address) { var index = address.Trim('/').IndexOf('/'); @@ -727,7 +720,7 @@ namespace Emby.Server.Implementations.HttpServer return null; } - private Task Write(IResponse response, string text) + private static Task Write(IResponse response, string text) { var bOutput = Encoding.UTF8.GetBytes(text); response.SetContentLength(bOutput.Length); @@ -853,7 +846,9 @@ namespace Emby.Server.Implementations.HttpServer return _jsonSerializer.DeserializeFromStreamAsync(stream, type); } - private string NormalizeEmbyRoutePath(string path) + //TODO Add Jellyfin Route Path Normalizer + + private static string NormalizeEmbyRoutePath(string path) { if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) { @@ -863,7 +858,7 @@ namespace Emby.Server.Implementations.HttpServer return "emby/" + path; } - private string NormalizeMediaBrowserRoutePath(string path) + private static string NormalizeMediaBrowserRoutePath(string path) { if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) { @@ -873,7 +868,7 @@ namespace Emby.Server.Implementations.HttpServer return "mediabrowser/" + path; } - private string DoubleNormalizeEmbyRoutePath(string path) + private static string DoubleNormalizeEmbyRoutePath(string path) { if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) { diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 73b2afe640..05ec18642e 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Net; using Microsoft.Extensions.Logging; using MediaBrowser.Model.Serialization; @@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.HttpServer { if (result == null) { - throw new ArgumentNullException("result"); + throw new ArgumentNullException(nameof(result)); } if (responseHeaders == null) @@ -245,7 +245,7 @@ namespace Emby.Server.Implementations.HttpServer return GetCompressionType(request); } - private string GetCompressionType(IRequest request) + private static string GetCompressionType(IRequest request) { var acceptEncoding = request.Headers["Accept-Encoding"]; @@ -365,7 +365,7 @@ namespace Emby.Server.Implementations.HttpServer return _brotliCompressor.Compress(bytes); } - private byte[] Deflate(byte[] bytes) + private static byte[] Deflate(byte[] bytes) { // In .NET FX incompat-ville, you can't access compressed bytes without closing DeflateStream // Which means we must use MemoryStream since you have to use ToArray() on a closed Stream @@ -379,7 +379,7 @@ namespace Emby.Server.Implementations.HttpServer } } - private byte[] GZip(byte[] buffer) + private static byte[] GZip(byte[] buffer) { using (var ms = new MemoryStream()) using (var zipStream = new GZipStream(ms, CompressionMode.Compress)) @@ -398,7 +398,7 @@ namespace Emby.Server.Implementations.HttpServer : contentType.Split(';')[0].ToLower().Trim(); } - private string SerializeToXmlString(object from) + private static string SerializeToXmlString(object from) { using (var ms = new MemoryStream()) { @@ -453,7 +453,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } return GetStaticFileResult(requestContext, new StaticFileResultOptions @@ -471,7 +471,7 @@ namespace Emby.Server.Implementations.HttpServer if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } if (fileShare != FileShareMode.Read && fileShare != FileShareMode.ReadWrite) @@ -661,7 +661,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// Adds the expires header. /// - private void AddExpiresHeader(IDictionary responseHeaders, string cacheKey, TimeSpan? cacheDuration) + private static void AddExpiresHeader(IDictionary responseHeaders, string cacheKey, TimeSpan? cacheDuration) { if (cacheDuration.HasValue) { @@ -678,7 +678,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The responseHeaders. /// The last date modified. - private void AddAgeHeader(IDictionary responseHeaders, DateTime? lastDateModified) + private static void AddAgeHeader(IDictionary responseHeaders, DateTime? lastDateModified) { if (lastDateModified.HasValue) { @@ -771,7 +771,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The date. /// DateTime. - private DateTime NormalizeDateForComparison(DateTime date) + private static DateTime NormalizeDateForComparison(DateTime date) { return new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Kind); } @@ -781,7 +781,7 @@ namespace Emby.Server.Implementations.HttpServer /// /// The has options. /// The response headers. - private void AddResponseHeaders(IHasHeaders hasHeaders, IEnumerable> responseHeaders) + private static void AddResponseHeaders(IHasHeaders hasHeaders, IEnumerable> responseHeaders) { foreach (var item in responseHeaders) { diff --git a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs index dc20ee1a24..f08112f9ca 100644 --- a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs +++ b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Globalization; @@ -46,10 +46,7 @@ namespace Emby.Server.Implementations.HttpServer /// Additional HTTP Headers /// /// The headers. - public IDictionary Headers - { - get { return _options; } - } + public IDictionary Headers => _options; /// /// Initializes a new instance of the class. @@ -62,7 +59,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(contentType)) { - throw new ArgumentNullException("contentType"); + throw new ArgumentNullException(nameof(contentType)); } RangeHeader = rangeHeader; @@ -186,7 +183,7 @@ namespace Emby.Server.Implementations.HttpServer } } - private async Task CopyToInternalAsync(Stream source, Stream destination, long copyLength) + private static async Task CopyToInternalAsync(Stream source, Stream destination, long copyLength) { var array = new byte[BufferSize]; int bytesRead; @@ -220,8 +217,8 @@ namespace Emby.Server.Implementations.HttpServer public HttpStatusCode StatusCode { - get { return (HttpStatusCode)Status; } - set { Status = (int)value; } + get => (HttpStatusCode)Status; + set => Status = (int)value; } public string StatusDescription { get; set; } diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs index e153d6f71f..fb5bfa601a 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Entities; @@ -173,7 +173,7 @@ namespace Emby.Server.Implementations.HttpServer.Security return false; } - private void ValidateRoles(string[] roles, User user) + private static void ValidateRoles(string[] roles, User user) { if (roles.Contains("admin", StringComparer.OrdinalIgnoreCase)) { @@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.HttpServer.Security } } - private AuthenticationInfo GetTokenInfo(IRequest request) + private static AuthenticationInfo GetTokenInfo(IRequest request) { object info; request.Items.TryGetValue("OriginalAuthenticationInfo", out info); diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs index c3e2d31708..e632e4d27b 100644 --- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs +++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Connect; +using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Security; using System; @@ -227,7 +227,7 @@ namespace Emby.Server.Implementations.HttpServer.Security return result; } - private string NormalizeValue(string value) + private static string NormalizeValue(string value) { if (string.IsNullOrEmpty(value)) { diff --git a/Emby.Server.Implementations/HttpServer/StreamWriter.cs b/Emby.Server.Implementations/HttpServer/StreamWriter.cs index 0a44a5fe5e..df0d746852 100644 --- a/Emby.Server.Implementations/HttpServer/StreamWriter.cs +++ b/Emby.Server.Implementations/HttpServer/StreamWriter.cs @@ -35,10 +35,7 @@ namespace Emby.Server.Implementations.HttpServer /// Gets the options. /// /// The options. - public IDictionary Headers - { - get { return _options; } - } + public IDictionary Headers => _options; public Action OnComplete { get; set; } public Action OnError { get; set; } @@ -53,7 +50,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(contentType)) { - throw new ArgumentNullException("contentType"); + throw new ArgumentNullException(nameof(contentType)); } SourceStream = source; @@ -77,7 +74,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(contentType)) { - throw new ArgumentNullException("contentType"); + throw new ArgumentNullException(nameof(contentType)); } SourceBytes = source; diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs index 914fa9dbcc..5426114f6f 100644 --- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs +++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs @@ -82,19 +82,19 @@ namespace Emby.Server.Implementations.HttpServer { if (socket == null) { - throw new ArgumentNullException("socket"); + throw new ArgumentNullException(nameof(socket)); } if (string.IsNullOrEmpty(remoteEndPoint)) { - throw new ArgumentNullException("remoteEndPoint"); + throw new ArgumentNullException(nameof(remoteEndPoint)); } if (jsonSerializer == null) { - throw new ArgumentNullException("jsonSerializer"); + throw new ArgumentNullException(nameof(jsonSerializer)); } if (logger == null) { - throw new ArgumentNullException("logger"); + throw new ArgumentNullException(nameof(logger)); } Id = Guid.NewGuid(); @@ -148,7 +148,8 @@ namespace Emby.Server.Implementations.HttpServer /// /// Called when [receive]. /// - /// The bytes. + /// The memory block. + /// The length of the memory block. private void OnReceiveInternal(Memory memory, int length) { LastActivityDate = DateTime.UtcNow; @@ -219,7 +220,7 @@ namespace Emby.Server.Implementations.HttpServer { if (message == null) { - throw new ArgumentNullException("message"); + throw new ArgumentNullException(nameof(message)); } var json = _jsonSerializer.SerializeToString(message); @@ -237,7 +238,7 @@ namespace Emby.Server.Implementations.HttpServer { if (buffer == null) { - throw new ArgumentNullException("buffer"); + throw new ArgumentNullException(nameof(buffer)); } cancellationToken.ThrowIfCancellationRequested(); @@ -249,7 +250,7 @@ namespace Emby.Server.Implementations.HttpServer { if (string.IsNullOrEmpty(text)) { - throw new ArgumentNullException("text"); + throw new ArgumentNullException(nameof(text)); } cancellationToken.ThrowIfCancellationRequested(); @@ -261,10 +262,7 @@ namespace Emby.Server.Implementations.HttpServer /// Gets the state. /// /// The state. - public WebSocketState State - { - get { return _socket.State; } - } + public WebSocketState State => _socket.State; /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 34c711324b..56fbf622ce 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } if (!_affectedPaths.Contains(path, StringComparer.Ordinal)) @@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } lock (_timerLock) diff --git a/Emby.Server.Implementations/IO/IsoManager.cs b/Emby.Server.Implementations/IO/IsoManager.cs index 903d5f301f..e0cf328681 100644 --- a/Emby.Server.Implementations/IO/IsoManager.cs +++ b/Emby.Server.Implementations/IO/IsoManager.cs @@ -29,7 +29,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(isoPath)) { - throw new ArgumentNullException("isoPath"); + throw new ArgumentNullException(nameof(isoPath)); } var mounter = _mounters.FirstOrDefault(i => i.CanMount(isoPath)); diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs index ca5810fd6c..9a224bd0e3 100644 --- a/Emby.Server.Implementations/IO/LibraryMonitor.cs +++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs @@ -77,7 +77,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } TemporarilyIgnore(path); @@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } // This is an arbitraty amount of time, but delay it because file system writes often trigger events long after the file was actually written to. @@ -145,7 +145,7 @@ namespace Emby.Server.Implementations.IO { if (taskManager == null) { - throw new ArgumentNullException("taskManager"); + throw new ArgumentNullException(nameof(taskManager)); } LibraryManager = libraryManager; @@ -268,7 +268,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } path = path.TrimEnd(Path.DirectorySeparatorChar); @@ -469,7 +469,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var filename = Path.GetFileName(path); diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 0f85e0642b..5a5523a56d 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -85,17 +85,11 @@ namespace Emby.Server.Implementations.IO { // Be consistent across platforms because the windows server will fail to query network shares that don't follow windows conventions // https://referencesource.microsoft.com/#mscorlib/system/io/path.cs - _invalidFileNameChars = new char[] { '\"', '<', '>', '|', '\0', (Char)1, (Char)2, (Char)3, (Char)4, (Char)5, (Char)6, (Char)7, (Char)8, (Char)9, (Char)10, (Char)11, (Char)12, (Char)13, (Char)14, (Char)15, (Char)16, (Char)17, (Char)18, (Char)19, (Char)20, (Char)21, (Char)22, (Char)23, (Char)24, (Char)25, (Char)26, (Char)27, (Char)28, (Char)29, (Char)30, (Char)31, ':', '*', '?', '\\', '/' }; + _invalidFileNameChars = new char[] { '\"', '<', '>', '|', '\0', (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10, (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20, (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30, (char)31, ':', '*', '?', '\\', '/' }; } } - public char DirectorySeparatorChar - { - get - { - return Path.DirectorySeparatorChar; - } - } + public char DirectorySeparatorChar => Path.DirectorySeparatorChar; public string GetFullPath(string path) { @@ -112,7 +106,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(filename)) { - throw new ArgumentNullException("filename"); + throw new ArgumentNullException(nameof(filename)); } var extension = Path.GetExtension(filename); @@ -129,7 +123,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(filename)) { - throw new ArgumentNullException("filename"); + throw new ArgumentNullException(nameof(filename)); } var extension = Path.GetExtension(filename); @@ -145,7 +139,7 @@ namespace Emby.Server.Implementations.IO public string MakeAbsolutePath(string folderPath, string filePath) { - if (String.IsNullOrWhiteSpace(filePath)) return filePath; + if (string.IsNullOrWhiteSpace(filePath)) return filePath; if (filePath.Contains(@"://")) return filePath; //stream if (filePath.Length > 3 && filePath[1] == ':' && filePath[2] == '/') return filePath; //absolute local path @@ -200,12 +194,12 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(shortcutPath)) { - throw new ArgumentNullException("shortcutPath"); + throw new ArgumentNullException(nameof(shortcutPath)); } if (string.IsNullOrEmpty(target)) { - throw new ArgumentNullException("target"); + throw new ArgumentNullException(nameof(target)); } var extension = Path.GetExtension(shortcutPath); @@ -321,7 +315,7 @@ namespace Emby.Server.Implementations.IO return result; } - private ExtendedFileSystemInfo GetExtendedFileSystemInfo(string path) + private static ExtendedFileSystemInfo GetExtendedFileSystemInfo(string path) { var result = new ExtendedFileSystemInfo(); @@ -456,13 +450,13 @@ namespace Emby.Server.Implementations.IO return new FileStream(path, GetFileMode(mode), GetFileAccess(access), GetFileShare(share), defaultBufferSize, GetFileOptions(fileOpenOptions)); } - private FileOptions GetFileOptions(FileOpenOptions mode) + private static FileOptions GetFileOptions(FileOpenOptions mode) { var val = (int)mode; return (FileOptions)val; } - private FileMode GetFileMode(FileOpenMode mode) + private static FileMode GetFileMode(FileOpenMode mode) { switch (mode) { @@ -483,7 +477,7 @@ namespace Emby.Server.Implementations.IO } } - private FileAccess GetFileAccess(FileAccessMode mode) + private static FileAccess GetFileAccess(FileAccessMode mode) { switch (mode) { @@ -498,7 +492,7 @@ namespace Emby.Server.Implementations.IO } } - private FileShare GetFileShare(FileShareMode mode) + private static FileShare GetFileShare(FileShareMode mode) { switch (mode) { @@ -619,12 +613,12 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(file1)) { - throw new ArgumentNullException("file1"); + throw new ArgumentNullException(nameof(file1)); } if (string.IsNullOrEmpty(file2)) { - throw new ArgumentNullException("file2"); + throw new ArgumentNullException(nameof(file2)); } var temp1 = Path.Combine(_tempPath, Guid.NewGuid().ToString("N")); @@ -640,7 +634,7 @@ namespace Emby.Server.Implementations.IO CopyFile(temp1, file2, true); } - private char GetDirectorySeparatorChar(string path) + private static char GetDirectorySeparatorChar(string path) { return Path.DirectorySeparatorChar; } @@ -649,12 +643,12 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(parentPath)) { - throw new ArgumentNullException("parentPath"); + throw new ArgumentNullException(nameof(parentPath)); } if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var separatorChar = GetDirectorySeparatorChar(parentPath); @@ -666,7 +660,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var parent = GetDirectoryName(path); @@ -688,7 +682,7 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } if (path.EndsWith(":\\", StringComparison.OrdinalIgnoreCase)) @@ -772,7 +766,7 @@ namespace Emby.Server.Implementations.IO }).ToList(); } - private string GetName(DriveInfo drive) + private static string GetName(DriveInfo drive) { return drive.Name; } @@ -972,7 +966,7 @@ namespace Emby.Server.Implementations.IO } } - private void RunProcess(string path, string args, string workingDirectory) + private static void RunProcess(string path, string args, string workingDirectory) { using (var process = Process.Start(new ProcessStartInfo { diff --git a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs index aef53751ee..8ac662f78e 100644 --- a/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs +++ b/Emby.Server.Implementations/IO/MbLinkShortcutHandler.cs @@ -15,16 +15,13 @@ namespace Emby.Server.Implementations.IO _fileSystem = fileSystem; } - public string Extension - { - get { return ".mblink"; } - } + public string Extension => ".mblink"; public string Resolve(string shortcutPath) { if (string.IsNullOrEmpty(shortcutPath)) { - throw new ArgumentNullException("filenshortcutPathame"); + throw new ArgumentException("Shortcut path is empty or null.", nameof(shortcutPath)); } if (string.Equals(Path.GetExtension(shortcutPath), ".mblink", StringComparison.OrdinalIgnoreCase)) @@ -41,12 +38,12 @@ namespace Emby.Server.Implementations.IO { if (string.IsNullOrEmpty(shortcutPath)) { - throw new ArgumentNullException("shortcutPath"); + throw new ArgumentNullException(nameof(shortcutPath)); } if (string.IsNullOrEmpty(targetPath)) { - throw new ArgumentNullException("targetPath"); + throw new ArgumentNullException(nameof(targetPath)); } _fileSystem.WriteAllText(shortcutPath, targetPath); diff --git a/Emby.Server.Implementations/IO/ThrottledStream.cs b/Emby.Server.Implementations/IO/ThrottledStream.cs index 81760b6397..3635ee1db7 100644 --- a/Emby.Server.Implementations/IO/ThrottledStream.cs +++ b/Emby.Server.Implementations/IO/ThrottledStream.cs @@ -42,13 +42,7 @@ namespace Emby.Server.Implementations.IO /// Gets the current milliseconds. /// /// The current milliseconds. - protected long CurrentMilliseconds - { - get - { - return Environment.TickCount; - } - } + protected long CurrentMilliseconds => Environment.TickCount; /// /// Gets or sets the maximum bytes per second that can be transferred through the base stream. @@ -56,10 +50,7 @@ namespace Emby.Server.Implementations.IO /// The maximum bytes per second. public long MaximumBytesPerSecond { - get - { - return _maximumBytesPerSecond; - } + get => _maximumBytesPerSecond; set { if (MaximumBytesPerSecond != value) @@ -74,39 +65,21 @@ namespace Emby.Server.Implementations.IO /// Gets a value indicating whether the current stream supports reading. /// /// true if the stream supports reading; otherwise, false. - public override bool CanRead - { - get - { - return _baseStream.CanRead; - } - } + public override bool CanRead => _baseStream.CanRead; /// /// Gets a value indicating whether the current stream supports seeking. /// /// /// true if the stream supports seeking; otherwise, false. - public override bool CanSeek - { - get - { - return _baseStream.CanSeek; - } - } + public override bool CanSeek => _baseStream.CanSeek; /// /// Gets a value indicating whether the current stream supports writing. /// /// /// true if the stream supports writing; otherwise, false. - public override bool CanWrite - { - get - { - return _baseStream.CanWrite; - } - } + public override bool CanWrite => _baseStream.CanWrite; /// /// Gets the length in bytes of the stream. @@ -115,13 +88,7 @@ namespace Emby.Server.Implementations.IO /// A long value representing the length of the stream in bytes. /// The base stream does not support seeking. /// Methods were called after the stream was closed. - public override long Length - { - get - { - return _baseStream.Length; - } - } + public override long Length => _baseStream.Length; /// /// Gets or sets the position within the current stream. @@ -133,14 +100,8 @@ namespace Emby.Server.Implementations.IO /// Methods were called after the stream was closed. public override long Position { - get - { - return _baseStream.Position; - } - set - { - _baseStream.Position = value; - } + get => _baseStream.Position; + set => _baseStream.Position = value; } #endregion @@ -158,12 +119,12 @@ namespace Emby.Server.Implementations.IO { if (baseStream == null) { - throw new ArgumentNullException("baseStream"); + throw new ArgumentNullException(nameof(baseStream)); } if (maximumBytesPerSecond < 0) { - throw new ArgumentOutOfRangeException("maximumBytesPerSecond", + throw new ArgumentOutOfRangeException(nameof(maximumBytesPerSecond), maximumBytesPerSecond, "The maximum number of bytes per second can't be negative."); } diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs index be17893d8f..964e389620 100644 --- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs +++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs @@ -193,10 +193,7 @@ namespace Emby.Server.Implementations.Images return outputPath; } - public string Name - { - get { return "Dynamic Image Provider"; } - } + public string Name => "Dynamic Image Provider"; protected virtual string CreateImage(BaseItem item, List itemsWithImages, @@ -232,10 +229,7 @@ namespace Emby.Server.Implementations.Images throw new ArgumentException("Unexpected image type"); } - protected virtual int MaxImageAgeDays - { - get { return 7; } - } + protected virtual int MaxImageAgeDays => 7; public bool HasChanged(BaseItem item, IDirectoryService directoryServicee) { @@ -293,14 +287,7 @@ namespace Emby.Server.Implementations.Images return true; } - public int Order - { - get - { - // Run before the default image provider which will download placeholders - return 0; - } - } + public int Order => 0; protected string CreateSingleImage(List itemsWithImages, string outputPathWithoutExtension, ImageType imageType) { diff --git a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs index 7c79a7c69e..775b5d283c 100644 --- a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs +++ b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs @@ -67,7 +67,7 @@ namespace Emby.Server.Implementations.Library if (string.IsNullOrWhiteSpace(newPasswordHash)) { - throw new ArgumentNullException("newPasswordHash"); + throw new ArgumentNullException(nameof(newPasswordHash)); } user.Password = newPasswordHash; diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 451f16bef8..464fd2863d 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Progress; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; @@ -147,13 +147,7 @@ namespace Emby.Server.Implementations.Library /// Gets the library items cache. /// /// The library items cache. - private ConcurrentDictionary LibraryItemsCache - { - get - { - return _libraryItemsCache; - } - } + private ConcurrentDictionary LibraryItemsCache => _libraryItemsCache; private readonly IFileSystem _fileSystem; @@ -188,7 +182,6 @@ namespace Emby.Server.Implementations.Library /// Adds the parts. /// /// The rules. - /// The plugin folders. /// The resolvers. /// The intro providers. /// The item comparers. @@ -277,7 +270,7 @@ namespace Emby.Server.Implementations.Library { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } if (item is IItemByName) { @@ -317,7 +310,7 @@ namespace Emby.Server.Implementations.Library { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } var parent = item.GetOwner() ?? item.GetParent(); @@ -329,7 +322,7 @@ namespace Emby.Server.Implementations.Library { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } if (item.SourceType == SourceType.Channel) @@ -449,7 +442,7 @@ namespace Emby.Server.Implementations.Library ReportItemRemoved(item, parent); } - private IEnumerable GetMetadataPaths(BaseItem item, IEnumerable children) + private static IEnumerable GetMetadataPaths(BaseItem item, IEnumerable children) { var list = new List { @@ -502,11 +495,11 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(key)) { - throw new ArgumentNullException("key"); + throw new ArgumentNullException(nameof(key)); } if (type == null) { - throw new ArgumentNullException("type"); + throw new ArgumentNullException(nameof(type)); } if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) @@ -542,7 +535,7 @@ namespace Emby.Server.Implementations.Library { if (fileInfo == null) { - throw new ArgumentNullException("fileInfo"); + throw new ArgumentNullException(nameof(fileInfo)); } var fullPath = fileInfo.FullName; @@ -823,7 +816,7 @@ namespace Emby.Server.Implementations.Library if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } //_logger.LogInformation("FindByPath {0}", path); @@ -921,7 +914,7 @@ namespace Emby.Server.Implementations.Library { if (value <= 0) { - throw new ArgumentOutOfRangeException("Years less than or equal to 0 are invalid."); + throw new ArgumentOutOfRangeException(nameof(value),"Years less than or equal to 0 are invalid."); } var name = value.ToString(CultureInfo.InvariantCulture); @@ -1249,7 +1242,7 @@ namespace Emby.Server.Implementations.Library { if (id.Equals(Guid.Empty)) { - throw new ArgumentNullException("id"); + throw new ArgumentNullException(nameof(id)); } BaseItem item; @@ -1828,7 +1821,7 @@ namespace Emby.Server.Implementations.Library /// Creates the item. /// /// The item. - /// The cancellation token. + /// The parent item. /// Task. public void CreateItem(BaseItem item, BaseItem parent) { @@ -2023,7 +2016,7 @@ namespace Emby.Server.Implementations.Library return GetCollectionFoldersInternal(item, allUserRootChildren); } - private List GetCollectionFoldersInternal(BaseItem item, List allUserRootChildren) + private static List GetCollectionFoldersInternal(BaseItem item, List allUserRootChildren) { return allUserRootChildren .Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path, StringComparer.OrdinalIgnoreCase)) @@ -2247,7 +2240,7 @@ namespace Emby.Server.Implementations.Library { if (parent == null) { - throw new ArgumentNullException("parent"); + throw new ArgumentNullException(nameof(parent)); } var name = parent.Name; @@ -2313,7 +2306,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(name)) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } var parentIdString = parentId.Equals(Guid.Empty) ? null : parentId.ToString("N"); @@ -2708,15 +2701,15 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } if (string.IsNullOrWhiteSpace(from)) { - throw new ArgumentNullException("from"); + throw new ArgumentNullException(nameof(from)); } if (string.IsNullOrWhiteSpace(to)) { - throw new ArgumentNullException("to"); + throw new ArgumentNullException(nameof(to)); } from = from.Trim(); @@ -2864,7 +2857,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(name)) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } name = _fileSystem.GetValidFilename(name); @@ -2937,7 +2930,7 @@ namespace Emby.Server.Implementations.Library }); } - private bool ValidateNetworkPath(string path) + private static bool ValidateNetworkPath(string path) { //if (Environment.OSVersion.Platform == PlatformID.Win32NT) //{ @@ -2962,14 +2955,14 @@ namespace Emby.Server.Implementations.Library { if (pathInfo == null) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(pathInfo)); } var path = pathInfo.Path; if (string.IsNullOrWhiteSpace(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } if (!_fileSystem.DirectoryExists(path)) @@ -3017,7 +3010,7 @@ namespace Emby.Server.Implementations.Library { if (pathInfo == null) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(pathInfo)); } if (!string.IsNullOrWhiteSpace(pathInfo.NetworkPath) && !ValidateNetworkPath(pathInfo.NetworkPath)) @@ -3075,7 +3068,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(name)) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; @@ -3116,7 +3109,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var removeList = new List(); @@ -3148,7 +3141,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(mediaPath)) { - throw new ArgumentNullException("mediaPath"); + throw new ArgumentNullException(nameof(mediaPath)); } var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs index ddda4b2c39..3578d87639 100644 --- a/Emby.Server.Implementations/Library/MediaSourceManager.cs +++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; @@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.Library return list; } - private bool StreamSupportsExternalStream(MediaStream stream) + private static bool StreamSupportsExternalStream(MediaStream stream) { if (stream.IsExternal) { @@ -261,7 +261,7 @@ namespace Emby.Server.Implementations.Library } } - private void SetKeyProperties(IMediaSourceProvider provider, MediaSourceInfo mediaSource) + private static void SetKeyProperties(IMediaSourceProvider provider, MediaSourceInfo mediaSource) { var prefix = provider.GetType().FullName.GetMD5().ToString("N") + LiveStreamIdDelimeter; @@ -292,7 +292,7 @@ namespace Emby.Server.Implementations.Library { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } var hasMediaSources = (IHasMediaSources)item; @@ -401,7 +401,7 @@ namespace Emby.Server.Implementations.Library } } - private IEnumerable SortMediaSources(IEnumerable sources) + private static IEnumerable SortMediaSources(IEnumerable sources) { return sources.OrderBy(i => { @@ -501,7 +501,7 @@ namespace Emby.Server.Implementations.Library }, liveStream as IDirectStreamProvider); } - private void AddMediaInfo(MediaSourceInfo mediaSource, bool isAudio) + private static void AddMediaInfo(MediaSourceInfo mediaSource, bool isAudio) { mediaSource.DefaultSubtitleStreamIndex = null; @@ -629,6 +629,7 @@ namespace Emby.Server.Implementations.Library } catch (Exception ex) { + _logger.LogDebug(ex, "_jsonSerializer.DeserializeFromFile threw an exception."); } } @@ -759,7 +760,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(id)) { - throw new ArgumentNullException("id"); + throw new ArgumentNullException(nameof(id)); } var info = await GetLiveStreamInfo(id, cancellationToken).ConfigureAwait(false); @@ -770,7 +771,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(id)) { - throw new ArgumentNullException("id"); + throw new ArgumentNullException(nameof(id)); } await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); @@ -803,7 +804,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(id)) { - throw new ArgumentNullException("id"); + throw new ArgumentNullException(nameof(id)); } await _liveStreamSemaphore.WaitAsync().ConfigureAwait(false); diff --git a/Emby.Server.Implementations/Library/PathExtensions.cs b/Emby.Server.Implementations/Library/PathExtensions.cs index 28ed2f53ca..2d3019d171 100644 --- a/Emby.Server.Implementations/Library/PathExtensions.cs +++ b/Emby.Server.Implementations/Library/PathExtensions.cs @@ -16,12 +16,12 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrEmpty(str)) { - throw new ArgumentNullException("str"); + throw new ArgumentNullException(nameof(str)); } if (string.IsNullOrEmpty(attrib)) { - throw new ArgumentNullException("attrib"); + throw new ArgumentNullException(nameof(attrib)); } string srch = "[" + attrib + "="; diff --git a/Emby.Server.Implementations/Library/ResolverHelper.cs b/Emby.Server.Implementations/Library/ResolverHelper.cs index 14b28966aa..027d82c588 100644 --- a/Emby.Server.Implementations/Library/ResolverHelper.cs +++ b/Emby.Server.Implementations/Library/ResolverHelper.cs @@ -117,15 +117,15 @@ namespace Emby.Server.Implementations.Library { if (fileSystem == null) { - throw new ArgumentNullException("fileSystem"); + throw new ArgumentNullException(nameof(fileSystem)); } if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } if (args == null) { - throw new ArgumentNullException("args"); + throw new ArgumentNullException(nameof(args)); } // See if a different path came out of the resolver than what went in diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs index 8872bd641e..c7bd1a602d 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using System; @@ -30,10 +30,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get { return ResolverPriority.Fourth; } - } + public override ResolverPriority Priority => ResolverPriority.Fourth; public MultiItemResolverResult ResolveMultiple(Folder parent, List files, @@ -264,12 +261,12 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio result.Extras.Any(i => ContainsFile(i, file)); } - private bool ContainsFile(AudioBookFileInfo result, FileSystemMetadata file) + private static bool ContainsFile(AudioBookFileInfo result, FileSystemMetadata file) { return string.Equals(result.Path, file.FullName, StringComparison.OrdinalIgnoreCase); } - private bool IsIgnored(string filename) + private static bool IsIgnored(string filename) { return false; } diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs index dbfcf41e8b..da5fe48cda 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs @@ -36,14 +36,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get - { - // Behind special folder resolver - return ResolverPriority.Second; - } - } + public override ResolverPriority Priority => ResolverPriority.Second; /// /// Resolves the specified args. diff --git a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs index 71ccd7da8e..b3a5c27c88 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs @@ -35,14 +35,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get - { - // Behind special folder resolver - return ResolverPriority.Second; - } - } + public override ResolverPriority Priority => ResolverPriority.Second; /// /// Resolves the specified args. diff --git a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs index 5e73baa5ce..47e7f7344b 100644 --- a/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs @@ -13,10 +13,7 @@ namespace Emby.Server.Implementations.Library.Resolvers /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get { return ResolverPriority.Last; } - } + public override ResolverPriority Priority => ResolverPriority.Last; /// /// Resolves the specified args. diff --git a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs index b4a37be5f2..529916619c 100644 --- a/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs @@ -25,13 +25,7 @@ namespace Emby.Server.Implementations.Library.Resolvers /// Gets the priority. /// /// The priority. - public virtual ResolverPriority Priority - { - get - { - return ResolverPriority.First; - } - } + public virtual ResolverPriority Priority => ResolverPriority.First; /// /// Sets initial values on the newly resolved item diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs index b9aca14173..d3ab4dd377 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; @@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies /// Sets the provider id from path. /// /// The item. - private void SetProviderIdFromPath(BaseItem item) + private static void SetProviderIdFromPath(BaseItem item) { //we need to only look at the name of this actual item (not parents) var justName = Path.GetFileName(item.Path); diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 68b6c57ae6..0a45317a4e 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; @@ -27,17 +27,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get - { - // Give plugins a chance to catch iso's first - // Also since we have to loop through child files looking for videos, - // see if we can avoid some of that by letting other resolvers claim folders first - // Also run after series resolver - return ResolverPriority.Third; - } - } + public override ResolverPriority Priority => ResolverPriority.Third; public MultiItemResolverResult ResolveMultiple(Folder parent, List files, @@ -176,7 +166,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies return result; } - private bool IsIgnored(string filename) + private static bool IsIgnored(string filename) { // Ignore samples var sampleFilename = " " + filename.Replace(".", " ", StringComparison.OrdinalIgnoreCase) @@ -204,7 +194,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies result.Extras.Any(i => ContainsFile(i, file)); } - private bool ContainsFile(VideoFileInfo result, FileSystemMetadata file) + private static bool ContainsFile(VideoFileInfo result, FileSystemMetadata file) { return string.Equals(result.Path, file.FullName, StringComparison.OrdinalIgnoreCase); } @@ -330,7 +320,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies /// Sets the provider id from path. /// /// The item. - private void SetProviderIdsFromPath(Video item) + private static void SetProviderIdsFromPath(Video item) { if (item is Movie || item is MusicVideo) { diff --git a/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs index 311abf14e3..a073e0bd5b 100644 --- a/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs @@ -79,13 +79,6 @@ namespace Emby.Server.Implementations.Library.Resolvers return false; } - public override ResolverPriority Priority - { - get - { - // Behind special folder resolver - return ResolverPriority.Second; - } - } + public override ResolverPriority Priority => ResolverPriority.Second; } } diff --git a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs index 6a1f8ec6f2..5cf5cd3ad7 100644 --- a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs @@ -26,10 +26,7 @@ namespace Emby.Server.Implementations.Library.Resolvers /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get { return ResolverPriority.First; } - } + public override ResolverPriority Priority => ResolverPriority.First; /// /// Resolves the specified args. diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs index 0fe42fa736..4bfedf3c62 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; @@ -28,6 +28,9 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV /// Initializes a new instance of the class. /// /// The config. + /// The library manager. + /// The localization + /// The logger public SeasonResolver(IServerConfigurationManager config, ILibraryManager libraryManager, ILocalizationManager localization, ILogger logger) { _config = config; diff --git a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index 32e8b6120d..7d2865f0d8 100644 --- a/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; @@ -38,13 +38,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV /// Gets the priority. /// /// The priority. - public override ResolverPriority Priority - { - get - { - return ResolverPriority.Second; - } - } + public override ResolverPriority Priority => ResolverPriority.Second; /// /// Resolves the specified args. @@ -195,7 +189,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var extension = Path.GetExtension(path); @@ -236,7 +230,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV /// /// The item. /// The path. - private void SetProviderIdFromPath(Series item, string path) + private static void SetProviderIdFromPath(Series item, string path) { var justName = Path.GetFileName(path); diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.cs index 1212ba549e..bbb1394395 100644 --- a/Emby.Server.Implementations/Library/SearchEngine.cs +++ b/Emby.Server.Implementations/Library/SearchEngine.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; using Microsoft.Extensions.Logging; @@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Library }; } - private void AddIfMissing(List list, string value) + private static void AddIfMissing(List list, string value) { if (!list.Contains(value, StringComparer.OrdinalIgnoreCase)) { @@ -85,7 +85,7 @@ namespace Emby.Server.Implementations.Library if (string.IsNullOrEmpty(searchTerm)) { - throw new ArgumentNullException("searchTerm"); + throw new ArgumentNullException(nameof(searchTerm)); } searchTerm = searchTerm.Trim().RemoveDiacritics(); diff --git a/Emby.Server.Implementations/Library/UserDataManager.cs b/Emby.Server.Implementations/Library/UserDataManager.cs index 27ba32c0cb..3ca4b6b109 100644 --- a/Emby.Server.Implementations/Library/UserDataManager.cs +++ b/Emby.Server.Implementations/Library/UserDataManager.cs @@ -53,11 +53,11 @@ namespace Emby.Server.Implementations.Library { if (userData == null) { - throw new ArgumentNullException("userData"); + throw new ArgumentNullException(nameof(userData)); } if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } cancellationToken.ThrowIfCancellationRequested(); @@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.Library /// Gets the internal key. /// /// System.String. - private string GetCacheKey(long internalUserId, Guid itemId) + private static string GetCacheKey(long internalUserId, Guid itemId) { return internalUserId.ToString(CultureInfo.InvariantCulture) + "-" + itemId.ToString("N"); } @@ -198,7 +198,7 @@ namespace Emby.Server.Implementations.Library { if (data == null) { - throw new ArgumentNullException("data"); + throw new ArgumentNullException(nameof(data)); } return new UserItemDataDto @@ -226,7 +226,7 @@ namespace Emby.Server.Implementations.Library // If a position has been reported, and if we know the duration if (positionTicks > 0 && hasRuntime) { - var pctIn = Decimal.Divide(positionTicks, runtimeTicks) * 100; + var pctIn = decimal.Divide(positionTicks, runtimeTicks) * 100; // Don't track in very beginning if (pctIn < _config.Configuration.MinResumePct) diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index 679116fc0a..8f26dfe422 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Events; +using MediaBrowser.Common.Events; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; @@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.Library /// Gets the users. /// /// The users. - public IEnumerable Users { get { return _users; } } + public IEnumerable Users => _users; private User[] _users; @@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.Library { if (id.Equals(Guid.Empty)) { - throw new ArgumentNullException("id"); + throw new ArgumentNullException(nameof(id)); } return Users.FirstOrDefault(u => u.Id == id); @@ -183,7 +183,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(name)) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } return Users.FirstOrDefault(u => string.Equals(u.Name, name, StringComparison.OrdinalIgnoreCase)); @@ -222,7 +222,7 @@ namespace Emby.Server.Implementations.Library return true; } - private bool IsValidUsernameCharacter(char i) + private static bool IsValidUsernameCharacter(char i) { return !char.Equals(i, '<') && !char.Equals(i, '>'); } @@ -251,7 +251,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(username)) { - throw new ArgumentNullException("username"); + throw new ArgumentNullException(nameof(username)); } var user = Users @@ -344,7 +344,7 @@ namespace Emby.Server.Implementations.Library return success ? user : null; } - private string GetAuthenticationProviderId(IAuthenticationProvider provider) + private static string GetAuthenticationProviderId(IAuthenticationProvider provider) { return provider.GetType().FullName; } @@ -526,7 +526,7 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } var hasConfiguredPassword = GetAuthenticationProvider(user).HasPassword(user).Result; @@ -625,12 +625,12 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } if (string.IsNullOrEmpty(newName)) { - throw new ArgumentNullException("newName"); + throw new ArgumentNullException(nameof(newName)); } if (Users.Any(u => u.Id != user.Id && u.Name.Equals(newName, StringComparison.OrdinalIgnoreCase))) @@ -658,7 +658,7 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } if (user.Id.Equals(Guid.Empty) || !Users.Any(u => u.Id.Equals(user.Id))) @@ -689,7 +689,7 @@ namespace Emby.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(name)) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } if (!IsValidUsername(name)) @@ -737,7 +737,7 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } var allUsers = Users.ToList(); @@ -804,7 +804,7 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } if (user.ConnectLinkType.HasValue && user.ConnectLinkType.Value == UserLinkType.Guest) @@ -823,7 +823,7 @@ namespace Emby.Server.Implementations.Library { if (user == null) { - throw new ArgumentNullException("user"); + throw new ArgumentNullException(nameof(user)); } if (newPassword != null) @@ -833,7 +833,7 @@ namespace Emby.Server.Implementations.Library if (string.IsNullOrWhiteSpace(newPasswordHash)) { - throw new ArgumentNullException("newPasswordHash"); + throw new ArgumentNullException(nameof(newPasswordHash)); } user.EasyPassword = newPasswordHash; @@ -848,7 +848,7 @@ namespace Emby.Server.Implementations.Library /// /// The name. /// User. - private User InstantiateNewUser(string name) + private static User InstantiateNewUser(string name) { return new User { @@ -861,10 +861,7 @@ namespace Emby.Server.Implementations.Library }; } - private string PasswordResetFile - { - get { return Path.Combine(ConfigurationManager.ApplicationPaths.ProgramDataPath, "passwordreset.txt"); } - } + private string PasswordResetFile => Path.Combine(ConfigurationManager.ApplicationPaths.ProgramDataPath, "passwordreset.txt"); private string _lastPin; private PasswordPinCreationResult _lastPasswordPinCreationResult; @@ -1047,7 +1044,7 @@ namespace Emby.Server.Implementations.Library } } - private UserPolicy GetDefaultPolicy(User user) + private static UserPolicy GetDefaultPolicy(User user) { return new UserPolicy { @@ -1109,12 +1106,12 @@ namespace Emby.Server.Implementations.Library } } - private string GetPolicyFilePath(User user) + private static string GetPolicyFilePath(User user) { return Path.Combine(user.ConfigurationDirectoryPath, "policy.xml"); } - private string GetConfigurationFilePath(User user) + private static string GetConfigurationFilePath(User user) { return Path.Combine(user.ConfigurationDirectoryPath, "config.xml"); } diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 81a47bfea1..ba2aee08db 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; @@ -254,27 +254,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV if (requiresRefresh) { - await _libraryManager.ValidateMediaLibrary(new SimpleProgress(), CancellationToken.None); + await _libraryManager.ValidateMediaLibrary(new SimpleProgress(), CancellationToken.None); } } - public string Name - { - get { return "Emby"; } - } + public string Name => "Emby"; - public string DataPath - { - get { return Path.Combine(_config.CommonApplicationPaths.DataPath, "livetv"); } - } + public string DataPath => Path.Combine(_config.CommonApplicationPaths.DataPath, "livetv"); - private string DefaultRecordingPath - { - get - { - return Path.Combine(DataPath, "recordings"); - } - } + private string DefaultRecordingPath => Path.Combine(DataPath, "recordings"); private string RecordingPath { @@ -288,10 +276,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } } - public string HomePageUrl - { - get { return "https://github.com/jellyfin/jellyfin"; } - } + public string HomePageUrl => "https://github.com/jellyfin/jellyfin"; public async Task RefreshSeriesTimers(CancellationToken cancellationToken, IProgress progress) { @@ -491,7 +476,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV return GetEpgChannelFromTunerChannel(info, tunerChannel, epgChannels); } - private string GetMappedChannel(string channelId, NameValuePair[] mappings) + private static string GetMappedChannel(string channelId, NameValuePair[] mappings) { foreach (NameValuePair mapping in mappings) { @@ -850,7 +835,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV return Task.CompletedTask; } - private void UpdateExistingTimerWithNewMetadata(TimerInfo existingTimer, TimerInfo updatedTimer) + private static void UpdateExistingTimerWithNewMetadata(TimerInfo existingTimer, TimerInfo updatedTimer) { // Update the program info but retain the status existingTimer.ChannelId = updatedTimer.ChannelId; @@ -980,7 +965,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV if (string.IsNullOrWhiteSpace(tunerHostId)) { - throw new ArgumentNullException("tunerHostId"); + throw new ArgumentNullException(nameof(tunerHostId)); } return info.EnabledTuners.Contains(tunerHostId, StringComparer.OrdinalIgnoreCase); @@ -1114,7 +1099,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (string.IsNullOrWhiteSpace(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } foreach (var hostInstance in _liveTvManager.TunerHosts) @@ -1342,7 +1327,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (timer == null) { - throw new ArgumentNullException("timer"); + throw new ArgumentNullException(nameof(timer)); } LiveTvProgram programInfo = null; @@ -1795,7 +1780,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } } - private string GetPostProcessArguments(string path, string arguments) + private static string GetPostProcessArguments(string path, string arguments) { return arguments.Replace("{path}", path, StringComparison.OrdinalIgnoreCase); } @@ -2501,7 +2486,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (seriesTimer == null) { - throw new ArgumentNullException("seriesTimer"); + throw new ArgumentNullException(nameof(seriesTimer)); } var query = new InternalItemsQuery diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 4ea83b7acd..5463f78c22 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -55,14 +55,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV _assemblyInfo = assemblyInfo; } - private bool CopySubtitles - { - get - { - return false; - //return string.Equals(OutputFormat, "mkv", StringComparison.OrdinalIgnoreCase); - } - } + private static bool CopySubtitles => false; public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile) { @@ -226,7 +219,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV return inputModifier + " " + commandLineArgs; } - private string GetAudioArgs(MediaSourceInfo mediaSource) + private static string GetAudioArgs(MediaSourceInfo mediaSource) { var mediaStreams = mediaSource.MediaStreams ?? new List(); var inputAudioCodec = mediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).FirstOrDefault() ?? string.Empty; @@ -242,7 +235,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV //return "-codec:a:0 aac -strict experimental -ab 320000"; } - private bool EncodeVideo(MediaSourceInfo mediaSource) + private static bool EncodeVideo(MediaSourceInfo mediaSource) { return false; } @@ -383,6 +376,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV } catch (ObjectDisposedException) { + // TODO Investigate and properly fix. // Don't spam the log. This doesn't seem to throw in windows, but sometimes under linux } catch (Exception ex) diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs index 9f179dc2ce..593f98881a 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs @@ -68,7 +68,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (newList == null) { - throw new ArgumentNullException("newList"); + throw new ArgumentNullException(nameof(newList)); } var file = _dataPath + ".json"; @@ -85,7 +85,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } var list = GetAll().ToList(); @@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { if (item == null) { - throw new ArgumentNullException("item"); + throw new ArgumentNullException(nameof(item)); } var list = GetAll().ToList(); diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs index e4ab347704..bdc6ae0093 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Globalization; using System.Linq; @@ -90,7 +90,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV AddOrUpdateSystemTimer(item); } - private bool ShouldStartTimer(TimerInfo item) + private static bool ShouldStartTimer(TimerInfo item) { if (item.Status == RecordingStatus.Completed || item.Status == RecordingStatus.Cancelled) diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index e8ffd0caaf..0ba8c8b42b 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using MediaBrowser.Common; using MediaBrowser.Common.Net; using MediaBrowser.Controller.LiveTv; @@ -38,12 +38,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings _appHost = appHost; } - private string UserAgent - { - get { return "Emby/" + _appHost.ApplicationVersion; } - } + private string UserAgent => "Emby/" + _appHost.ApplicationVersion; - private List GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc) + private static List GetScheduleRequestDates(DateTime startDateUtc, DateTime endDateUtc) { List dates = new List(); @@ -63,7 +60,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings { if (string.IsNullOrEmpty(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } // Normalize incoming input @@ -189,7 +186,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings } } - private int GetSizeOrder(ScheduleDirect.ImageData image) + private static int GetSizeOrder(ScheduleDirect.ImageData image) { if (!string.IsNullOrWhiteSpace(image.height)) { @@ -202,7 +199,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return 0; } - private string GetChannelNumber(ScheduleDirect.Map map) + private static string GetChannelNumber(ScheduleDirect.Map map) { var channelNumber = map.logicalChannelNumber; @@ -218,7 +215,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return channelNumber.TrimStart('0'); } - private bool IsMovie(ScheduleDirect.ProgramDetails programInfo) + private static bool IsMovie(ScheduleDirect.ProgramDetails programInfo) { return string.Equals(programInfo.entityType, "movie", StringComparison.OrdinalIgnoreCase); } @@ -390,7 +387,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return info; } - private DateTime GetDate(string value) + private static DateTime GetDate(string value) { var date = DateTime.ParseExact(value, "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", CultureInfo.InvariantCulture); @@ -429,7 +426,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings } } - private double GetAspectRatio(ScheduleDirect.ImageData i) + private static double GetAspectRatio(ScheduleDirect.ImageData i) { int width = 0; int height = 0; @@ -664,7 +661,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings } } - options.RequestHeaders["token"] = await GetToken(providerInfo, options.CancellationToken).ConfigureAwait(false);; + options.RequestHeaders["token"] = await GetToken(providerInfo, options.CancellationToken).ConfigureAwait(false); return await Post(options, false, providerInfo).ConfigureAwait(false); } @@ -765,16 +762,10 @@ namespace Emby.Server.Implementations.LiveTv.Listings } } - public string Name - { - get { return "Schedules Direct"; } - } + public string Name => "Schedules Direct"; public static string TypeName = "SchedulesDirect"; - public string Type - { - get { return TypeName; } - } + public string Type => TypeName; private async Task HasLineup(ListingsProviderInfo info, CancellationToken cancellationToken) { @@ -951,7 +942,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings return null; } - private string NormalizeName(string value) + private static string NormalizeName(string value) { return value.Replace(" ", string.Empty).Replace("-", string.Empty); } diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 4d7c7fef41..2b1ee84a8a 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -36,15 +36,9 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings _zipClient = zipClient; } - public string Name - { - get { return "XmlTV"; } - } + public string Name => "XmlTV"; - public string Type - { - get { return "xmltv"; } - } + public string Type => "xmltv"; private string GetLanguage(ListingsProviderInfo info) { @@ -78,7 +72,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings { CancellationToken = cancellationToken, Url = path, - Progress = new SimpleProgress(), + Progress = new SimpleProgress(), DecompressionMethod = CompressionMethod.Gzip, // It's going to come back gzipped regardless of this value @@ -164,7 +158,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings { if (string.IsNullOrWhiteSpace(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } /* @@ -187,7 +181,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings .Select(p => GetProgramInfo(p, info)); } - private ProgramInfo GetProgramInfo(XmlTvProgram program, ListingsProviderInfo info) + private static ProgramInfo GetProgramInfo(XmlTvProgram program, ListingsProviderInfo info) { string episodeTitle = program.Episode?.Title; @@ -210,9 +204,9 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings IsMovie = program.Categories.Any(c => info.MovieCategories.Contains(c, StringComparer.OrdinalIgnoreCase)), IsNews = program.Categories.Any(c => info.NewsCategories.Contains(c, StringComparer.OrdinalIgnoreCase)), IsSports = program.Categories.Any(c => info.SportsCategories.Contains(c, StringComparer.OrdinalIgnoreCase)), - ImageUrl = program.Icon != null && !String.IsNullOrEmpty(program.Icon.Source) ? program.Icon.Source : null, - HasImage = program.Icon != null && !String.IsNullOrEmpty(program.Icon.Source), - OfficialRating = program.Rating != null && !String.IsNullOrEmpty(program.Rating.Value) ? program.Rating.Value : null, + ImageUrl = program.Icon != null && !string.IsNullOrEmpty(program.Icon.Source) ? program.Icon.Source : null, + HasImage = program.Icon != null && !string.IsNullOrEmpty(program.Icon.Source), + OfficialRating = program.Rating != null && !string.IsNullOrEmpty(program.Rating.Value) ? program.Rating.Value : null, CommunityRating = program.StarRating, SeriesId = program.Episode == null ? null : program.Title.GetMD5().ToString("N") }; @@ -246,7 +240,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings } // Construct an id from the channel and start date - programInfo.Id = String.Format("{0}_{1:O}", program.ChannelId, program.StartDate); + programInfo.Id = string.Format("{0}_{1:O}", program.ChannelId, program.StartDate); if (programInfo.IsMovie) { @@ -294,7 +288,7 @@ namespace Jellyfin.Server.Implementations.LiveTv.Listings { Id = c.Id, Name = c.DisplayName, - ImageUrl = c.Icon != null && !String.IsNullOrEmpty(c.Icon.Source) ? c.Icon.Source : null, + ImageUrl = c.Icon != null && !string.IsNullOrEmpty(c.Icon.Source) ? c.Icon.Source : null, Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number }).ToList(); diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs index 6fe5787158..dbc7b16a22 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common; +using MediaBrowser.Common; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Dto; @@ -321,6 +321,7 @@ namespace Emby.Server.Implementations.LiveTv } catch (Exception ex) { + _logger.LogDebug(ex, "GetImageCacheTag raised an exception in LiveTvDtoService.FillImages."); } } @@ -331,10 +332,10 @@ namespace Emby.Server.Implementations.LiveTv { try { - dto.ParentBackdropImageTags = new string[] - { - _imageProcessor.GetImageCacheTag(program, image) - }; + dto.ParentBackdropImageTags = new [] + { + _imageProcessor.GetImageCacheTag(program, image) + }; dto.ParentBackdropItemId = program.Id.ToString("N"); } catch (Exception ex) diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index a81a0bcbb7..d39c13bd09 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Progress; using MediaBrowser.Controller.Configuration; @@ -104,10 +104,7 @@ namespace Emby.Server.Implementations.LiveTv /// Gets the services. /// /// The services. - public IReadOnlyList Services - { - get { return _services; } - } + public IReadOnlyList Services => _services; private LiveTvOptions GetConfiguration() { @@ -167,15 +164,9 @@ namespace Emby.Server.Implementations.LiveTv }); } - public ITunerHost[] TunerHosts - { - get { return _tunerHosts; } - } + public ITunerHost[] TunerHosts => _tunerHosts; - public IListingsProvider[] ListingProviders - { - get { return _listingProviders; } - } + public IListingsProvider[] ListingProviders => _listingProviders; public List GetTunerHostTypes() { @@ -323,7 +314,7 @@ namespace Emby.Server.Implementations.LiveTv return _services.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase)); } - private void Normalize(MediaSourceInfo mediaSource, ILiveTvService service, bool isVideo) + private static void Normalize(MediaSourceInfo mediaSource, ILiveTvService service, bool isVideo) { // Not all of the plugins are setting this mediaSource.IsInfiniteStream = true; @@ -1418,6 +1409,7 @@ namespace Emby.Server.Implementations.LiveTv if (query.IsInProgress ?? false) { + //TODO Fix The co-variant conversion between Video[] and BaseItem[], this can generate runtime issues. result.Items = result .Items .OfType