Merge pull request #1496 from jvoisin/remove_jsonpath

Remove jsonpath
master
François-Xavier Thomas 5 years ago committed by GitHub
commit f7df8b2555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      airsonic-main/pom.xml
  2. 13
      airsonic-main/src/main/java/org/airsonic/player/service/VersionService.java

@ -520,10 +520,6 @@
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.sun.mail</groupId> <groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId> <artifactId>javax.mail</artifactId>

@ -19,7 +19,8 @@
*/ */
package org.airsonic.player.service; package org.airsonic.player.service;
import com.jayway.jsonpath.JsonPath; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.airsonic.player.domain.Version; import org.airsonic.player.domain.Version;
import org.airsonic.player.util.FileUtil; import org.airsonic.player.util.FileUtil;
import org.apache.http.client.ResponseHandler; import org.apache.http.client.ResponseHandler;
@ -37,10 +38,7 @@ import org.springframework.stereotype.Service;
import java.io.*; import java.io.*;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Comparator; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -243,7 +241,10 @@ public class VersionService {
return; return;
} }
List<String> unsortedTags = JsonPath.read(content, JSON_PATH); List<String>unsortedTags = new LinkedList<>();
for (JsonNode item: new ObjectMapper().readTree(content)) {
unsortedTags.add(item.path("tag_name").asText());
}
Function<String, Version> convertToVersion = s -> { Function<String, Version> convertToVersion = s -> {
Matcher match = VERSION_REGEX.matcher(s); Matcher match = VERSION_REGEX.matcher(s);

Loading…
Cancel
Save