From ec1f5dc317182582ebff843c9e8a4d5277405469 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 6 Jan 2019 21:50:43 +0100 Subject: 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. --- MediaBrowser.Api/Library/LibraryStructureService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs') diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index bba89acec..cd839e0f8 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -192,7 +192,7 @@ namespace MediaBrowser.Api.Library { if (appPaths == null) { - throw new ArgumentNullException("appPaths"); + throw new ArgumentNullException(nameof(appPaths)); } _appPaths = appPaths; @@ -244,12 +244,12 @@ namespace MediaBrowser.Api.Library { if (string.IsNullOrWhiteSpace(request.Name)) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } if (string.IsNullOrWhiteSpace(request.NewName)) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } var rootFolderPath = _appPaths.DefaultUserViewsPath; @@ -322,7 +322,7 @@ namespace MediaBrowser.Api.Library { if (string.IsNullOrWhiteSpace(request.Name)) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } _libraryMonitor.Stop(); @@ -370,7 +370,7 @@ namespace MediaBrowser.Api.Library { if (string.IsNullOrWhiteSpace(request.Name)) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } _libraryManager.UpdateMediaPath(request.Name, request.PathInfo); @@ -384,7 +384,7 @@ namespace MediaBrowser.Api.Library { if (string.IsNullOrWhiteSpace(request.Name)) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } _libraryMonitor.Stop(); -- cgit v1.2.3