Merge pull request #1683 from dkanada/misc
Move the transcode path and other small fixes
This commit is contained in:
commit
a266b54ad6
|
@ -66,7 +66,7 @@ namespace Emby.Server.Implementations.Configuration
|
||||||
{
|
{
|
||||||
base.AddParts(factories);
|
base.AddParts(factories);
|
||||||
|
|
||||||
UpdateTranscodingTempPath();
|
UpdateTranscodePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -87,13 +87,13 @@ namespace Emby.Server.Implementations.Configuration
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the transcoding temporary path.
|
/// Updates the transcoding temporary path.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateTranscodingTempPath()
|
private void UpdateTranscodePath()
|
||||||
{
|
{
|
||||||
var encodingConfig = this.GetConfiguration<EncodingOptions>("encoding");
|
var encodingConfig = this.GetConfiguration<EncodingOptions>("encoding");
|
||||||
|
|
||||||
((ServerApplicationPaths)ApplicationPaths).TranscodingTempPath = string.IsNullOrEmpty(encodingConfig.TranscodingTempPath) ?
|
((ServerApplicationPaths)ApplicationPaths).TranscodingTempPath = string.IsNullOrEmpty(encodingConfig.TranscodingTempPath) ?
|
||||||
null :
|
null :
|
||||||
Path.Combine(encodingConfig.TranscodingTempPath, "transcoding-temp");
|
Path.Combine(encodingConfig.TranscodingTempPath, "transcodes");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNamedConfigurationUpdated(string key, object configuration)
|
protected override void OnNamedConfigurationUpdated(string key, object configuration)
|
||||||
|
@ -102,7 +102,7 @@ namespace Emby.Server.Implementations.Configuration
|
||||||
|
|
||||||
if (string.Equals(key, "encoding", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(key, "encoding", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
UpdateTranscodingTempPath();
|
UpdateTranscodePath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,23 +13,22 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes all transcoding temp files
|
/// Deletes all transcoding temp files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DeleteTranscodingTempTask : IScheduledTask, IConfigurableScheduledTask
|
public class DeleteTranscodeFileTask : IScheduledTask, IConfigurableScheduledTask
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the application paths.
|
/// Gets or sets the application paths.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The application paths.</value>
|
/// <value>The application paths.</value>
|
||||||
protected ServerApplicationPaths ApplicationPaths { get; set; }
|
private ServerApplicationPaths ApplicationPaths { get; set; }
|
||||||
|
|
||||||
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="DeleteTranscodingTempTask" /> class.
|
/// Initializes a new instance of the <see cref="DeleteTranscodeFileTask" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DeleteTranscodingTempTask(ServerApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem)
|
public DeleteTranscodeFileTask(ServerApplicationPaths appPaths, ILogger logger, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
ApplicationPaths = appPaths;
|
ApplicationPaths = appPaths;
|
||||||
_logger = logger;
|
_logger = logger;
|
|
@ -10,7 +10,7 @@ using MediaBrowser.Model.Tasks;
|
||||||
namespace Emby.Server.Implementations.ScheduledTasks
|
namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class RefreshMediaLibraryTask
|
/// Class RefreshMediaLibraryTask.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RefreshMediaLibraryTask : IScheduledTask
|
public class RefreshMediaLibraryTask : IScheduledTask
|
||||||
{
|
{
|
||||||
|
@ -31,15 +31,14 @@ 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>
|
||||||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||||
{
|
{
|
||||||
return new[] {
|
yield return new TaskTriggerInfo
|
||||||
|
{
|
||||||
// Every so often
|
Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(12).Ticks
|
||||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(12).Ticks}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
public string Name => "Scan media library";
|
public string Name => "Scan media library";
|
||||||
|
|
||||||
public string Description => "Scans your media library and refreshes metatata based on configuration.";
|
public string Description => "Scans your media library for new files and refreshes metadata.";
|
||||||
|
|
||||||
public string Category => "Library";
|
public string Category => "Library";
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
var currentOptions = options;
|
var currentOptions = options;
|
||||||
|
|
||||||
var typeOptions = libraryOptions.GetTypeOptions(item.GetType().Name);
|
var typeOptions = libraryOptions.GetTypeOptions(item.GetType().Name);
|
||||||
var typeFetcherOrder = typeOptions == null ? null : typeOptions.ImageFetcherOrder;
|
var typeFetcherOrder = typeOptions?.ImageFetcherOrder;
|
||||||
|
|
||||||
return ImageProviders.Where(i => CanRefresh(i, item, libraryOptions, options, refreshOptions, includeDisabled))
|
return ImageProviders.Where(i => CanRefresh(i, item, libraryOptions, options, refreshOptions, includeDisabled))
|
||||||
.OrderBy(i =>
|
.OrderBy(i =>
|
||||||
|
@ -287,7 +287,6 @@ namespace MediaBrowser.Providers.Manager
|
||||||
if (!(i is ILocalImageProvider))
|
if (!(i is ILocalImageProvider))
|
||||||
{
|
{
|
||||||
var fetcherOrder = typeFetcherOrder ?? currentOptions.ImageFetcherOrder;
|
var fetcherOrder = typeFetcherOrder ?? currentOptions.ImageFetcherOrder;
|
||||||
|
|
||||||
var index = Array.IndexOf(fetcherOrder, i.Name);
|
var index = Array.IndexOf(fetcherOrder, i.Name);
|
||||||
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user