From 4a20260a27e8ede4188609d8206a7313f7243e97 Mon Sep 17 00:00:00 2001 From: Narfinger Date: Fri, 11 Oct 2019 19:24:55 +0900 Subject: add another parser case and allow parsing of seasonless Add another parser case and we now allow parsing of seasonless series which hopefully should cover more cases of directory structure --- Emby.Server.Implementations/Library/LibraryManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs') diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 87e951f25..90f373cc6 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1899,7 +1899,7 @@ namespace Emby.Server.Implementations.Library /// The cancellation token. public void UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken) { - UpdateItems(new [] { item }, parent, updateReason, cancellationToken); + UpdateItems(new[] { item }, parent, updateReason, cancellationToken); } /// @@ -2487,6 +2487,10 @@ namespace Emby.Server.Implementations.Library { episode.ParentIndexNumber = season.IndexNumber; } + else + { + episode.ParentIndexNumber = 1; + } if (episode.ParentIndexNumber.HasValue) { -- cgit v1.2.3 From 9cd62d661f3209ddf411faf5936e2483b532fadb Mon Sep 17 00:00:00 2001 From: Narfinger Date: Thu, 7 Nov 2019 10:50:02 +0900 Subject: removed restriction to 3 digits in episodenumber and 4 in season numbers --- Emby.Naming/Common/NamingOptions.cs | 12 ++++++------ Emby.Server.Implementations/Library/LibraryManager.cs | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs') diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index e1f25fd2b..9cf430daf 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -329,31 +329,31 @@ namespace Emby.Naming.Common // *** End Kodi Standard Naming                 // [bar] Foo - 1 [baz] -                new EpisodeExpression(@".*?(\[.*?\])+.*?(?(\w+\s)+?)[-\s_]+(?\d{1,3}).*$"){ +                new EpisodeExpression(@".*?(\[.*?\])+.*?(?(\w+\s)+?)[-\s_]+(?\d+).*$"){ IsNamed=false, }, - new EpisodeExpression(@".*(\\|\/)[sS]?(?\d{1,4})[xX](?\d{1,3})[^\\\/]*$") + new EpisodeExpression(@".*(\\|\/)[sS]?(?\d+)[xX](?\d+)[^\\\/]*$") { IsNamed = true }, - new EpisodeExpression(@".*(\\|\/)[sS](?\d{1,4})[x,X]?[eE](?\d{1,3})[^\\\/]*$") + new EpisodeExpression(@".*(\\|\/)[sS](?\d+)[x,X]?[eE](?\d+)[^\\\/]*$") { IsNamed = true }, - new EpisodeExpression(@".*(\\|\/)(?((?![sS]?\d{1,4}[xX]\d{1,3})[^\\\/])*)?([sS]?(?\d{1,4})[xX](?\d{1,3}))[^\\\/]*$") + new EpisodeExpression(@".*(\\|\/)(?((?![sS]?\d{1,4}[xX]\d{1,3})[^\\\/])*)?([sS]?(?\d{1,4})[xX](?\d+))[^\\\/]*$") { IsNamed = true }, - new EpisodeExpression(@".*(\\|\/)(?[^\\\/]*)[sS](?\d{1,4})[xX\.]?[eE](?\d{1,3})[^\\\/]*$") + new EpisodeExpression(@".*(\\|\/)(?[^\\\/]*)[sS](?\d{1,4})[xX\.]?[eE](?\d+)[^\\\/]*$") { IsNamed = true }, // "01.avi" - new EpisodeExpression(@".*[\\\/](?\d{1,3})(-(?\d{2,3}))*\.\w+$") + new EpisodeExpression(@".*[\\\/](?\d+)(-(?\d+))*\.\w+$") { IsOptimistic = true, IsNamed = true diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 90f373cc6..dd74b1060 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -2489,6 +2489,11 @@ namespace Emby.Server.Implementations.Library } 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; } -- cgit v1.2.3