mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #360 - Series.xml not being read correctly
This commit is contained in:
parent
189618a751
commit
cc2cfabda8
@ -111,8 +111,8 @@ namespace MediaBrowser.Providers.TV
|
|||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||||
{
|
{
|
||||||
// Don't proceed if there's local metadata and save local is off, as it's likely from another source
|
// Don't proceed if there's local metadata
|
||||||
if (HasLocalMeta(item) && !ConfigurationManager.Configuration.SaveLocalMeta)
|
if (HasLocalMeta(item))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -151,12 +151,6 @@ namespace MediaBrowser.Providers.TV
|
|||||||
/// <returns>Task{System.Boolean}.</returns>
|
/// <returns>Task{System.Boolean}.</returns>
|
||||||
public override async Task<bool> FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken)
|
public override async Task<bool> FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Don't proceed if there's local metadata and save local is off, as it's likely from another source
|
|
||||||
if (HasLocalMeta(item) && !ConfigurationManager.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var episode = (Episode)item;
|
var episode = (Episode)item;
|
||||||
|
@ -213,7 +213,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
var seriesDataPath = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId);
|
var seriesDataPath = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId);
|
||||||
|
|
||||||
await FetchSeriesData(series, seriesId, seriesDataPath, cancellationToken).ConfigureAwait(false);
|
await FetchSeriesData(series, seriesId, seriesDataPath, force, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseProviderInfo data;
|
BaseProviderInfo data;
|
||||||
@ -233,9 +233,10 @@ namespace MediaBrowser.Providers.TV
|
|||||||
/// <param name="series">The series.</param>
|
/// <param name="series">The series.</param>
|
||||||
/// <param name="seriesId">The series id.</param>
|
/// <param name="seriesId">The series id.</param>
|
||||||
/// <param name="seriesDataPath">The series data path.</param>
|
/// <param name="seriesDataPath">The series data path.</param>
|
||||||
|
/// <param name="isForcedRefresh">if set to <c>true</c> [is forced refresh].</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task{System.Boolean}.</returns>
|
/// <returns>Task{System.Boolean}.</returns>
|
||||||
private async Task FetchSeriesData(Series series, string seriesId, string seriesDataPath, CancellationToken cancellationToken)
|
private async Task FetchSeriesData(Series series, string seriesId, string seriesDataPath, bool isForcedRefresh, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly).Select(Path.GetFileName).ToArray();
|
var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly).Select(Path.GetFileName).ToArray();
|
||||||
|
|
||||||
@ -249,7 +250,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Examine if there's no local metadata, or save local is on (to get updates)
|
// Examine if there's no local metadata, or save local is on (to get updates)
|
||||||
if (!HasLocalMeta(series) || ConfigurationManager.Configuration.SaveLocalMeta)
|
if (!HasLocalMeta(series) || isForcedRefresh)
|
||||||
{
|
{
|
||||||
var seriesXmlPath = Path.Combine(seriesDataPath, seriesXmlFilename);
|
var seriesXmlPath = Path.Combine(seriesDataPath, seriesXmlFilename);
|
||||||
var actorsXmlPath = Path.Combine(seriesDataPath, "actors.xml");
|
var actorsXmlPath = Path.Combine(seriesDataPath, "actors.xml");
|
||||||
@ -265,13 +266,6 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
FetchActors(series, actorsDoc, seriesDoc);
|
FetchActors(series, actorsDoc, seriesDoc);
|
||||||
}
|
}
|
||||||
if (ConfigurationManager.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
//var ms = new MemoryStream();
|
|
||||||
//seriesDoc.Save(ms);
|
|
||||||
|
|
||||||
//await _providerManager.SaveToLibraryFilesystem(series, Path.Combine(series.MetaLocation, LocalMetaFileName), ms, cancellationToken).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user