mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
converted movie providers to new system
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,8 +92,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||
{
|
||||
base.SetInitialItemValues(item, args);
|
||||
|
||||
Season.AddMetadataFiles(args);
|
||||
|
||||
SetProviderIdFromPath(item, args.Path);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user