mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-03-08 22:52:02 -05:00
[PR #66] [MERGED] [core] Improve Media Handling #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
main← Head: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.