lib: sort fixes
[nikiroo-utils.git] / src / be / nikiroo / fanfix / data / MetaData.java
index 1781d869f263c559d6e7f5240399db5e498a4fd5..586196a663fea88aa39fe45111445d76df0d5651 100644 (file)
@@ -112,6 +112,8 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
 
        /**
         * The story resume (a.k.a. description).
+        * <p>
+        * This can be NULL if we don't have a resume for this {@link Story}.
         * 
         * @return the resume
         */
@@ -388,12 +390,14 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
                        return 1;
                }
 
-               String id = (getUuid() == null ? "" : getUuid())
+               String id = (getTitle() == null ? "" : getTitle())
+                               + (getUuid() == null ? "" : getUuid())
                                + (getLuid() == null ? "" : getLuid());
-               String oId = (getUuid() == null ? "" : o.getUuid())
+               String oId = (getTitle() == null ? "" : o.getTitle())
+                               + (getUuid() == null ? "" : o.getUuid())
                                + (o.getLuid() == null ? "" : o.getLuid());
 
-               return id.compareTo(oId);
+               return id.compareToIgnoreCase(oId);
        }
 
        @Override
@@ -470,7 +474,7 @@ public class MetaData implements Cloneable, Comparable<MetaData>, Serializable {
 
                String cover = "none";
                if (getCover() != null) {
-                       cover = StringUtils.formatNumber(getCover().getData().length)
+                       cover = StringUtils.formatNumber(getCover().getSize())
                                        + "bytes";
                }