From a559f433dba4a1e14fdb0841816038d13a0acd7a Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Thu, 8 Aug 2024 14:05:43 +0200 Subject: [PATCH] add another helper method to rented instance data class --- .../java/eu/m724/vastapp/vastai/data/RentedInstance.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/eu/m724/vastapp/vastai/data/RentedInstance.kt b/app/src/main/java/eu/m724/vastapp/vastai/data/RentedInstance.kt index 91b0140..b026f63 100644 --- a/app/src/main/java/eu/m724/vastapp/vastai/data/RentedInstance.kt +++ b/app/src/main/java/eu/m724/vastapp/vastai/data/RentedInstance.kt @@ -73,6 +73,14 @@ data class RentedInstance( } } + /** + * gpu model or label if set + * @return instance name + */ + fun getName(): String { + return label ?: instance.machine.gpu.model + } + /** * returns whether the instance is running * this is true also if the instance is stopping