mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
added unaired/missing indicators
This commit is contained in:
parent
ca3a0c5dc9
commit
b21899b953
@ -181,7 +181,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
private async Task<bool> AddMissingEpisodes(Series series, string seriesDataPath, List<Episode> existingEpisodes, IEnumerable<Tuple<int, int>> episodeLookup, CancellationToken cancellationToken)
|
private async Task<bool> AddMissingEpisodes(Series series, string seriesDataPath, List<Episode> existingEpisodes, IEnumerable<Tuple<int, int>> episodeLookup, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var hasChanges = false;
|
var hasChanges = false;
|
||||||
|
|
||||||
foreach (var tuple in episodeLookup)
|
foreach (var tuple in episodeLookup)
|
||||||
{
|
{
|
||||||
if (tuple.Item1 <= 0)
|
if (tuple.Item1 <= 0)
|
||||||
@ -375,8 +375,9 @@ namespace MediaBrowser.Providers.TV
|
|||||||
|
|
||||||
var xmlPath = Path.Combine(seriesDataPath, filename);
|
var xmlPath = Path.Combine(seriesDataPath, filename);
|
||||||
|
|
||||||
// It appears the best way to filter out invalid entries is to only include those with valid air dates
|
DateTime? airDate = null;
|
||||||
|
|
||||||
|
// It appears the best way to filter out invalid entries is to only include those with valid air dates
|
||||||
using (var streamReader = new StreamReader(xmlPath, Encoding.UTF8))
|
using (var streamReader = new StreamReader(xmlPath, Encoding.UTF8))
|
||||||
{
|
{
|
||||||
// Use XmlReader for best performance
|
// Use XmlReader for best performance
|
||||||
@ -397,6 +398,16 @@ namespace MediaBrowser.Providers.TV
|
|||||||
{
|
{
|
||||||
switch (reader.Name)
|
switch (reader.Name)
|
||||||
{
|
{
|
||||||
|
case "EpisodeName":
|
||||||
|
{
|
||||||
|
var val = reader.ReadElementContentAsString();
|
||||||
|
if (string.IsNullOrWhiteSpace(val))
|
||||||
|
{
|
||||||
|
// Not valid, ignore these
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "FirstAired":
|
case "FirstAired":
|
||||||
{
|
{
|
||||||
var val = reader.ReadElementContentAsString();
|
var val = reader.ReadElementContentAsString();
|
||||||
@ -406,7 +417,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
DateTime date;
|
DateTime date;
|
||||||
if (DateTime.TryParse(val, out date))
|
if (DateTime.TryParse(val, out date))
|
||||||
{
|
{
|
||||||
return date.ToUniversalTime();
|
airDate = date.ToUniversalTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,7 +433,7 @@ namespace MediaBrowser.Providers.TV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return airDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user