Commit Graph

731 Commits

Author SHA1 Message Date
BaronGreenback
8a69300bf5 Changes styles as suggested by @barronpm
Added addtional comments & source type as per intellisense suggestion
change code as per sonacloud
2020-04-29 12:24:01 +01:00
Vasily
5922c35d69
Merge pull request #2920 from Bond-009/tests2
Add some simple tests
2020-04-29 12:17:01 +03:00
BaronGreenback
ebd589aa86 Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored.
Fixing this required the removal of the code that attempted to detect virtual interfaces. Not wanting to remove functionality, but not able to keep the code in place, I implemented a work around solution (see 4 below).

Whilst in the area, I also fixed a few minor bugs i encountered (1, 5, 6 below) and stopped SSDP messages from going out on non-LAN interfaces (3)

All these changes are related.

Changes

1 IsInPrivateAddressSpace - improved subnet code checking
2 interfaces with no gateway were being excluded from SSDP blasts
3 filtered SSDP blasts from not LAN addresses as defined on the network page.
4 removed #986 mod - as this was part of the issue of #2986. Interfaces can be excluded from the LAN by putting the LAN address in brackets. eg. [10.1.1.1] will exclude an interface with ip address 10.1.1.1 from SSDP
5 fixed a problem where an invalid LAN address causing the SSDP to crash
6 corrected local link filter (FilterIPAddress) to filter on 169.254. addresses
2020-04-28 21:57:39 +01:00
BaronGreenback
a3140f83c6 Revert "Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored."
This reverts commit 2aaecb8e14.
2020-04-28 21:51:49 +01:00
BaronGreenback
2aaecb8e14 Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored.
Fixing this required the removal of the code that attempted to detect virtual interfaces. Not wanting to remove functionality, but not able to keep the code in place, I implemented a work around solution (see 4 below).

Whilst in the area, I also fixed a few minor bugs i encountered (1, 5, 6 below) and stopped SSDP messages from going out on non-LAN interfaces (3)

All these changes are related.

Changes

