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

Obscene Images from unsplash.com at NextCloud #59

Closed
vodkabashful opened this issue May 19, 2020 · 5 comments · Fixed by #60
Closed

Obscene Images from unsplash.com at NextCloud #59

vodkabashful opened this issue May 19, 2020 · 5 comments · Fixed by #60

Comments

@vodkabashful
Copy link

Sometimes we get obscene images as nextcloud login /download background pictures, is it possible to filter such images?
001

@marius-wieschollek
Copy link
Contributor

With the unsplash random image url we can not spcify what should not be on the image.

But maybe we can fetch the image from https://source.unsplash.com/featured/?nature,wallpaper. This is also random but from their featured collection (and not all images) and those seem to be more sfw.

@newhinton
Copy link
Contributor

That is most unfortunate!

I will have to look at the api, but it seems they have a filter for that:
https://unsplash.com/documentation#content-safety

you can try to edit the url to your liking if you have write access to the appdir

@robinmetral
Copy link
Contributor

robinmetral commented May 31, 2020

@newhinton this param wouldn't work because it's from the Unsplash API, and this plugin uses the Source API: https://source.unsplash.com/

It seems that the URL is already trying to get an image from the featured images:

background-image : url('https://source.unsplash.com/random/featured/?nature') !important;

But the API is used incorrectly. random shouldn't be in the URL, and therefore images aren't only those in the featured collection.

Here's a demo (note: I appended daily to all links in the demo to compare the results together):

The following URL will return the random daily image from the "featured" collection, with search param "nature": https://source.unsplash.com/featured/daily?nature

With random in the URL (https://source.unsplash.com/random/featured/daily?nature), as it is at present in this plugin, the image isn't the one from the featured collection, but from the broader random daily image: https://source.unsplash.com/random/daily?nature.

In short: with the current URL, featured is ignored, hence the unwanted images.

@newhinton
Copy link
Contributor

@robinmetral Sadly, i cannot replicate the issue (due to the random nature of the issue). However, i have confirmed that your changes are working, therefore i will give it a try and i will release it.

@newhinton
Copy link
Contributor

I prepared an release which should pop up soon in your instances

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 a pull request may close this issue.

4 participants