mirror of
				https://github.com/TeamPiped/Piped-Backend.git
				synced 2024-08-14 23:51:41 +00:00 
			
		
		
		
	Handle lbryId timeout gracefully. (#241)
This commit is contained in:
		
							parent
							
								
									561a4f44e1
								
							
						
					
					
						commit
						ce50b7523f
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -155,12 +155,20 @@ public class ResponseHelper {
 | 
			
		|||
        if (info.getUploadDate() != null && System.currentTimeMillis() - time < TimeUnit.DAYS.toMillis(Constants.FEED_RETENTION))
 | 
			
		||||
            updateVideo(info.getId(), info, time);
 | 
			
		||||
 | 
			
		||||
        String lbryId;
 | 
			
		||||
 | 
			
		||||
        try {
 | 
			
		||||
            lbryId = futureLbryId.get(2, TimeUnit.SECONDS);
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            lbryId = null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        final Streams streams = new Streams(info.getName(), info.getDescription().getContent(),
 | 
			
		||||
                info.getTextualUploadDate(), info.getUploaderName(), substringYouTube(info.getUploaderUrl()),
 | 
			
		||||
                rewriteURL(info.getUploaderAvatarUrl()), rewriteURL(info.getThumbnailUrl()), info.getDuration(),
 | 
			
		||||
                info.getViewCount(), info.getLikeCount(), info.getDislikeCount(), info.getUploaderSubscriberCount(), info.isUploaderVerified(),
 | 
			
		||||
                audioStreams, videoStreams, relatedStreams, subtitles, livestream, rewriteURL(info.getHlsUrl()),
 | 
			
		||||
                rewriteURL(info.getDashMpdUrl()), futureLbryId.get(2, TimeUnit.SECONDS), chapters);
 | 
			
		||||
                rewriteURL(info.getDashMpdUrl()), lbryId, chapters);
 | 
			
		||||
 | 
			
		||||
        return Constants.mapper.writeValueAsBytes(streams);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue