diff --git a/MediaBrowser.Api/ConfigurationService.cs b/MediaBrowser.Api/ConfigurationService.cs
index 7b6e5ed19e..ce6ca015de 100644
--- a/MediaBrowser.Api/ConfigurationService.cs
+++ b/MediaBrowser.Api/ConfigurationService.cs
@@ -122,53 +122,12 @@ namespace MediaBrowser.Api
return ToOptimizedResult(result);
}
- const string XbmcMetadata = "Xbmc Nfo";
- const string MediaBrowserMetadata = "Media Browser Xml";
-
public void Post(AutoSetMetadataOptions request)
{
- var service = AutoDetectMetadataService();
-
- Logger.Info("Setting preferred metadata format to " + service);
-
- var serviceToDisable = string.Equals(service, XbmcMetadata) ?
- MediaBrowserMetadata :
- XbmcMetadata;
-
- _configurationManager.DisableMetadataService(serviceToDisable);
+ _configurationManager.DisableMetadataService("Media Browser Xml");
_configurationManager.SaveConfiguration();
}
- private string AutoDetectMetadataService()
- {
- try
- {
- var paths = _libraryManager.GetDefaultVirtualFolders()
- .SelectMany(i => i.Locations)
- .Distinct(StringComparer.OrdinalIgnoreCase)
- .Select(i => new DirectoryInfo(i))
- .ToList();
-
- if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
- .Any())
- {
- return XbmcMetadata;
- }
-
- if (paths.SelectMany(i => i.EnumerateFiles("*.xml", SearchOption.AllDirectories))
- .Any(i => string.Equals(i.Name, "series.xml", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "movie.xml", StringComparison.OrdinalIgnoreCase)))
- {
- return MediaBrowserMetadata;
- }
- }
- catch (Exception)
- {
-
- }
-
- return XbmcMetadata;
- }
-
///
/// Posts the specified configuraiton.
///
diff --git a/MediaBrowser.Api/Devices/DeviceService.cs b/MediaBrowser.Api/Devices/DeviceService.cs
index bb8d8eda3f..b873c6a712 100644
--- a/MediaBrowser.Api/Devices/DeviceService.cs
+++ b/MediaBrowser.Api/Devices/DeviceService.cs
@@ -44,8 +44,8 @@ namespace MediaBrowser.Api.Devices
[ApiMember(Name = "Name", Description = "Name", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
public string Name { get; set; }
- [ApiMember(Name = "FullPath", Description = "FullPath", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
- public string FullPath { get; set; }
+ [ApiMember(Name = "Id", Description = "Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
+ public string Id { get; set; }
public Stream RequestStream { get; set; }
}
@@ -132,7 +132,7 @@ namespace MediaBrowser.Api.Devices
{
var deviceId = Request.QueryString["DeviceId"];
var album = Request.QueryString["Album"];
- var fullPath = Request.QueryString["FullPath"];
+ var id = Request.QueryString["Id"];
var name = Request.QueryString["Name"];
var task = _deviceManager.AcceptCameraUpload(deviceId, request.RequestStream, new LocalFileInfo
@@ -140,7 +140,7 @@ namespace MediaBrowser.Api.Devices
MimeType = Request.ContentType,
Album = album,
Name = name,
- FullPath = fullPath
+ Id = id
});
Task.WaitAll(task);
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs
index 1fa1a5509d..65c51befff 100644
--- a/MediaBrowser.Api/ItemUpdateService.cs
+++ b/MediaBrowser.Api/ItemUpdateService.cs
@@ -237,7 +237,7 @@ namespace MediaBrowser.Api
if (musicVideo != null)
{
- musicVideo.Artist = request.Artists[0];
+ musicVideo.Artists = request.Artists.ToList();
musicVideo.Album = request.Album;
}
diff --git a/MediaBrowser.Api/Movies/TrailersService.cs b/MediaBrowser.Api/Movies/TrailersService.cs
index b0ee6b6d57..a6024d4610 100644
--- a/MediaBrowser.Api/Movies/TrailersService.cs
+++ b/MediaBrowser.Api/Movies/TrailersService.cs
@@ -1,10 +1,20 @@
-using MediaBrowser.Controller.Dto;
+using MediaBrowser.Api.UserLibrary;
+using MediaBrowser.Controller.Channels;
+using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
+using MediaBrowser.Model.Channels;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Querying;
using ServiceStack;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
namespace MediaBrowser.Api.Movies
{
@@ -16,6 +26,17 @@ namespace MediaBrowser.Api.Movies
{
}
+ [Route("/Trailers", "GET", Summary = "Finds movies and trailers similar to a given trailer.")]
+ public class Getrailers : BaseItemsRequest, IReturn
+ {
+ ///
+ /// Gets or sets the user id.
+ ///
+ /// The user id.
+ [ApiMember(Name = "UserId", Description = "User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
+ public Guid? UserId { get; set; }
+ }
+
///
/// Class TrailersService
///
@@ -38,6 +59,7 @@ namespace MediaBrowser.Api.Movies
private readonly IItemRepository _itemRepo;
private readonly IDtoService _dtoService;
+ private readonly IChannelManager _channelManager;
///
/// Initializes a new instance of the class.
@@ -45,13 +67,14 @@ namespace MediaBrowser.Api.Movies
/// The user manager.
/// The user data repository.
/// The library manager.
- public TrailersService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
+ public TrailersService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService, IChannelManager channelManager)
{
_userManager = userManager;
_userDataRepository = userDataRepository;
_libraryManager = libraryManager;
_itemRepo = itemRepo;
_dtoService = dtoService;
+ _channelManager = channelManager;
}
///
@@ -75,5 +98,71 @@ namespace MediaBrowser.Api.Movies
return ToOptimizedSerializedResultUsingCache(result);
}
+
+ public async Task