Add a method to return format in AppItem

This commit is contained in:
lynxnb 2023-02-22 17:48:44 +01:00 committed by Niccolò Betto
parent d1fd44e32e
commit ee98aaaed1

View File

@ -49,9 +49,15 @@ data class AppItem(private val meta : AppEntry) : DataItem() {
*/ */
val uri get() = meta.uri val uri get() = meta.uri
/**
* The format of the application
*/
val format get() = meta.format
val loaderResult get() = meta.loaderResult val loaderResult get() = meta.loaderResult
fun loaderResultString(context : Context) = context.getString(when (meta.loaderResult) { fun loaderResultString(context : Context) = context.getString(
when (meta.loaderResult) {
LoaderResult.Success -> R.string.metadata_missing LoaderResult.Success -> R.string.metadata_missing
LoaderResult.ParsingError -> R.string.invalid_file LoaderResult.ParsingError -> R.string.invalid_file
@ -61,7 +67,8 @@ data class AppItem(private val meta : AppEntry) : DataItem() {
LoaderResult.MissingHeaderKey, LoaderResult.MissingHeaderKey,
LoaderResult.MissingTitleKek, LoaderResult.MissingTitleKek,
LoaderResult.MissingKeyArea -> R.string.incomplete_prod_keys LoaderResult.MissingKeyArea -> R.string.incomplete_prod_keys
}) }
)
/** /**
* The name and author is used as the key * The name and author is used as the key