mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-26 15:38:39 +02:00
Add missing options
This commit is contained in:
parent
62fcc84bf4
commit
276b219fbd
|
@ -298,10 +298,11 @@ namespace MediaBrowser.Providers.Plugins.Omdb
|
||||||
|
|
||||||
using var response = await GetOmdbResponse(_httpClientFactory.CreateClient(NamedClient.Default), url, cancellationToken).ConfigureAwait(false);
|
using var response = await GetOmdbResponse(_httpClientFactory.CreateClient(NamedClient.Default), url, cancellationToken).ConfigureAwait(false);
|
||||||
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||||
var rootObject = await JsonSerializer.DeserializeAsync<RootObject>(stream, cancellationToken: cancellationToken).ConfigureAwait(false);
|
var jsonOptions = JsonDefaults.GetOptions();
|
||||||
|
var rootObject = await JsonSerializer.DeserializeAsync<RootObject>(stream, jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||||
await using FileStream jsonFileStream = File.Create(path);
|
await using FileStream jsonFileStream = File.Create(path);
|
||||||
await JsonSerializer.SerializeAsync(jsonFileStream, rootObject, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
|
await JsonSerializer.SerializeAsync(jsonFileStream, rootObject, jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
@ -337,10 +338,11 @@ namespace MediaBrowser.Providers.Plugins.Omdb
|
||||||
|
|
||||||
using var response = await GetOmdbResponse(_httpClientFactory.CreateClient(NamedClient.Default), url, cancellationToken).ConfigureAwait(false);
|
using var response = await GetOmdbResponse(_httpClientFactory.CreateClient(NamedClient.Default), url, cancellationToken).ConfigureAwait(false);
|
||||||
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||||
var rootObject = await JsonSerializer.DeserializeAsync<SeasonRootObject>(stream, cancellationToken: cancellationToken).ConfigureAwait(false);
|
var jsonOptions = JsonDefaults.GetOptions();
|
||||||
|
var rootObject = await JsonSerializer.DeserializeAsync<SeasonRootObject>(stream, jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||||
await using FileStream jsonFileStream = File.Create(path);
|
await using FileStream jsonFileStream = File.Create(path);
|
||||||
await JsonSerializer.SerializeAsync(jsonFileStream, rootObject, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
|
await JsonSerializer.SerializeAsync(jsonFileStream, rootObject, jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue