diff options
Diffstat (limited to 'vdrmanager')
3 files changed, 34 insertions, 65 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java index 0c841b9..bbd3181 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java @@ -114,10 +114,10 @@ public abstract class Event { return shortText; } if (TextUtils.isEmpty(description) == false) { - if (description.length() < 30) { + if (description.length() < 50) { return description; } - return TextUtils.substring(description, 0, 30) + "…"; + return TextUtils.substring(description, 0, 50) + "…"; } return ""; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java index 323b1cc..c999bba 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java @@ -4,6 +4,7 @@ import static de.bjusystems.vdrmanager.gui.Utils.mapSpecialChars; import java.util.Date; +import android.text.TextUtils; import de.bjusystems.vdrmanager.StringUtils; import de.bjusystems.vdrmanager.app.C; @@ -13,50 +14,6 @@ public class Recording extends Event { public static final String FOLDERDELIMCHAR = "~"; - public class Folder { - - public String name; - - public Folder parent; - - private String path; - - public boolean isRoot() { - return parent == null; - } - - public String getFullPath() { - if (this.path != null) { - return this.path; - } - if (isRoot()) { - this.path = ""; - } else { - this.path = parent.getFullPath() + "/" + name; - } - - return path; - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - return ((Folder) o).name.equals(this.name); - } - - @Override - public int hashCode() { - return name.hashCode(); - } - - @Override - public String toString() { - return name + "(" + path + ")"; - } - }; - public Recording(String line) { final String[] words = StringUtils.splitPreserveAllTokens(line, C.DATA_SEPARATOR); @@ -65,7 +22,7 @@ public class Recording extends Event { start = new Date(Long.parseLong(words[idx++]) * 1000); stop = new Date(Long.parseLong(words[idx++]) * 1000); channelName = mapSpecialChars(words[idx++]); - eventTitle = mapSpecialChars(words[idx++]); + title = mapSpecialChars(words[idx++]); shortText = mapSpecialChars(words[idx++]); description = mapSpecialChars(words[idx++]); fileName = mapSpecialChars(words[idx++]); @@ -89,24 +46,31 @@ public class Recording extends Event { } if (idx < words.length) { // name - String titleRaw = mapSpecialChars(words[idx]); + String titleRaw = mapSpecialChars(words[idx++]); int idxdel = titleRaw.lastIndexOf(FOLDERDELIMCHAR); if (idxdel == -1) { title = titleRaw; folder = ROOT_FOLDER; } else { title = titleRaw.substring(idxdel + 1); - String foldersRaw = titleRaw.substring(0, idxdel); - folder = foldersRaw; } } else { - title = eventTitle; folder = ROOT_FOLDER; } + if (idx < words.length) { + if (words[idx++].equals("1")) { + neww = true; + } + } + if (title.charAt(0) == '%') { + cut = true; + title = title.substring(1); + } + } private String folder; @@ -121,7 +85,9 @@ public class Recording extends Event { private String devInode = null; - private String eventTitle = null; + private boolean cut = false; + + private boolean neww = false; /** * If it is not null, recording is on going or will be on going until this @@ -129,14 +95,6 @@ public class Recording extends Event { */ private Date timerStopTime = null; - public String getEventTitle() { - return eventTitle; - } - - public void setEventTitle(String eventTitle) { - this.eventTitle = eventTitle; - } - public Date getTimerStopTime() { return timerStopTime; } @@ -155,7 +113,7 @@ public class Recording extends Event { /** * in millis - * + * * @return */ public long getRealDuration() { @@ -214,4 +172,13 @@ public class Recording extends Event { this.folder = folder; } + public boolean isCut() { + return cut; + } + + + public boolean isNeww() { + return neww; + } + }
\ No newline at end of file diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/RecordingListItem.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/RecordingListItem.java index 58d798c..8395364 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/RecordingListItem.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/RecordingListItem.java @@ -1,11 +1,13 @@ package de.bjusystems.vdrmanager.data; +import de.bjusystems.vdrmanager.gui.RecordingDir; + public class RecordingListItem extends EventListItem { - public String folder; + public RecordingDir folder; - public Integer count = 0; + //public Integer count = 0; public RecordingListItem(Recording rec) { super(rec); @@ -20,7 +22,7 @@ public class RecordingListItem extends EventListItem { @Override public String getTitle() { if(isFolder()){ - return folder; + return folder.getName(); } return super.getTitle(); } @@ -34,7 +36,7 @@ public class RecordingListItem extends EventListItem { @Override public String getHeader() { if (isFolder()) { - return folder; + return folder.getName(); } else { return super.getHeader(); } |