Merge pull request #1667 from mfietz/issue/1658-sync-duplicates

Prevent gpodder sync duplicates
This commit is contained in:
Tom Hennen 2016-02-13 11:52:44 -05:00
commit 5cdd873fad
1 changed files with 8 additions and 2 deletions

View File

@ -735,13 +735,19 @@ public class GpodnetService {
List<String> added = new LinkedList<String>();
JSONArray jsonAdded = object.getJSONArray("add");
for (int i = 0; i < jsonAdded.length(); i++) {
added.add(jsonAdded.getString(i));
String addedUrl = jsonAdded.getString(i);
// gpodder escapes colons unnecessarily
addedUrl = addedUrl.replace("%3A", ":");
added.add(addedUrl);
}
List<String> removed = new LinkedList<String>();
JSONArray jsonRemoved = object.getJSONArray("remove");
for (int i = 0; i < jsonRemoved.length(); i++) {
removed.add(jsonRemoved.getString(i));
String removedUrl = jsonRemoved.getString(i);
// gpodder escapes colons unnecessarily
removedUrl = removedUrl.replace("%3A", ":");
removed.add(removedUrl);
}
long timestamp = object.getLong("timestamp");