Showing 1,292 of 3,313 total issues
Function downloadWebTorrentVideo
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function downloadWebTorrentVideo (target: { uri: string, torrentName?: string }, timeout: number) {
const id = target.uri || target.torrentName
let timer
const path = generateVideoImportTmpPath(id)
Function videoLiveAddValidator
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return cleanUpReqFiles(req)
if (!isValidPasswordProtectedPrivacy(req, res)) return cleanUpReqFiles(req)
Function updateMasterHLSPlaylist
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateMasterHLSPlaylist (video: MVideo, playlistArg: MStreamingPlaylist): Promise<MStreamingPlaylistFilesVideo> {
return playlistFilesQueue.add(async () => {
const playlist = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlistArg.id)
const extMedia: string[] = []
Function update
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async update (overrideTo?: string[]) {
logger.debug(
'Updating remote video "%s".', this.videoObject.uuid,
{ videoObject: this.videoObject, ...this.lTags() }
)
Function processVideoTranscription
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function processVideoTranscription (options: ProcessOptions<RunnerJobTranscriptionPayload>) {
const { server, job, runnerToken } = options
const config = ConfigManager.Instance.getConfig().transcription
Function processHLSTranscoding
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function processHLSTranscoding (options: ProcessOptions<RunnerJobVODHLSTranscodingPayload>) {
const { server, job, runnerToken } = options
const payload = job.payload
let ffmpegProgress: number
Function getSitemapLocalVideoUrls
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getSitemapLocalVideoUrls () {
const serverActor = await getServerActor()
let acc: { url: string, video: any[] }[] = []
Function addVideo
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function addVideo (options: {
req: express.Request
res: express.Response
videoPhysicalFile: express.VideoLegacyUploadFile
videoInfo: VideoCreate
Function addVideosToFeed
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addVideosToFeed (feed: Feed, videos: VideoModel[]) {
/**
* Adding video items to the feed object, one at a time
*/
for (const video of videos) {
Function run
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function run () {
await initDatabaseModels(true)
JobQueue.Instance.init()
Function listForApi
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static listForApi (parameters: {
start: number
count: number
sort: string
search?: string
Function buildVideosFromRows
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildVideosFromRows (options: {
rows: SQLRow[]
include?: VideoIncludeType
rowsWebVideoFiles?: SQLRow[]
rowsStreamingPlaylist?: SQLRow[]
Function getBypassFromPasswordGrant
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function getBypassFromPasswordGrant (username: string, password: string): Promise<BypassLogin> {
const plugins = PluginManager.Instance.getIdAndPassAuths()
const pluginAuths: { npmName?: string, registerAuthOptions: RegisterServerAuthPassOptions }[] = []
for (const plugin of plugins) {
Function generateSubtitle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function generateSubtitle (options: {
video: MVideoUUID
}) {
const outputPath = join(CONFIG.STORAGE.TMP_DIR, 'transcription', buildSUUID())
Function buildImporters
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildImporters (user: MUserDefault) {
// Keep consistency in import order (don't import videos before channels for example)
return [
{
name: 'account' as 'account',
Function getStats
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getStats () {
const { totalLocalVideos, totalLocalVideoViews, totalVideos } = await VideoModel.getStats()
const { totalLocalVideoComments, totalVideoComments } = await VideoCommentModel.getStats()
const {
totalUsers,
Function getContextMenuOptions
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getContextMenuOptions () {
const content = () => {
const self = this
const player = this.player
Function updateForm
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateForm () {
const defaultValues: any = {
nsfw: 'false',
commentsPolicy: this.serverConfig.defaults.publish.commentsPolicy,
downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
Function processAudioMergeTranscoding
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function processAudioMergeTranscoding (options: ProcessOptions<RunnerJobVODAudioMergeTranscodingPayload>) {
const { server, job, runnerToken } = options
const payload = job.payload
let ffmpegProgress: number
Function buildResumeUpload
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async buildResumeUpload <T> (options: OverrideCommandOptions & {
path: string
fixture: string
attaches?: Record<string, string>