Fix cases where multiple files are resolved as a single book

This commit is contained in:
Joe Rogers 2023-03-06 23:27:21 -05:00
parent 18b8efa7e0
commit 361fff3a0c
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4
2 changed files with 5 additions and 1 deletions

View File

@ -192,7 +192,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
continue;
}
if (resolvedItem.Files.Count == 0)
// Until multi-part books are handled letting files stack hides them from browsing in the client
if (resolvedItem.Files.Count == 0 || resolvedItem.Extras.Count > 0 || resolvedItem.AlternateVersions.Count > 0)
{
continue;
}

View File

@ -40,6 +40,9 @@ public class AudioResolverTests
[InlineData("chapter 01 part 01.mp3", "chapter 01 part 02.mp3")]
/* Mismatched chapters, parts, and named files. */
[InlineData("chapter 01.mp3", "part 2.mp3")]
[InlineData("book title.mp3", "chapter name.mp3")] // "book title" resolves as alternate version of book based on directory name
[InlineData("01 Content.mp3", "01 Credits.mp3")] // resolves as alternate versions of chapter 1
[InlineData("Chapter Name.mp3", "Part 1.mp3")]
public void Resolve_AudiobookDirectory_NoResult(params string[] children)
{
var resolved = TestResolveChildren("/parent/book title", children);