diff --git a/build.gradle b/build.gradle index 15df005..10413d4 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ dependencies { implementation 'it.unimi.dsi:fastutil-core:8.5.4' implementation 'commons-codec:commons-codec:1.15' implementation 'org.bouncycastle:bcprov-jdk15on:1.69' - implementation 'com.github.TeamNewPipe:NewPipeExtractor:5a882637855cbf1edc201fa38d4a79dc45506be0' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:d8179dc35ae036bfd6e450a7050e998e0f1b041f' implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.4' diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 9355c00..a391050 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -218,6 +218,13 @@ public class ResponseHelper { me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(s, info.getId()); if (channel != null) { + if (channel.isVerified() != info.isVerified()) { + channel.setVerified(info.isVerified()); + if (!s.getTransaction().isActive()) + s.getTransaction().begin(); + s.update(channel); + s.getTransaction().commit(); + } for (StreamInfoItem item : info.getRelatedItems()) { long time = item.getUploadDate() != null ? item.getUploadDate().offsetDateTime().toInstant().toEpochMilli() @@ -624,7 +631,7 @@ public class ResponseHelper { } channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(), - info.getAvatarUrl(), false); + info.getAvatarUrl(), info.isVerified()); sess.save(channel); sess.beginTransaction().commit(); @@ -835,7 +842,7 @@ public class ResponseHelper { } channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(), - info.getAvatarUrl(), false); + info.getAvatarUrl(), info.isVerified()); sess.save(channel); Multithreading.runAsync(() -> { diff --git a/src/main/java/me/kavin/piped/utils/obj/FeedItem.java b/src/main/java/me/kavin/piped/utils/obj/FeedItem.java index 5197085..e2411ae 100644 --- a/src/main/java/me/kavin/piped/utils/obj/FeedItem.java +++ b/src/main/java/me/kavin/piped/utils/obj/FeedItem.java @@ -6,10 +6,10 @@ public class FeedItem { public long views, duration, uploaded; - public boolean verified; + public boolean uploaderVerified; public FeedItem(String url, String title, String thumbnail, String uploaderUrl, String uploaderName, - String uploaderAvatar, long views, long duration, long uploaded, boolean verified) { + String uploaderAvatar, long views, long duration, long uploaded, boolean uploaderVerified) { this.url = url; this.title = title; this.thumbnail = thumbnail; @@ -19,6 +19,6 @@ public class FeedItem { this.views = views; this.duration = duration; this.uploaded = uploaded; - this.verified = verified; + this.uploaderVerified = uploaderVerified; } }