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/Library/IUserDataManager.cs

70 lines
2.5 KiB

#nullable disable
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.Threading;
using Jellyfin.Data.Entities;
6 years ago
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Library
{
/// <summary>
/// Interface IUserDataManager.
6 years ago
/// </summary>
public interface IUserDataManager
{
/// <summary>
/// Occurs when [user data saved].
/// </summary>
event EventHandler<UserDataSaveEventArgs> UserDataSaved;
/// <summary>
/// Saves the user data.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="item">The item.</param>
/// <param name="userData">The user data.</param>
/// <param name="reason">The reason.</param>
/// <param name="cancellationToken">The cancellation token.</param>
void SaveUserData(Guid userId, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken);
void SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken);
6 years ago
UserItemData GetUserData(User user, BaseItem item);
6 years ago
UserItemData GetUserData(Guid userId, BaseItem item);
/// <summary>
/// Gets the user data dto.
/// </summary>
UserItemDataDto GetUserDataDto(BaseItem item, User user);
6 years ago
UserItemDataDto GetUserDataDto(BaseItem item, BaseItemDto itemDto, User user, DtoOptions dto_options);
6 years ago
/// <summary>
/// Get all user data for the given user.
6 years ago
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>The user item data.</returns>
6 years ago
List<UserItemData> GetAllUserData(Guid userId);
/// <summary>
/// Save the all provided user data for the given user.
6 years ago
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="userData">The array of user data.</param>
/// <param name="cancellationToken">The cancellation token.</param>
6 years ago
void SaveAllUserData(Guid userId, UserItemData[] userData, CancellationToken cancellationToken);
/// <summary>
/// Updates playstate for an item and returns true or false indicating if it was played to completion.
6 years ago
/// </summary>
bool UpdatePlayState(BaseItem item, UserItemData data, long? positionTicks);
}
}