mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 04:05:50 -04:00
update subtitles
This commit is contained in:
parent
3eda14eff0
commit
a86d0a3585
@ -170,8 +170,9 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
{
|
{
|
||||||
CollectionType.Games,
|
CollectionType.Games,
|
||||||
CollectionType.Books,
|
CollectionType.Books,
|
||||||
CollectionType.MusicVideos ,
|
CollectionType.MusicVideos,
|
||||||
CollectionType.HomeVideos
|
CollectionType.HomeVideos,
|
||||||
|
CollectionType.Photos
|
||||||
};
|
};
|
||||||
|
|
||||||
return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
|
return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
|
||||||
|
@ -205,7 +205,7 @@ namespace MediaBrowser.Providers.Subtitles
|
|||||||
public async Task<IEnumerable<NameIdPair>> GetSupportedLanguages(CancellationToken cancellationToken)
|
public async Task<IEnumerable<NameIdPair>> GetSupportedLanguages(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
await Login(cancellationToken).ConfigureAwait(false);
|
await Login(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var result = OpenSubtitles.GetSubLanguages("en");
|
var result = OpenSubtitles.GetSubLanguages("en");
|
||||||
if (!(result is MethodResponseGetSubLanguages))
|
if (!(result is MethodResponseGetSubLanguages))
|
||||||
{
|
{
|
||||||
@ -321,7 +321,8 @@ namespace MediaBrowser.Providers.Subtitles
|
|||||||
Name = i.SubFileName,
|
Name = i.SubFileName,
|
||||||
DateCreated = DateTime.Parse(i.SubAddDate, _usCulture),
|
DateCreated = DateTime.Parse(i.SubAddDate, _usCulture),
|
||||||
IsHashMatch = i.MovieHash == hasCopy
|
IsHashMatch = i.MovieHash == hasCopy
|
||||||
});
|
|
||||||
|
}).Where(i => !string.Equals(i.Format, "sub", StringComparison.OrdinalIgnoreCase) && !string.Equals(i.Format, "idx", StringComparison.OrdinalIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
@ -15,6 +15,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
@ -130,6 +131,8 @@ namespace MediaBrowser.Providers.Subtitles
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//var isText = MediaStream.IsTextFormat(response.Format);
|
||||||
|
|
||||||
using (var fs = _fileSystem.GetFileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
using (var fs = _fileSystem.GetFileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
||||||
{
|
{
|
||||||
await stream.CopyToAsync(fs).ConfigureAwait(false);
|
await stream.CopyToAsync(fs).ConfigureAwait(false);
|
||||||
|
@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
|
|
||||||
private int GetMaxAllowedBitrateForExternalSubtitleStream()
|
private int GetMaxAllowedBitrateForExternalSubtitleStream()
|
||||||
{
|
{
|
||||||
return 20000000;
|
return 30000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<MediaStream> GetMediaStreamsForItem(IEnumerable<MediaStream> streams)
|
private IEnumerable<MediaStream> GetMediaStreamsForItem(IEnumerable<MediaStream> streams)
|
||||||
|
@ -206,6 +206,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
|
|
||||||
var libraryItem = _libraryManager.GetItemById(item.Item1);
|
var libraryItem = _libraryManager.GetItemById(item.Item1);
|
||||||
|
|
||||||
|
if (libraryItem.IsTopParent)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Folder.IsPathOffline(path))
|
if (Folder.IsPathOffline(path))
|
||||||
{
|
{
|
||||||
libraryItem.IsOffline = true;
|
libraryItem.IsOffline = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user