diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-11-06 09:34:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-06 09:34:24 +0100 |
| commit | b3713b370f80b09b79ef7c0a2ed297742d15e1f7 (patch) | |
| tree | 3b98871a1ce5b06ed9938df4a6ee83bd22bfc8a4 | |
| parent | 66d36f77811519d14814cacba53d9df8fe631d81 (diff) | |
| parent | 390d41910c1424c6da402180c0e1060a46385836 (diff) | |
Merge pull request #17373 from TaterTechStudios/feature/audiobook-count
Audiobooks: Add Audiobook count to ItemCounts Dto
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/ItemCountService.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dto/ItemCounts.cs | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/ItemCountService.cs b/Jellyfin.Server.Implementations/Item/ItemCountService.cs index 942161a176..61a2caa253 100644 --- a/Jellyfin.Server.Implementations/Item/ItemCountService.cs +++ b/Jellyfin.Server.Implementations/Item/ItemCountService.cs @@ -118,6 +118,10 @@ public class ItemCountService : IItemCountService { result.BookCount = count.Count; } + else if (string.Equals(count.Key, lookup[BaseItemKind.AudioBook], StringComparison.Ordinal)) + { + result.AudioBookCount = count.Count; + } } return result; @@ -294,6 +298,10 @@ public class ItemCountService : IItemCountService { years.Add(year); } + else if (string.Equals(count.Key, lookup[BaseItemKind.AudioBook], StringComparison.Ordinal)) + { + result.AudioBookCount = count.Count; + } } if (years.Count == 0) diff --git a/MediaBrowser.Model/Dto/ItemCounts.cs b/MediaBrowser.Model/Dto/ItemCounts.cs index a15a0c82a8..6204645f64 100644 --- a/MediaBrowser.Model/Dto/ItemCounts.cs +++ b/MediaBrowser.Model/Dto/ItemCounts.cs @@ -72,6 +72,12 @@ namespace MediaBrowser.Model.Dto public int BookCount { get; set; } /// <summary> + /// Gets or sets the audio book count. + /// </summary> + /// <value>The audio book count.</value> + public int AudioBookCount { get; set; } + + /// <summary> /// Gets or sets the item count. /// </summary> /// <value>The item count.</value> @@ -83,7 +89,7 @@ namespace MediaBrowser.Model.Dto /// <returns>The total of the counts.</returns> public int TotalItemCount() { - return MovieCount + SeriesCount + EpisodeCount + ArtistCount + ProgramCount + TrailerCount + SongCount + AlbumCount + MusicVideoCount + BoxSetCount + BookCount; + return MovieCount + SeriesCount + EpisodeCount + ArtistCount + ProgramCount + TrailerCount + SongCount + AlbumCount + MusicVideoCount + BoxSetCount + BookCount + AudioBookCount; } } } |
