mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-27 10:00:53 +01:00
update subtitles
This commit is contained in:
@@ -205,7 +205,7 @@ namespace MediaBrowser.Providers.Subtitles
|
||||
public async Task<IEnumerable<NameIdPair>> GetSupportedLanguages(CancellationToken cancellationToken)
|
||||
{
|
||||
await Login(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
var result = OpenSubtitles.GetSubLanguages("en");
|
||||
if (!(result is MethodResponseGetSubLanguages))
|
||||
{
|
||||
@@ -321,7 +321,8 @@ namespace MediaBrowser.Providers.Subtitles
|
||||
Name = i.SubFileName,
|
||||
DateCreated = DateTime.Parse(i.SubAddDate, _usCulture),
|
||||
IsHashMatch = i.MovieHash == hasCopy
|
||||
});
|
||||
|
||||
}).Where(i => !string.Equals(i.Format, "sub", StringComparison.OrdinalIgnoreCase) && !string.Equals(i.Format, "idx", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -15,6 +15,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
@@ -130,6 +131,8 @@ namespace MediaBrowser.Providers.Subtitles
|
||||
|
||||
try
|
||||
{
|
||||
//var isText = MediaStream.IsTextFormat(response.Format);
|
||||
|
||||
using (var fs = _fileSystem.GetFileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
||||
{
|
||||
await stream.CopyToAsync(fs).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user