nextcloud / appstore

:convenience_store: App Store for Nextcloud
https://apps.nextcloud.com
GNU Affero General Public License v3.0
297 stars 135 forks source link

Download images into media folder when importing screenshots #361

Open BernhardPosselt opened 7 years ago

BernhardPosselt commented 7 years ago

When importing screenshots at https://github.com/nextcloud/appstore/blob/master/nextcloudappstore/core/api/v1/release/importer.py#L134 the real screenshots should be downloaded into the media folder at MEDIA_ROOT/APP_ID/screenshots/NUMBER.EXT where

Example: media/news/screenshots/1.jpg

Previously stored images should be removed upon successful import

In addition the maximum screenshot size should be limited to a configurable setting in base.py, default: MAX_DOWNLOAD_IMG_SIZE = (1024*2) 2 # 2 MB To achieve that refactor https://github.com/nextcloud/appstore/blob/master/nextcloudappstore/core/api/v1/release/downloader.py#L28 so that a downloader can download any file

The image URLs should then be changed to relative path from the MEDIA_ROOT, e.g. news/screenshots/1.jpg. Finally serializers and the web interface need to be adjusted

Deleting apps ofc also gets rid of the screenshots

nursoda commented 2 years ago

Not sure why this is still open as images seem to be cached meanwhile (see #925). Current solution seems to be a redirection (dynamic loading through the app store).