Skip to content

Allow overriding individual file type's refresh rates#323

Closed
videah wants to merge 2 commits intobaskerville:masterfrom
videah:file-refresh-override
Closed

Allow overriding individual file type's refresh rates#323
videah wants to merge 2 commits intobaskerville:masterfrom
videah:file-refresh-override

Conversation

@videah
Copy link
Contributor

@videah videah commented Sep 5, 2023

Adds a new setting to change the refresh rate based on a documents file type.

# Override the refresh rate for individual file types.
[reader.refresh-rate.file-types]
epub = { regular = 8, inverted = 2 }
cbz = { regular = 1, inverted = 1 }

The motivation for this is that I prefer partial refreshes for text heavy content like .epub's but want full refreshes for .cbz to prevent ghosting from comic/manga panels.

inverted = 2

# Override the refresh rate for individual file types.
[reader.refresh-rate.file-types]
Copy link
Owner

Choose a reason for hiding this comment

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

The Settings-sample.toml file needs to match the default values.


# Override the refresh rate for individual file types.
[reader.refresh-rate.file-types]
epub = { regular = 8, inverted = 2 }
Copy link
Owner

Choose a reason for hiding this comment

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

The defaults are already this, so the epub key is useless.

pub struct RefreshRateSettings {
pub regular: u8,
pub inverted: u8,
pub file_types: HashMap<String, RefreshRateSettings>,
Copy link
Owner

Choose a reason for hiding this comment

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

Would it be possible for RefreshRateSettings to be non-recursive?

We use the term kind instead of type (a reserved word) as you can see elsewhere in this file.

This new attribute shouldn't be serialized if empty.

@videah videah requested a review from baskerville September 8, 2023 10:54
@videah
Copy link
Contributor Author

videah commented Sep 8, 2023

Included the necessary tweaks, I've made it so the default has CBZ files refreshing every page since it seems like a sane default to me and exposes the functionality in Settings-sample.toml

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.

2 participants