瀏覽代碼

Use 'await using Stream' instead of 'using Stream'

David 5 年之前
父節點
當前提交
fcbae95d19
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Jellyfin.Api/Controllers/SubtitleController.cs

+ 1 - 1
Jellyfin.Api/Controllers/SubtitleController.cs

@@ -217,7 +217,7 @@ namespace Jellyfin.Api.Controllers
 
             if (string.Equals(format, "vtt", StringComparison.OrdinalIgnoreCase) && addVttTimeMap)
             {
-                using var stream = await EncodeSubtitles(id, mediaSourceId, index, format, startPositionTicks, endPositionTicks, copyTimestamps).ConfigureAwait(false);
+                await using Stream stream = await EncodeSubtitles(id, mediaSourceId, index, format, startPositionTicks, endPositionTicks, copyTimestamps).ConfigureAwait(false);
                 using var reader = new StreamReader(stream);
 
                 var text = await reader.ReadToEndAsync().ConfigureAwait(false);