]> www.vanbest.org Git - tv_grab_nl_java/commitdiff
At --configure, keep channels from previous configure if either name or id is the...
authorJan-Pascal van Best <janpascal@vanbest.org>
Tue, 11 Jun 2013 21:30:24 +0000 (23:30 +0200)
committerJan-Pascal van Best <janpascal@vanbest.org>
Tue, 11 Jun 2013 21:30:24 +0000 (23:30 +0200)
Changelog
src/main/java/org/vanbest/xmltv/Main.java

index 948de8e685e5892d54cb9296183a69fba791a633..08ccf0c9bbe5b3865cbb512140e2ab17fcbe1d70 100644 (file)
--- 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
index d042d939b48dbf4d75e3cdddc65585f9ff95b8aa..e366048de07452a192c380a61c733ac4a5dbe5c4 100644 (file)
@@ -196,10 +196,12 @@ public class Main {
                // public String cacheDbPassword;
 
                Set<String> oldChannels = new HashSet<String>();
+               Set<String> oldChannelNames = new HashSet<String>();
                Set<Integer> oldGuides = new HashSet<Integer>();
                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="