mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
Merge branch 'master' into embytv
This commit is contained in:
@@ -1552,14 +1552,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
var episodesToDelete = librarySeries.GetItemList(
|
||||
new InternalItemsQuery
|
||||
{
|
||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DateCreated, SortOrder.Descending) },
|
||||
OrderBy = new[] { (ItemSortBy.DateCreated, SortOrder.Descending) },
|
||||
IsVirtualItem = false,
|
||||
IsFolder = false,
|
||||
Recursive = true,
|
||||
DtoOptions = new DtoOptions(true)
|
||||
}).Where(i => i.IsFileProtocol && File.Exists(i.Path))
|
||||
.Skip(seriesTimer.KeepUpTo - 1)
|
||||
.ToList();
|
||||
|
||||
})
|
||||
.Where(i => i.IsFileProtocol && File.Exists(i.Path))
|
||||
.Skip(seriesTimer.KeepUpTo - 1)
|
||||
.ToList();
|
||||
|
||||
foreach (var item in episodesToDelete)
|
||||
{
|
||||
@@ -1619,12 +1621,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
},
|
||||
true);
|
||||
}
|
||||
else
|
||||
else if (File.Exists(timer.RecordingPath))
|
||||
{
|
||||
if (File.Exists(timer.RecordingPath))
|
||||
{
|
||||
_fileSystem.DeleteFile(timer.RecordingPath);
|
||||
}
|
||||
_fileSystem.DeleteFile(timer.RecordingPath);
|
||||
}
|
||||
|
||||
_timerProvider.Delete(timer);
|
||||
@@ -2188,7 +2187,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
},
|
||||
MinStartDate = startDateUtc.AddMinutes(-3),
|
||||
MaxStartDate = startDateUtc.AddMinutes(3),
|
||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending) }
|
||||
OrderBy = new[] { (ItemSortBy.StartDate, SortOrder.Ascending) }
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(channelId))
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common;
|
||||
@@ -12,7 +13,6 @@ using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
@@ -663,7 +663,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||
|
||||
try
|
||||
{
|
||||
return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false);
|
||||
return await _httpClient.SendAsync(options, HttpMethod.Get).ConfigureAwait(false);
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
@@ -738,7 +738,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||
|
||||
httpOptions.RequestHeaders["token"] = token;
|
||||
|
||||
using (await _httpClient.SendAsync(httpOptions, "PUT").ConfigureAwait(false))
|
||||
using (await _httpClient.SendAsync(httpOptions, HttpMethod.Put).ConfigureAwait(false))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Emby.XmlTv.Classes;
|
||||
using Emby.XmlTv.Entities;
|
||||
using Jellyfin.XmlTv;
|
||||
using Jellyfin.XmlTv.Entities;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
|
||||
@@ -212,16 +212,16 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
|
||||
var orderBy = internalQuery.OrderBy.ToList();
|
||||
|
||||
orderBy.AddRange(query.SortBy.Select(i => new ValueTuple<string, SortOrder>(i, query.SortOrder ?? SortOrder.Ascending)));
|
||||
orderBy.AddRange(query.SortBy.Select(i => (i, query.SortOrder ?? SortOrder.Ascending)));
|
||||
|
||||
if (query.EnableFavoriteSorting)
|
||||
{
|
||||
orderBy.Insert(0, new ValueTuple<string, SortOrder>(ItemSortBy.IsFavoriteOrLiked, SortOrder.Descending));
|
||||
orderBy.Insert(0, (ItemSortBy.IsFavoriteOrLiked, SortOrder.Descending));
|
||||
}
|
||||
|
||||
if (!internalQuery.OrderBy.Any(i => string.Equals(i.Item1, ItemSortBy.SortName, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
orderBy.Add(new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending));
|
||||
orderBy.Add((ItemSortBy.SortName, SortOrder.Ascending));
|
||||
}
|
||||
|
||||
internalQuery.OrderBy = orderBy.ToArray();
|
||||
@@ -307,9 +307,12 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
}
|
||||
|
||||
private ILiveTvService GetService(string name)
|
||||
{
|
||||
return _services.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
=> Array.Find(_services, x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
?? throw new KeyNotFoundException(
|
||||
string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"No service with the name '{0}' can be found.",
|
||||
name));
|
||||
|
||||
private static void Normalize(MediaSourceInfo mediaSource, ILiveTvService service, bool isVideo)
|
||||
{
|
||||
@@ -775,22 +778,22 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
|
||||
var topFolder = GetInternalLiveTvFolder(cancellationToken);
|
||||
|
||||
if (query.OrderBy.Length == 0)
|
||||
if (query.OrderBy.Count == 0)
|
||||
{
|
||||
if (query.IsAiring ?? false)
|
||||
{
|
||||
// Unless something else was specified, order by start date to take advantage of a specialized index
|
||||
query.OrderBy = new ValueTuple<string, SortOrder>[]
|
||||
query.OrderBy = new[]
|
||||
{
|
||||
new ValueTuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending)
|
||||
(ItemSortBy.StartDate, SortOrder.Ascending)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unless something else was specified, order by start date to take advantage of a specialized index
|
||||
query.OrderBy = new ValueTuple<string, SortOrder>[]
|
||||
query.OrderBy = new[]
|
||||
{
|
||||
new ValueTuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending)
|
||||
(ItemSortBy.StartDate, SortOrder.Ascending)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -874,7 +877,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
IsSports = query.IsSports,
|
||||
IsKids = query.IsKids,
|
||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending) },
|
||||
OrderBy = new[] { (ItemSortBy.StartDate, SortOrder.Ascending) },
|
||||
TopParentIds = new[] { topFolder.Id },
|
||||
DtoOptions = options,
|
||||
GenreIds = query.GenreIds
|
||||
@@ -1399,7 +1402,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
IsVirtualItem = false,
|
||||
Limit = limit,
|
||||
StartIndex = query.StartIndex,
|
||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DateCreated, SortOrder.Descending) },
|
||||
OrderBy = new[] { (ItemSortBy.DateCreated, SortOrder.Descending) },
|
||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||
IncludeItemTypes = includeItemTypes.ToArray(),
|
||||
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
||||
@@ -1897,7 +1900,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
MaxStartDate = now,
|
||||
MinEndDate = now,
|
||||
Limit = channelIds.Length,
|
||||
OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.StartDate, SortOrder.Ascending) },
|
||||
OrderBy = new[] { (ItemSortBy.StartDate, SortOrder.Ascending) },
|
||||
TopParentIds = new[] { GetInternalLiveTvFolder(CancellationToken.None).Id },
|
||||
DtoOptions = options
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
@@ -64,7 +65,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||
httpRequestOptions.RequestHeaders[header.Key] = header.Value;
|
||||
}
|
||||
|
||||
var response = await _httpClient.SendAsync(httpRequestOptions, "GET").ConfigureAwait(false);
|
||||
var response = await _httpClient.SendAsync(httpRequestOptions, HttpMethod.Get).ConfigureAwait(false);
|
||||
|
||||
var extension = "ts";
|
||||
var requiresRemux = false;
|
||||
|
||||
Reference in New Issue
Block a user