feat: Android TV support (#503)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-09-28 21:07:49 +02:00 committed by GitHub
parent 7ab8c015b9
commit c299492d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
168 changed files with 12019 additions and 3073 deletions

View file

@ -55,10 +55,30 @@ class SharedUtility {
}
Future<bool?> addAccount(AccountModel account) async {
return await saveAccounts(getAccounts()
..add(account.copyWith(
lastUsed: DateTime.now(),
)));
final newAccount = account.copyWith(
lastUsed: DateTime.now(),
);
List<AccountModel> accounts = getAccounts().toList();
if (accounts.any((element) => element.sameIdentity(newAccount))) {
accounts = accounts
.map(
(e) => e.sameIdentity(newAccount)
? e.copyWith(
credentials: newAccount.credentials,
lastUsed: newAccount.lastUsed,
)
: e,
)
.toList();
} else {
accounts = [
...accounts,
newAccount,
];
}
return await saveAccounts(accounts);
}
Future<bool?> removeAccount(AccountModel? account) async {