cooldown

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cooldown provides media cooldown management to prevent recent replays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles media cooldown tracking

func NewManager

func NewManager(
	cooldownRepo *repository.CooldownRepository,
	historyRepo *repository.HistoryRepository,
	cfg *config.CooldownConfig,
	logger *slog.Logger,
) *Manager

NewManager creates a new cooldown Manager

func (*Manager) GetActiveCooldownMediaIDs

func (m *Manager) GetActiveCooldownMediaIDs(ctx context.Context) ([]int64, error)

GetActiveCooldownMediaIDs returns IDs of all media currently on cooldown

func (*Manager) RecordPlay

func (m *Manager) RecordPlay(ctx context.Context, media *models.Media, channelID, themeName string) error

RecordPlay records that a media item was played and sets its cooldown

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL