Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds cover_url and banner_url to API , fixes blades #4388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sometimes-coding
Copy link

@sometimes-coding sometimes-coding commented Dec 19, 2024

Expects url hence cover_url and banner_url, no change has been made to http/TorrentController.php which could probably benefit from this change as well (though you may want to add it as additional option rather than replacement)

Considerations: Imagick needed for compression (if enabled) , better support for varying filetypes while preserving alpha channels if applicable.

Conversion to .webp its old news but lets optimize storage, load times and leverage capabilities to include transparency for applicable no_meta categories. (yes, I've made sure it can grab .jpg for backward compatibility)


Whats with this UrlHelper??

I'm a php baby, so might be a better way to implement this. The idea is to try to keep things read-only so externally hosted is great. However not so reliable. DMCA's anyone? So while whitelists is great for hosting screenshots and whatnot, having nuked covers and banners might not be ideal. Thus this would be a helper where you can configure trusted external hosts (that wont be here today, gone tomorrow) and just display 'em if trusted. Else, we can just download the image, compress and serve it. Obviously safeguards need to be in place so this feature should be able to be turned off. Also could skip download if content-header not known to prevent abuse.

Hope this helps with Issue (#3897)

Copy link

what-the-diff bot commented Dec 19, 2024

PR Summary

  • Added UrlHelper Helper Class
    Handles external URLs and IP ranges verifications.
  • Enhanced TorrentController
    Incorporates UrlHelper, manages image URLs through handleImage and improves store method to assign trusted image URLs to torrents.
  • Revised Torrent model
    New properties cover_url and banner_url included for external image URL management.
  • Database Migration Executed
    Introduced cover_url and banner_url fields to the torrents table.
  • Views Updated
    Image source management revised in multiple templates to cater for local and external URL display.
  • Updated Dependencies
    Installed ext-imagick for image processing.

@bitchcrazy1
Copy link

this would be a welcomed change so bots can upload cover pics when doing music etc

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