parent
7c5c4d3ccd
commit
9e07ee1594
|
|
@ -139,6 +139,17 @@ wnd.szc_set_config_version = (v = 0) => (cfg.value.version = v);
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 md:col-6">
|
||||
<label>
|
||||
<input type="checkbox" v-model="cfg.alwaysUploadAsContent" />
|
||||
Always upload as content
|
||||
</label>
|
||||
<p class="hint">
|
||||
This will always upload the image content directly, instead of
|
||||
as an URL
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<span class="col-12 status-quiet">{{ versionInfo }}</span>
|
||||
</div>
|
||||
</TabPanel>
|
||||
|
|
|
|||
|
|
@ -162,8 +162,12 @@ async function upload() {
|
|||
try {
|
||||
const post: ScrapedPostDetails = cloneDeep(pop.selectedPost)!;
|
||||
|
||||
// uploadMode "content" requires a content token to work. So ensure it is set.
|
||||
if (post.uploadMode == "content") {
|
||||
// uploadMode "content" requires a content token to work. So ensure it is
|
||||
// set. Ignore fallback "Upload as URL" mode as well
|
||||
if (
|
||||
(cfg.value.alwaysUploadAsContent || post.uploadMode === "content")
|
||||
&& post.name !== "[fallback] Upload as URL"
|
||||
) {
|
||||
await ensurePostHasContentToken(post);
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +261,10 @@ async function ensurePostHasContentToken(post: ScrapedPostDetails) {
|
|||
}
|
||||
|
||||
try {
|
||||
let tmpRes = await selectedInstance.uploadTempFile(post.contentUrl, post.uploadMode);
|
||||
const uploadMode =
|
||||
cfg.value.alwaysUploadAsContent && post.name !== "[fallback] Upload as URL" ?
|
||||
'content' : post.uploadMode;
|
||||
let tmpRes = await selectedInstance.uploadTempFile(post.contentUrl, uploadMode);
|
||||
// Save contentToken in PostViewModel so that we can reuse it when creating/uploading the post.
|
||||
instanceSpecificData.contentToken = tmpRes.token;
|
||||
} catch (ex) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export const cfg = useStorageLocal(
|
|||
{
|
||||
version: 0,
|
||||
addPageUrlToSource: true,
|
||||
alwaysUploadAsContent: false,
|
||||
autoSearchSimilar: false,
|
||||
loadTagCounts: true,
|
||||
fetchPostInfo: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue