Skip to content

Commit

Permalink
part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Nov 3, 2023
1 parent e2effd5 commit 1c16764
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 132 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The rules engine allows you to pattern match tracks in your music library and
apply tag changes to them. For example:

```bash
$ rose metadata run-rule 'trackartist,albumartist:^CHUU$' 'replace:Chuu'
$ rose rules run 'trackartist,albumartist:^CHUU$' 'replace:Chuu'

CHUU - 2023. Howl/01. Howl.opus
trackartist[main]: ['CHUU'] -> ['Chuu']
Expand Down Expand Up @@ -242,13 +242,15 @@ Options:
--help Show this message and exit.

Commands:
cache Manage the read cache.
collages Manage collages.
completion Print a shell completion script.
fs Manage the virtual library.
metadata Run metadata improvement tools
playlists Manage playlists.
releases Manage releases.
cache Manage the read cache
collages Manage collages
fs Manage the virtual filesystem
gen-completion Generate a shell completion script
playlists Manage playlists
releases Manage releases
tracks Manage tracks
reload Reload the configuration of active Rosé processes
rules Run metadata update rules on the entire library
```

> [!NOTE]
Expand Down Expand Up @@ -375,12 +377,14 @@ on scripting with Rosé.
For additional documentation, please refer to the following files:

- [Configuration](./docs/CONFIGURATION.md)
- [Browsing with the Virtual Filesystem](./docs/VIRTUAL_FILESYSTEM.md)
- [Available Commands](./docs/AVAILABLE_COMMANDS.md)
- [Browsing the Virtual Filesystem](./docs/VIRTUAL_FILESYSTEM.md)
- [Managing Releases](./docs/RELEASES.md)
- [Managing Playlists & Collages](./docs/PLAYLISTS_COLLAGES.md)
- [Managing Your Music Metadata](./docs/METADATA_MANAGEMENT.md)
- [Using Playlists & Collages](./docs/PLAYLISTS_COLLAGES.md)
- [Maintaining the Cache](./docs/CACHE_MAINTENANCE.md)
- [Tagging Conventions](./docs/TAGGING_CONVENTIONS.md)
- [Shell Scripting](./docs/SHELL_SCRIPTING.md)
- [Tagging Conventions](./docs/TAGGING_CONVENTIONS.md)
- [Architecture](./docs/ARCHITECTURE.md)

# License
Expand Down
79 changes: 79 additions & 0 deletions docs/AVAILABLE_COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Available Commands

This document enumerates the commands available in Rosé's CLI.

First, a quick note on the structure: Rosé primarily organizes commands by the
resource they effect. Most commands are of the structure `rose {resource} {action}`.

