From 5d4ae43ed023990cc791ca4d6c8f28a1a5d6016d Mon Sep 17 00:00:00 2001 From: Jacob Moura Date: Thu, 25 Jan 2024 10:51:29 -0300 Subject: [PATCH] fix: update cover with exact type --- lib/app/data/repositories/uno_sync_repository.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/app/data/repositories/uno_sync_repository.dart b/lib/app/data/repositories/uno_sync_repository.dart index acc163e..ce8c598 100644 --- a/lib/app/data/repositories/uno_sync_repository.dart +++ b/lib/app/data/repositories/uno_sync_repository.dart @@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart'; import 'package:media_store_plus/media_store_plus.dart'; import 'package:path/path.dart'; import 'package:uno/uno.dart'; +import 'package:yuno/app/interactor/actions/platform_action.dart'; import 'package:yuno/app/interactor/models/embeds/game.dart'; import '../../core/constants/env.dart'; @@ -35,7 +36,7 @@ class UnoSyncRepository implements SyncRepository { return false; } return name.endsWith('.png') || - name.endsWith('.jgp') || + name.endsWith('.jpg') || name.endsWith('.jpeg'); }, ).toList(); @@ -44,9 +45,11 @@ class UnoSyncRepository implements SyncRepository { return game; } + final gameName = basenameWithoutExtension(convertContentUriToFilePath(game.path)); + final file = files.firstWhereOrNull((doc) { - final name = doc.name!.toLowerCase(); - return name.startsWith('${game.name.toLowerCase()}.'); + final name = doc.name!; + return name.startsWith('${gameName}.'); }); if (file == null) {