mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Add ability to upload (and save) SDH subtitles (#10036)
This commit is contained in:
parent
2d14b065a8
commit
9564248b10
@ -90,7 +90,7 @@ public class SubtitleController : BaseJellyfinApiController
|
|||||||
[Authorize(Policy = Policies.RequiresElevation)]
|
[Authorize(Policy = Policies.RequiresElevation)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public ActionResult<Task> DeleteSubtitle(
|
public async Task<ActionResult> DeleteSubtitle(
|
||||||
[FromRoute, Required] Guid itemId,
|
[FromRoute, Required] Guid itemId,
|
||||||
[FromRoute, Required] int index)
|
[FromRoute, Required] int index)
|
||||||
{
|
{
|
||||||
@ -101,7 +101,7 @@ public class SubtitleController : BaseJellyfinApiController
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
_subtitleManager.DeleteSubtitles(item, index);
|
await _subtitleManager.DeleteSubtitles(item, index).ConfigureAwait(false);
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +416,7 @@ public class SubtitleController : BaseJellyfinApiController
|
|||||||
Format = body.Format,
|
Format = body.Format,
|
||||||
Language = body.Language,
|
Language = body.Language,
|
||||||
IsForced = body.IsForced,
|
IsForced = body.IsForced,
|
||||||
|
IsHearingImpaired = body.IsHearingImpaired,
|
||||||
Stream = memoryStream
|
Stream = memoryStream
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
_providerManager.QueueRefresh(video.Id, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), RefreshPriority.High);
|
_providerManager.QueueRefresh(video.Id, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), RefreshPriority.High);
|
||||||
|
@ -25,6 +25,12 @@ public class UploadSubtitleDto
|
|||||||
[Required]
|
[Required]
|
||||||
public bool IsForced { get; set; }
|
public bool IsForced { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the subtitle is for hearing impaired.
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public bool IsHearingImpaired { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the subtitle data.
|
/// Gets or sets the subtitle data.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,8 @@ namespace MediaBrowser.Controller.Subtitles
|
|||||||
|
|
||||||
public bool IsForced { get; set; }
|
public bool IsForced { get; set; }
|
||||||
|
|
||||||
|
public bool IsHearingImpaired { get; set; }
|
||||||
|
|
||||||
public Stream Stream { get; set; }
|
public Stream Stream { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,6 +200,11 @@ namespace MediaBrowser.Providers.Subtitles
|
|||||||
saveFileName += ".forced";
|
saveFileName += ".forced";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.IsHearingImpaired)
|
||||||
|
{
|
||||||
|
saveFileName += ".sdh";
|
||||||
|
}
|
||||||
|
|
||||||
saveFileName += "." + response.Format.ToLowerInvariant();
|
saveFileName += "." + response.Format.ToLowerInvariant();
|
||||||
|
|
||||||
if (saveInMediaFolder)
|
if (saveInMediaFolder)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user