diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2017-10-15 19:00:56 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2017-10-15 19:00:56 -0700 |
commit | b14ec9a9282cb49951b790ce1b48b1a078616926 (patch) | |
tree | deada14d4a407de18812d0e72c32136a2de2caa5 /src/main/java/com/p4square/grow/model/Chapter.java | |
parent | 79b8aacbb7b347bba9d14b1332666e7263a3a058 (diff) |
Refactor Chapter Ordering Logic20171015
The bug impacting the CCB integration was due to the "Introduction"
chapter having a higher "score" than every other chapter. It was a
mistake to use Score to compared chapter progress, particularly since
there are more chapters than scores.
This change gathers the chapter ordering logic, which was scattered
throughout the code into a new Chapters enum. Playlist and Chapter now
use Chapters as a key, instead of loose strings. Same for the
ProgressReporter interface.
Diffstat (limited to 'src/main/java/com/p4square/grow/model/Chapter.java')
-rw-r--r-- | src/main/java/com/p4square/grow/model/Chapter.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/p4square/grow/model/Chapter.java b/src/main/java/com/p4square/grow/model/Chapter.java index ac27de6..3306bf0 100644 --- a/src/main/java/com/p4square/grow/model/Chapter.java +++ b/src/main/java/com/p4square/grow/model/Chapter.java @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonIgnore; * @author Jesse Morgan <jesse@jesterpm.net> */ public class Chapter implements Cloneable { - private String mName; + private Chapters mName; private Map<String, VideoRecord> mVideos; - public Chapter(String name) { + public Chapter(Chapters name) { mName = name; - mVideos = new HashMap<String, VideoRecord>(); + mVideos = new HashMap<>(); } /** @@ -36,7 +36,7 @@ public class Chapter implements Cloneable { /** * @return The Chapter name. */ - public String getName() { + public Chapters getName() { return mName; } @@ -45,7 +45,7 @@ public class Chapter implements Cloneable { * * @param name The name of the chapter. */ - public void setName(final String name) { + public void setName(final Chapters name) { mName = name; } |