aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Dto
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Dto')
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs2
-rw-r--r--MediaBrowser.Model/Dto/ItemCounts.cs9
-rw-r--r--MediaBrowser.Model/Dto/TrickplayInfoDto.cs62
-rw-r--r--MediaBrowser.Model/Dto/UserDto.cs9
4 files changed, 78 insertions, 4 deletions
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 937409111a..8f223c12a5 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -569,7 +569,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the trickplay manifest.
/// </summary>
/// <value>The trickplay manifest.</value>
- public Dictionary<string, Dictionary<int, TrickplayInfo>> Trickplay { get; set; }
+ public Dictionary<string, Dictionary<int, TrickplayInfoDto>> Trickplay { get; set; }
/// <summary>
/// Gets or sets the type of the location.
diff --git a/MediaBrowser.Model/Dto/ItemCounts.cs b/MediaBrowser.Model/Dto/ItemCounts.cs
index 95f4a3d772..a15a0c82a8 100644
--- a/MediaBrowser.Model/Dto/ItemCounts.cs
+++ b/MediaBrowser.Model/Dto/ItemCounts.cs
@@ -76,5 +76,14 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The item count.</value>
public int ItemCount { get; set; }
+
+ /// <summary>
+ /// Adds all counts.
+ /// </summary>
+ /// <returns>The total of the counts.</returns>
+ public int TotalItemCount()
+ {
+ return MovieCount + SeriesCount + EpisodeCount + ArtistCount + ProgramCount + TrailerCount + SongCount + AlbumCount + MusicVideoCount + BoxSetCount + BookCount;
+ }
}
}
diff --git a/MediaBrowser.Model/Dto/TrickplayInfoDto.cs b/MediaBrowser.Model/Dto/TrickplayInfoDto.cs
new file mode 100644
index 0000000000..0c5f6e8171
--- /dev/null
+++ b/MediaBrowser.Model/Dto/TrickplayInfoDto.cs
@@ -0,0 +1,62 @@
+using System;
+using Jellyfin.Database.Implementations.Entities;
+
+namespace MediaBrowser.Model.Dto;
+
+/// <summary>
+/// The trickplay api model.
+/// </summary>
+public record TrickplayInfoDto
+{
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TrickplayInfoDto"/> class.
+ /// </summary>
+ /// <param name="info">The trickplay info.</param>
+ public TrickplayInfoDto(TrickplayInfo info)
+ {
+ ArgumentNullException.ThrowIfNull(info);
+
+ Width = info.Width;
+ Height = info.Height;
+ TileWidth = info.TileWidth;
+ TileHeight = info.TileHeight;
+ ThumbnailCount = info.ThumbnailCount;
+ Interval = info.Interval;
+ Bandwidth = info.Bandwidth;
+ }
+
+ /// <summary>
+ /// Gets the width of an individual thumbnail.
+ /// </summary>
+ public int Width { get; init; }
+
+ /// <summary>
+ /// Gets the height of an individual thumbnail.
+ /// </summary>
+ public int Height { get; init; }
+
+ /// <summary>
+ /// Gets the amount of thumbnails per row.
+ /// </summary>
+ public int TileWidth { get; init; }
+
+ /// <summary>
+ /// Gets the amount of thumbnails per column.
+ /// </summary>
+ public int TileHeight { get; init; }
+
+ /// <summary>
+ /// Gets the total amount of non-black thumbnails.
+ /// </summary>
+ public int ThumbnailCount { get; init; }
+
+ /// <summary>
+ /// Gets the interval in milliseconds between each trickplay thumbnail.
+ /// </summary>
+ public int Interval { get; init; }
+
+ /// <summary>
+ /// Gets the peak bandwidth usage in bits per second.
+ /// </summary>
+ public int Bandwidth { get; init; }
+}
diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs
index 05019741e0..c6b4a4d141 100644
--- a/MediaBrowser.Model/Dto/UserDto.cs
+++ b/MediaBrowser.Model/Dto/UserDto.cs
@@ -1,5 +1,6 @@
#nullable disable
using System;
+using System.ComponentModel;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Users;
@@ -54,20 +55,22 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets a value indicating whether this instance has password.
/// </summary>
/// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
- public bool HasPassword { get; set; }
+ [Obsolete("This information is no longer provided")]
+ public bool? HasPassword { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether this instance has configured password.
/// </summary>
/// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
- public bool HasConfiguredPassword { get; set; }
+ [Obsolete("This is always true")]
+ public bool? HasConfiguredPassword { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether this instance has configured easy password.
/// </summary>
/// <value><c>true</c> if this instance has configured easy password; otherwise, <c>false</c>.</value>
[Obsolete("Easy Password has been replaced with Quick Connect")]
- public bool HasConfiguredEasyPassword { get; set; }
+ public bool? HasConfiguredEasyPassword { get; set; } = false;
/// <summary>
/// Gets or sets whether async login is enabled or not.