Skip to content

Commit

Permalink
move all virtual filesystem config keys into vfs. toml namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed May 6, 2024
1 parent 7bd796b commit 7f40d0a
Show file tree
Hide file tree
Showing 13 changed files with 485 additions and 446 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Great! Next, we'll (1) configure Rosé, (2) mount the virtual filesystem, and fi
# WARNING: The files in this directory WILL be modified by Rosé!
music_source_dir = "~/.music-source"
# The mountpoint for the virtual filesystem.
fuse_mount_dir = "~/music"
vfs.mount_dir = "~/music"
```

The full configuration specification is documented in [Configuration](./docs/CONFIGURATION.md).
Expand Down Expand Up @@ -279,10 +279,10 @@ Great! Next, we'll (1) configure Rosé, (2) mount the virtual filesystem, and fi
synchronization.

Now that the virtual filesystem is mounted, let's go take a look! Navigate to the configured
`fuse_mount_dir`, and you should see your music available in the virtual filesystem!
`vfs.mount_dir`, and you should see your music available in the virtual filesystem!

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ ls -1
'1. Releases'
Expand Down
28 changes: 15 additions & 13 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from rose.cache import CACHE_SCHEMA_PATH, process_string_for_fts, update_cache
from rose.common import VERSION
from rose.config import Config
from rose.config import Config, VirtualFSConfig
from rose.templates import PathTemplateConfig

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -70,29 +70,31 @@ def config(isolated_dir: Path) -> Config:

return Config(
music_source_dir=music_source_dir,
fuse_mount_dir=mount_dir,
cache_dir=cache_dir,
max_proc=2,
artist_aliases_map={},
artist_aliases_parents_map={},
fuse_artists_whitelist=None,
fuse_genres_whitelist=None,
fuse_descriptors_whitelist=None,
fuse_labels_whitelist=None,
fuse_artists_blacklist=None,
fuse_genres_blacklist=None,
fuse_descriptors_blacklist=None,
fuse_labels_blacklist=None,
hide_genres_with_only_new_releases=False,
hide_descriptors_with_only_new_releases=False,
hide_labels_with_only_new_releases=False,
cover_art_stems=["cover", "folder", "art", "front"],
valid_art_exts=["jpg", "jpeg", "png"],
max_filename_bytes=180,
path_templates=PathTemplateConfig.with_defaults(),
rename_source_files=False,
ignore_release_directories=[],
stored_metadata_rules=[],
vfs=VirtualFSConfig(
mount_dir=mount_dir,
artists_whitelist=None,
genres_whitelist=None,
descriptors_whitelist=None,
labels_whitelist=None,
artists_blacklist=None,
genres_blacklist=None,
descriptors_blacklist=None,
labels_blacklist=None,
hide_genres_with_only_new_releases=False,
hide_descriptors_with_only_new_releases=False,
hide_labels_with_only_new_releases=False,
),
)


Expand Down
2 changes: 1 addition & 1 deletion docs/AVAILABLE_COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 mount`: Mount the virtual filesystem onto the configured `$vfs_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
Expand Down
26 changes: 13 additions & 13 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The configuration parameters, with examples, are:
music_source_dir = "~/.music-source"

# The directory to mount the virtual filesystem on.
fuse_mount_dir = "~/music"
vfs.mount_dir = "~/music"

# =======================
# === Optional values ===
Expand Down Expand Up @@ -64,31 +64,31 @@ artist_aliases = [
# and labels are shown. However, if this configuration parameter is specified,
# the list can be restricted to a specific few values. This is useful if you
# only care about a few specific genres and labels.
fuse_artists_whitelist = [ "xxx", "yyy" ]
fuse_genres_whitelist = [ "xxx", "yyy" ]
fuse_descriptors_whitelist = [ "xxx", "yyy" ]
fuse_labels_whitelist = [ "xxx", "yyy" ]
vfs.artists_whitelist = [ "xxx", "yyy" ]
vfs.genres_whitelist = [ "xxx", "yyy" ]
vfs.descriptors_whitelist = [ "xxx", "yyy" ]
vfs.labels_whitelist = [ "xxx", "yyy" ]
# Artists, genres, descriptors, and labels to hide from the virtual filesystem
# navigation. These options remove specific entities from their respective
# top-level virtual filesystem directories. This is useful if there are a few
# values you don't find useful, e.g. a random featuring artist or one super
# niche genre.
#
# These options are mutually exclusive with the fuse_*_whitelist options; if
# These options are mutually exclusive with the *_whitelist options; if
# both are specified for a given entity type, the configuration will not
# validate.
fuse_artists_blacklist = [ "xxx" ]
fuse_genres_blacklist = [ "xxx" ]
fuse_descriptors_blacklist = [ "xxx" ]
fuse_labels_blacklist = [ "xxx" ]
vfs.artists_blacklist = [ "xxx" ]
vfs.genres_blacklist = [ "xxx" ]
vfs.descriptors_blacklist = [ "xxx" ]
vfs.labels_blacklist = [ "xxx" ]

# Whether to hide the genres, descriptors, and labels from new releases from
# being returned in when listing genres/descriptors/labels. This is useful new
# releases are improperly tagged, as those tags tend to be very incorrect by
# default.
hide_genres_with_only_new_releases = true
hide_descriptors_with_only_new_releases = true
hide_labels_with_only_new_releases = true
vfs.hide_genres_with_only_new_releases = true
vfs.hide_descriptors_with_only_new_releases = true
vfs.hide_labels_with_only_new_releases = true

# When Rosé scans a release directory, it looks for cover art that matches:
#
Expand Down
2 changes: 1 addition & 1 deletion docs/METADATA_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ command accepts a Release ID or a Release's virtual filesystem directory name.
So for example:

```bash
$ rose releases edit "$fuse_mount_dir/1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
$ rose releases edit "$vfs_mount_dir/1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
$ rose releases edit "018b4ff1-acdf-7ff1-bcd6-67757aea0fed"
```

Expand Down
22 changes: 11 additions & 11 deletions docs/PLAYLISTS_COLLAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ $ rose playlists create "Evening"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ mkdir "7. Collages/Morning"

Expand All @@ -135,7 +135,7 @@ _Releases and tracks can be added by UUID or path. Rosé accepts both source dir
virtual filesystem paths._

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose collages add-release "Morning" "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
[17:59:38] INFO: Added release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP to collage Morning
Expand All @@ -157,7 +157,7 @@ $ rose playlists add-track "Evening" "018b6514-6fb7-7cc6-9d23-8eaf0b1beee8"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ cp -r "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP" "7. Collages/Morning/"

Expand All @@ -181,7 +181,7 @@ _Releases and tracks can be removed by UUID or path. Rosé accepts both source d
virtual filesystem paths._

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir
$ rose collages remove-release "Morning" "7. Collages/Morning/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
[18:11:43] INFO: Removed release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP from collage Morning
[18:11:43] INFO: Updating cache for collage Morning
Expand All @@ -202,7 +202,7 @@ $ rose playlists remove-track "Evening" "018b6514-6fb7-7cc6-9d23-8eaf0b1beee8"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rmdir "7. Collages/Morning/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"

Expand Down Expand Up @@ -281,7 +281,7 @@ $ rose playlists create "Evening"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rmdir "7. Collages/Morning"

Expand Down Expand Up @@ -327,7 +327,7 @@ $ tree "8. Playlists/"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ mv "7. Collages/Road Trip/" "7. Collages/Long Flight"

Expand All @@ -352,7 +352,7 @@ regardless of the cover art name in the source directory._
Command line:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose playlists set-cover "Shower" ./cover.jpg
[20:51:59] INFO: Set the cover of playlist Shower to cover.jpg
Expand All @@ -372,7 +372,7 @@ filenames. The valid cover art filenames are controlled by and documented in
[Configuration](./CONFIGURATION.md)._

```bash
$ cd $fuse_mount_dir
$ cd $vfsvfs_t_dir

