From: Jan-Pascal van Best Date: Tue, 11 Jun 2013 21:30:24 +0000 (+0200) Subject: At --configure, keep channels from previous configure if either name or id is the... X-Git-Tag: 1.3.1~1 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=2c8a36499e029a1d23ccb23ae5d0d45224a7a2bb;p=tv_grab_nl_java At --configure, keep channels from previous configure if either name or id is the same --- diff --git a/Changelog b/Changelog index 948de8e..08ccf0c 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,10 @@ Changelog for tv_grab_nl_java ============================= +tv_grab_nl_java-1.3.1 (2013-06-11) +- When reconfiguring, keep channels from source if either channel id + or channel name is identical + tv_grab_nl_java-1.3.0 (2013-06-11) - Change --description output to show just a single line, fixes #11 - Added fetch-channel-logos option in configuration file, fixes #12 diff --git a/src/main/java/org/vanbest/xmltv/Main.java b/src/main/java/org/vanbest/xmltv/Main.java index d042d93..e366048 100644 --- a/src/main/java/org/vanbest/xmltv/Main.java +++ b/src/main/java/org/vanbest/xmltv/Main.java @@ -196,10 +196,12 @@ public class Main { // public String cacheDbPassword; Set oldChannels = new HashSet(); + Set oldChannelNames = new HashSet(); Set oldGuides = new HashSet(); for (Channel c : config.channels) { if (c.enabled) { oldChannels.add(c.source + "::" + c.id); + oldChannelNames.add(c.source + "::" + c.defaultName()); oldGuides.add(c.source); } } @@ -239,7 +241,8 @@ public class Main { boolean none = false; boolean keep = false; for (Channel c : channels) { - boolean selected = oldChannels.contains(c.source + "::" + c.id); + boolean selected = oldChannels.contains(c.source + "::" + c.id) || + oldChannelNames.contains(c.source + "::" + c.defaultName()); System.out.print("add channel " + c.getXmltvChannelId() + " (" + c.defaultName() + ") [[y]es,[n]o,[a]ll,[none],[k]eep selection (default="