feature: cache article images for offline reading
After fetching articles, all remote images referenced in article content are downloaded to ~/.local/share/net.jeena.FeedTheMonkey/images/ and their src attributes rewritten to file:// URIs. Subsequent loads of the same article (including from the cache on the next startup) display images without a network connection. Metered-connection awareness: image caching is skipped automatically when GIO reports the network connection as metered, regardless of the preference setting. A "Cache Images" toggle in Preferences lets the user disable caching entirely (stored in the cache-images GSettings key). After each refresh, images no longer referenced by any article in the current unread list are deleted from the cache directory to prevent unbounded disk growth.
This commit is contained in:
parent
183191727b
commit
fda441bebd
9 changed files with 186 additions and 12 deletions
|
|
@ -17,6 +17,17 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
|
|||
</child>
|
||||
<child>
|
||||
<object class="AdwPreferencesPage">
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="title" translatable="yes">Images</property>
|
||||
<child>
|
||||
<object class="AdwSwitchRow" id="cache_images_row">
|
||||
<property name="title" translatable="yes">Cache Images</property>
|
||||
<property name="subtitle" translatable="yes">Download images for offline reading (skipped on metered connections)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup">
|
||||
<property name="title" translatable="yes">Content Filters</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue