mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-14 06:10:29 +05:30
fix: format duration in rss feed
This commit is contained in:
parent
7b9e0ac432
commit
26844fcc1d
@ -8,6 +8,7 @@ import me.kavin.piped.utils.obj.db.Channel;
|
|||||||
import me.kavin.piped.utils.obj.db.Video;
|
import me.kavin.piped.utils.obj.db.Video;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.hibernate.StatelessSession;
|
import org.hibernate.StatelessSession;
|
||||||
|
|
||||||
@ -86,7 +87,7 @@ public class ChannelHelpers {
|
|||||||
entry.setTitle(video.getTitle());
|
entry.setTitle(video.getTitle());
|
||||||
entry.setPublishedDate(new Date(video.getUploaded()));
|
entry.setPublishedDate(new Date(video.getUploaded()));
|
||||||
|
|
||||||
String contentText = String.format("Title: %s\nViews: %d\nId: %s\nDuration: %d\nIs YT Shorts: %b", video.getTitle(), video.getViews(), video.getId(), video.getDuration(), video.isShort());
|
String contentText = String.format("Title: %s\nViews: %d\nId: %s\nDuration: %s\nIs YT Shorts: %b", video.getTitle(), video.getViews(), video.getId(), DurationFormatUtils.formatDuration(video.getDuration() * 1000, "[HH]':'mm':'ss"), video.isShort());
|
||||||
content.setValue(contentText);
|
content.setValue(contentText);
|
||||||
|
|
||||||
String thumbnailContent =
|
String thumbnailContent =
|
||||||
|
Loading…
Reference in New Issue
Block a user