Implement uploaderVerified for feed response.

This commit is contained in:
FireMasterK 2021-08-17 22:59:15 +05:30
parent 27f4977f41
commit 90d04f9e4f
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
3 changed files with 13 additions and 6 deletions

View file

@ -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'

View file

@ -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(() -> {

View file

@ -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;
}
}