Fix cases where multiple files are resolved as a single book

pull/9446/head
Joe Rogers 2 years ago
parent 18b8efa7e0
commit 361fff3a0c
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

@ -192,7 +192,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
continue; 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; continue;
} }

@ -40,6 +40,9 @@ public class AudioResolverTests
[InlineData("chapter 01 part 01.mp3", "chapter 01 part 02.mp3")] [InlineData("chapter 01 part 01.mp3", "chapter 01 part 02.mp3")]
/* Mismatched chapters, parts, and named files. */ /* Mismatched chapters, parts, and named files. */
[InlineData("chapter 01.mp3", "part 2.mp3")] [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) public void Resolve_AudiobookDirectory_NoResult(params string[] children)
{ {
var resolved = TestResolveChildren("/parent/book title", children); var resolved = TestResolveChildren("/parent/book title", children);

Loading…
Cancel
Save