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:
parent
5307932656
commit
605a5050af
|
@ -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})")
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue