fix:Onlinelife: множество озвучек у сериалов
This commit is contained in:
@@ -118,10 +118,13 @@ public class Onlinelife implements KinoWarez {
|
|||||||
Map<String, List<KinoItem>> seasons = new LinkedHashMap<>();
|
Map<String, List<KinoItem>> seasons = new LinkedHashMap<>();
|
||||||
for (JsonElement element : jsonArray) {
|
for (JsonElement element : jsonArray) {
|
||||||
jsonObj = element.getAsJsonObject();
|
jsonObj = element.getAsJsonObject();
|
||||||
String titleSeason = jsonObj.get("comment").getAsString();
|
|
||||||
|
|
||||||
ArrayList<KinoItem> serials = new ArrayList<>();
|
|
||||||
JsonArray jsonSerials = jsonObj.get("playlist").getAsJsonArray();
|
JsonArray jsonSerials = jsonObj.get("playlist").getAsJsonArray();
|
||||||
|
if (jsonSerials.size() > 0) {
|
||||||
|
if (jsonSerials.get(0).getAsJsonObject().has("file")) {
|
||||||
|
String titleSeason = jsonObj.get("comment").getAsString();
|
||||||
|
ArrayList<KinoItem> serials = new ArrayList<>();
|
||||||
|
|
||||||
for (JsonElement elm1 : jsonSerials) {
|
for (JsonElement elm1 : jsonSerials) {
|
||||||
jsonObj = elm1.getAsJsonObject();
|
jsonObj = elm1.getAsJsonObject();
|
||||||
serials.add(new KinoItem(
|
serials.add(new KinoItem(
|
||||||
@@ -132,6 +135,28 @@ public class Onlinelife implements KinoWarez {
|
|||||||
|
|
||||||
serials.sort(Comparator.comparing(KinoItem::getTitle));
|
serials.sort(Comparator.comparing(KinoItem::getTitle));
|
||||||
seasons.put(titleSeason, serials);
|
seasons.put(titleSeason, serials);
|
||||||
|
} else {
|
||||||
|
// мультиозвучка
|
||||||
|
for (JsonElement elm1 : jsonSerials) {
|
||||||
|
jsonObj = elm1.getAsJsonObject();
|
||||||
|
JsonArray jsonSerials2 = jsonObj.get("playlist").getAsJsonArray();
|
||||||
|
|
||||||
|
String titleSeason = jsonObj.get("comment").getAsString();
|
||||||
|
ArrayList<KinoItem> serials = new ArrayList<>();
|
||||||
|
|
||||||
|
for (JsonElement elm2 : jsonSerials2) {
|
||||||
|
jsonObj = elm2.getAsJsonObject();
|
||||||
|
serials.add(new KinoItem(
|
||||||
|
jsonObj.get("comment").getAsString(),
|
||||||
|
jsonObj.get("file").getAsString().replace("http://", "/proxy/onlinelife/")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
serials.sort(Comparator.comparing(KinoItem::getTitle));
|
||||||
|
seasons.put(titleSeason, serials);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kinoPlay.setSeasons(seasons);
|
kinoPlay.setSeasons(seasons);
|
||||||
|
|||||||
@@ -48,5 +48,6 @@ public class TestOnlinelife extends KinoWarezTestCase {
|
|||||||
@Override
|
@Override
|
||||||
public void testFoundSeasonSerial() {
|
public void testFoundSeasonSerial() {
|
||||||
seasonsSerial("/915-doktor-kto.html", kinoWarez);
|
seasonsSerial("/915-doktor-kto.html", kinoWarez);
|
||||||
|
seasonsSerial("/11127-moya-geroyskaya-akademiya-2016.html", kinoWarez);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user