mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Implement uploaderVerified for feed response.
This commit is contained in:
parent
27f4977f41
commit
90d04f9e4f
3 changed files with 13 additions and 6 deletions
|
@ -16,7 +16,7 @@ dependencies {
|
||||||
implementation 'it.unimi.dsi:fastutil-core:8.5.4'
|
implementation 'it.unimi.dsi:fastutil-core:8.5.4'
|
||||||
implementation 'commons-codec:commons-codec:1.15'
|
implementation 'commons-codec:commons-codec:1.15'
|
||||||
implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
|
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.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.4'
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.4'
|
||||||
|
|
|
@ -218,6 +218,13 @@ public class ResponseHelper {
|
||||||
me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(s, info.getId());
|
me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(s, info.getId());
|
||||||
|
|
||||||
if (channel != null) {
|
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()) {
|
for (StreamInfoItem item : info.getRelatedItems()) {
|
||||||
long time = item.getUploadDate() != null
|
long time = item.getUploadDate() != null
|
||||||
? item.getUploadDate().offsetDateTime().toInstant().toEpochMilli()
|
? item.getUploadDate().offsetDateTime().toInstant().toEpochMilli()
|
||||||
|
@ -624,7 +631,7 @@ public class ResponseHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(),
|
channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(),
|
||||||
info.getAvatarUrl(), false);
|
info.getAvatarUrl(), info.isVerified());
|
||||||
sess.save(channel);
|
sess.save(channel);
|
||||||
sess.beginTransaction().commit();
|
sess.beginTransaction().commit();
|
||||||
|
|
||||||
|
@ -835,7 +842,7 @@ public class ResponseHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(),
|
channel = new me.kavin.piped.utils.obj.db.Channel(channelId, info.getName(),
|
||||||
info.getAvatarUrl(), false);
|
info.getAvatarUrl(), info.isVerified());
|
||||||
sess.save(channel);
|
sess.save(channel);
|
||||||
|
|
||||||
Multithreading.runAsync(() -> {
|
Multithreading.runAsync(() -> {
|
||||||
|
|
|
@ -6,10 +6,10 @@ public class FeedItem {
|
||||||
|
|
||||||
public long views, duration, uploaded;
|
public long views, duration, uploaded;
|
||||||
|
|
||||||
public boolean verified;
|
public boolean uploaderVerified;
|
||||||
|
|
||||||
public FeedItem(String url, String title, String thumbnail, String uploaderUrl, String uploaderName,
|
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.url = url;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.thumbnail = thumbnail;
|
this.thumbnail = thumbnail;
|
||||||
|
@ -19,6 +19,6 @@ public class FeedItem {
|
||||||
this.views = views;
|
this.views = views;
|
||||||
this.duration = duration;
|
this.duration = duration;
|
||||||
this.uploaded = uploaded;
|
this.uploaded = uploaded;
|
||||||
this.verified = verified;
|
this.uploaderVerified = uploaderVerified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue