Skip to content

Commit

Permalink
fix: update cover with exact type
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobaraujo7 committed Jan 25, 2024
1 parent ecfbee5 commit 5d4ae43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/app/data/repositories/uno_sync_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -35,7 +36,7 @@ class UnoSyncRepository implements SyncRepository {
return false;
}
return name.endsWith('.png') ||
name.endsWith('.jgp') ||
name.endsWith('.jpg') ||
name.endsWith('.jpeg');
},
).toList();
Expand All @@ -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) {
Expand Down

0 comments on commit 5d4ae43

Please sign in to comment.