You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Persistence/IUserDataRepository.cs

56 lines
2.0 KiB

#nullable disable
using System.Collections.Generic;
6 years ago
using System.Threading;
using MediaBrowser.Controller.Entities;
6 years ago
namespace MediaBrowser.Controller.Persistence
{
/// <summary>
/// Provides an interface to implement a UserData repository.
6 years ago
/// </summary>
public interface IUserDataRepository : IRepository
{
/// <summary>
/// Saves the user data.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="key">The key.</param>
/// <param name="userData">The user data.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
void SaveUserData(long userId, string key, UserItemData userData, CancellationToken cancellationToken);
/// <summary>
/// Gets the user data.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="key">The key.</param>
/// <returns>The user data.</returns>
6 years ago
UserItemData GetUserData(long userId, string key);
/// <summary>
/// Gets the user data.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="keys">The keys.</param>
/// <returns>The user data.</returns>
6 years ago
UserItemData GetUserData(long userId, List<string> keys);
/// <summary>
/// Return all user data associated with the given user.
6 years ago
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>The list of user item data.</returns>
6 years ago
List<UserItemData> GetAllUserData(long userId);
/// <summary>
/// Save all user data associated with the given user.
6 years ago
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="userData">The user item data.</param>
/// <param name="cancellationToken">The cancellation token.</param>
6 years ago
void SaveAllUserData(long userId, UserItemData[] userData, CancellationToken cancellationToken);
}
}