$ mv ~/downloads/cover.jpg "8. Playlists/Shower/cover.jpg"

Expand All @@ -390,7 +390,7 @@ _This operation is playlist-only, as collages do not have their own cover art._
Command line:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose playlists delete-cover "Shower"
[02:10:34] INFO: Deleted cover arts of playlist Lounge
Expand All @@ -405,7 +405,7 @@ $ tree "8. Playlists/Shower/"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rm "8. Playlists/Shower/cover.jpg"

Expand Down
14 changes: 7 additions & 7 deletions docs/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ are supported as well.
This operation is only supported on the command line.

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose releases toggle-new "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
[21:47:52] INFO: Updating cache for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match
Expand Down Expand Up @@ -105,7 +105,7 @@ _The filename of the cover art in the virtual filesystem will always appear as
Command line:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose releases set-cover "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP" ./cover.jpg
[20:43:50] INFO: Set the cover of release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match to cover.jpg
Expand All @@ -128,7 +128,7 @@ filenames. The valid cover art filenames are controlled by and documented in
[Configuration](./CONFIGURATION.md)._

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ mv ~/downloads/cover.jpg "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP/cover.jpg"

Expand All @@ -147,7 +147,7 @@ $ tree "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP/"
This operation is only supported on the command line.

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose releases delete-cover "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
[02:13:17] INFO: Deleted cover arts of release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match
Expand All @@ -171,7 +171,7 @@ the deletion was accidental._
Command line:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose releases delete "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"
[21:56:25] INFO: Trashed release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP
Expand All @@ -191,7 +191,7 @@ $ tree "1. Releases/"
Virtual filesystem:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rmdir "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP"

Expand Down Expand Up @@ -286,7 +286,7 @@ rid of the release while keeping the track(s) you liked.
To demonstrate:

```bash
$ cd $fuse_mount_dir
$ cd $vfs_mount_dir

$ rose releases create-single "1. Releases/ITZY - 2022. CHECKMATE/01.\ SNEAKERS.opus"
[12:16:06] INFO: Created phony single release ITZY - 2022. SNEAKERS
Expand Down
2 changes: 1 addition & 1 deletion docs/VIRTUAL_FILESYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ source directory. Rosé also exposes the `.rose.{uuid}.toml` datafile in the vir
# Hiding Artists, Genres, and Labels

Rosé supports hiding individual artists, genres, and labels in their view directories (`4. Artists`,
`5. Genres`, and `6. Labels`) with the `fuse_x_blacklist` and `fuse_x_whitelist` configuration
`5. Genres`, and `6. Labels`) with the `vfs.x_blacklist` and `vfs.x_whitelist` configuration
parameters. See [Configuration](./CONFIGURATION.md) for additional documentation on configuring the
blacklist or whitelist.

Expand Down
Loading

0 comments on commit 7f40d0a

Please sign in to comment.