You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If a file doesn't have an iconUrl property in titledb, it will show up as a blank square
Describe the solution you'd like
Allow the user to override this with a local file. Possibly check for a cached local file first, otherwise download a new version of the image.
The text was updated successfully, but these errors were encountered:
Here is a quick workaround that I made. It might be better to store an override image in a different folder, in case the user wants to clear their image cache at some time.
diff --git a/nut/Title.py b/nut/Title.py
index d4fbcaa..43c4c1f 100644
--- a/nut/Title.py+++ b/nut/Title.py@@ -619,7 +619,7 @@ class Title:
def download(self, base, fileName, url):
path = os.path.join(base, fileName)
- if os.path.isfile(path):+ if os.path.isfile(path) or url is None:
return path
os.makedirs(base, exist_ok=True)
urllib.request.urlretrieve(url, path)
@@ -664,10 +664,13 @@ class Title:
if 'iconUrl' not in self.__dict__:
self.iconUrl = None
- if not self.iconUrl or self.iconUrl.startswith('cocoon:/'):+ if not self.iconUrl:+ baseName = self.id+ ext = ".jpg"+ elif self.iconUrl.startswith('cocoon:/'):
return None
-- baseName, ext = os.path.splitext(self.iconUrl)+ else:+ baseName, ext = os.path.splitext(self.iconUrl)
return self.getResizedImage(self.download(Config.paths.titleImages + self.id, 'icon' + ext, self.iconUrl), width, height)
def screenshotFile(self, i, width=None, height=None):```
gritstub
changed the title
[Feature] Allow custom icon images
[Feature] Allow custom icon images / Fix empty image squares for titles
Sep 8, 2022
Is your feature request related to a problem? Please describe.
If a file doesn't have an iconUrl property in titledb, it will show up as a blank square
Describe the solution you'd like
Allow the user to override this with a local file. Possibly check for a cached local file first, otherwise download a new version of the image.
The text was updated successfully, but these errors were encountered: