Skip to content

Commit 4e923a7

Browse files
committed
cloud: fix short lived regression
1 parent b5593d6 commit 4e923a7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

plugins/cloud/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
{
3-
"scrypted.debugHost": "127.0.0.1",
3+
"scrypted.debugHost": "scrypted-nvr",
44
}

plugins/cloud/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/cloud/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@
5353
"@types/node": "^22.1.0",
5454
"ts-node": "^10.9.2"
5555
},
56-
"version": "0.2.34"
56+
"version": "0.2.35"
5757
}

plugins/cloud/src/main.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,10 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
729729
}
730730

731731
async convertMedia(data: string | Buffer | any, fromMimeType: string, toMimeType: string, options?: MediaObjectOptions): Promise<MediaObject | Buffer | any> {
732-
if (toMimeType !== ScryptedMimeTypes.Url)
732+
if (!toMimeType.startsWith(ScryptedMimeTypes.Url))
733733
throw new Error('unsupported cloud url conversion');
734734

735-
if (fromMimeType === ScryptedMimeTypes.LocalUrl) {
735+
if (fromMimeType.startsWith(ScryptedMimeTypes.LocalUrl)) {
736736
// if cloudflare is enabled and the plugin isn't set up as a custom domain, try to use the cloudflare url for
737737
// short lived urls.
738738
if (this.cloudflareTunnel && this.storageSettings.values.forwardingMode !== 'Custom Domain') {
@@ -746,7 +746,7 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
746746
}
747747
return this.whitelist(data.toString(), 10 * 365 * 24 * 60 * 60 * 1000, `https://${this.getHostname()}`);
748748
}
749-
else if (fromMimeType === ScryptedMimeTypes.PushEndpoint) {
749+
else if (fromMimeType.startsWith(ScryptedMimeTypes.PushEndpoint)) {
750750
const validDomain = this.getSSLHostname();
751751
if (validDomain)
752752
return Buffer.from(`https://${validDomain}${await this.getCloudMessagePath()}/${data}`);

0 commit comments

Comments
 (0)