aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2015-09-23 06:12:46 +0200
committersoftworkz <softworkz@hotmail.com>2016-02-05 05:21:25 +0100
commit3a868e28b3e3d9f0a13fc38c680047010d627b0f (patch)
tree4b9f71b825e4c0222b7becc4bee5c0cf2d2871ab /MediaBrowser.Api/Library
parentd28ef71d93ea7fe50343f82f575637307b4d74bf (diff)
Auto-Organize: Added feature to remember/persist series matching in manual organization dialog #2
When a filename cannot be auto-matched to an existing series name, the organization must be performed manually. Unfortunately not just once, but again and again for each episode coming in. This change proposes a simple but solid method to optionally persist the matching condition from within the manual organization dialog. This approach will make Emby "learn" how to organize files in the future without user interaction.
Diffstat (limited to 'MediaBrowser.Api/Library')
-rw-r--r--MediaBrowser.Api/Library/FileOrganizationService.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/MediaBrowser.Api/Library/FileOrganizationService.cs b/MediaBrowser.Api/Library/FileOrganizationService.cs
index 29a9826295..a08cc099e5 100644
--- a/MediaBrowser.Api/Library/FileOrganizationService.cs
+++ b/MediaBrowser.Api/Library/FileOrganizationService.cs
@@ -74,6 +74,34 @@ namespace MediaBrowser.Api.Library
public bool RememberCorrection { get; set; }
}
+ [Route("/Library/FileOrganizationSmartMatch", "GET", Summary = "Gets smart match entries")]
+ public class GetSmartMatchInfos : IReturn<QueryResult<SmartMatchInfo>>
+ {
+ /// <summary>
+ /// Skips over a given number of items within the results. Use for paging.
+ /// </summary>
+ /// <value>The start index.</value>
+ [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
+ public int? StartIndex { get; set; }
+
+ /// <summary>
+ /// The maximum number of items to return
+ /// </summary>
+ /// <value>The limit.</value>
+ [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
+ public int? Limit { get; set; }
+ }
+
+ [Route("/Library/FileOrganizationSmartMatch/{Id}/Delete", "POST", Summary = "Deletes a smart match entry")]
+ public class DeleteSmartMatchEntry
+ {
+ [ApiMember(Name = "Id", Description = "Item ID", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
+ public string Id { get; set; }
+
+ [ApiMember(Name = "MatchString", Description = "SmartMatch String", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
+ public string MatchString { get; set; }
+ }
+
[Authenticated(Roles = "Admin")]
public class FileOrganizationService : BaseApiService
{
@@ -130,5 +158,21 @@ namespace MediaBrowser.Api.Library
Task.WaitAll(task);
}
+
+ public object Get(GetSmartMatchInfos request)
+ {
+ var result = _iFileOrganizationService.GetSmartMatchInfos(new FileOrganizationResultQuery
+ {
+ Limit = request.Limit,
+ StartIndex = request.StartIndex
+ });
+
+ return ToOptimizedSerializedResultUsingCache(result);
+ }
+
+ public void Post(DeleteSmartMatchEntry request)
+ {
+ _iFileOrganizationService.DeleteSmartMatchEntry(request.Id, request.MatchString);
+ }
}
}