Browse Source

move additional classes to new server lib

Luke Pulverenti 8 years ago
parent
commit
3eb4091808
88 changed files with 357 additions and 281 deletions
  1. 1 1
      Emby.Server.Implementations/Activity/ActivityManager.cs
  2. 1 1
      Emby.Server.Implementations/Dto/DtoService.cs
  3. 97 2
      Emby.Server.Implementations/Emby.Server.Implementations.csproj
  4. 15 12
      Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
  5. 1 1
      Emby.Server.Implementations/FileOrganization/Extensions.cs
  6. 1 1
      Emby.Server.Implementations/FileOrganization/FileOrganizationNotifier.cs
  7. 1 1
      Emby.Server.Implementations/FileOrganization/FileOrganizationService.cs
  8. 3 18
      Emby.Server.Implementations/FileOrganization/NameUtils.cs
  9. 1 1
      Emby.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs
  10. 2 2
      Emby.Server.Implementations/FileOrganization/TvFolderOrganizer.cs
  11. 1 1
      Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs
  12. 27 28
      Emby.Server.Implementations/Library/LibraryManager.cs
  13. 1 1
      Emby.Server.Implementations/Library/LocalTrailerPostScanTask.cs
  14. 7 4
      Emby.Server.Implementations/Library/MediaSourceManager.cs
  15. 1 1
      Emby.Server.Implementations/Library/MusicManager.cs
  16. 1 1
      Emby.Server.Implementations/Library/PathExtensions.cs
  17. 2 2
      Emby.Server.Implementations/Library/ResolverHelper.cs
  18. 4 4
      Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs
  19. 2 2
      Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
  20. 1 1
      Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs
  21. 4 4
      Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
  22. 1 1
      Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs
  23. 1 1
      Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs
  24. 1 1
      Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs
  25. 2 2
      Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
  26. 1 1
      Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs
  27. 1 1
      Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs
  28. 1 1
      Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
  29. 1 1
      Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs
  30. 1 1
      Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
  31. 1 1
      Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
  32. 3 3
      Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
  33. 1 1
      Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs
  34. 2 7
      Emby.Server.Implementations/Library/SearchEngine.cs
  35. 1 1
      Emby.Server.Implementations/Library/UserViewManager.cs
  36. 1 1
      Emby.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs
  37. 1 1
      Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs
  38. 1 1
      Emby.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs
  39. 1 1
      Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs
  40. 1 1
      Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs
  41. 1 1
      Emby.Server.Implementations/Library/Validators/GenresValidator.cs
  42. 1 1
      Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs
  43. 1 1
      Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs
  44. 1 1
      Emby.Server.Implementations/Library/Validators/PeopleValidator.cs
  45. 1 1
      Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs
  46. 1 1
      Emby.Server.Implementations/Library/Validators/StudiosValidator.cs
  47. 1 1
      Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs
  48. 63 0
      Emby.Server.Implementations/Logging/PatternsLogger.cs
  49. 5 4
      Emby.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs
  50. 2 2
      Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs
  51. 1 1
      Emby.Server.Implementations/Sorting/AirTimeComparer.cs
  52. 1 1
      Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
  53. 1 1
      Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs
  54. 1 1
      Emby.Server.Implementations/Sorting/AlbumComparer.cs
  55. 1 1
      Emby.Server.Implementations/Sorting/AlphanumComparator.cs
  56. 1 1
      Emby.Server.Implementations/Sorting/ArtistComparer.cs
  57. 1 1
      Emby.Server.Implementations/Sorting/BudgetComparer.cs
  58. 1 1
      Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs
  59. 1 1
      Emby.Server.Implementations/Sorting/CriticRatingComparer.cs
  60. 1 1
      Emby.Server.Implementations/Sorting/DateCreatedComparer.cs
  61. 1 1
      Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
  62. 1 1
      Emby.Server.Implementations/Sorting/DatePlayedComparer.cs
  63. 1 1
      Emby.Server.Implementations/Sorting/GameSystemComparer.cs
  64. 1 1
      Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs
  65. 1 1
      Emby.Server.Implementations/Sorting/IsFolderComparer.cs
  66. 1 1
      Emby.Server.Implementations/Sorting/IsPlayedComparer.cs
  67. 1 1
      Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs
  68. 1 1
      Emby.Server.Implementations/Sorting/MetascoreComparer.cs
  69. 1 1
      Emby.Server.Implementations/Sorting/NameComparer.cs
  70. 1 1
      Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
  71. 1 1
      Emby.Server.Implementations/Sorting/PlayCountComparer.cs
  72. 1 1
      Emby.Server.Implementations/Sorting/PlayersComparer.cs
  73. 1 1
      Emby.Server.Implementations/Sorting/PremiereDateComparer.cs
  74. 1 1
      Emby.Server.Implementations/Sorting/ProductionYearComparer.cs
  75. 1 1
      Emby.Server.Implementations/Sorting/RandomComparer.cs
  76. 1 1
      Emby.Server.Implementations/Sorting/RevenueComparer.cs
  77. 1 1
      Emby.Server.Implementations/Sorting/RuntimeComparer.cs
  78. 1 1
      Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
  79. 1 1
      Emby.Server.Implementations/Sorting/SortNameComparer.cs
  80. 1 1
      Emby.Server.Implementations/Sorting/StartDateComparer.cs
  81. 1 1
      Emby.Server.Implementations/Sorting/StudioComparer.cs
  82. 5 0
      Emby.Server.Implementations/packages.config
  83. 12 10
      MediaBrowser.Server.Implementations/IO/FileRefresher.cs
  84. 5 4
      MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
  85. 22 23
      MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
  86. 0 79
      MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
  87. 7 4
      MediaBrowser.Server.Startup.Common/ApplicationHost.cs
  88. 1 0
      MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs

+ 1 - 1
MediaBrowser.Server.Implementations/Activity/ActivityManager.cs → Emby.Server.Implementations/Activity/ActivityManager.cs

@@ -8,7 +8,7 @@ using System;
 using System.Linq;
 using System.Threading.Tasks;
 
