Merge pull request #1929 from Narfinger/parser-fix4

[Draft][Help wanted] Fix parsing of certain names and adds a default season if no season was found

(cherry picked from commit 61b9b4046a)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
dkanada
2019-11-08 02:14:01 +09:00
committed by Joshua Boniface
parent cf54a0e8be
commit 46ab046c34
5 changed files with 103 additions and 9 deletions

View File

@@ -1899,7 +1899,7 @@ namespace Emby.Server.Implementations.Library
/// <param name="cancellationToken">The cancellation token.</param>
public void UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
{
UpdateItems(new [] { item }, parent, updateReason, cancellationToken);
UpdateItems(new[] { item }, parent, updateReason, cancellationToken);
}
/// <summary>
@@ -2487,6 +2487,15 @@ namespace Emby.Server.Implementations.Library
{
episode.ParentIndexNumber = season.IndexNumber;
}
else
{
/*
Anime series don't generally have a season in their file name, however,
tvdb needs a season to correctly get the metadata.
Hence, a null season needs to be filled with something. */
//FIXME perhaps this would be better for tvdb parser to ask for season 1 if no season is specified
episode.ParentIndexNumber = 1;
}
if (episode.ParentIndexNumber.HasValue)
{