diff options
author | geronimo <geronimo013@gmx.de> | 2012-07-26 17:17:09 +0200 |
---|---|---|
committer | geronimo <geronimo013@gmx.de> | 2012-07-26 17:17:09 +0200 |
commit | 37dc743591dee0e4326d0100a41f725d4704faf3 (patch) | |
tree | 7073d341cb30cdd81be535e07a73660da36d7c85 /cmpcj/src/de/schwarzrot/cmpc/domain/Media.java | |
parent | 55a02203e1d5fcdf8cbc0093af5c14d41d6d8dd7 (diff) | |
download | cmp-37dc743591dee0e4326d0100a41f725d4704faf3.tar.gz cmp-37dc743591dee0e4326d0100a41f725d4704faf3.tar.bz2 |
fixed bug around enum/int confusion
Diffstat (limited to 'cmpcj/src/de/schwarzrot/cmpc/domain/Media.java')
-rw-r--r-- | cmpcj/src/de/schwarzrot/cmpc/domain/Media.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java index e784924..2958121 100644 --- a/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java +++ b/cmpcj/src/de/schwarzrot/cmpc/domain/Media.java @@ -51,7 +51,7 @@ public class Media { } - public int getType() { + public SupportedMediaType getType() { return type; } @@ -72,11 +72,24 @@ public class Media { public void setType(int type) { - this.type = type; + if (type == SupportedMediaType.Audio.ordinal()) + this.type = SupportedMediaType.Audio; + else if (type == SupportedMediaType.Movie.ordinal()) + this.type = SupportedMediaType.Movie; + else if (type == SupportedMediaType.DVDImage.ordinal()) + this.type = SupportedMediaType.DVDImage; + else if (type == SupportedMediaType.LegacyVdrRecording.ordinal()) + this.type = SupportedMediaType.LegacyVdrRecording; + else if (type == SupportedMediaType.VdrRecording.ordinal()) + this.type = SupportedMediaType.VdrRecording; + else if (type == SupportedMediaType.Picture.ordinal()) + this.type = SupportedMediaType.Picture; + else + this.type = SupportedMediaType.Invalid; } private String name; - private int type; + private SupportedMediaType type; private String path; private String search; } |