Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.34 #278

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electron-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postybirb-plus",
"version": "3.1.33",
"version": "3.1.34",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export class DescriptionParser {
private settings: SettingsService,
) {
this.websiteDescriptionShortcuts = websitesService.getUsernameShortcuts();
this.websiteDescriptionShortcuts = {
...this.websiteDescriptionShortcuts,
twitter: [ // injects legacy twitter shortcut back in
{
key: 'tw',
url: 'https://twitter.com/$1',
},
],
};
}

public async parse(
Expand Down
30 changes: 13 additions & 17 deletions electron-app/src/server/websites/newgrounds/newgrounds.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,20 @@ export class Newgrounds extends Website {
return Promise.reject(this.createPostResponse({ additionalInfo: post.body }));
}

private async getThumbnail(thumbnail: PostFile, primary: PostFile): Promise<PostFile> {
let thumbfile = thumbnail;
private async getThumbnail(
thumbnail: PostFile | undefined,
primary: PostFile,
): Promise<PostFile> {
let thumbfile: PostFile = {
value: thumbnail?.value ?? primary.value,
options: {
filename: 'thumbnail.png',
contentType: 'image/png',
},
};
if (!thumbnail && primary.options.contentType === 'image/gif') {
const frame0 = await GifManipulator.getFrame(primary.value);
thumbfile = {
value: frame0,
options: {
filename: 'thumbnail.png',
contentType: 'image/png',
},
};
thumbfile.value = frame0;
}

const scalePx = 600;
Expand Down Expand Up @@ -158,8 +161,6 @@ export class Newgrounds extends Website {
}

thumbfile.value = thumb.toPNG();
thumbfile.options.filename = 'thumbnail.png';
thumbfile.options.contentType = 'image/png';
return thumbfile;
}

Expand Down Expand Up @@ -215,12 +216,7 @@ export class Newgrounds extends Website {
}

const { edit_url, project_id } = initRes.body;

let thumbfile = await this.getThumbnail(
data.thumbnail ? data.thumbnail : data.primary.file,
data.primary.file,
);

const thumbfile = await this.getThumbnail(data.thumbnail, data.primary.file);
const primaryBuf = nativeImage.createFromBuffer(data.primary.file.value);
const size = primaryBuf.getSize();
const fileUploadRes = await Http.post<
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postybirb-plus",
"version": "3.1.33",
"version": "3.1.34",
"description": "PostyBirb is an application that helps artists post art and other multimedia to multiple websites more quickly..",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postybirb-plus-ui",
"version": "3.1.33",
"version": "3.1.34",
"license": "BSD-3-Clause",
"private": true,
"Author": "Michael DiCarlo",
Expand Down