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

Video quality selection #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Video quality selection #5

wants to merge 2 commits into from

Conversation

Frozo13
Copy link

@Frozo13 Frozo13 commented Dec 15, 2021

No description provided.

@@ -7,16 +7,22 @@ help: |
/help — this message
/language — change language
/audio — convert all files to audio
/max_quality - automatically download videos in maximum quality
Copy link
Member

Choose a reason for hiding this comment

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

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

import handleUrl from '@/handlers/handleUrl'
import i18n from '@/helpers/i18n'
import ignoreOldMessageUpdates from '@/middlewares/ignoreOldMessageUpdates'
import report from '@/helpers/report'
import sendHelp from '@/handlers/sendHelp'
import startMongo from '@/helpers/startMongo'
import { resolutionMenu } from './menus/resolutionMenu'
Copy link
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
Member

Choose a reason for hiding this comment

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

Use replyWithLocalization

if (ctx.dbchat.autoMaxQuality) {
return createDownloadJobAndRequest(ctx, url)
} else {
const waitMessage = await ctx.reply(ctx.i18n.t('check_resolutions'))
Copy link
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
Member

Choose a reason for hiding this comment

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

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

shortId!: string
@prop({ required: true })
url!: string
@prop({ required: true, type: () => [Number] })
Copy link
Member

Choose a reason for hiding this comment

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

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

}

const ShortUrlModel = getModelForClass(ShortUrl, {
schemaOptions: { timestamps: true },
Copy link
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