X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FBasicLibrary.java;h=78d20d654afee85ec8e1f0826abd156576fe821e;hb=3989dfc5ced262e3c8d07fc796ec06ce5513c6b8;hp=8ec4e5620655ad148fb6b4b47b2c16d0f4284ee8;hpb=116904b8f8386091f978c0c678343c2f1cc80356;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/BasicLibrary.java b/src/be/nikiroo/fanfix/library/BasicLibrary.java index 8ec4e56..78d20d6 100644 --- a/src/be/nikiroo/fanfix/library/BasicLibrary.java +++ b/src/be/nikiroo/fanfix/library/BasicLibrary.java @@ -119,6 +119,31 @@ abstract public class BasicLibrary { return null; } + /** + * Return the cover image associated to this author. + *

+ * By default, return the custom cover if any, and if not, return the cover + * of the first story with this author. + * + * @param author + * the author + * + * @return the cover image or NULL + */ + public Image getAuthorCover(String author) { + Image custom = getCustomAuthorCover(author); + if (custom != null) { + return custom; + } + + List metas = getListByAuthor(author); + if (metas.size() > 0) { + return getCover(metas.get(0).getLuid()); + } + + return null; + } + /** * Return the custom cover image associated to this source. *

@@ -134,7 +159,21 @@ abstract public class BasicLibrary { } /** - * Fix the source cover to the given story cover. + * Return the custom cover image associated to this author. + *

+ * By default, return NULL. + * + * @param author + * the author to look for + * + * @return the custom cover or NULL if none + */ + public Image getCustomAuthorCover(@SuppressWarnings("unused") String author) { + return null; + } + + /** + * Set the source cover to the given story cover. * * @param source * the source to change @@ -143,6 +182,16 @@ abstract public class BasicLibrary { */ public abstract void setSourceCover(String source, String luid); + /** + * Set the author cover to the given story cover. + * + * @param source + * the author to change + * @param luid + * the story LUID + */ + public abstract void setAuthorCover(String author, String luid); + /** * Return the list of stories (represented by their {@link MetaData}, which * MAY not have the cover included).