Debug 2
This commit is contained in:
parent
c9601c33c3
commit
2f87c3cf5a
|
@ -46,7 +46,7 @@ export default function Slideshow() {
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
log.info("Rendering slideshow", { loading, imageURL, nextImageURL });
|
console.log("Rendering slideshow", { loading, imageURL, nextImageURL });
|
||||||
|
|
||||||
if (loading) return <PairedSuccessfullyOverlay />;
|
if (loading) return <PairedSuccessfullyOverlay />;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { shuffled } from "@/utils/array";
|
||||||
import { ensure, ensureString } from "@/utils/ensure";
|
import { ensure, ensureString } from "@/utils/ensure";
|
||||||
import ComlinkCryptoWorker from "@ente/shared/crypto";
|
import ComlinkCryptoWorker from "@ente/shared/crypto";
|
||||||
import HTTPService from "@ente/shared/network/HTTPService";
|
import HTTPService from "@ente/shared/network/HTTPService";
|
||||||
import { getCastFileURL, getEndpoint } from "@ente/shared/network/api";
|
import { getCastFileURL, getCastThumbnailURL, getEndpoint } from "@ente/shared/network/api";
|
||||||
import { wait } from "@ente/shared/utils";
|
import { wait } from "@ente/shared/utils";
|
||||||
import { detectMediaMIMEType } from "services/detect-type";
|
import { detectMediaMIMEType } from "services/detect-type";
|
||||||
import {
|
import {
|
||||||
|
@ -140,7 +140,8 @@ export const renderableImageURLs = async function* (castData: CastData) {
|
||||||
if (urls.length < 4) continue;
|
if (urls.length < 4) continue;
|
||||||
|
|
||||||
const oldestURL = urls.shift();
|
const oldestURL = urls.shift();
|
||||||
if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL);
|
console.log("Not revoking", oldestURL);
|
||||||
|
// if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL);
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
||||||
const urlPair: RenderableImageURLPair = [
|
const urlPair: RenderableImageURLPair = [
|
||||||
|
@ -298,7 +299,7 @@ const downloadFile = async (castToken: string, file: EnteFile) => {
|
||||||
if (!isImageOrLivePhoto(file))
|
if (!isImageOrLivePhoto(file))
|
||||||
throw new Error("Can only cast images and live photos");
|
throw new Error("Can only cast images and live photos");
|
||||||
|
|
||||||
const url = getCastFileURL(file.id);
|
const url = getCastThumbnailURL(file.id);
|
||||||
const resp = await HTTPService.get(
|
const resp = await HTTPService.get(
|
||||||
url,
|
url,
|
||||||
null,
|
null,
|
||||||
|
@ -312,7 +313,7 @@ const downloadFile = async (castToken: string, file: EnteFile) => {
|
||||||
const cryptoWorker = await ComlinkCryptoWorker.getInstance();
|
const cryptoWorker = await ComlinkCryptoWorker.getInstance();
|
||||||
const decrypted = await cryptoWorker.decryptFile(
|
const decrypted = await cryptoWorker.decryptFile(
|
||||||
new Uint8Array(resp.data),
|
new Uint8Array(resp.data),
|
||||||
await cryptoWorker.fromB64(file.file.decryptionHeader),
|
await cryptoWorker.fromB64(file.thumbnail.decryptionHeader),
|
||||||
file.key,
|
file.key,
|
||||||
);
|
);
|
||||||
return new Response(decrypted).blob();
|
return new Response(decrypted).blob();
|
||||||
|
|
Loading…
Reference in a new issue