- `fs/` _(See [Browsing with the Virtual Filesystem](./VIRTUAL_FILESYSTEM.md))_
- `fs mount`: Mount the virtual filesystem onto the configured `$fuse_mount_dir`.
- `fs unmount`: Unmount the virtual filesystem by invoking `umount`.
- `cache/` _(See [Maintaining the Cache](./CACHE_MAINTENANCE.md))_
- `cache update`: Scan the source directory and update the read cache with
any new metadata changes.
- `cache watch`: Start a watcher that will trigger `cache update` for any
files and directories that have been modified.
- `cache unwatch`: Kill the running cache watcher process.
- `releases/` _(See [Managing Releases](./RELEASES.md))_
- `releases print`: Print a single release's metadata in JSON.
- `releases print-all`: Print all releases' metadata in JSON, with an
optional matcher rule to filter out releases.
- `releases import`: Import a release directory into the managed source
- directory.
- `releases edit`: Edit a release's metadata as a text file in your
`$EDITOR`.
- `releases toggle-new`: Toggle the "new"-ness of a release.
- `releases delete`: Remove a release from the library and move its source
files to the trash bin.
- `releases set-cover`: Set the cover art for a release. Replaces any
existing cover art.
- `releases delete-cover`: Set the cover art for a release. Replaces any
existing cover art.
- `releases extract-covers`: Extract embedded cover arts in all releases into
external cover art files.
- `releases run-rule`: Run one or more metadata actions on all tracks in the
release.
- `releases add-metadata-url`: Associate an external metadata URL to the release.
- `releases search-metadata-urls`: Search for external metadata URLs to
associate with the release.
- `releases download-metadata`: Download metadata from associated URLs and
suggest metadata improvements.
- `releases create-single`: Create a "phony" single release from a track and
copy the track into the new release.
- `tracks/`
- `tracks print`: Print a single track's metadata in JSON.
- `tracks print-all`: Print all tracks' metadata in JSON, with an optional
matcher rule to filter out tracks.
- `tracks run-rule`: Run one or more metadata actions on a track.
- `collages/` _(See [Managing Playlists & Collages](./PLAYLISTS_COLLAGES.md))_
- `collages print`: Print a single collage's metadata in JSON.
- `collages print-all`: Print all collages' metadata in JSON.
- `collages create`: Create a new collage.
- `collages edit`: Edit the releases in a collage as a text file. Supports
reordering and removing releases.
- `collages delete`: Delete a collage. The collage's release list is moved to
the trash bin.
- `collages rename`: Rename a collage.
- `collages add-release`: Add a release to a collage.
- `collages remove-release`: Remove a release from a collage.
- `playlists/` _(See [Managing Playlists & Collages](./PLAYLISTS_COLLAGES.md))_
- `playlists print`: Print a single playlist's metadata in JSON.
- `playlists print-all`: Print all playlists' metadata in JSON.
- `playlists create`: Create a new playlist.
- `playlists edit`: Edit the tracks in a playlist as a text file. Supports
reordering and removing tracks.
- `playlists delete`: Delete a playlist. The playlist's track list is moved to
the trash bin.
- `playlists rename`: Rename a playlist.
- `playlists add-track`: Add a track to a playlist.
- `playlists remove-track`: Remove a track from a playlist.
- `playlists set-cover`: Set the cover art for a playlist. Replaces any existing
cover art.
- `playlists delete-cover`: Remove the cover art of a playlist.
- `rules/` _(See [Managing Your Music Metadata](./METADATA_MANAGEMENT.md))_
- `rules run`: Run an ad hoc rule in the command line interface. You can also
easily test rules with the `--dry-run` flag.
- `rules run-stored`: Run the rules stored in the configuration file.
- `reload`: Informs any active processes, meaning the Virtual Filesystem and
Cache Watcher, to reload their configurations from disk.
- `gen-completion`: Print a shell completion script for Rosé to stdout.
13 changes: 7 additions & 6 deletions docs/CACHE_MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ changes made _through_ Rosé. Any updates made through the virtual filesystem or
command line automatically trigger a cache update for the changed files. Rosé
will also update the cache when the virtual filesystem is mounted.

However, even with that improvement, you would still need to run `rose cache
update` automatically whenever changes are made directly to the source
directory. Thus, Rosé provides the `rose cache watch` command, which runs a
watcher that listens for file update events in the source directory. This
watcher will trigger a cache update whenever a file in the source directory
changes.
However, even with that improvement, if you directly change the source
directory with a tool that isn't Rosé, the cache will not automatically update
in response. If you make all edits through Rosé, then this isn't a problem! But
for users with other tools that directly edit the source directory, Rosé
provides the `rose cache watch` command, which runs a watcher that listens for
file update events in the source directory. This watcher will trigger a cache
update whenever a file in the source directory changes.

# Cache Resets

Expand Down
10 changes: 7 additions & 3 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,26 @@ cache_dir = "~/.cache/rose"
max_proc = 4
```

# Reloading

TBD

# Shell Completion

Rosé supports optional shell completion for the `bash`, `zsh`, and `fish`
shells. The following commands enable shell completion:

```bash
# Bash
$ rose completion bash > ~/.config/rose/completion.bash
$ rose gen-completion bash > ~/.config/rose/completion.bash
$ echo ". ~/.config/rose/.completion.bash" >> ~/.bashrc

# Zsh
$ rose completion zsh > ~/.config/rose/completion.zsh
$ rose gen-completion zsh > ~/.config/rose/completion.zsh
$ echo ". ~/.config/rose/.completion.zsh" >> ~/.zshrc

# Fish
$ rose completion fish > ~/.config/fish/completions/rose.fish
$ rose gen-completion fish > ~/.config/fish/completions/rose.fish
```

# Systemd
Expand Down
10 changes: 5 additions & 5 deletions docs/METADATA_MANAGEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ To run an ad hoc rule from the command line, use the following command:

```bash
# Accepts one or more actions.
$ rose metadata run-rule [matcher] [action]...
$ rose rules run [matcher] [action]...
```

Rules can also be stored in the configuration file to be ran on future
Expand All @@ -132,7 +132,7 @@ two of Chuu's releases, but the first is tagged as `CHUU`, and the second as
this change:

```bash
$ rose metadata run-rule 'trackartist,albumartist:^CHUU$' 'replace:Chuu'
$ rose rules run 'trackartist,albumartist:^CHUU$' 'replace:Chuu'

