Skip to content

Add pause_when so FetchCord stops overriding other statuses - #246

Merged
BlivionIaG merged 3 commits into
fetchcord:masterfrom
nyannoying1337:feat/pause-when
Sep 11, 2026
Merged

BlivionIaG merged 3 commits into
fetchcord:masterfrom
nyannoying1337:feat/pause-when

Conversation

@nyannoying1337

Copy link
Copy Markdown
Contributor

From the Discord list.

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.

Why the flag as well as the config key: Config() only ever reads the packaged YAML - there's no %APPDATA%/XDG lookup anywhere - so a config-only version of this would mean editing files inside site-packages to use it. Happy to drop the flag if you'd rather fix config discovery first and keep the surface smaller.

Matching is on the whole process name rather than a substring, so steam isn't triggered by steamwebhelper. The transitions are announced once each rather than every cycle, since this is checked once per cycle.

psutil is already a dependency, so nothing new is pulled in.

nyannoying1337 and others added 3 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 fetchcord#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>
@BlivionIaG
BlivionIaG merged commit 8ce5bba into fetchcord:master Sep 11, 2026
11 of 12 checks passed
cursor Bot pushed a commit that referenced this pull request Sep 11, 2026
#246 left one blank line missing between TestPauseWhenInTheLoop and
TestDryRun, which fails CI's ruff format --check on master.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BlivionIaG <BlivionIaG@users.noreply.github.com>
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