Skip to content

Commit 2344634

Browse files
committed
Update return signatures
1 parent 04fd42c commit 2344634

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

plugin/library.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212

1313
log = logging.getLogger(__name__)
1414

15+
ASSETS = [
16+
'header',
17+
'library_600x900',
18+
'library_hero',
19+
'library_hero_blur',
20+
'logo'
21+
]
22+
1523

1624
@dataclass
1725
class Library:
@@ -94,6 +102,12 @@ def __init__(self, name: str, path: Union[str, Path], image_dir: LibraryImageDir
94102
self._id = id
95103
self._image_id = self.id
96104

105+
def _get_hashed_icon(self) -> Optional[Path]:
106+
asset_path = Path(self.image_dir).joinpath(self.id)
107+
for asset in asset_path.iterdir():
108+
if asset.stem not in ASSETS:
109+
return asset
110+
97111
@property
98112
def id(self):
99113
"""
@@ -124,11 +138,11 @@ def get_image(self, type: str, sep='_') -> Path:
124138
return self.image_dir.get_image(id, type, sep)
125139

126140
@cached_property
127-
def icon(self) -> Path:
141+
def icon(self) -> Optional[Path]:
128142
"""
129143
Return the icon for this library item.
130144
"""
131-
return self.get_image('icon') or Path(self.unquoted_path())
145+
return self._get_hashed_icon()
132146

133147
@cached_property
134148
def hero(self) -> Path:

plugin/steam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
import logging
3-
import winreg as reg
4-
from winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE
3+
#import winreg as reg
4+
#from winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE
55
from typing import Union
66

77
from .vdfs import VDF

0 commit comments

Comments
 (0)