mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Fix empty username (#6209)
* revert changes from #5860 Signed-off-by: parneet-guraya <gurayaparneet@gmail.com> * read author prop instead Signed-off-by: parneet-guraya <gurayaparneet@gmail.com> * Use user prop if author is empty or null Signed-off-by: parneet-guraya <gurayaparneet@gmail.com> * fix test Signed-off-by: parneet-guraya <gurayaparneet@gmail.com> --------- Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
32d485cc51
commit
972bf785f1
8 changed files with 29 additions and 26 deletions
|
|
@ -125,6 +125,19 @@ class Media constructor(
|
|||
categoriesHiddenStatus = categoriesHiddenStatus
|
||||
)
|
||||
|
||||
/**
|
||||
* Returns Author if it's not null or empty, otherwise
|
||||
* returns user
|
||||
* @return Author or User
|
||||
*/
|
||||
fun getAuthorOrUser(): String? {
|
||||
return if (!author.isNullOrEmpty()) {
|
||||
author
|
||||
} else{
|
||||
user
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets media display title
|
||||
* @return Media title
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue