From 6cb7e338ecbf1143f8147fbde7e840660adfe0b6 Mon Sep 17 00:00:00 2001 From: "starship.coder" Date: Mon, 31 Oct 2022 12:15:45 +0100 Subject: [PATCH] Add account id --- lib/properties/account.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/properties/account.dart b/lib/properties/account.dart index ab3320da..78b7b322 100644 --- a/lib/properties/account.dart +++ b/lib/properties/account.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + /// Account information, which is exposed for information and debugging purposes /// and should be ignored in most cases. /// @@ -18,6 +20,16 @@ class Account { /// Android mimetypes provided by this account. List mimetypes; + + /// On Android, the rawId isn't uniq + String getAccountId() { + if (Platform.isAndroid) { + return '$name|$type'; + } else { + return rawId; + } + } + Account(this.rawId, this.type, this.name, this.mimetypes); factory Account.fromJson(Map json) => Account(