mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 00:55:13 +01:00
update camera upload
This commit is contained in:
@@ -8,6 +8,7 @@ using MediaBrowser.Model.Devices;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Users;
|
||||
@@ -151,12 +152,13 @@ namespace MediaBrowser.Server.Implementations.Devices
|
||||
path = Path.Combine(path, _fileSystem.GetValidFilename(file.Album));
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
path = Path.Combine(path, file.Name);
|
||||
path = Path.ChangeExtension(path, MimeTypes.ToExtension(file.MimeType) ?? "jpg");
|
||||
|
||||
_libraryMonitor.ReportFileSystemChangeBeginning(path);
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
try
|
||||
{
|
||||
using (var fs = _fileSystem.GetFileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read))
|
||||
|
||||
@@ -369,6 +369,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await GetProgramsAsyncInternal(channelId, startDateUtc, endDateUtc, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error getting programs", ex);
|
||||
return GetEpgDataForChannel(channelId).Where(i => i.StartDate <= endDateUtc && i.EndDate >= startDateUtc);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<ProgramInfo>> GetProgramsAsyncInternal(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
|
||||
{
|
||||
var channels = await GetChannelsAsync(true, cancellationToken).ConfigureAwait(false);
|
||||
var channel = channels.First(i => string.Equals(i.Id, channelId, StringComparison.OrdinalIgnoreCase));
|
||||
@@ -377,6 +390,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
{
|
||||
var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channel.Number, startDateUtc, endDateUtc, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var list = programs.ToList();
|
||||
|
||||
// Replace the value that came from the provider with a normalized value
|
||||
|
||||
@@ -331,7 +331,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||
Container = "ts",
|
||||
Id = profile,
|
||||
SupportsDirectPlay = true,
|
||||
SupportsDirectStream = false,
|
||||
SupportsDirectStream = true,
|
||||
SupportsTranscoding = true
|
||||
};
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
"type",
|
||||
"data",
|
||||
"StartDate",
|
||||
"EndDate",
|
||||
"IsOffline",
|
||||
"ChannelId",
|
||||
@@ -516,35 +517,44 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
|
||||
if (!reader.IsDBNull(2))
|
||||
{
|
||||
item.EndDate = reader.GetDateTime(2).ToUniversalTime();
|
||||
var hasStartDate = item as IHasStartDate;
|
||||
if (hasStartDate != null)
|
||||
{
|
||||
hasStartDate.StartDate = reader.GetDateTime(2).ToUniversalTime();
|
||||
}
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(3))
|
||||
{
|
||||
item.IsOffline = reader.GetBoolean(3);
|
||||
item.EndDate = reader.GetDateTime(3).ToUniversalTime();
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(4))
|
||||
{
|
||||
item.ChannelId = reader.GetString(4);
|
||||
item.IsOffline = reader.GetBoolean(4);
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(5))
|
||||
{
|
||||
item.ChannelId = reader.GetString(5);
|
||||
}
|
||||
|
||||
var hasProgramAttributes = item as IHasProgramAttributes;
|
||||
if (hasProgramAttributes != null)
|
||||
{
|
||||
if (!reader.IsDBNull(5))
|
||||
{
|
||||
hasProgramAttributes.IsMovie = reader.GetBoolean(5);
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(6))
|
||||
{
|
||||
hasProgramAttributes.IsSports = reader.GetBoolean(6);
|
||||
hasProgramAttributes.IsMovie = reader.GetBoolean(6);
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(7))
|
||||
{
|
||||
hasProgramAttributes.IsKids = reader.GetBoolean(7);
|
||||
hasProgramAttributes.IsSports = reader.GetBoolean(7);
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(8))
|
||||
{
|
||||
hasProgramAttributes.IsKids = reader.GetBoolean(8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user