update subtitles

This commit is contained in:
Luke Pulverenti 2015-11-14 14:56:56 -05:00
parent 3eda14eff0
commit a86d0a3585
5 changed files with 15 additions and 5 deletions

View File

@ -170,8 +170,9 @@ namespace MediaBrowser.Controller.Entities
{
CollectionType.Games,
CollectionType.Books,
CollectionType.MusicVideos ,
CollectionType.HomeVideos
CollectionType.MusicVideos,
CollectionType.HomeVideos,
CollectionType.Photos
};
return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);

View File

@ -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()

View File

@ -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);

View File

@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library
private int GetMaxAllowedBitrateForExternalSubtitleStream()
{
return 20000000;
return 30000000;
}
private IEnumerable<MediaStream> GetMediaStreamsForItem(IEnumerable<MediaStream> streams)

View File

@ -206,6 +206,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
var libraryItem = _libraryManager.GetItemById(item.Item1);
if (libraryItem.IsTopParent)
{
continue;
}
if (Folder.IsPathOffline(path))
{
libraryItem.IsOffline = true;