File tree 3 files changed +23
-4
lines changed
3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,17 @@ wnd.szc_set_config_version = (v = 0) => (cfg.value.version = v);
139
139
</p >
140
140
</div >
141
141
142
+ <div class =" col-12 md:col-6" >
143
+ <label >
144
+ <input type =" checkbox" v-model =" cfg.alwaysUploadAsContent" />
145
+ Always upload as content
146
+ </label >
147
+ <p class =" hint" >
148
+ This will always upload the image content directly, instead of
149
+ as an URL
150
+ </p >
151
+ </div >
152
+
142
153
<span class =" col-12 status-quiet" >{{ versionInfo }}</span >
143
154
</div >
144
155
</TabPanel >
Original file line number Diff line number Diff line change @@ -162,8 +162,12 @@ async function upload() {
162
162
try {
163
163
const post: ScrapedPostDetails = cloneDeep (pop .selectedPost )! ;
164
164
165
- // uploadMode "content" requires a content token to work. So ensure it is set.
166
- if (post .uploadMode == " content" ) {
165
+ // uploadMode "content" requires a content token to work. So ensure it is
166
+ // set. Ignore fallback "Upload as URL" mode as well
167
+ if (
168
+ (cfg .value .alwaysUploadAsContent || post .uploadMode === " content" )
169
+ && post .name !== " [fallback] Upload as URL"
170
+ ) {
167
171
await ensurePostHasContentToken (post );
168
172
}
169
173
@@ -257,7 +261,10 @@ async function ensurePostHasContentToken(post: ScrapedPostDetails) {
257
261
}
258
262
259
263
try {
260
- let tmpRes = await selectedInstance .uploadTempFile (post .contentUrl , post .uploadMode );
264
+ const uploadMode =
265
+ cfg .value .alwaysUploadAsContent && post .name !== " [fallback] Upload as URL" ?
266
+ ' content' : post .uploadMode ;
267
+ let tmpRes = await selectedInstance .uploadTempFile (post .contentUrl , uploadMode );
261
268
// Save contentToken in PostViewModel so that we can reuse it when creating/uploading the post.
262
269
instanceSpecificData .contentToken = tmpRes .token ;
263
270
} catch (ex ) {
@@ -403,7 +410,7 @@ useDark();
403
410
<template >
404
411
<div class =" popup-messages" >
405
412
<div class =" messages" >
406
- <!--
413
+ <!--
407
414
Error messages
408
415
-->
409
416
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const cfg = useStorageLocal(
14
14
{
15
15
version : 0 ,
16
16
addPageUrlToSource : true ,
17
+ alwaysUploadAsContent : false ,
17
18
autoSearchSimilar : false ,
18
19
loadTagCounts : true ,
19
20
fetchPostInfo : true ,
You can’t perform that action at this time.
0 commit comments