mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 10:43:30 +01:00
Merge remote-tracking branch 'upstream/api-migration' into api-image-service
This commit is contained in:
@@ -4,30 +4,30 @@ using MediaBrowser.Model.Services;
|
||||
namespace MediaBrowser.Api.Images
|
||||
{
|
||||
/// <summary>
|
||||
/// Class ImageRequest
|
||||
/// Class ImageRequest.
|
||||
/// </summary>
|
||||
public class ImageRequest : DeleteImageRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// The max width
|
||||
/// The max width.
|
||||
/// </summary>
|
||||
[ApiMember(Name = "MaxWidth", Description = "The maximum image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? MaxWidth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The max height
|
||||
/// The max height.
|
||||
/// </summary>
|
||||
[ApiMember(Name = "MaxHeight", Description = "The maximum image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? MaxHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The width
|
||||
/// The width.
|
||||
/// </summary>
|
||||
[ApiMember(Name = "Width", Description = "The fixed image width to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The height
|
||||
/// The height.
|
||||
/// </summary>
|
||||
[ApiMember(Name = "Height", Description = "The fixed image height to return.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int? Height { get; set; }
|
||||
@@ -79,7 +79,7 @@ namespace MediaBrowser.Api.Images
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class DeleteImageRequest
|
||||
/// Class DeleteImageRequest.
|
||||
/// </summary>
|
||||
public class DeleteImageRequest
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace MediaBrowser.Api.Images
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class GetPersonImage
|
||||
/// Class GetPersonImage.
|
||||
/// </summary>
|
||||
[Route("/Artists/{Name}/Images/{Type}", "GET")]
|
||||
[Route("/Artists/{Name}/Images/{Type}/{Index}", "GET")]
|
||||
@@ -78,7 +78,7 @@ namespace MediaBrowser.Api.Images
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class GetUserImage
|
||||
/// Class GetUserImage.
|
||||
/// </summary>
|
||||
[Route("/Users/{Id}/Images/{Type}", "GET")]
|
||||
[Route("/Users/{Id}/Images/{Type}/{Index}", "GET")]
|
||||
@@ -95,7 +95,7 @@ namespace MediaBrowser.Api.Images
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class ImageService
|
||||
/// Class ImageService.
|
||||
/// </summary>
|
||||
public class ImageService : BaseApiService
|
||||
{
|
||||
@@ -405,7 +405,6 @@ namespace MediaBrowser.Api.Images
|
||||
Path = imageResult.Item1,
|
||||
|
||||
FileShare = FileShare.Read
|
||||
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -558,6 +557,11 @@ namespace MediaBrowser.Api.Images
|
||||
// Handle image/png; charset=utf-8
|
||||
mimeType = mimeType.Split(';').FirstOrDefault();
|
||||
var userDataPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.UserConfigurationDirectoryPath, user.Username);
|
||||
if (user.ProfileImage != null)
|
||||
{
|
||||
_userManager.ClearProfileImage(user);
|
||||
}
|
||||
|
||||
user.ProfileImage = new Jellyfin.Data.Entities.ImageInfo(Path.Combine(userDataPath, "profile" + MimeTypes.ToExtension(mimeType)));
|
||||
|
||||
await _providerManager
|
||||
|
||||
Reference in New Issue
Block a user