[PR #66] [MERGED] [core] Improve Media Handling #70

Closed
opened 2025-10-31 16:56:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/feeddeck/feeddeck/pull/66
Author: @ricoberger
Created: 11/4/2023
Status: Merged
Merged: 11/4/2023
Merged by: @ricoberger

Base: mainHead: core-improve-media-handling-2


📝 Commits (1)

  • 641e50b [core] Improve Media Handling

📊 Changes

14 files changed (+103 additions, -105 deletions)

View changed files

app/lib/utils/image_url.dart (+0 -32)
📝 app/lib/widgets/item/details/item_details_podcast.dart (+3 -15)
📝 app/lib/widgets/item/details/utils/item_description.dart (+3 -11)
📝 app/lib/widgets/item/details/utils/item_media.dart (+3 -7)
📝 app/lib/widgets/item/details/utils/item_media_gallery.dart (+4 -7)
📝 app/lib/widgets/item/preview/item_preview_github.dart (+0 -2)
📝 app/lib/widgets/item/preview/item_preview_googlenews.dart (+0 -2)
📝 app/lib/widgets/item/preview/utils/item_description.dart (+1 -1)
📝 app/lib/widgets/item/preview/utils/item_media.dart (+2 -4)
📝 app/lib/widgets/item/preview/utils/item_media_gallery.dart (+2 -6)
📝 app/lib/widgets/item/preview/utils/item_source.dart (+0 -4)
📝 app/lib/widgets/source/source_icon.dart (+2 -6)
app/lib/widgets/utils/cached_network_image.dart (+61 -0)
📝 supabase/functions/_shared/feed/utils/uploadFile.ts (+22 -8)

📄 Description

This commit improves / simplifies the media handling within the app. Until now we always had to provide the type of the media file (item media / source icon) when we wanted to display it. This is now not necessary anymore. Instead we always display the image from it's original path when the url starts with "http://" or "https://". Additionally we also check the platform to proxy the image request on the web. If the image doesn't start with "http://" or "https://" we always try to display the image from the Supabase storage.

For this we also adjusted the corresponding Deno function, so that we check if the image starts with "http://" or "https://" before we upload it to the Supabase storage. If this is the case we upload the source icon to the Supabase storage. If the upload fails, we will use the original path of the icon.

Last but not least this commit also introduces our own "CachedNetworkImage" widget, which wraps the original "CachedNetworkImage" widget. Our own widget will ensure that we use the correct url for the image request, so that we do not have to use this function all over the app anymore. Later this widget can also be used to introduce our own cache manager.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/feeddeck/feeddeck/pull/66 **Author:** [@ricoberger](https://github.com/ricoberger) **Created:** 11/4/2023 **Status:** ✅ Merged **Merged:** 11/4/2023 **Merged by:** [@ricoberger](https://github.com/ricoberger) **Base:** `main` ← **Head:** `core-improve-media-handling-2` --- ### 📝 Commits (1) - [`641e50b`](https://github.com/feeddeck/feeddeck/commit/641e50bb9ccee2a36d059377d0b9fe198699ff0e) [core] Improve Media Handling ### 📊 Changes **14 files changed** (+103 additions, -105 deletions) <details> <summary>View changed files</summary> ➖ `app/lib/utils/image_url.dart` (+0 -32) 📝 `app/lib/widgets/item/details/item_details_podcast.dart` (+3 -15) 📝 `app/lib/widgets/item/details/utils/item_description.dart` (+3 -11) 📝 `app/lib/widgets/item/details/utils/item_media.dart` (+3 -7) 📝 `app/lib/widgets/item/details/utils/item_media_gallery.dart` (+4 -7) 📝 `app/lib/widgets/item/preview/item_preview_github.dart` (+0 -2) 📝 `app/lib/widgets/item/preview/item_preview_googlenews.dart` (+0 -2) 📝 `app/lib/widgets/item/preview/utils/item_description.dart` (+1 -1) 📝 `app/lib/widgets/item/preview/utils/item_media.dart` (+2 -4) 📝 `app/lib/widgets/item/preview/utils/item_media_gallery.dart` (+2 -6) 📝 `app/lib/widgets/item/preview/utils/item_source.dart` (+0 -4) 📝 `app/lib/widgets/source/source_icon.dart` (+2 -6) ➕ `app/lib/widgets/utils/cached_network_image.dart` (+61 -0) 📝 `supabase/functions/_shared/feed/utils/uploadFile.ts` (+22 -8) </details> ### 📄 Description This commit improves / simplifies the media handling within the app. Until now we always had to provide the type of the media file (item media / source icon) when we wanted to display it. This is now not necessary anymore. Instead we always display the image from it's original path when the url starts with "http://" or "https://". Additionally we also check the platform to proxy the image request on the web. If the image doesn't start with "http://" or "https://" we always try to display the image from the Supabase storage. For this we also adjusted the corresponding Deno function, so that we check if the image starts with "http://" or "https://" before we upload it to the Supabase storage. If this is the case we upload the source icon to the Supabase storage. If the upload fails, we will use the original path of the icon. Last but not least this commit also introduces our own "CachedNetworkImage" widget, which wraps the original "CachedNetworkImage" widget. Our own widget will ensure that we use the correct url for the image request, so that we do not have to use this function all over the app anymore. Later this widget can also be used to introduce our own cache manager. <!-- Keep PR title verbose enough and add prefix telling about what source it touches e.g "[rss] Add feature xyz" or if the the PR is not realated to a source use "[core]", e.g. "[core] Fix xyz". If you add a breaking change within your PR you should add ":warning:" to the title, e.g. ":warning: [core] My breaking change" --> <!-- Description of what have been changed. Please also reference an issue, when available. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-10-31 16:56:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/feeddeck#70