mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 15:20:34 +02:00
Remove attachment filenames from attachment URLs.
This commit is contained in:
parent
9eef5f860d
commit
262a8f47af
|
@ -20,7 +20,7 @@ using MimeTypes = MediaBrowser.Model.Net.MimeTypes;
|
||||||
|
|
||||||
namespace MediaBrowser.Api.Attachments
|
namespace MediaBrowser.Api.Attachments
|
||||||
{
|
{
|
||||||
[Route("/Videos/{Id}/{MediaSourceId}/Attachments/{Index}/{Filename}", "GET", Summary = "Gets specified attachment.")]
|
[Route("/Videos/{Id}/{MediaSourceId}/Attachments/{Index}", "GET", Summary = "Gets specified attachment.")]
|
||||||
public class GetAttachment
|
public class GetAttachment
|
||||||
{
|
{
|
||||||
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
|
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
|
||||||
|
@ -31,9 +31,6 @@ namespace MediaBrowser.Api.Attachments
|
||||||
|
|
||||||
[ApiMember(Name = "Index", Description = "The attachment stream index", IsRequired = true, DataType = "int", ParameterType = "path", Verb = "GET")]
|
[ApiMember(Name = "Index", Description = "The attachment stream index", IsRequired = true, DataType = "int", ParameterType = "path", Verb = "GET")]
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
|
|
||||||
[ApiMember(Name = "Filename", Description = "The attachment filename", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
|
|
||||||
public string Filename { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AttachmentService : BaseApiService
|
public class AttachmentService : BaseApiService
|
||||||
|
|
|
@ -527,12 +527,10 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
foreach (var attachment in mediaSource.MediaAttachments)
|
foreach (var attachment in mediaSource.MediaAttachments)
|
||||||
{
|
{
|
||||||
var filename = string.IsNullOrWhiteSpace(attachment.Filename) ? "Attachment" : attachment.Filename;
|
attachment.DeliveryUrl = string.Format("/Videos/{0}/{1}/Attachments/{2}",
|
||||||
attachment.DeliveryUrl = string.Format("/Videos/{0}/{1}/Attachments/{2}/{3}",
|
|
||||||
item.Id,
|
item.Id,
|
||||||
mediaSource.Id,
|
mediaSource.Id,
|
||||||
attachment.Index,
|
attachment.Index);
|
||||||
filename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue