using System.Threading.Tasks;
using Jellyfin.Plugin.WatchedTogether.Configuration;
namespace Jellyfin.Plugin.WatchedTogether.Services;
///
/// Creates shared accounts on demand from a separator-joined username typed at the login screen.
///
public interface IDynamicGroupService
{
///
/// Attempts to authenticate a not-yet-existing shared account named like "alice+bob", creating
/// it if the submitted password belongs to one of the named members.
///
/// The username typed at the login screen.
/// The submitted password.
///
/// The created group and the shared account's username, or null if the name is not a
/// valid member combination or no named member's password matched.
///
Task TryCreateFromLoginAsync(string enteredUsername, string password);
}
///
/// The outcome of a successful on-demand group creation.
///
/// The group that was created.
/// The username of the shared account.
public record DynamicGroupResult(SharedGroup Group, string SharedUsername);