Skip to content

Commit

Permalink
clean up api surface (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline authored May 6, 2024
1 parent 7f40d0a commit 8cb4d4f
Show file tree
Hide file tree
Showing 15 changed files with 515 additions and 502 deletions.
187 changes: 114 additions & 73 deletions rose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,46 @@
UnsupportedFiletypeError,
)
from rose.cache import (
STORED_DATA_FILE_REGEX,
CachedRelease,
CachedTrack,
Collage,
DescriptorEntry,
GenreEntry,
LabelEntry,
Playlist,
Release,
Track,
artist_exists,
calculate_release_logtext,
calculate_track_logtext,
collage_exists,
collage_lock_name,
descriptor_exists,
genre_exists,
get_collage,
get_path_of_track_in_playlist,
get_collage_releases,
get_playlist,
get_playlist_cover_path,
get_playlist_tracks,
get_release,
get_track,
get_tracks_associated_with_release,
get_tracks_of_release,
label_exists,
list_artists,
list_collages,
list_descriptors,
list_genres,
list_labels,
list_playlists,
lock,
make_release_logtext,
make_track_logtext,
maybe_invalidate_cache_database,
playlist_exists,
playlist_lock_name,
release_lock_name,
release_within_collage,
track_within_playlist,
track_within_release,
update_cache,
update_cache_evict_nonexistent_collages,
update_cache_evict_nonexistent_playlists,
update_cache_evict_nonexistent_releases,
update_cache_for_collages,
update_cache_for_playlists,
update_cache_for_releases,
)
from rose.collages import (
Expand All @@ -47,6 +58,8 @@
)
from rose.common import (
VERSION,
Artist,
ArtistMapping,
RoseError,
RoseExpectedError,
initialize_logging,
Expand Down Expand Up @@ -82,95 +95,123 @@
from rose.templates import (
PathContext,
PathTemplate,
eval_release_template,
eval_track_template,
evaluate_release_template,
evaluate_track_template,
preview_path_templates,
)
from rose.tracks import dump_all_tracks, dump_track, run_actions_on_track
from rose.watcher import start_watchdog

__all__ = [
"AudioTags",
"CachedRelease",
"CachedTrack",
# Plumbing
"initialize_logging",
"VERSION",
# Errors
"RoseError",
"RoseExpectedError",
"UnsupportedFiletypeError",
# Utilities
"sanitize_dirname",
"sanitize_filename",
"make_release_logtext",
"make_track_logtext",
"SUPPORTED_AUDIO_EXTENSIONS",
# Configuration
"Config",
"DescriptorEntry",
"GenreEntry",
"LabelEntry",
# Cache
"maybe_invalidate_cache_database",
"update_cache",
"update_cache_evict_nonexistent_collages",
"update_cache_evict_nonexistent_playlists",
"update_cache_evict_nonexistent_releases",
"update_cache_for_collages",
"update_cache_for_playlists",
"update_cache_for_releases",
# Locks
"lock",
"release_lock_name",
"collage_lock_name",
"playlist_lock_name",
# Tagging
"AudioTags",
# Rule Engine
"MetadataAction",
"MetadataMatcher",
"MetadataRule",
"execute_metadata_rule",
"execute_stored_metadata_rules",
"run_actions_on_release",
"run_actions_on_track",
# Path Templates
"PathContext",
"PathTemplate",
"RoseError",
"RoseExpectedError",
"STORED_DATA_FILE_REGEX", # TODO: Revise: is_release_directory / is_track_file
"SUPPORTED_AUDIO_EXTENSIONS",
"UnsupportedFiletypeError",
"VERSION",
"add_release_to_collage",
"add_track_to_playlist",
"artist_exists",
"calculate_release_logtext", # TODO: Rename.
"calculate_track_logtext", # TODO: Rename.
"collage_exists",
"create_collage",
"create_playlist",
"evaluate_release_template",
"evaluate_track_template",
"preview_path_templates",
# Releases
"Release",
"create_single_release",
"delete_collage",
"delete_playlist",
"delete_playlist_cover_art",
"delete_release",
"delete_release_cover_art",
"descriptor_exists",
"dump_all_collages",
"dump_all_playlists",
"dump_all_releases",
"dump_all_tracks",
"dump_collage",
"dump_playlist",
"dump_release",
"dump_track",
"edit_collage_in_editor", # TODO: Move editor part to CLI, make this file-submissions.
"edit_playlist_in_editor", # TODO: Move editor part to CLI, make this file-submissions.
"edit_release",
"eval_release_template", # TODO: Rename.
"eval_track_template", # TODO: Rename.
"execute_metadata_rule",
"execute_stored_metadata_rules",
"genre_exists",
"get_collage",
"get_path_of_track_in_playlist", # TODO: Redesign.
"get_playlist",
"get_playlist_cover_path", # TODO: Remove.
"get_release",
"set_release_cover_art",
"toggle_release_new",
# Tracks
"Track",
"dump_all_tracks",
"dump_track",
"get_track",
"get_tracks_associated_with_release", # TODO: Rename: `get_tracks_of_release` / `dump_release(with_tracks=tracks)`
"label_exists",
"get_tracks_of_release",
"track_within_release",
# Artists
"Artist",
"ArtistMapping",
"artist_exists",
"list_artists",
"list_collages",
"list_descriptors",
# Genres
"GenreEntry",
"list_genres",
"genre_exists",
# Descriptors
"DescriptorEntry",
"list_descriptors",
"descriptor_exists",
# Labels
"LabelEntry",
"list_labels",
"list_playlists",
"maybe_invalidate_cache_database",
"playlist_exists",
"preview_path_templates",
"label_exists",
# Collages
"Collage",
"add_release_to_collage",
"create_collage",
"delete_collage",
"dump_all_collages",
"dump_collage",
"edit_collage_in_editor", # TODO: Move editor part to CLI, make this file-submissions.
"get_collage",
"get_collage_releases",
"list_collages",
"remove_release_from_collage",
"remove_track_from_playlist",
"release_within_collage",
"rename_collage",
# Playlists
"Playlist",
"add_track_to_playlist",
"list_playlists",
"create_playlist",
"delete_playlist",
"delete_playlist_cover_art",
"get_playlist",
"get_playlist_tracks",
"dump_all_playlists",
"dump_playlist",
"edit_playlist_in_editor", # TODO: Move editor part to CLI, make this file-submissions.
"track_within_playlist",
"remove_track_from_playlist",
"rename_playlist",
"run_actions_on_release",
"run_actions_on_track",
"sanitize_dirname",
"sanitize_filename",
"set_playlist_cover_art",
"set_release_cover_art",
"start_watchdog",
"toggle_release_new",
"update_cache",
"update_cache_for_releases",
"initialize_logging",
]

initialize_logging(__name__)
Loading

0 comments on commit 8cb4d4f

Please sign in to comment.