diff --git a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java index 36437ff..f6b8375 100644 --- a/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java +++ b/core/src/main/java/com/jdbernard/wdiwtlt/db/models/Playlist.java @@ -4,12 +4,14 @@ import java.sql.Timestamp; import java.util.Date; public class Playlist extends Model { - public boolean userCreated; + public boolean userCreated = false; public Timestamp lastUsed = new Timestamp(new Date().getTime()); public String name; - public int modCount; - public int mediaFileCount; - public Integer copiedFromId; + public int modCount = 0; + public int mediaFileCount = 0; + public Integer copiedFromId = null; - public String toString() { return name; } + public String toString() { + if (userCreated) return name; + return name + " (auto)"; } } diff --git a/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql b/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql index 203c25f..3e578bc 100644 --- a/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql +++ b/core/src/main/sql/migrations/20151209054632-initial-schema-up.sql @@ -52,7 +52,7 @@ CREATE TABLE playlists ( name VARCHAR NOT NULL, mod_count INTEGER NOT NULL DEFAULT 0, media_file_count INTEGER NOT NULL DEFAULT 0, - copied_from_id INTEGER REFERENCES playlists(id) + copied_from_id INTEGER REFERENCES playlists(id) DEFAULT NULL ); CREATE TABLE playlists_media_files (