From: Niki Roo Date: Wed, 8 Apr 2020 15:44:35 +0000 (+0200) Subject: [unknown] for unknown tag/author X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e915ed7720b87e261d94733955dad72defc9090d;p=fanfix-jexer.git [unknown] for unknown tag/author --- diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java index 2436e43..f93b1d4 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/AuthorTab.java @@ -6,6 +6,7 @@ import java.util.List; import javax.swing.tree.DefaultMutableTreeNode; import be.nikiroo.fanfix.Instance; +import be.nikiroo.fanfix.bundles.StringIdGui; public class AuthorTab extends BasicTab> { public AuthorTab(int index, String listenerCommand) { @@ -37,6 +38,10 @@ public class AuthorTab extends BasicTab> { @Override protected String keyToDisplay(String key) { + if (key.trim().isEmpty()) { + key = Instance.getInstance().getTransGui().getString(StringIdGui.MENU_AUTHORS_UNKNOWN); + } + return key; } diff --git a/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java b/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java index 746f268..90c8219 100644 --- a/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java +++ b/src/be/nikiroo/fanfix_swing/gui/browser/TagsTab.java @@ -6,7 +6,9 @@ import java.util.List; import javax.swing.tree.DefaultMutableTreeNode; import be.nikiroo.fanfix.Instance; +import be.nikiroo.fanfix.bundles.StringIdGui; import be.nikiroo.fanfix.data.MetaData; +import be.nikiroo.fanfix.library.MetaResultList; public class TagsTab extends BasicTab> { public TagsTab(int index, String listenerCommand) { @@ -21,8 +23,9 @@ public class TagsTab extends BasicTab> { @Override protected void fillData(List data) { try { - List metas = Instance.getInstance().getLibrary().getList(); - for (MetaData meta : metas) { + MetaResultList metas = Instance.getInstance().getLibrary().getList(); + // TODO: getTagList, getAuthorList... ? + for (MetaData meta : metas.getMetas()) { List tags = meta.getTags(); if (tags != null) { for (String tag : tags) { @@ -45,6 +48,11 @@ public class TagsTab extends BasicTab> { @Override protected String keyToDisplay(String key) { + if (key.trim().isEmpty()) { + // TODO: new TAG_UNKNOWN needed + key = Instance.getInstance().getTransGui().getString(StringIdGui.MENU_AUTHORS_UNKNOWN); + } + return key; }