store

package
v0.0.0-...-4aa44aa Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package store is responsible for conversion and storage of tracks and thumbnails.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertedFileOrError

type ConvertedFileOrError struct {
	ConvertedFile music.ConvertedFile
	Err           error
}

type Converter

type Converter interface {
	OutputFile(id string) string
	TemporaryOutputFile(id string) string
	OutputDirectory() string
	Convert(item Item) error
}

type Item

type Item struct {
	Id   string
	Path string
}

type Store

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

func NewStore

func NewStore(ctx context.Context, log logging.Logger, converter Converter) (*Store, error)

func NewThumbnailStore

func NewThumbnailStore(ctx context.Context, dataDir string) (*Store, error)

func (*Store) GetConvertedFile

func (s *Store) GetConvertedFile(ctx context.Context, id string) (music.ConvertedFile, error)

func (*Store) GetStats

func (s *Store) GetStats() (queries.StoreStats, error)

func (*Store) SetItems

func (s *Store) SetItems(items []Item)

type ThumbnailConverter

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

func NewThumbnailConverter

func NewThumbnailConverter(dataDir string) *ThumbnailConverter

func (*ThumbnailConverter) Convert

func (c *ThumbnailConverter) Convert(item Item) error

func (*ThumbnailConverter) OutputDirectory

func (c *ThumbnailConverter) OutputDirectory() string

func (*ThumbnailConverter) OutputFile

func (c *ThumbnailConverter) OutputFile(id string) string

func (*ThumbnailConverter) TemporaryOutputFile

func (c *ThumbnailConverter) TemporaryOutputFile(id string) string

type TrackConverter

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

func NewTrackConverter

func NewTrackConverter(dataDir string) *TrackConverter

func (*TrackConverter) Convert

func (c *TrackConverter) Convert(item Item) error

func (*TrackConverter) OutputDirectory

func (c *TrackConverter) OutputDirectory() string

func (*TrackConverter) OutputFile

func (c *TrackConverter) OutputFile(id string) string

func (*TrackConverter) TemporaryOutputFile

func (c *TrackConverter) TemporaryOutputFile(id string) string

type TrackStore

type TrackStore struct {
	*Store
	// contains filtered or unexported fields
}

func NewTrackStore

func NewTrackStore(ctx context.Context, dataDir string) (*TrackStore, error)

func (*TrackStore) GetDuration

func (s *TrackStore) GetDuration(id string) time.Duration

func (*TrackStore) SetItems

func (s *TrackStore) SetItems(items []Item)

Jump to

Keyboard shortcuts

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