1 IsInPrivateAddressSpace - improved subnet code checking
2 interfaces with no gateway were being excluded from SSDP blasts
3 filtered SSDP blasts from not LAN addresses as defined on the network page.
4 removed #986 mod - as this was part of the issue of #2986. Interfaces can be excluded from the LAN by putting the LAN address in brackets. eg. [10.1.1.1] will exclude an interface with ip address 10.1.1.1 from SSDP
5 fixed a problem where an invalid LAN address causing the SSDP to crash
6 corrected local link filter (FilterIPAddress) to filter on 169.254. addresses
2020-04-28 21:45:46 +01:00
Mark Monteiro
cbd62e00a4 Ensure transcoding path is created when it is retrieved 2020-04-26 15:07:37 -04:00
Bond_009
118f30059c Merge branch 'master' into nullable4 2020-04-23 11:29:19 +02:00
Mark Monteiro
8f02fb9a4f Remove unused usings
This addresses the new issues identified in SonarCloud analysis
2020-04-22 13:09:59 -04:00
Bond-009
d744d7d234 Merge branch 'master' into register-services-correctly 2020-04-22 13:05:03 -04:00
Bond-009
c0b3c11b2e
Merge pull request #2846 from jellyfin/azure
Remove requirement to build web during server builds
2020-04-22 00:17:44 +02:00
Mark Monteiro
c5f163293f Add <ProjectGuid> properties to all project files
This is required for SonarCloud analysis to run
2020-04-21 16:21:09 -04:00
Bond_009
c430a7ed8f Address comments 2020-04-21 10:18:26 +02:00
Mark Monteiro
f815059698 Merge remote-tracking branch 'upstream/master' into register-services-correctly 2020-04-20 20:11:33 -04:00
Bond_009
7f4a229cd2 Add some simple tests 2020-04-20 10:18:12 +02:00
dkanada
e6ef680775 add code suggestions 2020-04-20 14:27:46 +09:00
Mark Monteiro
9728aa8b0a Merge branch 'master' into register-services-correctly 2020-04-13 17:06:24 -04:00
dkanada
cb2523e2ef merge branch master into plugin 2020-04-13 14:38:19 +09:00
Bond-009
3d611743ed
Merge pull request #2680 from mark-monteiro/remove-common-process
Remove CommonProcess and ProcessFactory
2020-04-11 20:30:20 +02:00
Mark Monteiro
1e1295bebf Merge remote-tracking branch 'upstream/master' into register-services-correctly 2020-04-11 10:00:39 -04:00
dkanada
bd55bdb4e3 merge branch master into plugin 2020-04-11 20:10:16 +09:00
dkanada
8e9aeb84b1 remove release channel from plugin classes 2020-04-11 19:33:36 +09:00
Mark Monteiro
8e3b09a996 Do not use IAsyncEnumerable unnecessarily 2020-04-06 22:04:24 -04:00
Bond_009
2fcbc2a5b8 Enable nullabe reference types for Emby.Drawing and Jellyfin.Drawing.Skia 2020-04-05 21:19:04 +02:00
Mark Monteiro
3d8501e462 Document exception 2020-04-05 09:25:23 -04:00
Mark Monteiro
aee6a1b476 Remove unnecessary async and parameter from ApplicationHost initialization method 2020-04-04 20:40:50 -04:00
Mark Monteiro
4efdc63337 Add missing call to ConfigureAwait() 2020-04-03 20:51:30 -04:00
Mark Monteiro
e0f40f57d8 Merge remote-tracking branch 'upstream/master' into remove-common-process 2020-04-03 20:22:03 -04:00
Bond_009
2be394089e Enable Microsoft.CodeAnalysis.FxCopAnalyzers for Jellyfin.Common 2020-04-02 20:12:18 +02:00
dkanada
5a816f0b22
Merge pull request #2731 from Bond-009/minor2
Minor improvements
2020-04-03 01:41:05 +09:00
Vasily
07ea120ba9
Merge pull request #2601 from mark-monteiro/support-running-without-web-content
Support Running Server Without Web Content
2020-04-01 23:38:43 +03:00
Bond_009
4419587c2a Minor improvements 2020-04-01 15:30:53 +02:00
Mark Monteiro
1c13be085f Make HasExitedSafe() private 2020-03-27 01:28:24 +01:00
Mark Monteiro
97c36d11d4 Use a TimeSpan instead of ms and support providing a custom CancellationToken 2020-03-27 01:09:09 +01:00
Mark Monteiro
ee2f911a2b Remove unnecessary CommonProcess abstraction 2020-03-27 00:10:16 +01:00
Mark Monteiro
aa9737afb3 Update .NET Core to 3.1.3 2020-03-25 20:09:48 +01:00
Mark Monteiro
debab44870 Update all packages to .NET Core 3.1.2 2020-03-22 02:03:07 +01:00
Mark Monteiro
e2685c51ec Merge remote-tracking branch 'upstream/master' into support-running-without-web-content 2020-03-15 18:07:02 +01:00
Mark Monteiro
05ab61200a Do not call UseContentRoot() on the web host builder
This call has nothing to do with static web content and should not have ever been called with the web content path: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-3.1&tabs=windows#content-root
Since this call is removed, the ContentRoot property is also removed from ApplicationHost as it is no longer needed.
Finally, move validation of the static content path to the DashboardService where it is actually used.
2020-03-15 17:42:57 +01:00
Bond-009
94fe9b8f6d
Merge branch 'master' into warn17 2020-03-11 20:26:43 +01:00
Mark Monteiro
6131599e88 Merge branch 'master' into support-injecting-iconfiguration 2020-03-10 22:45:17 +01:00
Bond_009
ada3f96668 Add tests for alpha numeric sorting 2020-03-05 00:54:46 +01:00
Mark Monteiro
7e3b6768f8 Add NuGet reference to config abstractions in MediaBrowser.Common project 2020-03-01 12:10:32 +01:00
Mark Monteiro
48f8118072 Do not save a reference to the startup config in ApplicationHost 2020-02-28 23:28:15 +01:00
dkanada
974a04c129 update plugin classes for nightly builds 2020-02-26 01:58:39 +09:00
Bond_009
07cc4be6a7 Fix some warnings
* Add analyzers to MediaBrowser.XbmcMetadata
* Enable TreatWarningsAsErrors for MediaBrowser.XbmcMetadata
* Add analyzers to MediaBrowser.WebDashboard
* Enable TreatWarningsAsErrors for MediaBrowser.WebDashboard
* Disable SA1600 in favor of CS1591
2020-02-23 12:11:43 +01:00
Mark Monteiro
8ffb073ccb Enable documentation warnings for fully documented files 2020-02-12 20:05:26 +01:00
Mark Monteiro
a381eb884c add-some-xml-documentation 2020-02-10 10:26:28 +01:00
Bond_009
2186df8ac4 Update deps 2020-01-28 22:42:07 +01:00
Bond_009
bb236b9591 Merge branch 'master' into warn12 2020-01-10 21:18:16 +01:00
Bond_009
f9a454628d Preformance!!! 2019-12-22 22:21:41 +01:00
Bond_009
cf2e2a3f30 Fix exceptions while scanning
Fixes these exceptions:
```
[2019-12-22 20:48:14.779 +01:00] [ERR] Error in WaitForExit
System.InvalidOperationException: No process is associated with this object.
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.GetWaitState()
   at System.Diagnostics.Process.WaitForExitCore(Int32 milliseconds)
   at System.Diagnostics.Process.WaitForExit(Int32 milliseconds)
   at Emby.Server.Implementations.Diagnostics.CommonProcess.WaitForExit(Int32 timeMs) in /home/pi/dev/jellyfin/Emby.Server.Implementations/Diagnostics/CommonProcess.cs:line 100
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.StopProcess(ProcessWrapper process, Int32 waitTimeMs) in /home/pi/dev/jellyfin/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs:line 785
[2019-12-22 20:48:14.790 +01:00] [INF] Killing ffmpeg process
[2019-12-22 20:48:14.795 +01:00] [ERR] Error killing process
System.InvalidOperationException: No process is associated with this object.
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.Kill()
   at Emby.Server.Implementations.Diagnostics.CommonProcess.Kill() in /home/pi/dev/jellyfin/Emby.Server.Implementations/Diagnostics/CommonProcess.cs:line 95
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.StopProcess(ProcessWrapper process, Int32 waitTimeMs) in /home/pi/dev/jellyfin/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs:line 799
[2019-12-22 20:48:14.808 +01:00] [ERR] Error in "ffprobe"
System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $.streams[0].start_pts | LineNumber: 32 | BytePositionInLine: 26.
 ---> System.InvalidOperationException: Cannot get the value of a token type 'Number' as a string.
   at System.Text.Json.Utf8JsonReader.GetString()
   at System.Text.Json.Serialization.Converters.JsonConverterString.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.JsonSerializer.HandleValue(JsonTokenType tokenType, JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadCore(JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan`1 buffer, JsonSerializerOptions options, ReadStack& readStack)
   at System.Text.Json.JsonSerializer.ReadAsync[TValue](Stream utf8Json, Type returnType, JsonSerializerOptions options, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable`1 videoType, Boolean forceEnableLogging, CancellationToken cancellationToken) in /home/pi/dev/jellyfin/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs:line 399
   at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo.ProbeVideo[T](T item, MetadataRefreshOptions options, CancellationToken cancellationToken) in /home/pi/dev/jellyfin/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs:line 122
   at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken) in /home/pi/dev/jellyfin/MediaBrowser.Providers/Manager/MetadataService.cs:line 815
```
2019-12-22 22:09:09 +01:00
Bond-009
137db45fc7
Apply suggestions from code review
Co-Authored-By: dkanada <dkanada@users.noreply.github.com>
2019-12-19 22:01:05 +01:00
Bond_009
2ef4ffd698 More warnings (removed) 2019-12-11 00:13:57 +01:00
Bond-009
a2c35e6dba Merge remote-tracking branch 'upstream/master' into random 2019-12-06 12:06:13 +01:00
Vasily
e41dd316d1
Merge pull request #2098 from Bond-009/config2
Fix GetTranscodePath function and cache path update logline
2019-12-05 12:05:46 +03:00
dkanada
a7ef1aa7ec
Merge pull request #2050 from Bond-009/nullref
Fix possible nullref when updating packages
2019-12-05 15:23:48 +09:00
Bond_009
4a0df15bbd Fix GetTranscodePath function and cache path update logline
* GetTranscodePath returned an empty string after the option was left
blank in the web UI
* Unified the log style for all paths
2019-12-04 22:18:37 +01:00
Bond-009
6f45d95951 Minor improvements to network code 2019-11-28 17:46:06 +01:00
Joshua M. Boniface
48120d01dc
Merge pull request #1991 from Bond-009/transtemp
Don't append transcodes to transcoding temp path
2019-11-24 15:13:50 -05:00
Bond-009
e808e8b2d2
Update MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs
Co-Authored-By: dkanada <dkanada@users.noreply.github.com>
2019-11-24 20:15:53 +01:00
Bond_009
6a6bfa6da9 Fix possible nullref when updating packages 2019-11-24 17:23:36 +01:00
dkanada
51cdc6ea16
Merge pull request #1926 from Bond-009/auth
Add clearer exceptions, warnings and docs
2019-11-23 01:14:32 +09:00
Bond-009
d4b438791f Don't append transcodes to transcoding temp path 2019-11-21 16:57:49 +01:00
Bond_009
03fe0e762d Fix typos in docs 2019-11-09 20:23:09 +01:00
Bond-009
126165080b Doc improvements 2019-11-07 10:55:02 +01:00
Bond-009
983d38a43b Merge branch 'master' into installationmanager 2019-11-07 10:50:55 +01:00
dkanada
3bfb36a67d
Merge pull request #1915 from Bond-009/hex
Rewrite hex encoder/decoder
2019-11-02 04:03:36 +09:00
Bond_009
d529f81cd9 Improve IInstallationManager interface 2019-11-01 17:57:19 +01:00
Bond_009
3f7836d9eb Update deps and add MultiThreading analyzer 2019-11-01 17:55:44 +01:00
Bond_009
593107e190 Multiplication is faster than bit shifting 2019-11-01 17:52:29 +01:00
Bond_009
b6627af65f Make decode even faster 2019-11-01 17:52:29 +01:00
Bond_009
a245f5a0d4 Rewrite hex encoder/decoder 2019-11-01 17:52:29 +01:00
Bond_009
016be02cd6 More warning fixes 2019-10-29 17:56:05 +01:00
Joshua M. Boniface
91600b1c81
Merge pull request #1898 from Bond-009/jsonfix
Fix Json serialization error
2019-10-20 15:16:01 -04:00
Bond_009
fef35d0505 Add clearer exceptions, warnings and docs 2019-10-20 21:12:03 +02:00
Bond_009
bbc0875387 Don't shuffle some types by default 2019-10-20 16:08:40 +02:00
Vasily
9040ef87dc
Merge pull request #1871 from Bond-009/doc
Enable `TreatWarningsAsErrors` for MediaBrowser.Common and Emby.Photos
2019-10-16 12:40:20 +03:00
Bond_009
5edb8159a7 Fix Json serialization error 2019-10-15 17:49:49 +02:00
Bond_009
9d4ce82ab9 Enable TreatWarningsAsErrors for MediaBrowser.Common and Emby.Photos
Adds `#pragma warning disable CS1591` to all files in
MediaBrowser.Common containing undocumented members.
2019-10-09 17:14:15 +02:00
Bond_009
e553eba31e Use System.Text.Json api 2019-10-08 20:59:53 +02:00
Bond_009
c9820d30ed Fix multiple mistakes and warnings 2019-09-23 20:32:44 +02:00
Bond-009
6f17a0b7af Remove legacy auth code (#1677)
* Remove legacy auth code

* Adds tests so we don't break PasswordHash (again)
* Clean up interfaces
* Remove duplicate code

* Use auto properties

* static using

* Don't use 'this'

* Fix build
2019-09-17 12:07:15 -04:00
Bond-009
ee637e8fec Fix warnings, improve performance (#1665)
* Fix warnings, improve performance

`QueryResult.Items` is now a `IReadOnlyList` so we don't need to
allocate a new `Array` when we have a `List` (and `Items` shouldn't need to
be mutable anyway)

* Update Providers .csproj to latest C#

* Remove extra newline from DtoService.cs

* Remove extra newline from UserLibraryService.cs
2019-09-02 02:19:29 -04:00
Bond_009
499c3dbdca Fix build for .Net Core 2.x 2019-08-16 17:37:40 +02:00
dkanada
bb04545068
Merge pull request #1614 from Bond-009/docs2
Document all public/internal members of Emby.Drawing
2019-08-15 21:01:44 -07:00
Bond_009
838e5d05d5 Document all public/internal members of Emby.Drawing
Forces all new public/internal members to be documented.
Enables TreatWarningsAsErrors for Emby.Drawing
2019-08-11 16:52:37 +02:00
Bond_009
7243689215 Minor improvements 2019-08-11 15:57:36 +02:00
Bond_009
5eaf5465a5 Check checksum for plugin downloads
* Compare the MD5 checksum when downloading plugins
* Reduced log spam due to http requests
* Removed 'GetTempFileResponse' function from HttpClientManager
* Fixed caching for HttpClientManager
2019-08-11 15:54:58 +02:00
dkanada
1ad67e223f
Merge pull request #1462 from Bond-009/installationmanager
Improvements to InstallationManager
2019-08-11 03:47:10 -07:00
Bond_009
2a58c643d2 Fix more warnings 2019-08-09 23:16:24 +02:00
Bond_009
ddd1a282ea Remove IpAddressInfo and IpEndPointInfo classes 2019-07-25 00:15:06 +02:00
Bond-009
e8028de4d7
Merge pull request #1560 from jellyfin/release-10.3.z
Backmerge for 10.3.7
2019-07-24 19:10:04 +02:00
Joshua M. Boniface
cf2f5b2026
Merge pull request #1538 from joshuaboniface/epg
Try to fix XmlTvListingsProvider
2019-07-14 17:09:00 -04:00
Bond_009
b294b802a8 Try to fix XmlTvListingsProvider 2019-07-13 17:18:27 -04:00
Bond_009
b1bd062709 Properly set content type 2019-07-13 17:12:06 -04:00
Bond-009
82f041d050
Merge branch 'master' into release-10.3.z 2019-07-06 23:08:52 +02:00
Bond_009
5fc4ad6c4e Address comments 2019-07-06 20:04:45 +02:00
Bond_009
3603c64fa6 Use HttpResponseHeaders instead of a dictionary 2019-07-06 20:04:45 +02:00
Bond_009
d405a400aa Fixes issues with HttpClientManager 2019-07-06 20:04:42 +02:00
Claus Vium
7eb94e9674 Update MediaBrowser.Common/Net/IHttpClient.cs
Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-06-18 22:21:07 -04:00