aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-05 23:39:16 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-05 23:39:16 -0500
commit821a3d29a228feaa3ac4d36c58ee478a405e0481 (patch)
tree48925fa069c1b57cc3c126b58194740c191359c1 /MediaBrowser.Server.Implementations
parent64eb8c82a3e82d84ac827aa35a55fdface9ac783 (diff)
converted movie providers to new system
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs17
-rw-r--r--MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs13
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs18
-rw-r--r--MediaBrowser.Server.Implementations/Library/ResolverHelper.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs12
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs2
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs12
8 files changed, 11 insertions, 67 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 32d4c7708..7dacfacc2 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -273,21 +273,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
{
if (item.LocationType == LocationType.FileSystem)
{
- return collections.Where(i =>
- {
-
- try
- {
- return i.LocationType == LocationType.FileSystem &&
- i.PhysicalLocations.Contains(item.Path);
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error getting ResolveArgs for {0}", ex, i.Path);
- return false;
- }
-
- }).Cast<T>();
+ return collections.Where(i => i.LocationType == LocationType.FileSystem &&
+ i.PhysicalLocations.Contains(item.Path)).Cast<T>();
}
}
diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
index 38f5cb62a..f1f9048a9 100644
--- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
+++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
@@ -162,18 +162,7 @@ namespace MediaBrowser.Server.Implementations.IO
.Children
.OfType<Folder>()
.Where(i => i.LocationType != LocationType.Remote && i.LocationType != LocationType.Virtual)
- .SelectMany(f =>
- {
- try
- {
- return f.PhysicalLocations;
- }
- catch (IOException)
- {
- return new string[] { };
- }
-
- })
+ .SelectMany(f => f.PhysicalLocations)
.Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(i => i)
.ToList();
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 8294bfed6..813d279ab 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -833,9 +833,6 @@ namespace MediaBrowser.Server.Implementations.Library
(item as MusicArtist).IsAccessedByName = true;
}
- // Set this now so we don't cause additional file system access during provider executions
- item.ResetResolveArgs(fileInfo);
-
return new Tuple<bool, T>(isNew, item);
}
@@ -1113,6 +1110,7 @@ namespace MediaBrowser.Server.Implementations.Library
cancellationToken.ThrowIfCancellationRequested();
await userRootFolder.ValidateChildren(new Progress<double>(), cancellationToken, recursive: false).ConfigureAwait(false);
+ var b = true;
}
/// <summary>
@@ -1244,7 +1242,6 @@ namespace MediaBrowser.Server.Implementations.Library
if (dbItem != null)
{
- dbItem.ResetResolveArgs(video.ResolveArgs);
video = dbItem;
}
}
@@ -1383,6 +1380,8 @@ namespace MediaBrowser.Server.Implementations.Library
item.DateLastSaved = DateTime.UtcNow;
+ _logger.Debug("Saving {0} to database.", item.Path ?? item.Name);
+
await ItemRepository.SaveItem(item, cancellationToken).ConfigureAwait(false);
UpdateItemInLibraryCache(item);
@@ -1479,16 +1478,7 @@ namespace MediaBrowser.Server.Implementations.Library
return true;
}
- try
- {
-
- return i.PhysicalLocations.Contains(item.Path);
- }
- catch (IOException ex)
- {
- _logger.ErrorException("Error getting resolve args for {0}", ex, i.Path);
- return false;
- }
+ return i.PhysicalLocations.Contains(item.Path);
})
.Select(i => i.CollectionType)
.Where(i => !string.IsNullOrEmpty(i))
diff --git a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
index 4ce5f11d4..ad2db5abb 100644
--- a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
+++ b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
@@ -23,8 +23,6 @@ namespace MediaBrowser.Server.Implementations.Library
/// <param name="fileSystem">The file system.</param>
public static void SetInitialItemValues(BaseItem item, ItemResolveArgs args, IFileSystem fileSystem)
{
- item.ResetResolveArgs(args);
-
// If the resolver didn't specify this
if (string.IsNullOrEmpty(item.Path))
{
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index 3d6f7e66a..998895cbf 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -184,7 +184,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
private void SetProviderIdFromPath(Video item)
{
//we need to only look at the name of this actual item (not parents)
- var justName = item.IsInMixedFolder ? Path.GetFileName(item.Path) : Path.GetFileName(item.MetaLocation);
+ var justName = item.IsInMixedFolder ? Path.GetFileName(item.Path) : Path.GetFileName(item.ContainingFolderPath);
var id = justName.GetAttributeValue("tmdbid");
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
index c426fed25..70280d8d3 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs
@@ -47,17 +47,5 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
return null;
}
-
- /// <summary>
- /// Sets the initial item values.
- /// </summary>
- /// <param name="item">The item.</param>
- /// <param name="args">The args.</param>
- protected override void SetInitialItemValues(Season item, ItemResolveArgs args)
- {
- base.SetInitialItemValues(item, args);
-
- Season.AddMetadataFiles(args);
- }
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
index 1bd975944..625274da9 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
@@ -92,8 +92,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
{
base.SetInitialItemValues(item, args);
- Season.AddMetadataFiles(args);
-
SetProviderIdFromPath(item, args.Path);
}
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index 9501d2d12..94b6cdd9e 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -326,13 +326,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.Name = channelInfo.Name;
}
- // Set this now so we don't cause additional file system access during provider executions
- item.ResetResolveArgs(fileInfo);
-
await item.RefreshMetadata(new MetadataRefreshOptions
{
- ForceSave = isNew,
- ResetResolveArgs = false
+ ForceSave = isNew
}, cancellationToken);
@@ -391,8 +387,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
await item.RefreshMetadata(new MetadataRefreshOptions
{
- ForceSave = isNew,
- ResetResolveArgs = false
+ ForceSave = isNew
}, cancellationToken);
@@ -448,8 +443,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
await item.RefreshMetadata(new MetadataRefreshOptions
{
- ForceSave = isNew,
- ResetResolveArgs = false
+ ForceSave = isNew
}, cancellationToken);