Allow disc_number to be a string (1/2, 2/2, for example).

This commit is contained in:
Jonathan Bernard 2016-03-21 01:12:38 -05:00
parent 795a7c8c76
commit 3d65a47781
3 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@ public class MediaLibrary {
mf.name = fileTag?.getFirst(TITLE)?.trim() ?: f.name
mf.comment = fileTag?.getAll(COMMENT)?.collect { it.trim() }?.join('\n\n')
mf.discNumber = safeToInteger(fileTag?.getFirst(DISC_NO)) ?: 1
mf.discNumber = fileTag?.getFirst(DISC_NO) ?: '1'
mf.trackNumber = safeToInteger(fileTag?.getFirst(TRACK))
def folderParts = mf.filePath.split("[\\\\/]")[1..<-1] as LinkedList

View File

@ -8,7 +8,7 @@ public class MediaFile extends Model {
public static final String FILE_LOCATION = "file location";
public String name;
public Integer discNumber;
public String discNumber;
public Integer trackNumber;
public int playCount = 0;
public String filePath;

View File

@ -17,7 +17,7 @@ CREATE INDEX albums_name_idx ON albums(name);
CREATE TABLE media_files (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
disc_number INTEGER NOT NULL DEFAULT 1,
disc_number VARCHAR NOT NULL DEFAULT '1',
track_number INTEGER,
play_count INTEGER NOT NULL DEFAULT 0,
file_path VARCHAR NOT NULL,