mirror of
https://github.com/jellyfin/jellyfin-plugin-nextpvr.git
synced 2024-11-23 14:09:44 +00:00
fix recordings
This commit is contained in:
parent
c93e675756
commit
6f4bbbd9fe
@ -13,12 +13,12 @@ using MediaBrowser.Plugins.NextPvr.Responses;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Model.Cryptography;
|
using MediaBrowser.Model.Cryptography;
|
||||||
|
using MediaBrowser.Model.IO;
|
||||||
|
|
||||||
namespace MediaBrowser.Plugins.NextPvr
|
namespace MediaBrowser.Plugins.NextPvr
|
||||||
{
|
{
|
||||||
@ -37,14 +37,16 @@ namespace MediaBrowser.Plugins.NextPvr
|
|||||||
private string Sid { get; set; }
|
private string Sid { get; set; }
|
||||||
private DateTime LastUpdatedSidDateTime { get; set; }
|
private DateTime LastUpdatedSidDateTime { get; set; }
|
||||||
private ICryptoProvider _cryptoProvider;
|
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;
|
_httpClient = httpClient;
|
||||||
_jsonSerializer = jsonSerializer;
|
_jsonSerializer = jsonSerializer;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
LastUpdatedSidDateTime = DateTime.UtcNow;
|
LastUpdatedSidDateTime = DateTime.UtcNow;
|
||||||
_cryptoProvider = cryptoProvider;
|
_cryptoProvider = cryptoProvider;
|
||||||
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -697,7 +699,7 @@ namespace MediaBrowser.Plugins.NextPvr
|
|||||||
var vlcObj = new VLCResponse().GetVLCResponse(stream, _jsonSerializer, _logger);
|
var vlcObj = new VLCResponse().GetVLCResponse(stream, _jsonSerializer, _logger);
|
||||||
_logger.Debug(vlcObj.StreamLocation);
|
_logger.Debug(vlcObj.StreamLocation);
|
||||||
|
|
||||||
while (!File.Exists(vlcObj.StreamLocation))
|
while (!_fileSystem.FileExists(vlcObj.StreamLocation))
|
||||||
{
|
{
|
||||||
await Task.Delay(200).ConfigureAwait(false);
|
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);
|
_logger.Info("[NextPvr] RecordingPath: {0}", recording.Path);
|
||||||
return new MediaSourceInfo
|
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)
|
public async Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null)
|
||||||
{
|
{
|
||||||
_logger.Info("[NextPvr] Start GetNewTimerDefault Async");
|
_logger.Info("[NextPvr] Start GetNewTimerDefault Async");
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard1.3;</TargetFrameworks>
|
<TargetFrameworks>netstandard1.3;</TargetFrameworks>
|
||||||
<AssemblyVersion>3.1.3.0</AssemblyVersion>
|
<AssemblyVersion>3.1.4.0</AssemblyVersion>
|
||||||
<FileVersion>3.1.3.0</FileVersion>
|
<FileVersion>3.1.4.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user