Skip to content

Add pause_when (CI-green follow-up to #246) - #251

Closed
BlivionIaG wants to merge 5 commits into
masterfrom
cursor/pr-246-pause-when-95ef
Closed

BlivionIaG wants to merge 5 commits into
masterfrom
cursor/pr-246-pause-when-95ef

Conversation

@BlivionIaG

Copy link
Copy Markdown
Member

Carries #246 (pause_when) rebased/merged onto current master (includes --dry-run from #244), plus a one-line ruff format fix that was failing CI on #246.

Why a separate PR: after the merge commit was pushed to nyannoying1337:feat/pause-when, further pushes to that fork branch are rejected (maintainer_can_modify is off), so the format fix could not land on #246 itself.

CI fix: tests/test_more.py needed a blank line between TestPauseWhenInTheLoop and TestDryRun (ruff format --check).

Same feature as #246; prefer merging this or re-enabling maintainer edits on #246 and cherry-picking c09eacb.

Open in Web Open in Cursor 

nyannoying1337 and others added 4 commits September 11, 2026 02:33
Discord shows one activity at a time, so while a game or Spotify is
running FetchCord's system info replaces the status the user actually
wants on their profile. There's currently no way to say "let that one
win".

pause_when lists the programs that should. While any of them is running
the presence is cleared and the loop just waits; when they exit it picks
up where it left off. The .exe suffix is optional in both directions, so
one entry works on every platform.

Configurable two ways:

    fetchcord --pause-when steam spotify

or pause_when in fetchcord_conf.yml. The CLI wins. I added the flag
because Config() only ever reads the packaged YAML - there's no
%APPDATA%/XDG lookup - so a config-only version of this would mean
editing files inside site-packages to use it.

Matching is on the whole process name, not a substring, so "steam"
doesn't get triggered by steamwebhelper. The transitions are announced
once each rather than every cycle.

psutil is already a dependency, so nothing new is pulled in.
args.py is a mechanical adjacent insert - master's --install-startup group
and --pause-when both stay.

__main__.py needed a decision. Master hoisted the snapshot out of the cycle
loop (one collection per rotation), and the pause check sat inside that
loop, so a straight merge would have collected a full snapshot on every
rotation while paused - a dozen PowerShell processes on Windows, for a
rotation that sends nothing. The check now runs at the top of the rotation,
ahead of the snapshot, so pausing skips the collection too. Added the
assertion for that to the paused test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WB6HG4WLukGEjhcq8FZJ7A
Resolve conflicts with #244 (--dry-run) by keeping both features:
pause_when and dry-run are adjacent additions to args, __main__, and tests.
Also point the pause loop test at presence.get_component_id after the
resolve_cycle refactor on master.

Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
@BlivionIaG
BlivionIaG marked this pull request as ready for review September 11, 2026 17:50
Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
@BlivionIaG BlivionIaG closed this Sep 11, 2026
@nyannoying1337
nyannoying1337 deleted the cursor/pr-246-pause-when-95ef branch September 20, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants