Update thumbnail paths (#1747)

This commit is contained in:
Rave | 図書館猫 2022-06-23 22:33:32 +02:00 committed by GitHub
parent 553a801bc3
commit 305673999b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 27 deletions

View file

@ -1,5 +1,4 @@
export const IMG_CDN_PUBLISH_URL = 'https://thumbs.odycdn.com/upload.php';
export const IMG_CDN_STATUS_URL = 'https://thumbs.odycdn.com/status.php';
export const IMG_CDN_PUBLISH_URL = 'https://thumbs.odycdn.com/upload';
export const JSON_RESPONSE_KEYS = Object.freeze({
STATUS: 'type',

View file

@ -20,7 +20,7 @@ import { push } from 'connected-react-router';
import analytics from 'analytics';
import { doOpenModal } from 'redux/actions/app';
import { CC_LICENSES, COPYRIGHT, OTHER, NONE, PUBLIC_DOMAIN } from 'constants/licenses';
import { IMG_CDN_PUBLISH_URL, IMG_CDN_STATUS_URL } from 'constants/cdn_urls';
import { IMG_CDN_PUBLISH_URL } from 'constants/cdn_urls';
import * as THUMBNAIL_STATUSES from 'constants/thumbnail_upload_statuses';
import { creditsToString } from 'util/format-credits';
import Lbry from 'lbry';
@ -381,30 +381,13 @@ export const doResetThumbnailStatus = () => (dispatch: Dispatch) => {
},
});
return fetch(IMG_CDN_STATUS_URL)
.then((res) => res.json())
.then((json) => {
if (json.status !== 'online') {
throw Error();
}
return dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM,
data: {
uploadThumbnailStatus: THUMBNAIL_STATUSES.READY,
thumbnail: '',
},
});
})
.catch(() =>
dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM,
data: {
uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN,
thumbnail: '',
},
})
);
return dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM,
data: {
uploadThumbnailStatus: THUMBNAIL_STATUSES.READY,
thumbnail: '',
},
});
};
export const doBeginPublish = (name: string) => (dispatch: Dispatch) => {