chore(fix): deprecate pexels, explanation to come

This commit is contained in:
David Ralph
2023-09-15 23:28:56 +01:00
parent e385dc6503
commit a035b70841
17 changed files with 19 additions and 58 deletions

View File

@@ -180,11 +180,7 @@ export default class BackgroundSettings extends PureComponent {
{
name: 'Unsplash',
value: 'unsplash',
},
{
name: 'Pexels',
value: 'pexels',
},
}
]}
name="backgroundAPI"
category="background"

View File

@@ -107,10 +107,8 @@ export default class Background extends PureComponent {
let requestURL, data;
switch (backgroundAPI) {
case 'unsplash':
requestURL = `${variables.constants.API_URL}/images/unsplash?categories=${apiCategories}&quality=${apiQuality}`;
break;
case 'pexels':
requestURL = `${variables.constants.API_URL}/images/pexels?quality=${apiQuality}`;
requestURL = `${variables.constants.API_URL}/images/unsplash?categories=${apiCategories}&quality=${apiQuality}`;
break;
// Defaults to Mue
default:
@@ -129,7 +127,7 @@ export default class Background extends PureComponent {
let photoURL, photographerURL;
if (backgroundAPI === 'unsplash' || backgroundAPI === 'pexels') {
if (backgroundAPI === 'unsplash') {
photoURL = data.photo_page;
photographerURL = data.photographer_page;
}

View File

@@ -68,48 +68,29 @@ function PhotoInformation({ info, url, api }) {
return null;
}
// remove unsplash and pexels text
// remove unsplash text
const unsplash = variables.getMessage('widgets.background.unsplash');
const pexels = variables.getMessage('widgets.background.pexels');
let credit = info.credit;
let photo = variables.getMessage('widgets.background.credit');
// unsplash and pexels credit
// unsplash credit
if (info.photographerURL && info.photographerURL !== '' && !info.offline && api) {
if (api === 'unsplash') {
photo = (
<a href={info.photoURL + '?utm_source=mue'} target="_blank" rel="noopener noreferrer">
{photo}
photo = (
<a href={info.photoURL + '?utm_source=mue'} target="_blank" rel="noopener noreferrer">
{photo}
</a>
);
credit = (
<>
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
{info.credit}
</a>{' '}
<a href="https://unsplash.com?utm_source=mue" target="_blank" rel="noopener noreferrer">
{unsplash}
</a>
);
credit = (
<>
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
{info.credit}
</a>{' '}
<a href="https://unsplash.com?utm_source=mue" target="_blank" rel="noopener noreferrer">
{unsplash}
</a>
</>
);
} else {
photo = (
<a href={info.photoURL} target="_blank" rel="noopener noreferrer">
{photo}
</a>
);
credit = (
<>
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
{info.credit}
</a>{' '}
<a href="https://pexels.com" target="_blank" rel="noopener noreferrer">
{pexels}
</a>
</>
);
}
</>
);
}
const ddgProxy = localStorage.getItem('ddgProxy') === 'true';