Skip to content

Commit

Permalink
Update thumbnail paths (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshokanneko authored Jun 23, 2022
1 parent 553a801 commit 3056739
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
3 changes: 1 addition & 2 deletions ui/constants/cdn_urls.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
33 changes: 8 additions & 25 deletions ui/redux/actions/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 3056739

Please sign in to comment.