diff --git a/commons/src/interfaces/websites/bluesky/bluesky.file.options.interface.ts b/commons/src/interfaces/websites/bluesky/bluesky.file.options.interface.ts index 52ae0e97..5daeb87b 100644 --- a/commons/src/interfaces/websites/bluesky/bluesky.file.options.interface.ts +++ b/commons/src/interfaces/websites/bluesky/bluesky.file.options.interface.ts @@ -4,5 +4,5 @@ export interface BlueskyFileOptions extends DefaultFileOptions { altText?: string; label_rating: string; replyToUrl?: string; - threadgate: string; + threadgate?: string; } diff --git a/commons/src/interfaces/websites/bluesky/bluesky.notification.options.interface.ts b/commons/src/interfaces/websites/bluesky/bluesky.notification.options.interface.ts index e20550fb..0a772daa 100644 --- a/commons/src/interfaces/websites/bluesky/bluesky.notification.options.interface.ts +++ b/commons/src/interfaces/websites/bluesky/bluesky.notification.options.interface.ts @@ -3,5 +3,5 @@ import { DefaultOptions } from '../../submission/default-options.interface'; export interface BlueskyNotificationOptions extends DefaultOptions { label_rating: string; replyToUrl?: string; - threadgate: string; + threadgate?: string; } diff --git a/electron-app/package.json b/electron-app/package.json index 7c9fe2a4..66ac4b23 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -1,6 +1,6 @@ { "name": "postybirb-plus", - "version": "3.1.38", + "version": "3.1.39", "description": "(ClientServer) PostyBirb is an application that helps artists post art and other multimedia to multiple websites more quickly.", "main": "dist/main.js", "author": "Michael DiCarlo", diff --git a/electron-app/src/server/websites/bluesky/bluesky.service.ts b/electron-app/src/server/websites/bluesky/bluesky.service.ts index 589ed20f..76c1db3e 100644 --- a/electron-app/src/server/websites/bluesky/bluesky.service.ts +++ b/electron-app/src/server/websites/bluesky/bluesky.service.ts @@ -263,7 +263,7 @@ export class Bluesky extends Website { let friendlyUrl = `https://${server}/profile/${handle}/post/${postId}`; // After the post has been made, check to see if we need to set a ThreadGate; these are the options to control who can reply to your post, and need additional calls - if (data.options.threadgate !== "") { + if (data.options.threadgate) { this.createThreadgate(agent, postResult.uri, data.options.threadgate); } @@ -359,7 +359,7 @@ export class Bluesky extends Website { let friendlyUrl = `https://${server}/profile/${handle}/post/${postId}`; // After the post has been made, check to see if we need to set a ThreadGate; these are the options to control who can reply to your post, and need additional calls - if (data.options.threadgate != "") { + if (data.options.threadgate) { this.createThreadgate(agent, postResult.uri, data.options.threadgate); } @@ -476,6 +476,9 @@ export class Bluesky extends Website { this.MAX_CHARS, getRichTextLength, ); + } else { + warnings.push(`You have not inserted the {tags} shortcut in your description; + tags will not be inserted in your post`) } } } diff --git a/electron-app/src/server/websites/furry-network/furry-network.service.ts b/electron-app/src/server/websites/furry-network/furry-network.service.ts index 92dfa482..ba2ea999 100644 --- a/electron-app/src/server/websites/furry-network/furry-network.service.ts +++ b/electron-app/src/server/websites/furry-network/furry-network.service.ts @@ -225,9 +225,17 @@ export class FurryNetwork extends Website { responses.push(create); } - const res = JSON.parse(responses.find(r => r.body).body ?? '{}'); + const { body } = responses.find(r => r.body); + if (body.startsWith('<')) { + throw this.createPostResponse({ + error: 'HTML response instead of json, check logs for additional info', + additionalInfo: body, + }); + } + + const res = JSON.parse(body || '{}'); if (!res || !res.id) { - throw this.createPostResponse({ additionalInfo: res }); + throw this.createPostResponse({ error: 'unexpected response type.', additionalInfo: res }); } return res; } diff --git a/electron-app/src/server/websites/hentai-foundry/hentai-foundry.service.ts b/electron-app/src/server/websites/hentai-foundry/hentai-foundry.service.ts index 1c6f9779..ef5baa9d 100644 --- a/electron-app/src/server/websites/hentai-foundry/hentai-foundry.service.ts +++ b/electron-app/src/server/websites/hentai-foundry/hentai-foundry.service.ts @@ -59,7 +59,11 @@ export class HentaiFoundry extends Website { } getScalingOptions(file: FileRecord): ScalingOptions { - return { maxSize: FileSize.MBtoBytes(50) }; + return { + maxHeight: 1500, + maxWidth: 1500, + maxSize: FileSize.MBtoBytes(2) + }; } async postNotificationSubmission( @@ -170,16 +174,34 @@ export class HentaiFoundry extends Website { } const { type, size, name } = submission.primary; - let maxMB: number = 50; - if (FileSize.MBtoBytes(maxMB) < size) { - if ( - isAutoscaling && - type === FileSubmissionType.IMAGE && - ImageManipulator.isMimeType(submission.primary.mimetype) - ) { - warnings.push(`${name} will be scaled down to ${maxMB}MB`); + + const scalingOptions = this.getScalingOptions(submission.primary); + + if ( + type === FileSubmissionType.IMAGE && + ImageManipulator.isMimeType(submission.primary.mimetype) + ) { + if (isAutoscaling) { + // Do we want to push it under a px size too + if (scalingOptions.maxWidth && + scalingOptions.maxHeight && + (submission.primary.height > scalingOptions.maxHeight || submission.primary.width > scalingOptions.maxWidth)) { + warnings.push(`${name} will be scaled down to a max of 1500x1500`); + } + + if (FileSize.MBtoBytes(scalingOptions.maxSize) < size) { + warnings.push(`${name} will be scaled down to ${scalingOptions.maxSize}MB`); + } } else { - problems.push(`Hentai Foundry limits ${submission.primary.mimetype} to ${maxMB}MB`); + if (scalingOptions.maxWidth && + scalingOptions.maxHeight && + (submission.primary.height > scalingOptions.maxHeight || submission.primary.width > scalingOptions.maxWidth)) { + warnings.push(`${name} will be manually moderated unless you rescale it below 1500x1500`); + } + + if (FileSize.MBtoBytes(scalingOptions.maxSize) < size) { + problems.push(`${name} must be under ${scalingOptions.maxSize}MB`); + } } } diff --git a/electron-app/src/server/websites/megalodon/megalodon.service.ts b/electron-app/src/server/websites/megalodon/megalodon.service.ts index 67c5e2e5..397decb0 100644 --- a/electron-app/src/server/websites/megalodon/megalodon.service.ts +++ b/electron-app/src/server/websites/megalodon/megalodon.service.ts @@ -227,12 +227,17 @@ export abstract class Megalodon extends Website { `Max description length allowed is ${instanceSettings.maxChars} characters.`, ); } else { - this.validateInsertTags( - warnings, - this.formatTags(FormContent.getTags(defaultPart.data.tags, submissionPart.data.tags)), - description, - instanceSettings.maxChars, - ); + if (description.toLowerCase().indexOf('{tags}') > -1) { + this.validateInsertTags( + warnings, + this.formatTags(FormContent.getTags(defaultPart.data.tags, submissionPart.data.tags)), + description, + instanceSettings.maxChars, + ); + } else { + warnings.push(`You have not inserted the {tags} shortcut in your description; + tags will not be inserted in your post`) + } } const files = [ diff --git a/electron-app/src/server/websites/telegram/telegram.service.ts b/electron-app/src/server/websites/telegram/telegram.service.ts index 829d3aa1..066ee1c5 100644 --- a/electron-app/src/server/websites/telegram/telegram.service.ts +++ b/electron-app/src/server/websites/telegram/telegram.service.ts @@ -273,7 +273,7 @@ export class Telegram extends Website { offset_peer: { _: 'inputPeerEmpty', }, - limit: 100, + limit: 200, }); const channels: Folder[] = chats @@ -526,7 +526,7 @@ export class Telegram extends Website { ); submissionPart.data.channels.forEach(f => { if (!WebsiteValidator.folderIdExists(f, folders)) { - problems.push(`Channel (${f}) not found.`); + problems.push(this.channelNotFound(f)); } }); } else { @@ -564,7 +564,7 @@ export class Telegram extends Website { if (FileSize.MBtoBytes(10) < size && type !== FileSubmissionType.IMAGE) { warnings.push( - `${name} will show in channel as Unknown Track but still will be available.`, + `${name} will show in channel as Unknown Track but still will be available to download.`, ); } }); @@ -588,7 +588,9 @@ export class Telegram extends Website { ); submissionPart.data.channels.forEach(f => { if (!WebsiteValidator.folderIdExists(f, folders)) { - problems.push(`Channel (${f}) not found.`); + problems.push( + this.channelNotFound(f), + ); } }); } else { @@ -605,6 +607,10 @@ export class Telegram extends Website { return { problems, warnings }; } + + private channelNotFound(f: string) { + return `Channel (${f}) not found. To fix this, simply post something in the channel. PostyBirb requests latest 200 chats and then filters them to include only those where you can send media. If you have a lot of active chats, PostyBirb will be not able to view inactive channels.`; + } } interface InputMedia { diff --git a/package.json b/package.json index 3249012b..0195806b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postybirb-plus", - "version": "3.1.38", + "version": "3.1.39", "description": "PostyBirb is an application that helps artists post art and other multimedia to multiple websites more quickly..", "main": "index.js", "scripts": { diff --git a/ui/package.json b/ui/package.json index e351c011..ee097446 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "postybirb-plus-ui", - "version": "3.1.38", + "version": "3.1.39", "license": "BSD-3-Clause", "private": true, "Author": "Michael DiCarlo", diff --git a/ui/src/views/submissions/scheduled-submissions/ScheduledSubmissions.tsx b/ui/src/views/submissions/scheduled-submissions/ScheduledSubmissions.tsx index c7bb429d..b93e32f6 100644 --- a/ui/src/views/submissions/scheduled-submissions/ScheduledSubmissions.tsx +++ b/ui/src/views/submissions/scheduled-submissions/ScheduledSubmissions.tsx @@ -4,7 +4,7 @@ import SubmissionUtil from '../../../utils/submission.util'; import moment from 'moment'; import { Submission } from 'postybirb-commons'; import { SubmissionPackage } from 'postybirb-commons'; -import { Calendar, Button, List, Badge, message } from 'antd'; +import { Calendar, Button, List, Badge, message, Popconfirm } from 'antd'; import { ScheduledSubmissionListItem } from './ScheduledSubmissionListItem'; interface Props { @@ -81,14 +81,20 @@ export default class ScheduledSubmissions extends React.Component { - + + } dataSource={this.props.submissions.sort( diff --git a/ui/src/websites/bluesky/Bluesky.tsx b/ui/src/websites/bluesky/Bluesky.tsx index 0134de0c..877cb1c2 100644 --- a/ui/src/websites/bluesky/Bluesky.tsx +++ b/ui/src/websites/bluesky/Bluesky.tsx @@ -67,7 +67,7 @@ BlueskyNotificationOptions , - +