mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Merge pull request #2362 from dkanada/tasks
Improve scan progress and fix a few bugs
This commit is contained in:
commit
87c5047b13
13 changed files with 47 additions and 54 deletions
|
@ -710,10 +710,10 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the root media folder
|
/// Creates the root media folder.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>AggregateFolder.</returns>
|
/// <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()
|
public AggregateFolder CreateRootFolder()
|
||||||
{
|
{
|
||||||
var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
|
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.
|
// 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
|
// In most cases, the newest one will be and the others obsolete but not yet cleaned up
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(path));
|
throw new ArgumentNullException(nameof(path));
|
||||||
|
@ -844,7 +843,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a Person
|
/// Gets the person.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <returns>Task{Person}.</returns>
|
/// <returns>Task{Person}.</returns>
|
||||||
|
@ -854,7 +853,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a Studio
|
/// Gets the studio.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <returns>Task{Studio}.</returns>
|
/// <returns>Task{Studio}.</returns>
|
||||||
|
@ -879,7 +878,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a Genre
|
/// Gets the genre.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <returns>Task{Genre}.</returns>
|
/// <returns>Task{Genre}.</returns>
|
||||||
|
@ -889,7 +888,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the genre.
|
/// Gets the music genre.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <returns>Task{MusicGenre}.</returns>
|
/// <returns>Task{MusicGenre}.</returns>
|
||||||
|
@ -899,7 +898,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a Year
|
/// Gets the year.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
/// <returns>Task{Year}.</returns>
|
/// <returns>Task{Year}.</returns>
|
||||||
|
@ -1076,9 +1075,9 @@ namespace Emby.Server.Implementations.Library
|
||||||
|
|
||||||
var innerProgress = new ActionableProgress<double>();
|
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);
|
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false);
|
||||||
|
|
||||||
progress.Report(96);
|
progress.Report(96);
|
||||||
|
@ -1087,7 +1086,6 @@ namespace Emby.Server.Implementations.Library
|
||||||
|
|
||||||
innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04)));
|
innerProgress.RegisterAction(pct => progress.Report(96 + (pct * .04)));
|
||||||
|
|
||||||
// Run post-scan tasks
|
|
||||||
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
|
await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
|
@ -1138,7 +1136,7 @@ namespace Emby.Server.Implementations.Library
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error running postscan task");
|
_logger.LogError(ex, "Error running post-scan task");
|
||||||
}
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
|
|
|
@ -291,10 +291,11 @@ namespace Emby.Server.Implementations.Library
|
||||||
&& authenticationProvider != null
|
&& authenticationProvider != null
|
||||||
&& !(authenticationProvider is DefaultAuthenticationProvider))
|
&& !(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;
|
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
|
user = Users
|
||||||
.FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
|
.FirstOrDefault(i => string.Equals(username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the task to be executed
|
/// Returns the task to be executed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <param name="progress">The progress.</param>
|
/// <param name="progress">The progress.</param>
|
||||||
|
@ -89,7 +89,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
SourceTypes = new SourceType[] { SourceType.Library },
|
SourceTypes = new SourceType[] { SourceType.Library },
|
||||||
HasChapterImages = false,
|
HasChapterImages = false,
|
||||||
IsVirtualItem = false
|
IsVirtualItem = false
|
||||||
|
|
||||||
})
|
})
|
||||||
.OfType<Video>()
|
.OfType<Video>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
@ -160,7 +159,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Chapter image extraction";
|
public string Name => "Extract Chapter Images";
|
||||||
|
|
||||||
public string Description => "Creates thumbnails for videos that have chapters.";
|
public string Description => "Creates thumbnails for videos that have chapters.";
|
||||||
|
|
||||||
|
|
|
@ -158,9 +158,9 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Cache file cleanup";
|
public string Name => "Clean Cache Directory";
|
||||||
|
|
||||||
public string Description => "Deletes cache files no longer needed by the system";
|
public string Description => "Deletes cache files no longer needed by the system.";
|
||||||
|
|
||||||
public string Category => "Maintenance";
|
public string Category => "Maintenance";
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ using MediaBrowser.Model.Tasks;
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes old log files
|
/// Deletes old log files.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DeleteLogFileTask : IScheduledTask, IConfigurableScheduledTask
|
public class DeleteLogFileTask : IScheduledTask, IConfigurableScheduledTask
|
||||||
{
|
{
|
||||||
|
@ -33,20 +33,18 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the triggers that define when the task will run
|
/// Creates the triggers that define when the task will run.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return new[] {
|
return new[] {
|
||||||
|
|
||||||
// Every so often
|
|
||||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the task to be executed
|
/// Returns the task to be executed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <param name="progress">The progress.</param>
|
/// <param name="progress">The progress.</param>
|
||||||
|
@ -81,7 +79,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Log file cleanup";
|
public string Name => "Clean Log Directory";
|
||||||
|
|
||||||
public string Description => string.Format("Deletes log files that are more than {0} days old.", ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
|
public string Description => string.Format("Deletes log files that are more than {0} days old.", ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
|
||||||
|
|
||||||
|
|
|
@ -125,9 +125,9 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Transcode file cleanup";
|
public string Name => "Clean Transcode Directory";
|
||||||
|
|
||||||
public string Description => "Deletes transcode files more than 24 hours old.";
|
public string Description => "Deletes transcode files more than one day old.";
|
||||||
|
|
||||||
public string Category => "Maintenance";
|
public string Category => "Maintenance";
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,12 @@ using MediaBrowser.Model.Tasks;
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks
|
namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class PeopleValidationTask
|
/// Class PeopleValidationTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PeopleValidationTask : IScheduledTask
|
public class PeopleValidationTask : IScheduledTask
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _library manager
|
/// The library manager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
|
|
||||||
|
@ -32,13 +32,12 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the triggers that define when the task will run
|
/// Creates the triggers that define when the task will run.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
// Every so often
|
|
||||||
new TaskTriggerInfo
|
new TaskTriggerInfo
|
||||||
{
|
{
|
||||||
Type = TaskTriggerInfo.TriggerInterval,
|
Type = TaskTriggerInfo.TriggerInterval,
|
||||||
|
@ -48,7 +47,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the task to be executed
|
/// Returns the task to be executed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <param name="progress">The progress.</param>
|
/// <param name="progress">The progress.</param>
|
||||||
|
@ -58,7 +57,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
return _libraryManager.ValidatePeople(cancellationToken, progress);
|
return _libraryManager.ValidatePeople(cancellationToken, progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Refresh people";
|
public string Name => "Refresh People";
|
||||||
|
|
||||||
public string Description => "Updates metadata for actors and directors in your media library.";
|
public string Description => "Updates metadata for actors and directors in your media library.";
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Name => "Check for plugin updates";
|
public string Name => "Update Plugins";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Description => "Downloads and installs updates for plugins that are configured to update automatically.";
|
public string Description => "Downloads and installs updates for plugins that are configured to update automatically.";
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Scan media library";
|
public string Name => "Scan Media Library";
|
||||||
|
|
||||||
public string Description => "Scans your media library for new files and refreshes metadata.";
|
public string Description => "Scans your media library for new files and refreshes metadata.";
|
||||||
|
|
||||||
|
|
|
@ -30,17 +30,17 @@ using Microsoft.Extensions.Logging;
|
||||||
namespace Emby.Server.Implementations.Session
|
namespace Emby.Server.Implementations.Session
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class SessionManager
|
/// Class SessionManager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SessionManager : ISessionManager, IDisposable
|
public class SessionManager : ISessionManager, IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _user data repository
|
/// The user data repository.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IUserDataManager _userDataManager;
|
private readonly IUserDataManager _userDataManager;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _logger
|
/// The logger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
private readonly IDeviceManager _deviceManager;
|
private readonly IDeviceManager _deviceManager;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _active connections
|
/// The active connections.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections =
|
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections =
|
||||||
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
|
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
@ -70,18 +70,23 @@ namespace Emby.Server.Implementations.Session
|
||||||
/// Occurs when [playback start].
|
/// Occurs when [playback start].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
|
public event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when [playback progress].
|
/// Occurs when [playback progress].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
|
public event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when [playback stopped].
|
/// Occurs when [playback stopped].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler<PlaybackStopEventArgs> PlaybackStopped;
|
public event EventHandler<PlaybackStopEventArgs> PlaybackStopped;
|
||||||
|
|
||||||
public event EventHandler<SessionEventArgs> SessionStarted;
|
public event EventHandler<SessionEventArgs> SessionStarted;
|
||||||
|
|
||||||
public event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
public event EventHandler<SessionEventArgs> CapabilitiesChanged;
|
||||||
|
|
||||||
public event EventHandler<SessionEventArgs> SessionEnded;
|
public event EventHandler<SessionEventArgs> SessionEnded;
|
||||||
|
|
||||||
public event EventHandler<SessionEventArgs> SessionActivity;
|
public event EventHandler<SessionEventArgs> SessionActivity;
|
||||||
|
|
||||||
public SessionManager(
|
public SessionManager(
|
||||||
|
@ -924,7 +929,6 @@ namespace Emby.Server.Implementations.Session
|
||||||
ClientName = session.Client,
|
ClientName = session.Client,
|
||||||
DeviceId = session.DeviceId,
|
DeviceId = session.DeviceId,
|
||||||
Session = session
|
Session = session
|
||||||
|
|
||||||
},
|
},
|
||||||
_logger);
|
_logger);
|
||||||
}
|
}
|
||||||
|
@ -1610,7 +1614,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
private DtoOptions _itemInfoDtoOptions;
|
private DtoOptions _itemInfoDtoOptions;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts a BaseItem to a BaseItemInfo
|
/// Converts a BaseItem to a BaseItemInfo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
|
private BaseItemDto GetItemInfo(BaseItem item, MediaSourceInfo mediaSource)
|
||||||
{
|
{
|
||||||
|
@ -1680,7 +1684,7 @@ namespace Emby.Server.Implementations.Session
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError("Error getting {0} image info", ex, type);
|
_logger.LogError(ex, "Error getting image information for {Type}", type);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ using Microsoft.Extensions.Logging;
|
||||||
namespace MediaBrowser.Api.Session
|
namespace MediaBrowser.Api.Session
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetSessions
|
/// Class GetSessions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Sessions", "GET", Summary = "Gets a list of sessions")]
|
[Route("/Sessions", "GET", Summary = "Gets a list of sessions")]
|
||||||
[Authenticated]
|
[Authenticated]
|
||||||
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Api.Session
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class DisplayContent
|
/// Class DisplayContent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")]
|
[Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")]
|
||||||
[Authenticated]
|
[Authenticated]
|
||||||
|
|
|
@ -281,7 +281,6 @@ namespace MediaBrowser.Api
|
||||||
{
|
{
|
||||||
IsHidden = false,
|
IsHidden = false,
|
||||||
IsDisabled = false
|
IsDisabled = false
|
||||||
|
|
||||||
}, true, true);
|
}, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,10 +394,11 @@ namespace MediaBrowser.Api
|
||||||
throw new MethodNotAllowedException("Hashed-only passwords are not valid for this API.");
|
throw new MethodNotAllowedException("Hashed-only passwords are not valid for this API.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Password should always be null
|
||||||
return Post(new AuthenticateUserByName
|
return Post(new AuthenticateUserByName
|
||||||
{
|
{
|
||||||
Username = user.Name,
|
Username = user.Name,
|
||||||
Password = null, // This should always be null
|
Password = null,
|
||||||
Pw = request.Pw
|
Pw = request.Pw
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,12 +126,6 @@ namespace MediaBrowser.Controller.Session
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public ISessionController[] SessionControllers { get; set; }
|
public ISessionController[] SessionControllers { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the application icon URL.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The application icon URL.</value>
|
|
||||||
public string AppIconUrl { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the supported commands.
|
/// Gets or sets the supported commands.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -259,7 +253,7 @@ namespace MediaBrowser.Controller.Session
|
||||||
|
|
||||||
foreach (var additionalUser in AdditionalUsers)
|
foreach (var additionalUser in AdditionalUsers)
|
||||||
{
|
{
|
||||||
if (userId.Equals(userId))
|
if (additionalUser.UserId.Equals(userId))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +315,7 @@ namespace MediaBrowser.Controller.Session
|
||||||
|
|
||||||
var newPositionTicks = positionTicks + ProgressIncrement;
|
var newPositionTicks = positionTicks + ProgressIncrement;
|
||||||
var item = progressInfo.Item;
|
var item = progressInfo.Item;
|
||||||
long? runtimeTicks = item == null ? null : item.RunTimeTicks;
|
long? runtimeTicks = item?.RunTimeTicks;
|
||||||
|
|
||||||
// Don't report beyond the runtime
|
// Don't report beyond the runtime
|
||||||
if (runtimeTicks.HasValue && newPositionTicks >= runtimeTicks.Value)
|
if (runtimeTicks.HasValue && newPositionTicks >= runtimeTicks.Value)
|
||||||
|
|
Loading…
Reference in a new issue