fix recordings

This commit is contained in:
Luke Pulverenti 2017-09-03 01:16:38 -04:00
parent c93e675756
commit 6f4bbbd9fe
2 changed files with 8 additions and 17 deletions

View File

@ -13,12 +13,12 @@ using MediaBrowser.Plugins.NextPvr.Responses;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Plugins.NextPvr
{
@ -37,14 +37,16 @@ namespace MediaBrowser.Plugins.NextPvr
private string Sid { get; set; }
private DateTime LastUpdatedSidDateTime { get; set; }
private ICryptoProvider _cryptoProvider;
private IFileSystem _fileSystem;
public LiveTvService(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger, ICryptoProvider cryptoProvider)
public LiveTvService(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger, ICryptoProvider cryptoProvider, IFileSystem fileSystem)
{
_httpClient = httpClient;
_jsonSerializer = jsonSerializer;
_logger = logger;
LastUpdatedSidDateTime = DateTime.UtcNow;
_cryptoProvider = cryptoProvider;
_fileSystem = fileSystem;
}
/// <summary>
@ -697,7 +699,7 @@ namespace MediaBrowser.Plugins.NextPvr
var vlcObj = new VLCResponse().GetVLCResponse(stream, _jsonSerializer, _logger);
_logger.Debug(vlcObj.StreamLocation);
while (!File.Exists(vlcObj.StreamLocation))
while (!_fileSystem.FileExists(vlcObj.StreamLocation))
{
await Task.Delay(200).ConfigureAwait(false);
}
@ -799,7 +801,7 @@ namespace MediaBrowser.Plugins.NextPvr
};
}
if (!string.IsNullOrEmpty(recording.Path) && File.Exists(recording.Path))
if (!string.IsNullOrEmpty(recording.Path) && _fileSystem.FileExists(recording.Path))
{
_logger.Info("[NextPvr] RecordingPath: {0}", recording.Path);
return new MediaSourceInfo
@ -856,17 +858,6 @@ namespace MediaBrowser.Plugins.NextPvr
}
}
public async Task CopyFilesAsync(StreamReader source, StreamWriter destination)
{
_logger.Info("[NextPvr] Start CopyFiles Async");
char[] buffer = new char[0x1000];
int numRead;
while ((numRead = await source.ReadAsync(buffer, 0, buffer.Length)) != 0)
{
await destination.WriteAsync(buffer, 0, numRead);
}
}
public async Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null)
{
_logger.Info("[NextPvr] Start GetNewTimerDefault Async");

View File

@ -2,8 +2,8 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.3;</TargetFrameworks>
<AssemblyVersion>3.1.3.0</AssemblyVersion>
<FileVersion>3.1.3.0</FileVersion>
<AssemblyVersion>3.1.4.0</AssemblyVersion>
<FileVersion>3.1.4.0</FileVersion>
</PropertyGroup>
<ItemGroup>