Commit graph

29 commits

Author SHA1 Message Date
Bond_009
a9a5fcde81 Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)

```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```

```
ArgumentNullException.ThrowIfNull($1);
```
2022-10-06 20:21:23 +02:00
Bond_009
1ee58bf020 Enable nullable for ItemDataProvider 2021-10-01 11:21:22 +02:00
Bond_009
6f8ccab788 Move non-jellyfin extensions to separate project 2021-06-19 18:04:46 +02:00
Bond_009
7e8428e588 Enable nullable reference types for Emby.Server.Implementations 2021-05-20 22:48:53 +02:00
BaronGreenback
bc1cc2d04a Remove unused using directives 2021-04-17 11:37:55 +01:00
Bond_009
a8ed753f6c FxCop -> Net Analyzers (part 2) 2021-03-13 22:33:28 +01:00
Bond_009
1ea2b200c0 JsonSerializer deserialize from bytes where possible
This is faster and uses way less memory
```
BenchmarkDotNet=v0.12.1, OS=fedora 32
Intel Core i7-6700HQ CPU 2.60GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=5.0.100
  [Host]     : .NET Core 5.0.0 (CoreCLR 5.0.20.51904, CoreFX 5.0.20.51904), X64 RyuJIT
  DefaultJob : .NET Core 5.0.0 (CoreCLR 5.0.20.51904, CoreFX 5.0.20.51904), X64 RyuJIT

| Method |     Mean |   Error |  StdDev |   Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |---------:|--------:|--------:|--------:|------:|------:|----------:|
|  Bytes | 158.4 us | 2.56 us | 2.14 us | 16.8457 |     - |     - |  52.08 KB |
| String | 172.8 us | 0.78 us | 0.70 us | 41.5039 |     - |     - | 127.82 KB |
| Custom | 155.5 us | 2.95 us | 2.76 us | 10.0098 |     - |     - |  31.27 KB |
```
2021-01-12 15:28:02 +01:00
David
3dec1fd6b2 Use UTF8 encoding and async correctly 2020-12-29 00:35:59 +01:00
David
043d045448 Put json serializer options in private field 2020-12-24 11:22:34 +01:00
David
e835dfb27d Use sync string instead of file 2020-12-24 10:31:51 +01:00
David
2a574914ea Use streams instead of strings 2020-12-23 19:24:58 +01:00
David
196388d607 Remove custom Json serializer from Emby.Server.Implementations 2020-12-23 13:14:40 +01:00
Bond_009
3ab50f5a3f Address comments 2020-04-01 19:05:41 +02:00
Bond_009
7060934792 Fix some warnings in Emby.Server.Implementations 2020-02-06 15:21:38 +01:00
Bond_009
8fe7b6551f Rewrite ItemDataProvider to be more robust
* Stop locking 2+ times per operation
* Don't clone the list multiple times
* Keep the lock for the duration of the operation
2019-09-12 21:34:55 +02:00
Bond_009
37ea50a572 Reduce the amount of exceptions thrown 2019-03-07 21:42:56 +01:00
PloughPuff
73c1cdb32a Avoid exceptions due to folder and file not found
1) Use function to return path to temp transcode path which has benefit of creating temp folder if not exists, thereby avoiding the exception when GetFilePaths is used.
2) Check json files exists before attempting to read from it.  Avoids having to mask FileNotFound exceptions when debugging.
2019-02-20 13:30:06 +00:00
Bond_009
a6a4cd5667 Removed some unused fields 2019-02-09 15:57:42 +01:00
Erwin de Haan
d7c6d16250 Unwrapped CreateDirectory and DeleteDirectory 2019-01-28 22:09:56 +01:00
Erwin de Haan
3a831994f6 Unwrapped GetDirectoryName and DirectorySeperatorChar 2019-01-28 22:06:34 +01:00
Erwin de Haan
e566d9a231 Find+Sed BOM removal *.cs: BDInfo-Emby.XmlTv 2019-01-13 20:54:44 +01:00
Erwin de Haan
39ef1106d7 Visual Studio Reformat: Emby.Server.Implementations Part Liv-P 2019-01-13 20:22:00 +01:00
Erwin de Haan
ec1f5dc317 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.
2019-01-10 20:38:53 +01:00
Bond_009
ea4c914123 Fix exception logging 2018-12-30 22:44:39 +01:00
Bond_009
0f8b3c6347 Use Microsoft.Extensions.Logging abstraction 2018-12-30 22:44:38 +01:00
Luke Pulverenti
33014f77aa update GetItems method 2017-05-26 02:48:54 -04:00
Luke Pulverenti
696a6b34ea improve smb support 2017-05-04 14:14:45 -04:00
Luke Pulverenti
0e9cd51f9c update .net core startup 2016-11-13 16:04:21 -05:00
Luke Pulverenti
d5ea8ca3ad move classes to portable 2016-11-03 19:35:19 -04:00
Renamed from MediaBrowser.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs (Browse further)