aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs40
-rw-r--r--MediaBrowser.Server.Implementations/MediaEncoder/EncodingManager.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs3
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs3
-rw-r--r--MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs5
5 files changed, 28 insertions, 25 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index ea9e58ee4..7ed4dc71e 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -172,27 +172,29 @@ namespace MediaBrowser.Server.Implementations.IO
}
}
- public void Start()
+ private bool IsLibraryMonitorEnabaled(BaseItem item)
{
- if (EnableLibraryMonitor)
+ var options = LibraryManager.GetLibraryOptions(item);
+
+ if (options != null && options.SchemaVersion >= 1)
{
- StartInternal();
+ return options.EnableRealtimeMonitor;
}
+
+ return EnableLibraryMonitor;
}
- /// <summary>
- /// Starts this instance.
- /// </summary>
- private void StartInternal()
+ public void Start()
{
LibraryManager.ItemAdded += LibraryManager_ItemAdded;
LibraryManager.ItemRemoved += LibraryManager_ItemRemoved;
- var pathsToWatch = new List<string> { LibraryManager.RootFolder.Path };
+ var pathsToWatch = new List<string> { };
var paths = LibraryManager
.RootFolder
.Children
+ .Where(IsLibraryMonitorEnabaled)
.OfType<Folder>()
.SelectMany(f => f.PhysicalLocations)
.Distinct(StringComparer.OrdinalIgnoreCase)
@@ -213,6 +215,14 @@ namespace MediaBrowser.Server.Implementations.IO
}
}
+ private void StartWatching(BaseItem item)
+ {
+ if (IsLibraryMonitorEnabaled(item))
+ {
+ StartWatchingPath(item.Path);
+ }
+ }
+
/// <summary>
/// Handles the ItemRemoved event of the LibraryManager control.
/// </summary>
@@ -235,7 +245,7 @@ namespace MediaBrowser.Server.Implementations.IO
{
if (e.Item.GetParent() is AggregateFolder)
{
- StartWatchingPath(e.Item.Path);
+ StartWatching(e.Item);
}
}
@@ -382,14 +392,6 @@ namespace MediaBrowser.Server.Implementations.IO
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
DisposeWatcher(dw);
-
- if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto)
- {
- Logger.Info("Disabling realtime monitor to prevent future instability");
-
- ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled;
- Stop();
- }
}
/// <summary>
@@ -420,8 +422,8 @@ namespace MediaBrowser.Server.Implementations.IO
var filename = Path.GetFileName(path);
- var monitorPath = !string.IsNullOrEmpty(filename) &&
- !_alwaysIgnoreFiles.Contains(filename, StringComparer.OrdinalIgnoreCase) &&
+ var monitorPath = !string.IsNullOrEmpty(filename) &&
+ !_alwaysIgnoreFiles.Contains(filename, StringComparer.OrdinalIgnoreCase) &&
!_alwaysIgnoreExtensions.Contains(Path.GetExtension(path) ?? string.Empty, StringComparer.OrdinalIgnoreCase);
// Ignore certain files
diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/EncodingManager.cs b/MediaBrowser.Server.Implementations/MediaEncoder/EncodingManager.cs
index 7f709d084..46ba7d2e7 100644
--- a/MediaBrowser.Server.Implementations/MediaEncoder/EncodingManager.cs
+++ b/MediaBrowser.Server.Implementations/MediaEncoder/EncodingManager.cs
@@ -123,7 +123,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
{
if (extractImages)
{
- if (video.VideoType == VideoType.HdDvd || video.VideoType == VideoType.Iso || video.VideoType == VideoType.BluRay)
+ if (video.VideoType == VideoType.HdDvd || video.VideoType == VideoType.Iso || video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd)
{
continue;
}
diff --git a/MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs b/MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs
index bf2afb5ac..c1394ee1c 100644
--- a/MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/CleanDatabaseScheduledTask.cs
@@ -313,8 +313,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (Folder.IsPathOffline(path))
{
- libraryItem.IsOffline = true;
- await libraryItem.UpdateToRepository(ItemUpdateType.None, cancellationToken).ConfigureAwait(false);
+ await libraryItem.UpdateIsOffline(true).ConfigureAwait(false);
continue;
}
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index b9befb531..5c94d589d 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -211,7 +211,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "ProductionYear", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "ParentId", "GUID");
_connection.AddColumn(Logger, "TypedBaseItems", "Genres", "Text");
- _connection.AddColumn(Logger, "TypedBaseItems", "ParentalRatingValue", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "SchemaVersion", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "SortName", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "RunTimeTicks", "BIGINT");
@@ -488,7 +487,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
"ProductionYear",
"ParentId",
"Genres",
- "ParentalRatingValue",
"InheritedParentalRatingValue",
"SchemaVersion",
"SortName",
@@ -795,7 +793,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
_saveItemCommand.GetParameter(index++).Value = string.Join("|", item.Genres.ToArray());
- _saveItemCommand.GetParameter(index++).Value = item.GetParentalRatingValue() ?? 0;
_saveItemCommand.GetParameter(index++).Value = item.GetInheritedParentalRatingValue() ?? 0;
_saveItemCommand.GetParameter(index++).Value = LatestSchemaVersion;
diff --git a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs
index 03485012f..408ec717e 100644
--- a/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs
+++ b/MediaBrowser.Server.Implementations/Sync/AppSyncProvider.cs
@@ -85,6 +85,11 @@ namespace MediaBrowser.Server.Implementations.Sync
{
Name = "Low",
Id = "low"
+ },
+ new SyncQualityOption
+ {
+ Name = "Custom",
+ Id = "custom"
}
};
}