Skip to content

plugins/rink: Let the user disable rink connecting to the internet - #99

Open
Sntx626 wants to merge 5 commits into
anyrun-org:masterfrom
Sntx626:rink-config-no-internet
Open

plugins/rink: Let the user disable rink connecting to the internet#99
Sntx626 wants to merge 5 commits into
anyrun-org:masterfrom
Sntx626:rink-config-no-internet

Conversation

@Sntx626

@Sntx626 Sntx626 commented Sep 29, 2023

Copy link
Copy Markdown

This PR adds configuration to the rink plugins so that users can disable pulling current currency conversion upon plugin startup.

This stops the rink plugin from connecting to the internet upon startup, as a result the plugin initializes much faster.

A downside is that rink no longer offers currency conversions.

The feature is opt-in, nothing should change as long as the user doesn't specifically disable the pulling of currencies for rink.

@sdaqo

sdaqo commented Jul 5, 2024

Copy link
Copy Markdown

I do not know if this fits in the context of this PR, but how about caching the json file? I know currency conversion changes over time but having it cached for a day or two is probably no big deal and would also speed up init + you do not loose currency conversion. I may open another PR if this ever gets merged...

@Kirottu

Kirottu commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator

Sorry for the late response, but this PR needs a rebase for me to review it.

@aaronjamt

aaronjamt commented Aug 12, 2026

Copy link
Copy Markdown

I'm interested in this, partially for privacy, but more importantly because (without this PR) you can't do calculations without an active internet connection. I'm happy to rebase it for you, if there's a way I'm able to do that (since I didn't open the PR).

@aaronjamt

aaronjamt commented Aug 12, 2026

Copy link
Copy Markdown

Went ahead and rebased it locally so I can use it, see rebased.patch (works for me, apply on current master f3b23bc). Also added the "prefix" config option to the README (add_prefix.patch) for consistency.

rebased.patch
add_prefix.patch

@Sntx626

Sntx626 commented Aug 12, 2026

Copy link
Copy Markdown
Author

@aaronjamt In case you still want to see it upstream with proper contribution, feel free to open a PR against https://github.com/Sntx626/anyrun/tree/rink-config-no-internet and I'll waive it through so that it appears in this PR.

Thanks for the work!

@Sntx626

Sntx626 commented Aug 20, 2026

Copy link
Copy Markdown
Author

@aaronjamt Ok, I was under the impression that GH would display you as a co-author for your own PR qq

It is merged now into this upstream PR ^^

@Sntx626

Sntx626 commented Aug 20, 2026

Copy link
Copy Markdown
Author

@Kirottu This PR has just been rebased and is ready for review.

@Kirottu Kirottu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that minor problem, this looks good to go.

Comment thread plugins/rink/src/lib.rs
#[derive(Deserialize, Debug)]
struct Config {
prefix: String,
pull_currencies: bool,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a #[serde(default = ...)] annotation with a reasonable value (true should be a reasonable default, and preserves existing functionality). Otherwise existing configs would break.

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