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