diff options
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Entities/IHasShares.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/Share.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/UserPermissions.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs | 10 |
4 files changed, 26 insertions, 24 deletions
diff --git a/MediaBrowser.Model/Entities/IHasShares.cs b/MediaBrowser.Model/Entities/IHasShares.cs index 31574a3ff..fb6b6e424 100644 --- a/MediaBrowser.Model/Entities/IHasShares.cs +++ b/MediaBrowser.Model/Entities/IHasShares.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace MediaBrowser.Model.Entities; @@ -10,5 +10,5 @@ public interface IHasShares /// <summary> /// Gets or sets the shares. /// </summary> - IReadOnlyList<Share> Shares { get; set; } + IReadOnlyList<UserPermissions> Shares { get; set; } } diff --git a/MediaBrowser.Model/Entities/Share.cs b/MediaBrowser.Model/Entities/Share.cs deleted file mode 100644 index 186aad189..000000000 --- a/MediaBrowser.Model/Entities/Share.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace MediaBrowser.Model.Entities; - -/// <summary> -/// Class to hold data on sharing permissions. -/// </summary> -public class Share -{ - /// <summary> - /// Gets or sets the user id. - /// </summary> - public string? UserId { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether the user has edit permissions. - /// </summary> - public bool CanEdit { get; set; } -} diff --git a/MediaBrowser.Model/Entities/UserPermissions.cs b/MediaBrowser.Model/Entities/UserPermissions.cs new file mode 100644 index 000000000..271feed11 --- /dev/null +++ b/MediaBrowser.Model/Entities/UserPermissions.cs @@ -0,0 +1,19 @@ +namespace MediaBrowser.Model.Entities; + +/// <summary> +/// Class to hold data on user permissions for lists. +/// </summary> +/// <param name="userId">The user id.</param> +/// <param name="canEdit">Edit permission.</param> +public class UserPermissions(string userId, bool canEdit = false) +{ + /// <summary> + /// Gets or sets the user id. + /// </summary> + public string UserId { get; set; } = userId; + + /// <summary> + /// Gets or sets a value indicating whether the user has edit permissions. + /// </summary> + public bool CanEdit { get; set; } = canEdit; +} diff --git a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs index 93eccd5c7..f1351588f 100644 --- a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs +++ b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs @@ -18,7 +18,7 @@ public class PlaylistCreationRequest /// <summary> /// Gets or sets the list of items. /// </summary> - public IReadOnlyList<Guid> ItemIdList { get; set; } = Array.Empty<Guid>(); + public IReadOnlyList<Guid> ItemIdList { get; set; } = []; /// <summary> /// Gets or sets the media type. @@ -31,12 +31,12 @@ public class PlaylistCreationRequest public Guid UserId { get; set; } /// <summary> - /// Gets or sets the shares. + /// Gets or sets the user permissions. /// </summary> - public IReadOnlyList<Share>? Shares { get; set; } + public IReadOnlyList<UserPermissions> Users { get; set; } = []; /// <summary> - /// Gets or sets a value indicating whether open access is enabled. + /// Gets or sets a value indicating whether the playlist is public. /// </summary> - public bool? OpenAccess { get; set; } + public bool? Public { get; set; } = true; } |
