mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
update schedules direct
This commit is contained in:
@@ -400,13 +400,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
||||
|
||||
_logger.Info("Headends on account ");
|
||||
|
||||
var countryParam = string.Equals("ca", country, StringComparison.OrdinalIgnoreCase)
|
||||
? "can"
|
||||
: "USA";
|
||||
|
||||
var options = new HttpRequestOptions()
|
||||
{
|
||||
Url = ApiUrl + "/headends?country=" + countryParam + "&postalcode=" + location,
|
||||
Url = ApiUrl + "/headends?country=" + country + "&postalcode=" + location,
|
||||
UserAgent = UserAgent,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
@@ -595,18 +591,32 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Validate(ListingsProviderInfo info)
|
||||
public async Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(info.ListingsId))
|
||||
if (validateLogin)
|
||||
{
|
||||
throw new ArgumentException("Listings Id required");
|
||||
if (string.IsNullOrWhiteSpace(info.Username))
|
||||
{
|
||||
throw new ArgumentException("Username is required");
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(info.Password))
|
||||
{
|
||||
throw new ArgumentException("Password is required");
|
||||
}
|
||||
}
|
||||
|
||||
var hasLineup = await HasLineup(info, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
if (!hasLineup)
|
||||
if (validateListings)
|
||||
{
|
||||
await AddLineupToAccount(info, CancellationToken.None).ConfigureAwait(false);
|
||||
if (string.IsNullOrWhiteSpace(info.ListingsId))
|
||||
{
|
||||
throw new ArgumentException("Listings Id required");
|
||||
}
|
||||
|
||||
var hasLineup = await HasLineup(info, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
if (!hasLineup)
|
||||
{
|
||||
await AddLineupToAccount(info, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
|
||||
// Might not be needed
|
||||
}
|
||||
|
||||
public Task Validate(ListingsProviderInfo info)
|
||||
public async Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings)
|
||||
{
|
||||
// Check that the path or url is valid. If not, throw a file not found exception
|
||||
}
|
||||
|
||||
@@ -2204,7 +2204,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
_taskManager.CancelIfRunningAndQueue<RefreshChannelsScheduledTask>();
|
||||
}
|
||||
|
||||
public async Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info)
|
||||
public async Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings)
|
||||
{
|
||||
info = (ListingsProviderInfo)_jsonSerializer.DeserializeFromString(_jsonSerializer.SerializeToString(info), typeof(ListingsProviderInfo));
|
||||
|
||||
@@ -2215,7 +2215,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
await provider.Validate(info).ConfigureAwait(false);
|
||||
await provider.Validate(info, validateLogin, validateListings).ConfigureAwait(false);
|
||||
|
||||
var config = GetConfiguration();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user