diff options
Diffstat (limited to 'cmpcj/src/de/schwarzrot/media/domain')
-rw-r--r-- | cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java | 31 | ||||
-rw-r--r-- | cmpcj/src/de/schwarzrot/media/domain/Genre.java | 49 |
2 files changed, 46 insertions, 34 deletions
diff --git a/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java b/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java index 573726c..95659aa 100644 --- a/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java +++ b/cmpcj/src/de/schwarzrot/media/domain/AbstractMediaNode.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: AbstractMediaNode.java - * Created: 13. June 2012, 04:57 - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: AbstractMediaNode.java Created: 13. June 2012, 04:57 Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -143,6 +143,7 @@ public abstract class AbstractMediaNode implements Serializable, Comparable<Abst public void setName(String name) { this.name = name; properties.put(NAME_PROPERTY, name); + refresh(); } @@ -227,7 +228,7 @@ public abstract class AbstractMediaNode implements Serializable, Comparable<Abst protected void refresh() { if (parent != null && realPath != null) - realPath = new File(parent.getRealPath(), realPath.getName()); + realPath = new File(parent.getRealPath(), getName()); } diff --git a/cmpcj/src/de/schwarzrot/media/domain/Genre.java b/cmpcj/src/de/schwarzrot/media/domain/Genre.java index 5bbb463..b19c550 100644 --- a/cmpcj/src/de/schwarzrot/media/domain/Genre.java +++ b/cmpcj/src/de/schwarzrot/media/domain/Genre.java @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== * - * File: Genre.java - * Created: 13. June 2012, 04:57 - * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a> - * Project: cmpc - a java frontend (client) part of compound media player - * uses external players to play the media + * File: Genre.java Created: 13. June 2012, 04:57 Author: <a + * href="mailto:geronimo013@gmx.de">Geronimo</a> Project: cmpc - a java frontend + * (client) part of compound media player uses external players to play the + * media * * CMP - compound media player * - * is a client/server mediaplayer intended to play any media from any workstation - * without the need to export or mount shares. cmps is an easy to use backend - * with a (ready to use) HTML-interface. Additionally the backend supports - * authentication via HTTP-digest authorization. - * cmpc is a client with vdr-like osd-menues. + * is a client/server mediaplayer intended to play any media from any + * workstation without the need to export or mount shares. cmps is an easy to + * use backend with a (ready to use) HTML-interface. Additionally the backend + * supports authentication via HTTP-digest authorization. cmpc is a client with + * vdr-like osd-menues. * - * Copyright (c) 2012 Reinhard Mantey, some rights reserved! - * published under Creative Commons by-sa - * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! published under + * Creative Commons by-sa For details see + * http://creativecommons.org/licenses/by-sa/3.0/ * - * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * The cmp project's homepage is at + * http://projects.vdr-developer.org/projects/cmp * * -------------------------------------------------------------- */ @@ -70,6 +70,13 @@ public class Genre extends AbstractMediaNode { } + @Override + public void refresh() { + super.refresh(); + update(); + } + + public void removeGenre(Genre g) { children.remove(g); } @@ -108,12 +115,16 @@ public class Genre extends AbstractMediaNode { public void update() { // instances has moved, so all children and media members must be updated - for (Genre g : children) { - g.refresh(); - g.update(); + if (children != null) { + for (Genre g : children) { + g.refresh(); + g.update(); + } + } + if (mediaList != null) { + for (Media m : mediaList) + m.refresh(); } - for (Media m : mediaList) - m.refresh(); } private List<Media> mediaList; |