Skip to content

Video quality selection#5

Open
Frozo13 wants to merge 2 commits into
Borodutch:mainfrom
Frozo13:main
Open

Video quality selection#5
Frozo13 wants to merge 2 commits into
Borodutch:mainfrom
Frozo13:main

Conversation

@Frozo13

@Frozo13 Frozo13 commented Dec 15, 2021

Copy link
Copy Markdown

No description provided.

Comment thread locales/en.yaml
/help — this message
/language — change language
/audio — convert all files to audio
/max_quality - automatically download videos in maximum quality

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо этого, давай сделаем /chooseResolution, который по дефолту false

Comment thread src/app.ts
import report from '@/helpers/report'
import sendHelp from '@/handlers/sendHelp'
import startMongo from '@/helpers/startMongo'
import { resolutionMenu } from './menus/resolutionMenu'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не используй относительные импорты, только @

export default async function handleMaxQuality(ctx: Context) {
ctx.dbchat.autoMaxQuality = !ctx.dbchat.autoMaxQuality
await ctx.dbchat.save()
return ctx.reply(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use replyWithLocalization

Comment thread src/handlers/handleUrl.ts
if (ctx.dbchat.autoMaxQuality) {
return createDownloadJobAndRequest(ctx, url)
} else {
const waitMessage = await ctx.reply(ctx.i18n.t('check_resolutions'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use replyWithLocalization

@@ -0,0 +1 @@
declare module 'random-token'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нам это точно нужно? Мы же делаем require

Comment thread src/models/ShortUrl.ts
shortId!: string
@prop({ required: true })
url!: string
@prop({ required: true, type: () => [Number] })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно обойтись без этого поля?

Comment thread src/models/ShortUrl.ts
}

const ShortUrlModel = getModelForClass(ShortUrl, {
schemaOptions: { timestamps: true },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай использовать @modelOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants