diff --git a/README.md b/README.md index b0fcf04..d1e2fa5 100644 --- a/README.md +++ b/README.md @@ -260,19 +260,13 @@ finally (3) play music! ```bash $ rose fs mount - [15:41:13] INFO: Refreshing the read cache for 5 releases - [15:41:13] INFO: Applying cache updates for release BLACKPINK - 2016. SQUARE TWO - [15:41:13] INFO: Applying cache updates for release BLACKPINK - 2016. SQUARE ONE - [15:41:13] INFO: Applying cache updates for release LOOΠΔ - 2017. Kim Lip - [15:41:13] INFO: Applying cache updates for release NewJeans - 2022. Ditto - [15:41:13] INFO: Applying cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - [15:41:13] INFO: Evicting cached releases that are not on disk - [15:41:13] INFO: Refreshing the read cache for 1 collages - [15:41:13] INFO: Applying cache updates for collage Road Trip - [15:41:13] INFO: Evicting cached collages that are not on disk - [15:41:13] INFO: Refreshing the read cache for 1 playlists - [15:41:13] INFO: Applying cache updates for playlist Shower - [15:41:13] INFO: Evicting cached playlists that are not on disk + [15:41:13] INFO: Updating cache for release BLACKPINK - 2016. SQUARE TWO + [15:41:13] INFO: Updating cache for release BLACKPINK - 2016. SQUARE ONE + [15:41:13] INFO: Updating cache for release LOOΠΔ - 2017. Kim Lip + [15:41:13] INFO: Updating cache for release NewJeans - 2022. Ditto + [15:41:13] INFO: Updating cache for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match + [15:41:13] INFO: Updating cache for collage Road Trip + [15:41:13] INFO: Updating cache for playlist Shower ``` Rosé emits log lines whenever something significant is occurring. This is diff --git a/docs/METADATA_MANAGEMENT.md b/docs/METADATA_MANAGEMENT.md index 059f524..9dc4d26 100644 --- a/docs/METADATA_MANAGEMENT.md +++ b/docs/METADATA_MANAGEMENT.md @@ -128,11 +128,11 @@ CHUU - 2023. Howl/05. Hitchhiker.opus Write changes to 5 tracks? [Y/n] y [01:10:58] INFO: Writing tag changes for rule matcher=trackartist,albumartist:CHUU action=matched:CHUU::replace:Chuu -[01:10:58] INFO: Writing tag changes to CHUU - 2023. Howl/01. Howl.opus -[01:10:58] INFO: Writing tag changes to CHUU - 2023. Howl/02. Underwater.opus -[01:10:58] INFO: Writing tag changes to CHUU - 2023. Howl/03. My Palace.opus -[01:10:58] INFO: Writing tag changes to CHUU - 2023. Howl/04. Aliens.opus -[01:10:58] INFO: Writing tag changes to CHUU - 2023. Howl/05. Hitchhiker.opus +[01:10:58] INFO: Wrote tag changes to CHUU - 2023. Howl/01. Howl.opus +[01:10:58] INFO: Wrote tag changes to CHUU - 2023. Howl/02. Underwater.opus +[01:10:58] INFO: Wrote tag changes to CHUU - 2023. Howl/03. My Palace.opus +[01:10:58] INFO: Wrote tag changes to CHUU - 2023. Howl/04. Aliens.opus +[01:10:58] INFO: Wrote tag changes to CHUU - 2023. Howl/05. Hitchhiker.opus Applied tag changes to 5 tracks! ``` @@ -166,13 +166,13 @@ LOOΠΔ - 2017. Chuu/02. Girl's Talk.opus Write changes to 7 tracks? [Y/n] y [01:14:57] INFO: Writing tag changes for rule matcher=trackartist,albumartist:Chuu action=genre::replace-all:K-Pop -[01:14:57] INFO: Writing tag changes to CHUU - 2023. Howl/01. Howl.opus -[01:14:57] INFO: Writing tag changes to CHUU - 2023. Howl/02. Underwater.opus -[01:14:57] INFO: Writing tag changes to CHUU - 2023. Howl/03. My Palace.opus -[01:14:57] INFO: Writing tag changes to CHUU - 2023. Howl/04. Aliens.opus -[01:14:57] INFO: Writing tag changes to CHUU - 2023. Howl/05. Hitchhiker.opus -[01:14:57] INFO: Writing tag changes to LOOΠΔ - 2017. Chuu/01. Heart Attack.opus -[01:14:57] INFO: Writing tag changes to LOOΠΔ - 2017. Chuu/02. Girl's Talk.opus +[01:14:57] INFO: Wrote tag changes to CHUU - 2023. Howl/01. Howl.opus +[01:14:57] INFO: Wrote tag changes to CHUU - 2023. Howl/02. Underwater.opus +[01:14:57] INFO: Wrote tag changes to CHUU - 2023. Howl/03. My Palace.opus +[01:14:57] INFO: Wrote tag changes to CHUU - 2023. Howl/04. Aliens.opus +[01:14:57] INFO: Wrote tag changes to CHUU - 2023. Howl/05. Hitchhiker.opus +[01:14:57] INFO: Wrote tag changes to LOOΠΔ - 2017. Chuu/01. Heart Attack.opus +[01:14:57] INFO: Wrote tag changes to LOOΠΔ - 2017. Chuu/02. Girl's Talk.opus Applied tag changes to 7 tracks! ``` diff --git a/docs/PLAYLISTS_COLLAGES.md b/docs/PLAYLISTS_COLLAGES.md index eb192ca..acce523 100644 --- a/docs/PLAYLISTS_COLLAGES.md +++ b/docs/PLAYLISTS_COLLAGES.md @@ -88,13 +88,11 @@ Command line: ```bash $ rose collages create "Morning" [17:51:22] INFO: Creating collage Morning in source directory -[17:51:22] INFO: Refreshing the read cache for 1 collages -[17:51:22] INFO: Applying cache updates for collage Morning +[17:51:22] INFO: Updating cache for collage Morning $ rose playlists create "Evening" [17:51:47] INFO: Creating playlist Evening in source directory -[17:51:47] INFO: Refreshing the read cache for 1 playlists -[17:51:47] INFO: Applying cache updates for playlist Evening +[17:51:47] INFO: Updating cache for playlist Evening ``` Virtual filesystem: @@ -129,18 +127,15 @@ globally unique._ ```bash $ rose collages add-release "Morning" "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" [17:59:38] INFO: Added release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] to collage Morning -[17:59:38] INFO: Refreshing the read cache for 1 collages -[17:59:38] INFO: Applying cache updates for collage Morning +[17:59:38] INFO: Updating cache for collage Morning $ rose collages add-release "Morning" "018b268e-ef68-7180-a01e-19bc3fdf970e" [17:59:44] INFO: Added release BLACKPINK - 2016. SQUARE TWO - Single [Dance-Pop;K-Pop] to collage Morning -[17:59:44] INFO: Refreshing the read cache for 1 collages -[17:59:44] INFO: Applying cache updates for collage Morning +[17:59:44] INFO: Updating cache for collage Morning $ rose playlists add-track "Evening" "018b6514-6fb7-7cc6-9d23-8eaf0b1beee8" [18:02:21] INFO: Added track LOOΠΔ ODD EYE CIRCLE - Chaotic.opus to playlist Evening -[18:02:21] INFO: Refreshing the read cache for 1 playlists -[18:02:21] INFO: Applying cache updates for playlist Evening +[18:02:21] INFO: Updating cache for playlist Evening ``` Virtual filesystem: @@ -175,18 +170,15 @@ globally unique._ ```bash $ rose collages remove-release "Morning" "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" [18:11:43] INFO: Removed release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] from collage Morning -[18:11:43] INFO: Refreshing the read cache for 1 collages -[18:11:43] INFO: Applying cache updates for collage Morning +[18:11:43] INFO: Updating cache for collage Morning $ rose collages remove-release "Morning" "018b268e-ef68-7180-a01e-19bc3fdf970e" [18:12:03] INFO: Removed release BLACKPINK - 2016. SQUARE TWO - Single [Dance-Pop;K-Pop] from collage Morning -[18:12:03] INFO: Refreshing the read cache for 1 collages -[18:12:03] INFO: Applying cache updates for collage Morning +[18:12:03] INFO: Updating cache for collage Morning $ rose playlists remove-track "Evening" "018b6514-6fb7-7cc6-9d23-8eaf0b1beee8" [18:12:22] INFO: Removed track LOOΠΔ ODD EYE CIRCLE - Chaotic.opus from playlist Evening -[18:12:22] INFO: Refreshing the read cache for 1 playlists -[18:12:22] INFO: Applying cache updates for playlist Evening +[18:12:22] INFO: Updating cache for playlist Evening ``` Virtual filesystem: @@ -224,8 +216,7 @@ LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] BLACKPINK - 2016. SQUARE TWO - Single [Dance-Pop;K-Pop] # And the logs printed to stderr are: [18:20:53] INFO: Edited collage Road Trip from EDITOR -[18:20:53] INFO: Refreshing the read cache for 1 collages -[18:20:53] INFO: Applying cache updates for collage Road Trip +[18:20:53] INFO: Updating cache for collage Road Trip $ tree "7. Collages/Road Trip/" 7. Collages/Road Trip/ @@ -243,8 +234,7 @@ BLACKPINK - PLAYING WITH FIRE.opus LOOΠΔ ODD EYE CIRCLE - Chaotic.opus # And the logs printed to stderr are: [18:22:42] INFO: Edited playlist Shower from EDITOR -[18:22:42] INFO: Refreshing the read cache for 1 playlists -[18:22:42] INFO: Applying cache updates for playlist Shower +[18:22:42] INFO: Updating cache for playlist Shower $ tree "8. Playlists/Shower/" 8. Playlists/Shower/ @@ -262,13 +252,11 @@ Command line: ```bash $ rose collages delete "Morning" -[18:23:44] INFO: Deleting collage Morning from source directory -[18:23:44] INFO: Evicting cached collages that are not on disk +[18:23:44] INFO: Deleted collage Morning from source directory [18:23:44] INFO: Evicted collage Morning from cache $ rose playlists create "Evening" -[18:26:38] INFO: Deleting playlist Evening from source directory -[18:26:38] INFO: Evicting cached playlists that are not on disk +[18:26:38] INFO: Deleted playlist Evening from source directory [18:26:38] INFO: Evicted playlist Evening from cache ``` @@ -301,10 +289,8 @@ Command line: ```bash $ rose collages rename "Road Trip" "Long Flight" -[18:29:08] INFO: Renaming collage Road Trip to Long Flight -[18:29:08] INFO: Refreshing the read cache for 1 collages -[18:29:08] INFO: Applying cache updates for collage Long Flight -[18:29:08] INFO: Evicting cached collages that are not on disk +[18:29:08] INFO: Renamed collage Road Trip to Long Flight +[18:29:08] INFO: Updating cache for collage Long Flight [18:29:08] INFO: Evicted collage Road Trip from cache $ tree "7. Collages/" @@ -312,10 +298,8 @@ $ tree "7. Collages/" └── Long Flight/... $ rose playlists rename "Shower" "Meal Prep" -[18:30:17] INFO: Renaming playlist Shower to Meal Prep -[18:30:17] INFO: Refreshing the read cache for 1 playlists -[18:30:17] INFO: Applying cache updates for playlist Meal Prep -[18:30:17] INFO: Evicting cached playlists that are not on disk +[18:30:17] INFO: Renamed playlist Shower to Meal Prep +[18:30:17] INFO: Updating cache for playlist Meal Prep [18:30:17] INFO: Evicted playlist Shower from cache $ tree "8. Playlists/" @@ -355,8 +339,7 @@ $ cd $fuse_mount_dir $ rose playlists set-cover "Shower" ./cover.jpg [20:51:59] INFO: Set the cover of playlist Shower to cover.jpg -[20:51:59] INFO: Refreshing the read cache for 1 playlists -[20:51:59] INFO: Applying cache updates for playlist Shower +[20:51:59] INFO: Updating cache for playlist Shower $ tree "8. Playlists/Shower/" 8. Playlists/Shower/ @@ -394,8 +377,7 @@ $ cd $fuse_mount_dir $ rose playlists remove-cover "Shower" [02:10:34] INFO: Deleted cover arts of playlist Lounge -[02:10:34] INFO: Refreshing the read cache for 1 playlists -[02:10:34] INFO: Applying cache updates for playlist Lounge +[02:10:34] INFO: Updating cache for playlist Lounge $ tree "8. Playlists/Shower/" 8. Playlists/Shower/ diff --git a/docs/VIRTUAL_FILESYSTEM.md b/docs/VIRTUAL_FILESYSTEM.md index 738f24c..9d9bdcc 100644 --- a/docs/VIRTUAL_FILESYSTEM.md +++ b/docs/VIRTUAL_FILESYSTEM.md @@ -110,11 +110,9 @@ Command line: $ cd $fuse_mount_dir $ rose releases toggle-new "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" -[21:47:52] INFO: Refreshing the read cache for 1 releases -[21:47:52] INFO: Applying cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match -[21:47:52] INFO: Refreshing the read cache for 1 collages +[21:47:52] INFO: Updating cache for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match [21:47:52] INFO: Updating release descriptions for Long Flight -[21:47:52] INFO: Applying cache updates for collage Long Flight +[21:47:52] INFO: Updating cache for collage Long Flight $ tree "2. Releases - New/" 2. Releases - New/ @@ -122,11 +120,9 @@ $ tree "2. Releases - New/" └── {NEW} LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]/... $ rose releases toggle-new "{NEW} LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" -[21:49:36] INFO: Refreshing the read cache for 1 releases -[21:49:36] INFO: Applying cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match -[21:49:36] INFO: Refreshing the read cache for 1 collages +[21:49:36] INFO: Updating cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match [21:49:36] INFO: Updating release descriptions for Long Flight -[21:49:36] INFO: Applying cache updates for collage Long Flight +[21:49:36] INFO: Updating cache for collage Long Flight $ tree "2. Releases - New/" 2. Releases - New/ @@ -164,8 +160,7 @@ $ cd $fuse_mount_dir $ rose releases set-cover "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" ./cover.jpg [20:43:50] INFO: Set the cover of release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match to cover.jpg -[20:43:50] INFO: Refreshing the read cache for 1 releases -[20:43:50] INFO: Applying cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match +[20:43:50] INFO: Updating cache for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match $ tree "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]/" 1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [K-Pop]/ @@ -207,8 +202,7 @@ $ cd $fuse_mount_dir $ rose releases remove-cover "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" [02:13:17] INFO: Deleted cover arts of release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match -[02:13:17] INFO: Refreshing the read cache for 1 releases -[02:13:17] INFO: Applying cache updates for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match +[02:13:17] INFO: Updating cache for release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match $ tree "1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]/" 1. Releases/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [K-Pop]/ @@ -248,12 +242,10 @@ $ cd $fuse_mount_dir $ rose releases delete "LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop]" [21:56:25] INFO: Trashed release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] -[21:56:25] INFO: Evicting cached releases that are not on disk [21:56:25] INFO: Evicted release /home/blissful/demo/source/LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match from cache -[21:56:25] INFO: Refreshing the read cache for 1 collages -[21:56:25] INFO: Removing nonexistent release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] from collage Long Flight +[21:56:25] INFO: Marking missing release LOOΠΔ ODD EYE CIRCLE - 2017. Mix & Match - EP [Dance-Pop;Future Bass;K-Pop] as missing in collage Long Flight [21:56:25] INFO: Updating release descriptions for Long Flight -[21:56:25] INFO: Applying cache updates for collage Long Flight +[21:56:25] INFO: Updating cache for collage Long Flight $ tree "1. Releases/" 1. Releases/ diff --git a/rose/cache.py b/rose/cache.py index 5814164..8249c2a 100644 --- a/rose/cache.py +++ b/rose/cache.py @@ -290,7 +290,7 @@ def update_cache(c: Config, force: bool = False) -> None: def update_cache_evict_nonexistent_releases(c: Config) -> None: - logger.info("Evicting cached releases that are not on disk") + logger.debug("Evicting cached releases that are not on disk") dirs = [Path(d.path).resolve() for d in os.scandir(c.music_source_dir) if d.is_dir()] with connect(c) as conn: cursor = conn.execute( @@ -302,7 +302,7 @@ def update_cache_evict_nonexistent_releases(c: Config) -> None: [str(d) for d in dirs], ) for row in cursor: - logger.info(f"Evicted release {row['source_path']} from cache") + logger.info(f"Evicted missing release {row['source_path']} from cache") def update_cache_for_releases( @@ -340,9 +340,9 @@ def update_cache_for_releases( and d.name not in c.ignore_release_directories ] if not release_dirs: - logger.info("No-Op: No whitelisted releases passed into update_cache_for_releases") + logger.debug("No-Op: No whitelisted releases passed into update_cache_for_releases") return - logger.info(f"Refreshing the read cache for {len(release_dirs)} releases") + logger.debug(f"Refreshing the read cache for {len(release_dirs)} releases") if len(release_dirs) < 10: logger.debug(f"Refreshing cached data for {', '.join([r.name for r in release_dirs])}") @@ -602,7 +602,7 @@ def _update_cache_for_releases_executor( upd_collage_release_dirnames: dict[str, str] = {} upd_playlist_track_filenames: dict[str, str] = {} for source_path, preexisting_release_id, files in dir_tree: - logger.debug(f"Updating release {source_path.name}") + logger.debug(f"Scanning release {source_path.name}") # Check to see if we should even process the directory. If the directory does not have # any tracks, skip it. And if it does not have any tracks, but is in the cache, remove # it from the cache. @@ -671,7 +671,7 @@ def _update_cache_for_releases_executor( with contextlib.suppress(Exception): release_id_from_first_file = AudioTags.from_file(first_audio_file).release_id if release_id_from_first_file is not None and not force: - logger.info( + logger.warning( f"No-Op: Skipping release at {source_path}: files in release already have " f"release_id {release_id_from_first_file}, but .rose.{{uuid}}.toml is missing, " "is another tool in the middle of writing the directory? Run with --force to " @@ -985,7 +985,7 @@ def _update_cache_for_releases_executor( # Schedule database executions. if unknown_cached_tracks or release_dirty or track_ids_to_insert: - logger.info(f"Applying cache updates for release {source_path.name}") + logger.info(f"Updating cache for release {source_path.name}") if unknown_cached_tracks: logger.debug(f"Deleting {len(unknown_cached_tracks)} unknown tracks from cache") @@ -1316,7 +1316,7 @@ def update_cache_for_collages( continue if collage_names is None or path.stem in collage_names: files.append((path.resolve(), path.stem, f)) - logger.info(f"Refreshing the read cache for {len(files)} collages") + logger.debug(f"Refreshing the read cache for {len(files)} collages") cached_collages: dict[str, CachedCollage] = {} with connect(c) as conn: @@ -1380,8 +1380,8 @@ def update_cache_for_collages( # disappearance)? they are recovered in the collage. for rls in releases: if not rls.get("missing", False) and rls["uuid"] not in existing_release_ids: - logger.info( - f"Marking release {rls['description_meta']} " + logger.warning( + f"Marking missing release {rls['description_meta']} " f"as missing in collage {cached_collage.name}" ) rls["missing"] = True @@ -1415,13 +1415,13 @@ def update_cache_for_collages( # Update the collage on disk if we have changed information. if releases != original_releases: - logger.info(f"Updating release descriptions for {cached_collage.name}") + logger.debug(f"Updating release descriptions for {cached_collage.name}") data["releases"] = releases with source_path.open("wb") as fp: tomli_w.dump(data, fp) cached_collage.source_mtime = str(os.stat(source_path).st_mtime) - logger.info(f"Applying cache updates for collage {cached_collage.name}") + logger.info(f"Updating cache for collage {cached_collage.name}") conn.execute( """ INSERT INTO collages (name, source_mtime) VALUES (?, ?) @@ -1451,7 +1451,7 @@ def update_cache_for_collages( def update_cache_evict_nonexistent_collages(c: Config) -> None: - logger.info("Evicting cached collages that are not on disk") + logger.debug("Evicting cached collages that are not on disk") collage_names: list[str] = [] for f in os.scandir(c.music_source_dir / "!collages"): p = Path(f.path) @@ -1468,7 +1468,7 @@ def update_cache_evict_nonexistent_collages(c: Config) -> None: collage_names, ) for row in cursor: - logger.info(f"Evicted collage {row['name']} from cache") + logger.info(f"Evicted missing collage {row['name']} from cache") def update_cache_for_playlists( @@ -1504,7 +1504,7 @@ def update_cache_for_playlists( continue if playlist_names is None or path.stem in playlist_names: files.append((path.resolve(), path.stem, f)) - logger.info(f"Refreshing the read cache for {len(files)} playlists") + logger.debug(f"Refreshing the read cache for {len(files)} playlists") cached_playlists: dict[str, CachedPlaylist] = {} with connect(c) as conn: @@ -1590,8 +1590,8 @@ def update_cache_for_playlists( # disappearance)? they are recovered in the playlist. for trk in tracks: if not trk.get("missing", False) and trk["uuid"] not in existing_track_ids: - logger.info( - f"Marking track {trk['description_meta']} " + logger.warning( + f"Marking missing track {trk['description_meta']} " f"as missing in playlist {cached_playlist.name}" ) trk["missing"] = True @@ -1625,13 +1625,13 @@ def update_cache_for_playlists( # Update the playlist on disk if we have changed information. if tracks != original_tracks: - logger.info(f"Updating track descriptions for {cached_playlist.name}") + logger.debug(f"Updating track descriptions for {cached_playlist.name}") data["tracks"] = tracks with source_path.open("wb") as fp: tomli_w.dump(data, fp) cached_playlist.source_mtime = str(os.stat(source_path).st_mtime) - logger.info(f"Applying cache updates for playlist {cached_playlist.name}") + logger.info(f"Updating cache for playlist {cached_playlist.name}") conn.execute( """ INSERT INTO playlists (name, source_mtime, cover_path) VALUES (?, ?, ?) @@ -1667,7 +1667,7 @@ def update_cache_for_playlists( def update_cache_evict_nonexistent_playlists(c: Config) -> None: - logger.info("Evicting cached playlists that are not on disk") + logger.debug("Evicting cached playlists that are not on disk") playlist_names: list[str] = [] for f in os.scandir(c.music_source_dir / "!playlists"): p = Path(f.path) @@ -1684,7 +1684,7 @@ def update_cache_evict_nonexistent_playlists(c: Config) -> None: playlist_names, ) for row in cursor: - logger.info(f"Evicted playlist {row['name']} from cache") + logger.info(f"Evicted missing playlist {row['name']} from cache") def list_releases( diff --git a/rose/cli.py b/rose/cli.py index 9c41046..a339911 100644 --- a/rose/cli.py +++ b/rose/cli.py @@ -121,9 +121,9 @@ def unwatch(ctx: Context) -> None: exit(1) with ctx.config.watchdog_pid_path.open("r") as fp: pid = int(fp.read()) - logger.info(f"Killing watchdog at process {pid}") try: os.kill(pid, signal.SIGTERM) + logger.info(f"Killed watchdog at process {pid}") except ProcessLookupError: logger.info(f"No-Op: Process {pid} not found") ctx.config.watchdog_pid_path.unlink() diff --git a/rose/collages.py b/rose/collages.py index 038fa07..74dfa2f 100644 --- a/rose/collages.py +++ b/rose/collages.py @@ -46,7 +46,7 @@ def create_collage(c: Config, name: str) -> None: if path.exists(): raise CollageAlreadyExistsError(f"Collage {name} already exists") path.touch() - logger.info(f"Creating collage {name} in source directory") + logger.info(f"Created collage {name} in source directory") update_cache_for_collages(c, [name], force=True) @@ -56,12 +56,11 @@ def delete_collage(c: Config, name: str) -> None: if not path.exists(): raise CollageDoesNotExistError(f"Collage {name} does not exist") send2trash(path) - logger.info(f"Deleting collage {name} from source directory") + logger.info(f"Deleted collage {name} from source directory") update_cache_evict_nonexistent_collages(c) def rename_collage(c: Config, old_name: str, new_name: str) -> None: - logger.info(f"Renaming collage {old_name} to {new_name}") old_path = collage_path(c, old_name) new_path = collage_path(c, new_name) with lock(c, collage_lock_name(old_name)), lock(c, collage_lock_name(new_name)): @@ -83,6 +82,7 @@ def rename_collage(c: Config, old_name: str, new_name: str) -> None: logger.debug( "Renaming collage-adjacent file {old_adjacent_file} to {new_adjacent_file}" ) + logger.info(f"Renamed collage {old_name} to {new_name}") update_cache_for_collages(c, [new_name], force=True) update_cache_evict_nonexistent_collages(c) diff --git a/rose/playlists.py b/rose/playlists.py index 9ef7cde..cf08a88 100644 --- a/rose/playlists.py +++ b/rose/playlists.py @@ -48,7 +48,7 @@ def create_playlist(c: Config, name: str) -> None: if path.exists(): raise PlaylistAlreadyExistsError(f"Playlist {name} already exists") path.touch() - logger.info(f"Creating playlist {name} in source directory") + logger.info(f"Created playlist {name} in source directory") update_cache_for_playlists(c, [name], force=True) @@ -58,12 +58,12 @@ def delete_playlist(c: Config, name: str) -> None: if not path.exists(): raise PlaylistDoesNotExistError(f"Playlist {name} does not exist") send2trash(path) - logger.info(f"Deleting playlist {name} from source directory") + logger.info(f"Deleted playlist {name} from source directory") update_cache_evict_nonexistent_playlists(c) def rename_playlist(c: Config, old_name: str, new_name: str) -> None: - logger.info(f"Renaming playlist {old_name} to {new_name}") + logger.info(f"Renamed playlist {old_name} to {new_name}") old_path = playlist_path(c, old_name) new_path = playlist_path(c, new_name) with lock(c, playlist_lock_name(old_name)), lock(c, playlist_lock_name(new_name)): @@ -104,7 +104,7 @@ def remove_track_from_playlist( old_tracks = data.get("tracks", []) new_tracks = [r for r in old_tracks if r["uuid"] != track_id] if old_tracks == new_tracks: - logger.info(f"No-Op: track {track_filename} not in playlist {playlist_name}") + logger.info(f"No-Op: Track {track_filename} not in playlist {playlist_name}") return data["tracks"] = new_tracks with path.open("wb") as fp: diff --git a/rose/rules.py b/rose/rules.py index 44ee323..bd5f7cb 100644 --- a/rose/rules.py +++ b/rose/rules.py @@ -276,12 +276,13 @@ def execute_metadata_rule( for tags, changes in actionable_audiotags: if tags.release_id: changed_release_ids.add(tags.release_id) - logger.info(f"Writing tag changes to {tags.path}") pathtext = str(tags.path).lstrip(str(c.music_source_dir) + "/") logger.debug( - f"{pathtext} changes: {' //// '.join([str(x)+' -> '+str(y) for _, x, y in changes])}" + f"Attempting to write {pathtext} changes: " + f"{' //// '.join([str(x)+' -> '+str(y) for _, x, y in changes])}" ) tags.flush() + logger.info(f"Wrote tag changes to {tags.path}") click.echo() click.echo(f"Applied tag changes to {len(actionable_audiotags)} tracks!") diff --git a/rose/watcher.py b/rose/watcher.py index 869c04d..8ce8916 100644 --- a/rose/watcher.py +++ b/rose/watcher.py @@ -163,14 +163,14 @@ async def event_processor(c: Config, queue: Queue[WatchdogEvent]) -> None: # pr debounce_times[key] = time.time() if event.collage: - logger.info( + logger.debug( f"Updating cache in response to {event.type} event on collage {event.collage}" ) await handle_event(c, event) continue if event.playlist: - logger.info( + logger.debug( f"Updating cache in response to {event.type} event on playlist {event.playlist}" ) await handle_event(c, event) @@ -179,7 +179,7 @@ async def event_processor(c: Config, queue: Queue[WatchdogEvent]) -> None: # pr assert event.release is not None # Launch the handler with the sleep asynchronously. This allows us to not block the main # thread, but insert a delay before processing the release. - logger.info( + logger.debug( f"Updating cache in response to {event.type} event on release {event.release.name}" ) asyncio.create_task(handle_event(c, event, 2))