mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
improve scan progress and fix a few bugs
This commit is contained in:
@@ -710,10 +710,10 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the root media folder
|
||||
/// Creates the root media folder.
|
||||
/// </summary>
|
||||
/// <returns>AggregateFolder.</returns>
|
||||
/// <exception cref="InvalidOperationException">Cannot create the root folder until plugins have loaded</exception>
|
||||
/// <exception cref="InvalidOperationException">Cannot create the root folder until plugins have loaded.</exception>
|
||||
public AggregateFolder CreateRootFolder()
|
||||
{
|
||||
var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
|
||||
@@ -824,7 +824,6 @@ namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
// If this returns multiple items it could be tricky figuring out which one is correct.
|
||||
// In most cases, the newest one will be and the others obsolete but not yet cleaned up
|
||||
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
@@ -844,7 +843,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Person
|
||||
/// Gets the person.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>Task{Person}.</returns>
|
||||
@@ -854,7 +853,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Studio
|
||||
/// Gets the studio.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>Task{Studio}.</returns>
|
||||
@@ -879,7 +878,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Genre
|
||||
/// Gets the genre.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>Task{Genre}.</returns>
|
||||
@@ -889,7 +888,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the genre.
|
||||
/// Gets the music genre.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns>Task{MusicGenre}.</returns>
|
||||
@@ -899,7 +898,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Year
|
||||
/// Gets the year.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns>Task{Year}.</returns>
|
||||
@@ -1076,9 +1075,9 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
var innerProgress = new ActionableProgress<double>();
|
||||
|
||||
innerProgress.RegisterAction(pct => progress.Report(pct * .96));
|
||||
innerProgress.RegisterAction(pct => progress.Report(pct * pct * 0.96));
|
||||
|
||||
// Now validate the entire media library
|
||||
// validate the entire media library
|
||||
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false);
|
||||
|
||||
progress.Report(96);
|
||||
@@ -1087,7 +1086,6 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04)));
|
||||
|
||||
// Run post-scan tasks
|
||||
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
progress.Report(100);
|
||||
@@ -1138,7 +1136,7 @@ namespace Emby.Server.Implementations.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error running postscan task");
|
||||
_logger.LogError(ex, "Error running post-scan task");
|
||||
}
|
||||
|
||||
numComplete++;
|
||||
|
||||
@@ -291,10 +291,11 @@ namespace Emby.Server.Implementations.Library
|
||||
&& authenticationProvider != null
|
||||
&& !(authenticationProvider is DefaultAuthenticationProvider))
|
||||
{
|
||||
// We should trust the user that the authprovider says, not what was typed
|
||||
// trust the username returned by the authentication provider
|
||||
username = updatedUsername;
|
||||
|
||||
// Search the database for the user again; the authprovider might have created it
|
||||
// search the database for the user again
|
||||
// the authentication provider might have created it
|
||||
user = Users
|
||||
.FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ using Microsoft.Extensions.Logging;
|
||||
namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SessionManager
|
||||
/// Class SessionManager.
|
||||
/// </summary>
|
||||
public class SessionManager : ISessionManager, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// The user data repository.
|
||||
/// </summary>
|
||||
private readonly IUserDataManager _userDataManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _logger
|
||||
/// The logger.
|
||||
/// </summary>
|
||||
private readonly ILogger _logger;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Session
|
||||
private readonly IDeviceManager _deviceManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _active connections
|
||||
/// The active connections.
|
||||
/// </summary>
|
||||
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections =
|
||||
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
|
||||
@@ -70,18 +70,23 @@ namespace Emby.Server.Implementations.Session
|
||||
/// Occurs when [playback start].
|
||||
/// </summary>
|
||||
public event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [playback progress].
|
||||
/// </summary>
|
||||
public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [playback stopped].
|
||||
/// </summary>
|
||||
public event EventHandler<PlaybackStopEventArgs> PlaybackStopped;
|
||||
|
||||
public event EventHandler<SessionEventArgs> SessionStarted;
|
||||
|
||||
public event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
||||
|
||||
public event EventHandler<SessionEventArgs> SessionEnded;
|
||||
|
||||
public event EventHandler<SessionEventArgs> SessionActivity;
|
||||
|
||||
public SessionManager(
|
||||
@@ -924,7 +929,6 @@ namespace Emby.Server.Implementations.Session
|
||||
ClientName = session.Client,
|
||||
DeviceId = session.DeviceId,
|
||||
Session = session
|
||||
|
||||
},
|
||||
_logger);
|
||||
}
|
||||
@@ -1610,7 +1614,7 @@ namespace Emby.Server.Implementations.Session
|
||||
private DtoOptions _itemInfoDtoOptions;
|
||||
|
||||
/// <summary>
|
||||
/// Converts a BaseItem to a BaseItemInfo
|
||||
/// Converts a BaseItem to a BaseItemInfo.
|
||||
/// </summary>
|
||||
private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
|
||||
{
|
||||
@@ -1680,7 +1684,7 @@ namespace Emby.Server.Implementations.Session
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError("Error getting {0} image info", ex, type);
|
||||
_logger.LogError("Error getting image information for {0}", ex, type);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user