-namespace MediaBrowser.Server.Implementations.Activity
+namespace Emby.Server.Implementations.Activity
 {
     public class ActivityManager : IActivityManager
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Dto/DtoService.cs → Emby.Server.Implementations/Dto/DtoService.cs

@@ -29,7 +29,7 @@ using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.Extensions;
 
-namespace MediaBrowser.Server.Implementations.Dto
+namespace Emby.Server.Implementations.Dto
 {
     public class DtoService : IDtoService
     {

+ 97 - 2
Emby.Server.Implementations/Emby.Server.Implementations.csproj

@@ -13,7 +13,7 @@
     <DefaultLanguage>en-US</DefaultLanguage>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <TargetFrameworkProfile>Profile75</TargetFrameworkProfile>
+    <TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -52,6 +52,7 @@
     <Compile Include="..\SharedVersion.cs">
       <Link>Properties\SharedVersion.cs</Link>
     </Compile>
+    <Compile Include="Activity\ActivityManager.cs" />
     <Compile Include="Branding\BrandingConfigurationFactory.cs" />
     <Compile Include="Channels\ChannelConfigurations.cs" />
     <Compile Include="Channels\ChannelDynamicMediaSourceProvider.cs" />
@@ -60,18 +61,112 @@
     <Compile Include="Channels\ChannelPostScanTask.cs" />
     <Compile Include="Channels\RefreshChannelsScheduledTask.cs" />
     <Compile Include="Collections\CollectionManager.cs" />
+    <Compile Include="Dto\DtoService.cs" />
+    <Compile Include="FileOrganization\EpisodeFileOrganizer.cs" />
+    <Compile Include="FileOrganization\Extensions.cs" />
+    <Compile Include="FileOrganization\FileOrganizationNotifier.cs" />
+    <Compile Include="FileOrganization\FileOrganizationService.cs" />
+    <Compile Include="FileOrganization\NameUtils.cs" />
+    <Compile Include="FileOrganization\OrganizerScheduledTask.cs" />
+    <Compile Include="FileOrganization\TvFolderOrganizer.cs" />
     <Compile Include="Intros\DefaultIntroProvider.cs" />
+    <Compile Include="Library\CoreResolutionIgnoreRule.cs" />
+    <Compile Include="Library\LibraryManager.cs" />
+    <Compile Include="Library\LocalTrailerPostScanTask.cs" />
+    <Compile Include="Library\MediaSourceManager.cs" />
+    <Compile Include="Library\MusicManager.cs" />
+    <Compile Include="Library\PathExtensions.cs" />
+    <Compile Include="Library\ResolverHelper.cs" />
+    <Compile Include="Library\Resolvers\Audio\AudioResolver.cs" />
+    <Compile Include="Library\Resolvers\Audio\MusicAlbumResolver.cs" />
+    <Compile Include="Library\Resolvers\Audio\MusicArtistResolver.cs" />
+    <Compile Include="Library\Resolvers\BaseVideoResolver.cs" />
+    <Compile Include="Library\Resolvers\FolderResolver.cs" />
+    <Compile Include="Library\Resolvers\ItemResolver.cs" />
+    <Compile Include="Library\Resolvers\Movies\BoxSetResolver.cs" />
+    <Compile Include="Library\Resolvers\Movies\MovieResolver.cs" />
+    <Compile Include="Library\Resolvers\PhotoAlbumResolver.cs" />
+    <Compile Include="Library\Resolvers\PhotoResolver.cs" />
+    <Compile Include="Library\Resolvers\PlaylistResolver.cs" />
+    <Compile Include="Library\Resolvers\SpecialFolderResolver.cs" />
+    <Compile Include="Library\Resolvers\TV\EpisodeResolver.cs" />
+    <Compile Include="Library\Resolvers\TV\SeasonResolver.cs" />
+    <Compile Include="Library\Resolvers\TV\SeriesResolver.cs" />
+    <Compile Include="Library\Resolvers\VideoResolver.cs" />
+    <Compile Include="Library\SearchEngine.cs" />
+    <Compile Include="Library\UserViewManager.cs" />
+    <Compile Include="Library\Validators\ArtistsPostScanTask.cs" />
+    <Compile Include="Library\Validators\ArtistsValidator.cs" />
+    <Compile Include="Library\Validators\GameGenresPostScanTask.cs" />
+    <Compile Include="Library\Validators\GameGenresValidator.cs" />
+    <Compile Include="Library\Validators\GenresPostScanTask.cs" />
+    <Compile Include="Library\Validators\GenresValidator.cs" />
+    <Compile Include="Library\Validators\MusicGenresPostScanTask.cs" />
+    <Compile Include="Library\Validators\MusicGenresValidator.cs" />
+    <Compile Include="Library\Validators\PeopleValidator.cs" />
+    <Compile Include="Library\Validators\StudiosPostScanTask.cs" />
+    <Compile Include="Library\Validators\StudiosValidator.cs" />
+    <Compile Include="Library\Validators\YearsPostScanTask.cs" />
+    <Compile Include="Logging\PatternsLogger.cs" />
     <Compile Include="News\NewsService.cs" />
+    <Compile Include="Persistence\CleanDatabaseScheduledTask.cs" />
     <Compile Include="Playlists\PlaylistManager.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ScheduledTasks\ChapterImagesTask.cs" />
     <Compile Include="ScheduledTasks\PeopleValidationTask.cs" />
     <Compile Include="ScheduledTasks\PluginUpdateTask.cs" />
     <Compile Include="ScheduledTasks\RefreshIntrosTask.cs" />
+    <Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
     <Compile Include="ScheduledTasks\SystemUpdateTask.cs" />
+    <Compile Include="Sorting\AiredEpisodeOrderComparer.cs" />
+    <Compile Include="Sorting\AirTimeComparer.cs" />
+    <Compile Include="Sorting\AlbumArtistComparer.cs" />
+    <Compile Include="Sorting\AlbumComparer.cs" />
+    <Compile Include="Sorting\AlphanumComparator.cs" />
+    <Compile Include="Sorting\ArtistComparer.cs" />
+    <Compile Include="Sorting\BudgetComparer.cs" />
+    <Compile Include="Sorting\CommunityRatingComparer.cs" />
+    <Compile Include="Sorting\CriticRatingComparer.cs" />
+    <Compile Include="Sorting\DateCreatedComparer.cs" />
+    <Compile Include="Sorting\DateLastMediaAddedComparer.cs" />
+    <Compile Include="Sorting\DatePlayedComparer.cs" />
+    <Compile Include="Sorting\GameSystemComparer.cs" />
+    <Compile Include="Sorting\IsFavoriteOrLikeComparer.cs" />
+    <Compile Include="Sorting\IsFolderComparer.cs" />
+    <Compile Include="Sorting\IsPlayedComparer.cs" />
+    <Compile Include="Sorting\IsUnplayedComparer.cs" />
+    <Compile Include="Sorting\MetascoreComparer.cs" />
+    <Compile Include="Sorting\NameComparer.cs" />
+    <Compile Include="Sorting\OfficialRatingComparer.cs" />
+    <Compile Include="Sorting\PlayCountComparer.cs" />
+    <Compile Include="Sorting\PlayersComparer.cs" />
+    <Compile Include="Sorting\PremiereDateComparer.cs" />
+    <Compile Include="Sorting\ProductionYearComparer.cs" />
+    <Compile Include="Sorting\RandomComparer.cs" />
+    <Compile Include="Sorting\RevenueComparer.cs" />
+    <Compile Include="Sorting\RuntimeComparer.cs" />
+    <Compile Include="Sorting\SeriesSortNameComparer.cs" />
+    <Compile Include="Sorting\SortNameComparer.cs" />
+    <Compile Include="Sorting\StartDateComparer.cs" />
+    <Compile Include="Sorting\StudioComparer.cs" />
     <Compile Include="Updates\InstallationManager.cs" />
   </ItemGroup>
-  <ItemGroup />
+  <ItemGroup>
+    <Reference Include="MediaBrowser.Naming, Version=1.0.6146.28476, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\MediaBrowser.Naming.1.0.0.57\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Patterns.Logging, Version=1.0.6149.1756, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\Patterns.Logging.1.0.0.4\lib\portable-net45+dnxcore50+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="IO\" />
+  </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

+ 15 - 12
MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs → Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs

@@ -7,8 +7,6 @@ using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Extensions;
 using MediaBrowser.Model.FileOrganization;
 using MediaBrowser.Model.Logging;
-using MediaBrowser.Server.Implementations.Library;
-using MediaBrowser.Server.Implementations.Logging;
 using System;
 using System.Collections.Generic;
 using System.Globalization;
@@ -16,11 +14,16 @@ using System.IO;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
+using Emby.Server.Implementations.Library;
+using Emby.Server.Implementations.Logging;
 using MediaBrowser.Common.IO;
+using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
+using MediaBrowser.Naming.TV;
+using EpisodeInfo = MediaBrowser.Controller.Providers.EpisodeInfo;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public class EpisodeFileOrganizer
     {
@@ -55,7 +58,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
                 OriginalPath = path,
                 OriginalFileName = Path.GetFileName(path),
                 Type = FileOrganizerType.Episode,
-                FileSize = new FileInfo(path).Length
+                FileSize = _fileSystem.GetFileInfo(path).Length
             };
 
             try
@@ -68,10 +71,10 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
             }
 
             var namingOptions = ((LibraryManager)_libraryManager).GetNamingOptions();
-            var resolver = new Naming.TV.EpisodeResolver(namingOptions, new PatternsLogger());
+            var resolver = new EpisodeResolver(namingOptions, new PatternsLogger());
 
             var episodeInfo = resolver.Resolve(path, false) ??
-                new Naming.TV.EpisodeInfo();
+                new MediaBrowser.Naming.TV.EpisodeInfo();
 
             var seriesName = episodeInfo.SeriesName;
 
@@ -505,7 +508,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 
                 episodePaths.AddRange(filesOfOtherExtensions);
             }
-            catch (DirectoryNotFoundException)
+            catch (IOException)
             {
                 // No big deal. Maybe the season folder doesn't already exist.
             }
@@ -575,7 +578,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
             result.ExtractedName = nameWithoutYear;
             result.ExtractedYear = yearInName;
 
-            var series = _libraryManager.GetItemList(new Controller.Entities.InternalItemsQuery
+            var series = _libraryManager.GetItemList(new InternalItemsQuery
             {
                 IncludeItemTypes = new[] { typeof(Series).Name },
                 Recursive = true
@@ -593,7 +596,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 
                 if (info != null)
                 {
-                    series = _libraryManager.GetItemList(new Controller.Entities.InternalItemsQuery
+                    series = _libraryManager.GetItemList(new InternalItemsQuery
                     {
                         IncludeItemTypes = new[] { typeof(Series).Name },
                         Recursive = true,
@@ -808,8 +811,8 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
         {
             try
             {
-                var sourceFileInfo = new FileInfo(sourcePath);
-                var destinationFileInfo = new FileInfo(newPath);
+                var sourceFileInfo = _fileSystem.GetFileInfo(sourcePath);
+                var destinationFileInfo = _fileSystem.GetFileInfo(newPath);
 
                 if (sourceFileInfo.Length == destinationFileInfo.Length)
                 {
@@ -820,7 +823,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
             {
                 return false;
             }
-            catch (DirectoryNotFoundException)
+            catch (IOException)
             {
                 return false;
             }

+ 1 - 1
MediaBrowser.Server.Implementations/FileOrganization/Extensions.cs → Emby.Server.Implementations/FileOrganization/Extensions.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Model.FileOrganization;
 using System.Collections.Generic;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public static class ConfigurationExtension
     {

+ 1 - 1
MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationNotifier.cs → Emby.Server.Implementations/FileOrganization/FileOrganizationNotifier.cs

@@ -8,7 +8,7 @@ using System;
 using System.Threading;
 using MediaBrowser.Model.Tasks;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     /// <summary>
     /// Class SessionInfoWebSocketListener

+ 1 - 1
MediaBrowser.Server.Implementations/FileOrganization/FileOrganizationService.cs → Emby.Server.Implementations/FileOrganization/FileOrganizationService.cs

@@ -21,7 +21,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.Tasks;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public class FileOrganizationService : IFileOrganizationService
     {

+ 3 - 18
MediaBrowser.Server.Implementations/FileOrganization/NameUtils.cs → Emby.Server.Implementations/FileOrganization/NameUtils.cs

@@ -2,10 +2,9 @@
 using MediaBrowser.Controller.Entities;
 using System;
 using System.Globalization;
-using System.Linq;
-using System.Text;
+using MediaBrowser.Controller.Extensions;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public static class NameUtils
     {
@@ -54,7 +53,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 
         private static string GetComparableName(string name)
         {
-            name = RemoveDiacritics(name);
+            name = name.RemoveDiacritics();
 
             name = " " + name + " ";
 
@@ -78,19 +77,5 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 
             return name.Trim();
         }
-
-        /// <summary>
-        /// Removes the diacritics.
-        /// </summary>
-        /// <param name="text">The text.</param>
-        /// <returns>System.String.</returns>
-        private static string RemoveDiacritics(string text)
-        {
-            return String.Concat(
-                text.Normalize(NormalizationForm.FormD)
-                .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
-                                              UnicodeCategory.NonSpacingMark)
-              ).Normalize(NormalizationForm.FormC);
-        }
     }
 }

+ 1 - 1
MediaBrowser.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs → Emby.Server.Implementations/FileOrganization/OrganizerScheduledTask.cs

@@ -13,7 +13,7 @@ using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.Tasks;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public class OrganizerScheduledTask : IScheduledTask, IConfigurableScheduledTask
     {

+ 2 - 2
MediaBrowser.Server.Implementations/FileOrganization/TvFolderOrganizer.cs → Emby.Server.Implementations/FileOrganization/TvFolderOrganizer.cs

@@ -14,7 +14,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.FileOrganization
+namespace Emby.Server.Implementations.FileOrganization
 {
     public class TvFolderOrganizer
     {
@@ -191,7 +191,7 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
                         _fileSystem.DeleteDirectory(path, false);
                     }
                     catch (UnauthorizedAccessException) { }
-                    catch (DirectoryNotFoundException) { }
+                    catch (IOException) { }
                 }
             }
             catch (UnauthorizedAccessException) { }

+ 1 - 1
MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs → Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs

@@ -10,7 +10,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     /// <summary>
     /// Provides the core resolver ignore rules

+ 27 - 28
MediaBrowser.Server.Implementations/Library/LibraryManager.cs → Emby.Server.Implementations/Library/LibraryManager.cs

@@ -18,9 +18,6 @@ using MediaBrowser.Naming.Audio;
 using MediaBrowser.Naming.Common;
 using MediaBrowser.Naming.TV;
 using MediaBrowser.Naming.Video;
-using MediaBrowser.Server.Implementations.Library.Validators;
-using MediaBrowser.Server.Implementations.Logging;
-using MediaBrowser.Server.Implementations.ScheduledTasks;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -30,6 +27,10 @@ using System.Linq;
 using System.Net;
 using System.Threading;
 using System.Threading.Tasks;
+using Emby.Server.Implementations.Library.Resolvers;
+using Emby.Server.Implementations.Library.Validators;
+using Emby.Server.Implementations.Logging;
+using Emby.Server.Implementations.ScheduledTasks;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Controller.Channels;
 using MediaBrowser.Model.Channels;
@@ -37,14 +38,13 @@ using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Extensions;
 using MediaBrowser.Model.Library;
 using MediaBrowser.Model.Net;
-using MediaBrowser.Server.Implementations.Library.Resolvers;
 using SortOrder = MediaBrowser.Model.Entities.SortOrder;
 using VideoResolver = MediaBrowser.Naming.Video.VideoResolver;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.IO;
 using MediaBrowser.Model.Tasks;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     /// <summary>
     /// Class LibraryManager
@@ -403,7 +403,7 @@ namespace MediaBrowser.Server.Implementations.Library
                 {
                     _fileSystem.DeleteDirectory(metadataPath, true);
                 }
-                catch (DirectoryNotFoundException)
+                catch (IOException)
                 {
 
                 }
@@ -1189,7 +1189,8 @@ namespace MediaBrowser.Server.Implementations.Library
             {
                 Name = Path.GetFileName(dir),
 
-                Locations = Directory.EnumerateFiles(dir, "*.mblink", SearchOption.TopDirectoryOnly)
+                Locations = _fileSystem.GetFilePaths(dir, false)
+                .Where(i => string.Equals(ShortcutFileExtension, Path.GetExtension(i), StringComparison.OrdinalIgnoreCase))
                     .Select(_fileSystem.ResolveShortcut)
                     .OrderBy(i => i)
                     .ToList(),
@@ -2302,11 +2303,11 @@ namespace MediaBrowser.Server.Implementations.Library
 
             var episodeInfo = locationType == LocationType.FileSystem || locationType == LocationType.Offline ?
                 resolver.Resolve(episode.Path, isFolder) :
-                new Naming.TV.EpisodeInfo();
+                new MediaBrowser.Naming.TV.EpisodeInfo();
 
             if (episodeInfo == null)
             {
-                episodeInfo = new Naming.TV.EpisodeInfo();
+                episodeInfo = new MediaBrowser.Naming.TV.EpisodeInfo();
             }
 
             var changed = false;
@@ -2787,10 +2788,7 @@ namespace MediaBrowser.Server.Implementations.Library
                 {
                     var path = Path.Combine(virtualFolderPath, collectionType + ".collection");
 
-                    using (File.Create(path))
-                    {
-
-                    }
+                    _fileSystem.WriteAllBytes(path, new byte[] {});
                 }
 
                 CollectionFolder.SaveLibraryOptions(virtualFolderPath, options);
@@ -2827,21 +2825,20 @@ namespace MediaBrowser.Server.Implementations.Library
 
         private bool ValidateNetworkPath(string path)
         {
-            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
-            {
-                // We can't validate protocol-based paths, so just allow them
-                if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) == -1)
-                {
-                    return Directory.Exists(path);
-                }
-            }
+            //if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+            //{
+            //    // We can't validate protocol-based paths, so just allow them
+            //    if (path.IndexOf("://", StringComparison.OrdinalIgnoreCase) == -1)
+            //    {
+            //        return _fileSystem.DirectoryExists(path);
+            //    }
+            //}
 
             // Without native support for unc, we cannot validate this when running under mono
             return true;
         }
 
         private const string ShortcutFileExtension = ".mblink";
-        private const string ShortcutFileSearch = "*" + ShortcutFileExtension;
         public void AddMediaPath(string virtualFolderName, MediaPathInfo pathInfo)
         {
             AddMediaPathInternal(virtualFolderName, pathInfo, true);
@@ -2863,12 +2860,12 @@ namespace MediaBrowser.Server.Implementations.Library
 
             if (!_fileSystem.DirectoryExists(path))
             {
-                throw new DirectoryNotFoundException("The path does not exist.");
+                throw new FileNotFoundException("The path does not exist.");
             }
 
             if (!string.IsNullOrWhiteSpace(pathInfo.NetworkPath) && !ValidateNetworkPath(pathInfo.NetworkPath))
             {
-                throw new DirectoryNotFoundException("The network path does not exist.");
+                throw new FileNotFoundException("The network path does not exist.");
             }
 
             var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
@@ -2911,7 +2908,7 @@ namespace MediaBrowser.Server.Implementations.Library
 
             if (!string.IsNullOrWhiteSpace(pathInfo.NetworkPath) && !ValidateNetworkPath(pathInfo.NetworkPath))
             {
-                throw new DirectoryNotFoundException("The network path does not exist.");
+                throw new FileNotFoundException("The network path does not exist.");
             }
 
             var rootFolderPath = ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
@@ -2973,7 +2970,7 @@ namespace MediaBrowser.Server.Implementations.Library
 
             if (!_fileSystem.DirectoryExists(path))
             {
-                throw new DirectoryNotFoundException("The media folder does not exist");
+                throw new FileNotFoundException("The media folder does not exist");
             }
 
             _libraryMonitorFactory().Stop();
@@ -3044,10 +3041,12 @@ namespace MediaBrowser.Server.Implementations.Library
 
             if (!_fileSystem.DirectoryExists(virtualFolderPath))
             {
-                throw new DirectoryNotFoundException(string.Format("The media collection {0} does not exist", virtualFolderName));
+                throw new FileNotFoundException(string.Format("The media collection {0} does not exist", virtualFolderName));
             }
 
-            var shortcut = Directory.EnumerateFiles(virtualFolderPath, ShortcutFileSearch, SearchOption.AllDirectories).FirstOrDefault(f => _fileSystem.ResolveShortcut(f).Equals(mediaPath, StringComparison.OrdinalIgnoreCase));
+            var shortcut = _fileSystem.GetFilePaths(virtualFolderPath, true)
+                .Where(i => string.Equals(ShortcutFileExtension, Path.GetExtension(i), StringComparison.OrdinalIgnoreCase))
+                .FirstOrDefault(f => _fileSystem.ResolveShortcut(f).Equals(mediaPath, StringComparison.OrdinalIgnoreCase));
 
             if (!string.IsNullOrEmpty(shortcut))
             {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/LocalTrailerPostScanTask.cs → Emby.Server.Implementations/Library/LocalTrailerPostScanTask.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Controller.Entities.TV;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     public class LocalTrailerPostScanTask : ILibraryPostScanTask
     {

+ 7 - 4
MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs → Emby.Server.Implementations/Library/MediaSourceManager.cs

@@ -18,8 +18,9 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.Threading;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     public class MediaSourceManager : IMediaSourceManager, IDisposable
     {
@@ -32,8 +33,9 @@ namespace MediaBrowser.Server.Implementations.Library
         private IMediaSourceProvider[] _providers;
         private readonly ILogger _logger;
         private readonly IUserDataManager _userDataManager;
+        private readonly ITimerFactory _timerFactory;
 
-        public MediaSourceManager(IItemRepository itemRepo, IUserManager userManager, ILibraryManager libraryManager, ILogger logger, IJsonSerializer jsonSerializer, IFileSystem fileSystem, IUserDataManager userDataManager)
+        public MediaSourceManager(IItemRepository itemRepo, IUserManager userManager, ILibraryManager libraryManager, ILogger logger, IJsonSerializer jsonSerializer, IFileSystem fileSystem, IUserDataManager userDataManager, ITimerFactory timerFactory)
         {
             _itemRepo = itemRepo;
             _userManager = userManager;
@@ -42,6 +44,7 @@ namespace MediaBrowser.Server.Implementations.Library
             _jsonSerializer = jsonSerializer;
             _fileSystem = fileSystem;
             _userDataManager = userDataManager;
+            _timerFactory = timerFactory;
         }
 
         public void AddParts(IEnumerable<IMediaSourceProvider> providers)
@@ -551,14 +554,14 @@ namespace MediaBrowser.Server.Implementations.Library
             return new Tuple<IMediaSourceProvider, string>(provider, keyId);
         }
 
-        private Timer _closeTimer;
+        private ITimer _closeTimer;
         private readonly TimeSpan _openStreamMaxAge = TimeSpan.FromSeconds(180);
 
         private void StartCloseTimer()
         {
             StopCloseTimer();
 
-            _closeTimer = new Timer(CloseTimerCallback, null, _openStreamMaxAge, _openStreamMaxAge);
+            _closeTimer = _timerFactory.Create(CloseTimerCallback, null, _openStreamMaxAge, _openStreamMaxAge);
         }
 
         private void StopCloseTimer()

+ 1 - 1
MediaBrowser.Server.Implementations/Library/MusicManager.cs → Emby.Server.Implementations/Library/MusicManager.cs

@@ -6,7 +6,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     public class MusicManager : IMusicManager
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/PathExtensions.cs → Emby.Server.Implementations/Library/PathExtensions.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Text.RegularExpressions;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     public static class PathExtensions
     {

+ 2 - 2
MediaBrowser.Server.Implementations/Library/ResolverHelper.cs → Emby.Server.Implementations/Library/ResolverHelper.cs

@@ -9,7 +9,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     /// <summary>
     /// Class ResolverHelper
@@ -112,7 +112,7 @@ namespace MediaBrowser.Server.Implementations.Library
         /// <summary>
         /// The MB name regex
         /// </summary>
-        private static readonly Regex MbNameRegex = new Regex(@"(\[.*?\])", RegexOptions.Compiled);
+        private static readonly Regex MbNameRegex = new Regex(@"(\[.*?\])");
 
         internal static string StripBrackets(string inputString)
         {

+ 4 - 4
MediaBrowser.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs → Emby.Server.Implementations/Library/Resolvers/Audio/AudioResolver.cs

@@ -3,12 +3,12 @@ using MediaBrowser.Controller.Resolvers;
 using MediaBrowser.Model.Entities;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
+namespace Emby.Server.Implementations.Library.Resolvers.Audio
 {
     /// <summary>
     /// Class AudioResolver
     /// </summary>
-    public class AudioResolver : ItemResolver<Controller.Entities.Audio.Audio>
+    public class AudioResolver : ItemResolver<MediaBrowser.Controller.Entities.Audio.Audio>
     {
         private readonly ILibraryManager _libraryManager;
 
@@ -31,7 +31,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
         /// </summary>
         /// <param name="args">The args.</param>
         /// <returns>Entities.Audio.Audio.</returns>
-        protected override Controller.Entities.Audio.Audio Resolve(ItemResolveArgs args)
+        protected override MediaBrowser.Controller.Entities.Audio.Audio Resolve(ItemResolveArgs args)
         {
             // Return audio if the path is a file and has a matching extension
 
@@ -57,7 +57,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
                         string.Equals(collectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase) ||
                         isMixed)
                     {
-                        return new Controller.Entities.Audio.Audio();
+                        return new MediaBrowser.Controller.Entities.Audio.Audio();
                     }
                 }
             }

+ 2 - 2
MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs → Emby.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs

@@ -5,17 +5,17 @@ using MediaBrowser.Controller.Resolvers;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Naming.Audio;
-using MediaBrowser.Server.Implementations.Logging;
 using System;
 using System.Collections.Generic;
 using System.IO;
+using Emby.Server.Implementations.Logging;
 using MediaBrowser.Common.IO;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.Configuration;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
+namespace Emby.Server.Implementations.Library.Resolvers.Audio
 {
     /// <summary>
     /// Class MusicAlbumResolver

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs → Emby.Server.Implementations/Library/Resolvers/Audio/MusicArtistResolver.cs

@@ -11,7 +11,7 @@ using MediaBrowser.Model.IO;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
+namespace Emby.Server.Implementations.Library.Resolvers.Audio
 {
     /// <summary>
     /// Class MusicArtistResolver

+ 4 - 4
MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs → Emby.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs

@@ -2,17 +2,17 @@
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Naming.Video;
-using MediaBrowser.Server.Implementations.Logging;
 using System;
 using System.IO;
+using Emby.Server.Implementations.Logging;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     /// <summary>
     /// Resolves a Path into a Video or Video subclass
     /// </summary>
     /// <typeparam name="T"></typeparam>
-    public abstract class BaseVideoResolver<T> : Controller.Resolvers.ItemResolver<T>
+    public abstract class BaseVideoResolver<T> : MediaBrowser.Controller.Resolvers.ItemResolver<T>
         where T : Video, new()
     {
         protected readonly ILibraryManager LibraryManager;
@@ -45,7 +45,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
             var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions();
             
             // If the path is a file check for a matching extensions
-            var parser = new Naming.Video.VideoResolver(namingOptions, new PatternsLogger());
+            var parser = new MediaBrowser.Naming.Video.VideoResolver(namingOptions, new PatternsLogger());
 
             if (args.IsDirectory)
             {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/FolderResolver.cs → Emby.Server.Implementations/Library/Resolvers/FolderResolver.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Resolvers;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     /// <summary>
     /// Class FolderResolver

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/ItemResolver.cs → Emby.Server.Implementations/Library/Resolvers/ItemResolver.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Resolvers;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     /// <summary>
     /// Class ItemResolver

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs → Emby.Server.Implementations/Library/Resolvers/Movies/BoxSetResolver.cs

@@ -5,7 +5,7 @@ using MediaBrowser.Model.Entities;
 using System;
 using System.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
+namespace Emby.Server.Implementations.Library.Resolvers.Movies
 {
     /// <summary>
     /// Class BoxSetResolver

+ 2 - 2
MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs → Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs

@@ -7,16 +7,16 @@ using MediaBrowser.Controller.Resolvers;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Extensions;
 using MediaBrowser.Naming.Video;
-using MediaBrowser.Server.Implementations.Logging;
 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using Emby.Server.Implementations.Logging;
 using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
+namespace Emby.Server.Implementations.Library.Resolvers.Movies
 {
     /// <summary>
     /// Class MovieResolver

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs → Emby.Server.Implementations/Library/Resolvers/PhotoAlbumResolver.cs

@@ -7,7 +7,7 @@ using System;
 using System.IO;
 using System.Linq;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     public class PhotoAlbumResolver : FolderResolver<PhotoAlbum>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs → Emby.Server.Implementations/Library/Resolvers/PhotoResolver.cs

@@ -11,7 +11,7 @@ using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.Configuration;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     public class PhotoResolver : ItemResolver<Photo>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/PlaylistResolver.cs → Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Playlists;
 using System;
 using System.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     public class PlaylistResolver : FolderResolver<Playlist>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs → Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs

@@ -9,7 +9,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     class SpecialFolderResolver : FolderResolver<Folder>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs → Emby.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Library;
 using System.Linq;
 using MediaBrowser.Model.Entities;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
+namespace Emby.Server.Implementations.Library.Resolvers.TV
 {
     /// <summary>
     /// Class EpisodeResolver

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs → Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Naming.Common;
 using MediaBrowser.Naming.TV;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
+namespace Emby.Server.Implementations.Library.Resolvers.TV
 {
     /// <summary>
     /// Class SeasonResolver

+ 3 - 3
MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs → Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs

@@ -6,18 +6,18 @@ using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Naming.Common;
 using MediaBrowser.Naming.TV;
-using MediaBrowser.Server.Implementations.Logging;
 using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using Emby.Server.Implementations.Logging;
 using MediaBrowser.Common.IO;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.Configuration;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
+namespace Emby.Server.Implementations.Library.Resolvers.TV
 {
     /// <summary>
     /// Class SeriesResolver
@@ -171,7 +171,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
                                 .ToList();
                         }
 
-                        var episodeResolver = new Naming.TV.EpisodeResolver(namingOptions, new PatternsLogger());
+                        var episodeResolver = new MediaBrowser.Naming.TV.EpisodeResolver(namingOptions, new PatternsLogger());
                         var episodeInfo = episodeResolver.Resolve(fullName, false, false);
                         if (episodeInfo != null && episodeInfo.EpisodeNumber.HasValue)
                         {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Resolvers/VideoResolver.cs → Emby.Server.Implementations/Library/Resolvers/VideoResolver.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Resolvers;
 
-namespace MediaBrowser.Server.Implementations.Library.Resolvers
+namespace Emby.Server.Implementations.Library.Resolvers
 {
     /// <summary>
     /// Resolves a Path into a Video

+ 2 - 7
MediaBrowser.Server.Implementations/Library/SearchEngine.cs → Emby.Server.Implementations/Library/SearchEngine.cs

@@ -1,7 +1,5 @@
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.Entities.TV;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Querying;
@@ -11,13 +9,10 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Extensions;
-using MediaBrowser.Model.Extensions;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     /// <summary>
-    /// Class LuceneSearchEngine
-    /// http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms
     /// </summary>
     public class SearchEngine : ISearchEngine
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/UserViewManager.cs → Emby.Server.Implementations/Library/UserViewManager.cs

@@ -15,7 +15,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Entities.Audio;
 using MediaBrowser.Model.Globalization;
 
-namespace MediaBrowser.Server.Implementations.Library
+namespace Emby.Server.Implementations.Library
 {
     public class UserViewManager : IUserViewManager
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs → Emby.Server.Implementations/Library/Validators/ArtistsPostScanTask.cs

@@ -5,7 +5,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class ArtistsPostScanTask

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/ArtistsValidator.cs → Emby.Server.Implementations/Library/Validators/ArtistsValidator.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class ArtistsValidator

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs → Emby.Server.Implementations/Library/Validators/GameGenresPostScanTask.cs

@@ -5,7 +5,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class GameGenresPostScanTask

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs → Emby.Server.Implementations/Library/Validators/GameGenresValidator.cs

@@ -7,7 +7,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     class GameGenresValidator
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/GenresPostScanTask.cs → Emby.Server.Implementations/Library/Validators/GenresPostScanTask.cs

@@ -5,7 +5,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 using MediaBrowser.Model.Logging;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     public class GenresPostScanTask : ILibraryPostScanTask
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs → Emby.Server.Implementations/Library/Validators/GenresValidator.cs

@@ -8,7 +8,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     class GenresValidator
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs → Emby.Server.Implementations/Library/Validators/MusicGenresPostScanTask.cs

@@ -5,7 +5,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class MusicGenresPostScanTask

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/MusicGenresValidator.cs → Emby.Server.Implementations/Library/Validators/MusicGenresValidator.cs

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     class MusicGenresValidator
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs → Emby.Server.Implementations/Library/Validators/PeopleValidator.cs

@@ -15,7 +15,7 @@ using MediaBrowser.Common.IO;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.IO;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class PeopleValidator

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/StudiosPostScanTask.cs → Emby.Server.Implementations/Library/Validators/StudiosPostScanTask.cs

@@ -5,7 +5,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     /// <summary>
     /// Class MusicGenresPostScanTask

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs → Emby.Server.Implementations/Library/Validators/StudiosValidator.cs

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Persistence;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     class StudiosValidator
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Library/Validators/YearsPostScanTask.cs → Emby.Server.Implementations/Library/Validators/YearsPostScanTask.cs

@@ -4,7 +4,7 @@ using System;
 using System.Threading;
 using System.Threading.Tasks;
 
-namespace MediaBrowser.Server.Implementations.Library.Validators
+namespace Emby.Server.Implementations.Library.Validators
 {
     public class YearsPostScanTask : ILibraryPostScanTask
     {

+ 63 - 0
Emby.Server.Implementations/Logging/PatternsLogger.cs

@@ -0,0 +1,63 @@
+using Patterns.Logging;
+using System;
+
+namespace Emby.Server.Implementations.Logging
+{
+    public class PatternsLogger : ILogger
+    {
+        private readonly MediaBrowser.Model.Logging.ILogger _logger;
+
+        public PatternsLogger()
+            : this(new MediaBrowser.Model.Logging.NullLogger())
+        {
+        }
+
+        public PatternsLogger(MediaBrowser.Model.Logging.ILogger logger)
+        {
+            _logger = logger;
+        }
+
+        public void Debug(string message, params object[] paramList)
+        {
+            _logger.Debug(message, paramList);
+        }
+
+        public void Error(string message, params object[] paramList)
+        {
+            _logger.Error(message, paramList);
+        }
+
+        public void ErrorException(string message, Exception exception, params object[] paramList)
+        {
+            _logger.ErrorException(message, exception, paramList);
+        }
+
+        public void Fatal(string message, params object[] paramList)
+        {
+            _logger.Fatal(message, paramList);
+        }
+
+        public void FatalException(string message, Exception exception, params object[] paramList)
+        {
+            _logger.FatalException(message, exception, paramList);
+        }
+
+        public void Info(string message, params object[] paramList)
+        {
+            _logger.Info(message, paramList);
+        }
+
+        public void Warn(string message, params object[] paramList)
+        {
+            _logger.Warn(message, paramList);
+        }
+
+        public void Log(LogSeverity severity, string message, params object[] paramList)
+        {
+        }
+
+        public void LogMultiline(string message, LogSeverity severity, System.Text.StringBuilder additionalContent)
+        {
+        }
+    }
+}

+ 5 - 4
MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs → Emby.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs

@@ -20,9 +20,9 @@ using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Model.Globalization;
 using MediaBrowser.Model.Tasks;
-using MediaBrowser.Server.Implementations.ScheduledTasks;
+using Emby.Server.Implementations.ScheduledTasks;
 
-namespace MediaBrowser.Server.Implementations.Persistence
+namespace Emby.Server.Implementations.Persistence
 {
     public class CleanDatabaseScheduledTask : IScheduledTask
     {
@@ -37,6 +37,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
 
         public const int MigrationVersion = 23;
         public static bool EnableUnavailableMessage = false;
+        const int LatestSchemaVersion = 109;
 
         public CleanDatabaseScheduledTask(ILibraryManager libraryManager, IItemRepository itemRepo, ILogger logger, IServerConfigurationManager config, IFileSystem fileSystem, IHttpServer httpServer, ILocalizationManager localization, ITaskManager taskManager)
         {
@@ -113,9 +114,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
                 _config.SaveConfiguration();
             }
 
-            if (_config.Configuration.SchemaVersion < SqliteItemRepository.LatestSchemaVersion)
+            if (_config.Configuration.SchemaVersion < LatestSchemaVersion)
             {
-                _config.Configuration.SchemaVersion = SqliteItemRepository.LatestSchemaVersion;
+                _config.Configuration.SchemaVersion = LatestSchemaVersion;
                 _config.SaveConfiguration();
             }
 

+ 2 - 2
MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs → Emby.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs

@@ -1,13 +1,13 @@
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Library;
-using MediaBrowser.Server.Implementations.Library;
 using System;
 using System.Collections.Generic;
 using System.Threading;
 using System.Threading.Tasks;
+using Emby.Server.Implementations.Library;
 using MediaBrowser.Model.Tasks;
 
-namespace MediaBrowser.Server.Implementations.ScheduledTasks
+namespace Emby.Server.Implementations.ScheduledTasks
 {
     /// <summary>
     /// Class RefreshMediaLibraryTask

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/AirTimeComparer.cs → Emby.Server.Implementations/Sorting/AirTimeComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class AirTimeComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs → Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     class AiredEpisodeOrderComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/AlbumArtistComparer.cs → Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs

@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class AlbumArtistComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/AlbumComparer.cs → Emby.Server.Implementations/Sorting/AlbumComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class AlbumComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/AlphanumComparator.cs → Emby.Server.Implementations/Sorting/AlphanumComparator.cs

@@ -2,7 +2,7 @@
 using System.Text;
 using MediaBrowser.Controller.Sorting;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class AlphanumComparator : IComparer<string>
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/ArtistComparer.cs → Emby.Server.Implementations/Sorting/ArtistComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class ArtistComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs → Emby.Server.Implementations/Sorting/BudgetComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class BudgetComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/CommunityRatingComparer.cs → Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class CommunityRatingComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/CriticRatingComparer.cs → Emby.Server.Implementations/Sorting/CriticRatingComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class CriticRatingComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/DateCreatedComparer.cs → Emby.Server.Implementations/Sorting/DateCreatedComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class DateCreatedComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs → Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class DateLastMediaAddedComparer : IUserBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/DatePlayedComparer.cs → Emby.Server.Implementations/Sorting/DatePlayedComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class DatePlayedComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/GameSystemComparer.cs → Emby.Server.Implementations/Sorting/GameSystemComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class GameSystemComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs → Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class IsFavoriteOrLikeComparer : IUserBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/IsFolderComparer.cs → Emby.Server.Implementations/Sorting/IsFolderComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class IsFolderComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/IsPlayedComparer.cs → Emby.Server.Implementations/Sorting/IsPlayedComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class IsPlayedComparer : IUserBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/IsUnplayedComparer.cs → Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class IsUnplayedComparer : IUserBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/MetascoreComparer.cs → Emby.Server.Implementations/Sorting/MetascoreComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class MetascoreComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/NameComparer.cs → Emby.Server.Implementations/Sorting/NameComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class NameComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/OfficialRatingComparer.cs → Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Globalization;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class OfficialRatingComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/PlayCountComparer.cs → Emby.Server.Implementations/Sorting/PlayCountComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class PlayCountComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/PlayersComparer.cs → Emby.Server.Implementations/Sorting/PlayersComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class PlayersComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/PremiereDateComparer.cs → Emby.Server.Implementations/Sorting/PremiereDateComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class PremiereDateComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/ProductionYearComparer.cs → Emby.Server.Implementations/Sorting/ProductionYearComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class ProductionYearComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs → Emby.Server.Implementations/Sorting/RandomComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class RandomComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs → Emby.Server.Implementations/Sorting/RevenueComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class RevenueComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/RuntimeComparer.cs → Emby.Server.Implementations/Sorting/RuntimeComparer.cs

@@ -2,7 +2,7 @@
 using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class RuntimeComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/SeriesSortNameComparer.cs → Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     class SeriesSortNameComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs → Emby.Server.Implementations/Sorting/SortNameComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     /// <summary>
     /// Class SortNameComparer

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/StartDateComparer.cs → Emby.Server.Implementations/Sorting/StartDateComparer.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class StartDateComparer : IBaseItemComparer
     {

+ 1 - 1
MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs → Emby.Server.Implementations/Sorting/StudioComparer.cs

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Sorting;
 using MediaBrowser.Model.Querying;
 using System.Linq;
 
-namespace MediaBrowser.Server.Implementations.Sorting
+namespace Emby.Server.Implementations.Sorting
 {
     public class StudioComparer : IBaseItemComparer
     {

+ 5 - 0
Emby.Server.Implementations/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="MediaBrowser.Naming" version="1.0.0.57" targetFramework="portable45-net45+win8" />
+  <package id="Patterns.Logging" version="1.0.0.4" targetFramework="portable45-net45+win8" />
+</packages>

+ 12 - 10
MediaBrowser.Server.Implementations/IO/FileRefresher.cs

@@ -14,7 +14,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Model.Extensions;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Tasks;
-using MediaBrowser.Server.Implementations.ScheduledTasks;
+using MediaBrowser.Model.Threading;
 
 namespace MediaBrowser.Server.Implementations.IO
 {
@@ -26,13 +26,14 @@ namespace MediaBrowser.Server.Implementations.IO
         private IServerConfigurationManager ConfigurationManager { get; set; }
         private readonly IFileSystem _fileSystem;
         private readonly List<string> _affectedPaths = new List<string>();
-        private Timer _timer;
+        private ITimer _timer;
+        private readonly ITimerFactory _timerFactory;
         private readonly object _timerLock = new object();
         public string Path { get; private set; }
 
         public event EventHandler<EventArgs> Completed;
 
-        public FileRefresher(string path, IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ITaskManager taskManager, ILogger logger)
+        public FileRefresher(string path, IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ITaskManager taskManager, ILogger logger, ITimerFactory timerFactory)
         {
             logger.Debug("New file refresher created for {0}", path);
             Path = path;
@@ -42,6 +43,7 @@ namespace MediaBrowser.Server.Implementations.IO
             LibraryManager = libraryManager;
             TaskManager = taskManager;
             Logger = logger;
+            _timerFactory = timerFactory;
             AddPath(path);
         }
 
@@ -88,7 +90,7 @@ namespace MediaBrowser.Server.Implementations.IO
 
                 if (_timer == null)
                 {
-                    _timer = new Timer(OnTimerCallback, null, TimeSpan.FromSeconds(ConfigurationManager.Configuration.LibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
+                    _timer = _timerFactory.Create(OnTimerCallback, null, TimeSpan.FromSeconds(ConfigurationManager.Configuration.LibraryMonitorDelay), TimeSpan.FromMilliseconds(-1));
                 }
                 else
                 {
@@ -163,7 +165,7 @@ namespace MediaBrowser.Server.Implementations.IO
             // If the root folder changed, run the library task so the user can see it
             if (itemsToRefresh.Any(i => i is AggregateFolder))
             {
-                TaskManager.CancelIfRunningAndQueue<RefreshMediaLibraryTask>();
+                LibraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
                 return;
             }
 
@@ -268,11 +270,11 @@ namespace MediaBrowser.Server.Implementations.IO
                     return false;
                 }
             }
-            catch (DirectoryNotFoundException)
-            {
-                // File may have been deleted
-                return false;
-            }
+            //catch (DirectoryNotFoundException)
+            //{
+            //    // File may have been deleted
+            //    return false;
+            //}
             catch (FileNotFoundException)
             {
                 // File may have been deleted

+ 5 - 4
MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

@@ -16,6 +16,7 @@ using MediaBrowser.Model.IO;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller.IO;
 using MediaBrowser.Model.Tasks;
+using MediaBrowser.Model.Threading;
 
 namespace MediaBrowser.Server.Implementations.IO
 {
@@ -136,12 +137,12 @@ namespace MediaBrowser.Server.Implementations.IO
         private IServerConfigurationManager ConfigurationManager { get; set; }
 
         private readonly IFileSystem _fileSystem;
-        private readonly IServerApplicationHost _appHost;
+        private readonly ITimerFactory _timerFactory;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="LibraryMonitor" /> class.
         /// </summary>
-        public LibraryMonitor(ILogManager logManager, ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, IServerApplicationHost appHost)
+        public LibraryMonitor(ILogManager logManager, ITaskManager taskManager, ILibraryManager libraryManager, IServerConfigurationManager configurationManager, IFileSystem fileSystem, ITimerFactory timerFactory)
         {
             if (taskManager == null)
             {
@@ -153,7 +154,7 @@ namespace MediaBrowser.Server.Implementations.IO
             Logger = logManager.GetLogger(GetType().Name);
             ConfigurationManager = configurationManager;
             _fileSystem = fileSystem;
-            _appHost = appHost;
+            _timerFactory = timerFactory;
 
             SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
         }
@@ -528,7 +529,7 @@ namespace MediaBrowser.Server.Implementations.IO
                     }
                 }
 
-                var newRefresher = new FileRefresher(path, _fileSystem, ConfigurationManager, LibraryManager, TaskManager, Logger);
+                var newRefresher = new FileRefresher(path, _fileSystem, ConfigurationManager, LibraryManager, TaskManager, Logger, _timerFactory);
                 newRefresher.Completed += NewRefresher_Completed;
                 _activeRefreshers.Add(newRefresher);
             }

+ 22 - 23
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs

@@ -15,7 +15,6 @@ using MediaBrowser.Model.Events;
 using MediaBrowser.Model.LiveTv;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Serialization;
-using MediaBrowser.Server.Implementations.FileOrganization;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -1528,28 +1527,28 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
         private async void OnSuccessfulRecording(TimerInfo timer, string path)
         {
-            if (timer.IsProgramSeries && GetConfiguration().EnableAutoOrganize)
-            {
-                try
-                {
-                    // this is to account for the library monitor holding a lock for additional time after the change is complete.
-                    // ideally this shouldn't be hard-coded
-                    await Task.Delay(30000).ConfigureAwait(false);
-
-                    var organize = new EpisodeFileOrganizer(_organizationService, _config, _fileSystem, _logger, _libraryManager, _libraryMonitor, _providerManager);
-
-                    var result = await organize.OrganizeEpisodeFile(path, _config.GetAutoOrganizeOptions(), false, CancellationToken.None).ConfigureAwait(false);
-
-                    if (result.Status == FileSortingStatus.Success)
-                    {
-                        return;
-                    }
-                }
-                catch (Exception ex)
-                {
-                    _logger.ErrorException("Error processing new recording", ex);
-                }
-            }
+            //if (timer.IsProgramSeries && GetConfiguration().EnableAutoOrganize)
+            //{
+            //    try
+            //    {
+            //        // this is to account for the library monitor holding a lock for additional time after the change is complete.
+            //        // ideally this shouldn't be hard-coded
+            //        await Task.Delay(30000).ConfigureAwait(false);
+
+            //        var organize = new EpisodeFileOrganizer(_organizationService, _config, _fileSystem, _logger, _libraryManager, _libraryMonitor, _providerManager);
+
+            //        var result = await organize.OrganizeEpisodeFile(path, _config.GetAutoOrganizeOptions(), false, CancellationToken.None).ConfigureAwait(false);
+
+            //        if (result.Status == FileSortingStatus.Success)
+            //        {
+            //            return;
+            //        }
+            //    }
+            //    catch (Exception ex)
+            //    {
+            //        _logger.ErrorException("Error processing new recording", ex);
+            //    }
+            //}
         }
 
         private void SaveNfo(TimerInfo timer, string recordingPath, string seriesPath)

+ 0 - 79
MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj

@@ -108,7 +108,6 @@
     <Compile Include="..\SharedVersion.cs">
       <Link>Properties\SharedVersion.cs</Link>
     </Compile>
-    <Compile Include="Activity\ActivityManager.cs" />
     <Compile Include="Activity\ActivityRepository.cs" />
     <Compile Include="Archiving\ZipClient.cs" />
     <Compile Include="Collections\CollectionsDynamicFolder.cs" />
@@ -122,7 +121,6 @@
     <Compile Include="Devices\DeviceManager.cs" />
     <Compile Include="Devices\DeviceRepository.cs" />
     <Compile Include="Devices\CameraUploadsFolder.cs" />
-    <Compile Include="Dto\DtoService.cs" />
     <Compile Include="EntryPoints\ActivityLogEntryPoint.cs" />
     <Compile Include="EntryPoints\AutomaticRestartEntryPoint.cs" />
     <Compile Include="EntryPoints\ExternalPortForwarding.cs" />
@@ -134,16 +132,9 @@
     <Compile Include="EntryPoints\RefreshUsersMetadata.cs" />
     <Compile Include="EntryPoints\UsageEntryPoint.cs" />
     <Compile Include="EntryPoints\UsageReporter.cs" />
-    <Compile Include="FileOrganization\EpisodeFileOrganizer.cs" />
-    <Compile Include="FileOrganization\Extensions.cs" />
-    <Compile Include="FileOrganization\FileOrganizationNotifier.cs" />
-    <Compile Include="FileOrganization\FileOrganizationService.cs" />
-    <Compile Include="FileOrganization\NameUtils.cs" />
-    <Compile Include="FileOrganization\TvFolderOrganizer.cs" />
     <Compile Include="EntryPoints\UdpServerEntryPoint.cs" />
     <Compile Include="EntryPoints\ServerEventNotifier.cs" />
     <Compile Include="EntryPoints\UserDataChangeNotifier.cs" />
-    <Compile Include="FileOrganization\OrganizerScheduledTask.cs" />
     <Compile Include="HttpServer\IHttpListener.cs" />
     <Compile Include="HttpServer\Security\AuthorizationContext.cs" />
     <Compile Include="HttpServer\ContainerAdapter.cs" />
@@ -171,45 +162,8 @@
     <Compile Include="IO\LibraryMonitor.cs" />
     <Compile Include="IO\MemoryStreamProvider.cs" />
     <Compile Include="IO\ThrottledStream.cs" />
-    <Compile Include="Library\CoreResolutionIgnoreRule.cs" />
-    <Compile Include="Library\LibraryManager.cs" />
-    <Compile Include="Library\LocalTrailerPostScanTask.cs" />
-    <Compile Include="Library\MediaSourceManager.cs" />
-    <Compile Include="Library\MusicManager.cs" />
-    <Compile Include="Library\PathExtensions.cs" />
-    <Compile Include="Library\Resolvers\SpecialFolderResolver.cs" />
-    <Compile Include="Library\Resolvers\BaseVideoResolver.cs" />
-    <Compile Include="Library\Resolvers\PhotoAlbumResolver.cs" />
-    <Compile Include="Library\Resolvers\PhotoResolver.cs" />
-    <Compile Include="Library\Resolvers\PlaylistResolver.cs" />
-    <Compile Include="Library\SearchEngine.cs" />
-    <Compile Include="Library\ResolverHelper.cs" />
-    <Compile Include="Library\Resolvers\Audio\AudioResolver.cs" />
-    <Compile Include="Library\Resolvers\Audio\MusicAlbumResolver.cs" />
-    <Compile Include="Library\Resolvers\Audio\MusicArtistResolver.cs" />
-    <Compile Include="Library\Resolvers\ItemResolver.cs" />
-    <Compile Include="Library\Resolvers\FolderResolver.cs" />
-    <Compile Include="Library\Resolvers\Movies\BoxSetResolver.cs" />
-    <Compile Include="Library\Resolvers\Movies\MovieResolver.cs" />
-    <Compile Include="Library\Resolvers\TV\EpisodeResolver.cs" />
-    <Compile Include="Library\Resolvers\TV\SeasonResolver.cs" />
-    <Compile Include="Library\Resolvers\TV\SeriesResolver.cs" />
-    <Compile Include="Library\Resolvers\VideoResolver.cs" />
     <Compile Include="Library\UserDataManager.cs" />
     <Compile Include="Library\UserManager.cs" />
-    <Compile Include="Library\UserViewManager.cs" />
-    <Compile Include="Library\Validators\ArtistsPostScanTask.cs" />
-    <Compile Include="Library\Validators\ArtistsValidator.cs" />
-    <Compile Include="Library\Validators\GameGenresPostScanTask.cs" />
-    <Compile Include="Library\Validators\GameGenresValidator.cs" />
-    <Compile Include="Library\Validators\GenresPostScanTask.cs" />
-    <Compile Include="Library\Validators\GenresValidator.cs" />
-    <Compile Include="Library\Validators\MusicGenresPostScanTask.cs" />
-    <Compile Include="Library\Validators\MusicGenresValidator.cs" />
-    <Compile Include="Library\Validators\PeopleValidator.cs" />
-    <Compile Include="Library\Validators\StudiosPostScanTask.cs" />
-    <Compile Include="Library\Validators\StudiosValidator.cs" />
-    <Compile Include="Library\Validators\YearsPostScanTask.cs" />
     <Compile Include="LiveTv\ChannelImageProvider.cs" />
     <Compile Include="LiveTv\EmbyTV\DirectRecorder.cs" />
     <Compile Include="LiveTv\EmbyTV\EmbyTV.cs" />
@@ -267,19 +221,16 @@
     <Compile Include="News\NewsEntryPoint.cs" />
     <Compile Include="Notifications\IConfigurableNotificationService.cs" />
     <Compile Include="Persistence\BaseSqliteRepository.cs" />
-    <Compile Include="Persistence\CleanDatabaseScheduledTask.cs" />
     <Compile Include="Persistence\DataExtensions.cs" />
     <Compile Include="Persistence\IDbConnector.cs" />
     <Compile Include="Persistence\MediaStreamColumns.cs" />
     <Compile Include="Reflection\AssemblyInfo.cs" />
-    <Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
     <Compile Include="Security\MBLicenseFile.cs" />
     <Compile Include="Security\PluginSecurityManager.cs" />
     <Compile Include="Security\RegRecord.cs" />
     <Compile Include="Serialization\JsonSerializer.cs" />
     <Compile Include="Social\SharingManager.cs" />
     <Compile Include="Social\SharingRepository.cs" />
-    <Compile Include="Sorting\StartDateComparer.cs" />
     <Compile Include="Sync\SyncHelper.cs" />
     <Compile Include="Sync\SyncJobOptions.cs" />
     <Compile Include="Sync\SyncNotificationEntryPoint.cs" />
@@ -311,40 +262,10 @@
     </Compile>
     <Compile Include="Session\SessionWebSocketListener.cs" />
     <Compile Include="Session\WebSocketController.cs" />
-    <Compile Include="Sorting\AiredEpisodeOrderComparer.cs" />
-    <Compile Include="Sorting\AirTimeComparer.cs" />
-    <Compile Include="Sorting\AlbumArtistComparer.cs" />
-    <Compile Include="Sorting\AlbumComparer.cs" />
-    <Compile Include="Sorting\AlphanumComparator.cs" />
-    <Compile Include="Sorting\ArtistComparer.cs" />
-    <Compile Include="Sorting\BudgetComparer.cs" />
-    <Compile Include="Sorting\CommunityRatingComparer.cs" />
-    <Compile Include="Sorting\CriticRatingComparer.cs" />
-    <Compile Include="Sorting\DateCreatedComparer.cs" />
-    <Compile Include="Sorting\DateLastMediaAddedComparer.cs" />
-    <Compile Include="Sorting\DatePlayedComparer.cs" />
-    <Compile Include="Sorting\GameSystemComparer.cs" />
-    <Compile Include="Sorting\IsFavoriteOrLikeComparer.cs" />
-    <Compile Include="Sorting\IsFolderComparer.cs" />
-    <Compile Include="Sorting\IsPlayedComparer.cs" />
-    <Compile Include="Sorting\IsUnplayedComparer.cs" />
-    <Compile Include="Sorting\MetascoreComparer.cs" />
-    <Compile Include="Sorting\NameComparer.cs" />
-    <Compile Include="Sorting\OfficialRatingComparer.cs" />
-    <Compile Include="Sorting\PlayCountComparer.cs" />
-    <Compile Include="Sorting\PlayersComparer.cs" />
-    <Compile Include="Sorting\PremiereDateComparer.cs" />
-    <Compile Include="Sorting\ProductionYearComparer.cs" />
-    <Compile Include="Sorting\RandomComparer.cs" />
-    <Compile Include="Sorting\RevenueComparer.cs" />
-    <Compile Include="Sorting\RuntimeComparer.cs" />
-    <Compile Include="Sorting\SeriesSortNameComparer.cs" />
-    <Compile Include="Sorting\SortNameComparer.cs" />
     <Compile Include="Persistence\SqliteDisplayPreferencesRepository.cs" />
     <Compile Include="Persistence\SqliteItemRepository.cs" />
     <Compile Include="Persistence\SqliteUserDataRepository.cs" />
     <Compile Include="Persistence\SqliteUserRepository.cs" />
-    <Compile Include="Sorting\StudioComparer.cs" />
     <Compile Include="Sync\AppSyncProvider.cs" />
     <Compile Include="Sync\CloudSyncProfile.cs" />
     <Compile Include="Sync\IHasSyncQuality.cs" />

+ 7 - 4
MediaBrowser.Server.Startup.Common/ApplicationHost.cs

@@ -54,9 +54,7 @@ using MediaBrowser.Server.Implementations.Collections;
 using MediaBrowser.Server.Implementations.Configuration;
 using MediaBrowser.Server.Implementations.Connect;
 using MediaBrowser.Server.Implementations.Devices;
-using MediaBrowser.Server.Implementations.Dto;
 using MediaBrowser.Server.Implementations.EntryPoints;
-using MediaBrowser.Server.Implementations.FileOrganization;
 using MediaBrowser.Server.Implementations.HttpServer;
 using MediaBrowser.Server.Implementations.HttpServer.Security;
 using MediaBrowser.Server.Implementations.IO;
@@ -107,8 +105,13 @@ using Emby.Dlna.ContentDirectory;
 using Emby.Dlna.Main;
 using Emby.Dlna.MediaReceiverRegistrar;
 using Emby.Dlna.Ssdp;
+using Emby.Server.Implementations.Activity;
 using Emby.Server.Implementations.Channels;
 using Emby.Server.Implementations.Collections;
+using Emby.Server.Implementations.Dto;
+using Emby.Server.Implementations.FileOrganization;
+using Emby.Server.Implementations.Library;
+using Emby.Server.Implementations.Persistence;
 using Emby.Server.Implementations.Playlists;
 using Emby.Server.Implementations.Updates;
 using MediaBrowser.Model.Activity;
@@ -588,7 +591,7 @@ namespace MediaBrowser.Server.Startup.Common
             var musicManager = new MusicManager(LibraryManager);
             RegisterSingleInstance<IMusicManager>(new MusicManager(LibraryManager));
 
-            LibraryMonitor = new LibraryMonitor(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, this);
+            LibraryMonitor = new LibraryMonitor(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, TimerFactory);
             RegisterSingleInstance(LibraryMonitor);
 
             ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, LibraryMonitor, LogManager, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer, MemoryStreamProvider);
@@ -639,7 +642,7 @@ namespace MediaBrowser.Server.Startup.Common
             ChannelManager = new ChannelManager(UserManager, DtoService, LibraryManager, LogManager.GetLogger("ChannelManager"), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, LocalizationManager, HttpClient, ProviderManager);
             RegisterSingleInstance(ChannelManager);
 
-            MediaSourceManager = new MediaSourceManager(ItemRepository, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager);
+            MediaSourceManager = new MediaSourceManager(ItemRepository, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager, TimerFactory);
             RegisterSingleInstance(MediaSourceManager);
 
             SessionManager = new SessionManager(UserDataManager, LogManager.GetLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager);

+ 1 - 0
MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs

@@ -1,4 +1,5 @@
 using System.Threading.Tasks;
+using Emby.Server.Implementations.Persistence;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Model.Tasks;
 using MediaBrowser.Server.Implementations.Persistence;