1
0
Fork 0
mirror of synced 2024-06-26 18:20:50 +12:00

RareGame: Make owned_dlcs a set

By making the attribute into a set, we avoid adding already existing dlcs
back into it when refreshing the library. Fixes duplicated entries in
the DLC page.
This commit is contained in:
loathingKernel 2023-05-29 16:16:36 +03:00
parent 5307932656
commit 605a5050af
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ from dataclasses import dataclass, field
from datetime import datetime
from logging import getLogger
from threading import Lock
from typing import List, Optional, Dict
from typing import List, Optional, Dict, Set
from PyQt5.QtCore import QRunnable, pyqtSlot, QProcess, QThreadPool
from PyQt5.QtGui import QPixmap
@ -77,7 +77,7 @@ class RareGame(RareGameSlim):
self.metadata: RareGame.Metadata = RareGame.Metadata()
self.__load_metadata()
self.owned_dlcs: List[RareGame] = []
self.owned_dlcs: Set[RareGame] = set()
if self.has_update:
logger.info(f"Update available for game: {self.app_name} ({self.app_title})")

View file

@ -257,7 +257,7 @@ class RareCore(QObject):
rdlc.signals.progress.start.connect(rgame.signals.progress.start)
rdlc.signals.progress.update.connect(rgame.signals.progress.update)
rdlc.signals.progress.finish.connect(rgame.signals.progress.finish)
rgame.owned_dlcs.append(rdlc)
rgame.owned_dlcs.add(rdlc)
self.__add_game(rdlc)
self.__add_game(rgame)
self.progress.emit(int(idx/length * 80) + 20, self.tr("Loaded <b>{}</b>").format(rgame.app_title))