musli

package module
v0.0.0-...-d45de67 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 13 Imported by: 0

README

musli — music library

A music library interface with a focus on albums. Unlike most consumer music programs, musli doesn't include an audio player. Instead, it relies on the media player you already have installed (see: Compatible media players). Likewise, the program doesn't include any methods to edit metadata, requiring that your music files already be properly tagged.

Written in Go with a SQLite database.

Install

go install github.com/micahco/musli/cmd/musli

Options

Run musli --help for a list of options and how to use them.

Configuration

musli uses a TOML configuration file. Each key has a default value.

The config file is located at: ~/.config/musli/config.toml on Unix systems. This file will not be created automatically.

See config.toml for an example.

Parameters
MusicDir

Default: "~/Music"

Recursively find music files in said directory.

ExecCmd

Default: "mpv"

Command to be executed for album playback. The individual paths for each track of the selected album will be passed as arguments to the command.

The command executed will look something like this:

mpv /path/to/ablum/track1.mp3 /path/to/ablum/track2.mp3 ...

CursorColor

Default: "5" // magenta

Refer to charm's Lip Gloss for valid color codes.

ShowStdout / ShowStderr:

Default: both false

Prints the command's stdout/stderr while the media player is running. Useful for debugging. Should only enable one at a time. If both are set to true, stdout takes precedence and stderr will not be printed.

Compatible media players

Any media player that follows the following pattern should work.

cmd [options] files...

Tested:

  • mpv
  • vlc
  • mplayer
  • parole

Flatpak versions should work as well (i.e. flatpak run io.mpv.Mpv).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPathToLibrary

func AddPathToLibrary(path string, db *sql.DB) error

func CloseDB

func CloseDB(db *sql.DB) error

func FetchTrackPaths

func FetchTrackPaths(db *sql.DB) ([]string, error)

func GetMusicDirPaths

func GetMusicDirPaths(dir string) ([]string, error)

func OpenDB

func OpenDB(path string) (*sql.DB, error)

func PlayAlbum

func PlayAlbum(albumID int64, execCmd string, showOut bool, showErr bool, db *sql.DB) error

func RemoveEmptyAlbums

func RemoveEmptyAlbums(db *sql.DB) error

func RemoveNotExistPath

func RemoveNotExistPath(path string, db *sql.DB) error

Types

type Album

type Album struct {
	ID          int64
	AlbumArtist string
	Name        string
	Year        int
}

func FetchAlbumsByAlbumArtist

func FetchAlbumsByAlbumArtist(asc bool, db *sql.DB) ([]Album, error)

func FetchAlbumsByQuery

func FetchAlbumsByQuery(query string, db *sql.DB) ([]Album, error)

func FetchAlbumsByRandom

func FetchAlbumsByRandom(db *sql.DB) ([]Album, error)

func FetchAlbumsByYear

func FetchAlbumsByYear(asc bool, db *sql.DB) ([]Album, error)

func FindAlbumsByYear

func FindAlbumsByYear(query []string, db *sql.DB) ([]Album, error)

type Track

type Track struct {
	AlbumID     int64
	Disc        int
	Path        string
	TrackNumber int
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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