Skip to content

Commit

Permalink
Update HF to allow 500 length of tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdicarlo committed Jun 23, 2022
1 parent f957177 commit 6021208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class HentaiFoundrySubmissionForm extends BaseWebsiteSubmissionForm impl
};

public tagConfig: TagConfig = {
maxStringLength: 75
maxStringLength: 500
};

constructor(injector: Injector) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class HentaiFoundry extends BaseWebsiteService {
'Pictures[fileupload]': fileAsFormDataObject(postData.primary),
'Pictures[submissionPolicyAgree]': '1',
'yt0': 'Create',
'Pictures[keywords]': this.formatTags(postData.tags, []),
'Pictures[edit_tags]': this.formatTags(postData.tags, []),
'Pictures[is_scrap]': options.scraps ? '1' : '0',
'Pictures[comments_type]': options.disableComments ? '-1' : '0',
'Pictures[categoryHier]': options.category || '',
Expand Down Expand Up @@ -170,11 +170,11 @@ export class HentaiFoundry extends BaseWebsiteService {
}

formatTags(defaultTags: string[] = [], other: string[] = []): any {
const maxLength = 75;
const maxLength = 500;
const tags = super.formatTags(defaultTags, other);
let tagString = tags.join(' ').trim();
let tagString = tags.join(', ').trim();

return tagString.length > maxLength ? tagString.substring(0, maxLength).split(' ').filter(tag => tag.length >= 3).join(' ') : tagString;
return tagString.length > maxLength ? tagString.substring(0, maxLength).split(', ').filter(tag => tag.length >= 3).join(', ') : tagString;
}

}

0 comments on commit 6021208

Please sign in to comment.