CHUU - 2023. Howl/01. Howl.opus
trackartist[main]: ['CHUU'] -> ['Chuu']
Expand Down Expand Up @@ -169,7 +169,7 @@ K-Pop genre. The following rule expresses that: for all releases with the
albumartist `Chuu`, add the `K-Pop` genre tag.

```bash
$ rose metadata run-rule 'albumartist:^Chuu$' 'genre::add:K-Pop'
$ rose rules run 'albumartist:^Chuu$' 'genre::add:K-Pop'

CHUU - 2023. Howl/01. Howl.opus
genre: [] -> ['K-Pop']
Expand Down Expand Up @@ -204,7 +204,7 @@ Success! However, notice that one of Chuu's releases has the genre tag `Kpop`.
Let's convert that `Kpop` tag to `K-Pop`, across the board.

```bash
$ rose metadata run-rule 'genre:^Kpop$' 'replace:K-Pop'
$ rose rules run 'genre:^Kpop$' 'replace:K-Pop'

G‐Dragon - 2012. ONE OF A KIND/01. One Of A Kind.opus
genre: ['Kpop'] -> ['K-Pop']
Expand Down Expand Up @@ -420,7 +420,7 @@ The formal syntax is defined by the following grammar:
You can preview a rule's changes with the `--dry-run` flag. For example:

```bash
$ rose metadata run-rule --dry-run 'albumartist:^Chuu$' 'genre::add:K-Pop'
$ rose rules run --dry-run 'albumartist:^Chuu$' 'genre::add:K-Pop'

CHUU - 2023. Howl/01. Howl.opus
genre: [] -> ['K-Pop']
Expand Down
2 changes: 1 addition & 1 deletion docs/PLAYLISTS_COLLAGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Using Playlists & Collages
# Managing Playlists & Collages

Rosé supports the creation and management of collages (lists of releases) and
playlists (lists of tracks).
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ For an introduction to Rosé, please visit the [README](../README.md).
For more detailed documentation, please visit the following files:

- [Configuration](./CONFIGURATION.md)
- [Browsing with the Virtual Filesystem](./VIRTUAL_FILESYSTEM.md)
- [Available Commands](./AVAILABLE_COMMANDS.md)
- [Browsing the Virtual Filesystem](./VIRTUAL_FILESYSTEM.md)
- [Managing Playlists & Collages](./PLAYLISTS_COLLAGES.md)
- [Managing Releases](./RELEASES.md)
- [Managing Your Music Metadata](./METADATA_MANAGEMENT.md)
- [Using Playlists & Collages](./PLAYLISTS_COLLAGES.md)
- [Maintaining the Cache](./CACHE_MAINTENANCE.md)
- [Shell Scripting](./SHELL_SCRIPTING.md)
- [Tagging Conventions](./docs/TAGGING_CONVENTIONS.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/VIRTUAL_FILESYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ directory name. NEW releases have their virtual directory name prefixed with

By default, Rosé flags releases as new when they are first imported.

NEW-ness has no effects besides prefixing the directory name with `{NEW}` and
adding the release to the `2. Releases - New` top-level directory. NEW-ness is
"New"-ness has no effects besides prefixing the directory name with `{NEW}` and
adding the release to the `2. Releases - New` top-level directory. "New"-ness is
designed for you, the human operator, to edit manually.

Rosé tracks NEW-ness within a release's `.rose.{uuid}.toml` file. See
Rosé tracks "new"-ness within a release's `.rose.{uuid}.toml` file. See
[Architecture](./ARCHITECTURE.md) for more information about this file.

# Hiding Artists, Genres, and Labels
Expand Down Expand Up @@ -110,7 +110,7 @@ All command line commands accept releases in three formats:
3. The path to the release in the virtual filesystem. The virtual filesystem
must be mounted for this format to work.

## Toggle Release NEW-ness
## Toggle Release "new"-ness

Command line:

Expand Down
Loading

0 comments on commit 1c16764

Please sign in to comment.