2016-08-18 18:00:04 -07:00
|
|
|
|
using MediaBrowser.Model.Events;
|
|
|
|
|
using MediaBrowser.Model.FileOrganization;
|
2014-01-20 11:46:08 -07:00
|
|
|
|
using MediaBrowser.Model.Querying;
|
2016-08-18 18:00:04 -07:00
|
|
|
|
using System;
|
2014-01-20 09:09:53 -07:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.FileOrganization
|
|
|
|
|
{
|
|
|
|
|
public interface IFileOrganizationService
|
|
|
|
|
{
|
2016-08-18 18:00:04 -07:00
|
|
|
|
event EventHandler<GenericEventArgs<FileOrganizationResult>> ItemAdded;
|
|
|
|
|
event EventHandler<GenericEventArgs<FileOrganizationResult>> ItemUpdated;
|
|
|
|
|
event EventHandler<GenericEventArgs<FileOrganizationResult>> ItemRemoved;
|
|
|
|
|
event EventHandler LogReset;
|
|
|
|
|
|
2014-01-20 09:09:53 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processes the new files.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void BeginProcessNewFiles();
|
|
|
|
|
|
2014-01-20 23:10:58 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes the original file.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="resultId">The result identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task DeleteOriginalFile(string resultId);
|
|
|
|
|
|
2014-01-22 10:05:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Clears the log.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task ClearLog();
|
|
|
|
|
|
2014-01-20 23:10:58 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs the organization.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="resultId">The result identifier.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task PerformOrganization(string resultId);
|
2014-01-22 10:05:06 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Performs the episode organization.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task PerformEpisodeOrganization(EpisodeFileOrganizationRequest request);
|
2014-01-20 23:10:58 -07:00
|
|
|
|
|
2014-01-20 09:09:53 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the results.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>IEnumerable{FileOrganizationResult}.</returns>
|
2014-01-20 11:46:08 -07:00
|
|
|
|
QueryResult<FileOrganizationResult> GetResults(FileOrganizationResultQuery query);
|
2014-01-22 10:05:06 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the result.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <returns>FileOrganizationResult.</returns>
|
|
|
|
|
FileOrganizationResult GetResult(string id);
|
|
|
|
|
|
2014-02-19 09:24:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the result by source path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
|
/// <returns>FileOrganizationResult.</returns>
|
|
|
|
|
FileOrganizationResult GetResultBySourcePath(string path);
|
|
|
|
|
|
2014-01-22 10:05:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the result.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="result">The result.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SaveResult(FileOrganizationResult result, CancellationToken cancellationToken);
|
2015-09-22 21:12:46 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a list of smart match entries
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>IEnumerable{SmartMatchInfo}.</returns>
|
|
|
|
|
QueryResult<SmartMatchInfo> GetSmartMatchInfos(FileOrganizationResultQuery query);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes a smart match entry.
|
|
|
|
|
/// </summary>
|
2016-02-07 18:25:10 -07:00
|
|
|
|
/// <param name="ItemName">Item name.</param>
|
2015-09-22 21:12:46 -07:00
|
|
|
|
/// <param name="matchString">The match string to delete.</param>
|
2016-02-07 18:25:10 -07:00
|
|
|
|
void DeleteSmartMatchEntry(string ItemName, string matchString);
|
2016-08-18 18:00:04 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attempts to add a an item to the list of currently processed items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="result">The result item.</param>
|
|
|
|
|
/// <param name="fullClientRefresh">Passing true will notify the client to reload all items, otherwise only a single item will be refreshed.</param>
|
|
|
|
|
/// <returns>True if the item was added, False if the item is already contained in the list.</returns>
|
|
|
|
|
bool AddToInProgressList(FileOrganizationResult result, bool fullClientRefresh);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removes an item from the list of currently processed items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="result">The result item.</param>
|
|
|
|
|
/// <returns>True if the item was removed, False if the item was not contained in the list.</returns>
|
|
|
|
|
bool RemoveFromInprogressList(FileOrganizationResult result);
|
2014-01-20 09:09:53 -07:00
|
|
|
|
}
|
|
|
|
|
}
|