Showing 1,292 of 3,313 total issues
Function run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function run () {
console.log('Moving private video files in dedicated folders.')
await ensureDir(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE)
await ensureDir(DIRECTORIES.WEB_VIDEOS.PRIVATE)
Function buildMainQuery
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildMainQuery (options: BuildVideosListQueryOptions, serverActor: MActorAccount) {
this.attributes = {
'"video".*': ''
}
Function buildAvailableUrl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildAvailableUrl (obj: any) {
const urls: string[] = []
if (obj.url) urls.push(obj.url)
if (obj.urls) {
Function downloadHLSVideoFile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function downloadHLSVideoFile (req: express.Request, res: express.Response) {
const video = res.locals.videoAll
const streamingPlaylist = getHLSPlaylist(video)
if (!streamingPlaylist) return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
Function filter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filter: async function (infoHash, params, cb) {
if (CONFIG.TRACKER.ENABLED === false) {
return cb(new Error('Tracker is disabled on this instance.'))
}
Function createUser
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function createUser (req: express.Request, res: express.Response) {
const body: UserCreate = req.body
const userToCreate = buildUser({
...pick(body, [ 'username', 'password', 'email', 'role', 'videoQuota', 'videoQuotaDaily', 'adminFlags' ]),
Function addVideoInPlaylist
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function addVideoInPlaylist (req: express.Request, res: express.Response) {
const body: VideoPlaylistElementCreate = req.body
const videoPlaylist = res.locals.videoPlaylistFull
const video = res.locals.onlyVideo
Function videoPlaylistsGetValidator
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const videoPlaylistsGetValidator = (fetchType: VideoPlaylistFetchType) => {
return [
isValidPlaylistIdParam('playlistId'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
Function isVideoCommentAccepted
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function isVideoCommentAccepted (req: express.Request, res: express.Response, video: MVideoFullLight, isReply: boolean) {
const acceptParameters = {
video,
commentBody: req.body,
user: res.locals.oauth.token.User,
Function processViewerStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async processViewerStats () {
if (this.processingViewersStats) return
this.processingViewersStats = true
if (!isTestOrDevInstance()) logger.info('Processing viewer statistics.', lTags())
Function saveToken
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function saveToken (
token: TokenInfo,
client: MOAuthClient,
user: MUser,
options: {
Function updateLocalActorImageFiles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function updateLocalActorImageFiles (options: {
accountOrChannel: MAccountDefault | MChannelDefault
imagePhysicalFile: { path: string }
type: ActorImageType_Type
sendActorUpdate: boolean
Function buildWorker
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildWorker (handlerName: JobType) {
const workerOptions: WorkerOptions = {
autorun: false,
concurrency: this.getJobConcurrency(handlerName),
prefix: this.jobRedisPrefix,
Function onWebVideoFileTranscoding
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function onWebVideoFileTranscoding (options: {
video: MVideoFullLight
videoOutputPath: string
wasAudioFile?: boolean // default false
deleteWebInputVideoFile?: MVideoFile
Function create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async create (options: CreateOptions) {
const { video, resolution, fps, dependsOnRunnerJob, separatedAudio, priority } = options
const jobUUID = buildUUID()
Function buildMetadataFromVideo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType_Type, size?: ImageSize) {
const existingThumbnail = Array.isArray(video.Thumbnails)
? video.Thumbnails.find(t => t.type === type)
: undefined
Function buildPlayerIfNeeded
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async buildPlayerIfNeeded () {
if (this.player) return
await TranslationsManager.loadLocaleInVideoJS(this.options.serverUrl, this.options.language, videojs)
Function initHotkeys
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private initHotkeys () {
this.hotkeysService.add([
new Hotkey([ 'Shift+/', 's' ], () => {
document.getElementById('search-video').focus()
return false
Function autoFollow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async autoFollow () {
if (CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_INDEX.ENABLED === false) return
const indexUrl = CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_INDEX.INDEX_URL
Function listRunnerJobs
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
listRunnerJobs (options: {
pagination: RestPagination
sort: SortMeta
search?: string
}) {