Skip to content

Voices video#10993

Draft
Okuro3499 wants to merge 10 commits intomasterfrom
voicesVideo
Draft

Voices video#10993
Okuro3499 wants to merge 10 commits intomasterfrom
voicesVideo

Conversation

@Okuro3499
Copy link
Collaborator

video.webm

This update introduces the ability to add, upload, and display video attachments in news posts. It extends the data model, repository, and UI to handle video files alongside images, including new UI elements for video selection and display, video upload logic, and video metadata management. String resources and layouts have been updated to support the new functionality.
Updated UploadManager to use RealmUser instead of RealmUserModel and corrected property access for user ID. In VoicesAdapter, replaced voicesRepository.getLibraryResource with getLibraryResourceFn for loading and adding library videos.
Replaced direct call to RealmMyTeam.isTeamLeader with teamsRepository.isTeamLeader using a coroutine. This change ensures team leader status is checked asynchronously and aligns with repository usage patterns.
@qltysh
Copy link

qltysh bot commented Jan 28, 2026

❌ 8 blocking issues (8 total)

Tool Category Rule Count
qlty Duplication Found 15 lines of similar code in 3 locations (mass = 118) 4
qlty Structure Function with high complexity (count = 29): onCreate 2
qlty Structure High total complexity (count = 72) 1
qlty Structure Function with many parameters (count = 7): createNews 1

val uri = data?.data
processVideoUri(uri, result.resultCode)
}
}
Copy link

@qltysh qltysh bot Jan 28, 2026

Choose a reason for hiding this comment

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

Found 15 lines of similar code in 3 locations (mass = 118) [qlty:similar-code]

}
}
}
}
Copy link

@qltysh qltysh bot Jan 28, 2026

Choose a reason for hiding this comment

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

High total complexity (count = 72) [qlty:file-complexity]


@JvmStatic
fun createNews(map: HashMap<String?, String>, mRealm: Realm, user: RealmUser?, imageUrls: RealmList<String>?, isReply: Boolean = false): RealmNews {
fun createNews(map: HashMap<String?, String>, mRealm: Realm, user: RealmUser?, imageUrls: RealmList<String>?, videoUrls: RealmList<String>? = null, isReply: Boolean = false): RealmNews {
Copy link

Choose a reason for hiding this comment

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

Function with many parameters (count = 7): createNews [qlty:function-parameters]

`object`.addProperty("customDeviceName", NetworkUtils.getCustomDeviceName(MainApplication.context))
`object`.add("privateFor", object1)
`object`.addProperty("mediaType", "video")
return `object`
Copy link

Choose a reason for hiding this comment

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

Found 17 lines of similar code in 2 locations (mass = 263) [qlty:similar-code]

}
}
}
}
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Function with high complexity (count = 18): loadVideo [qlty:function-complexity]


2. Found 42 lines of similar code in 2 locations (mass = 334) [qlty:similar-code]

Replace separate image/video pickers with a single media picker: register openMediaLauncher in BaseVoicesFragment to handle single or multi-select URIs, route files to processImageUri/processVideoUri via a new processMediaUri helper, and show a toast for unsupported types. Update VoicesFragment and TeamsVoicesFragment to use the new add_news_media button and launch openMediaLauncher. Update layouts to rename buttons to add_news_media and replace labels with add_media. Add/adjust localized strings (add_media, video_already_added, please_select_video, please_select_image_or_video) across locales and normalize ellipses. This simplifies the UI and centralizes media-selection logic.
val uri = data?.data
processMediaUri(uri, result.resultCode)
}
}
Copy link

Choose a reason for hiding this comment

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

Found 15 lines of similar code in 3 locations (mass = 118) [qlty:similar-code]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant