forked from recloudstream/cloudstream
		
	Fixed posters not displayed NginxProvider (#952)
* Added Nginx Provider and Nginx settings * fixed some stuff * updated NginxProvider to use latest newEpisode method * hide nginx provider when no url specified * fixed some stuff * removed useless credentials variable * added url to my website * fixed tabulation * Update settings.xml * nvm * fixed poster not loading when logged in * Fix Nginx poster Now using addPoster function in Nginx Co-authored-by: sarlay <dev@sarlays.com>
This commit is contained in:
		
							parent
							
								
									94164cfe06
								
							
						
					
					
						commit
						765b3efa26
					
				
					 1 changed files with 16 additions and 19 deletions
				
			
		|  | @ -1,6 +1,7 @@ | ||||||
| package com.lagradost.cloudstream3.movieproviders | package com.lagradost.cloudstream3.movieproviders | ||||||
| 
 | 
 | ||||||
| import com.lagradost.cloudstream3.* | import com.lagradost.cloudstream3.* | ||||||
|  | import com.lagradost.cloudstream3.LoadResponse.Companion.addDuration | ||||||
| import com.lagradost.cloudstream3.LoadResponse.Companion.addRating | import com.lagradost.cloudstream3.LoadResponse.Companion.addRating | ||||||
| import com.lagradost.cloudstream3.utils.ExtractorLink | import com.lagradost.cloudstream3.utils.ExtractorLink | ||||||
| import com.lagradost.cloudstream3.TvType | import com.lagradost.cloudstream3.TvType | ||||||
|  | @ -65,23 +66,19 @@ class NginxProvider : MainAPI() { | ||||||
| 
 | 
 | ||||||
|             val data = url + dataList.firstNotNullOf { item -> item.takeIf { (!it.attr("href").contains(".nfo") &&  !it.attr("href").contains(".jpg"))} }.attr("href").toString()  // exclude poster and nfo (metadata) file |             val data = url + dataList.firstNotNullOf { item -> item.takeIf { (!it.attr("href").contains(".nfo") &&  !it.attr("href").contains(".jpg"))} }.attr("href").toString()  // exclude poster and nfo (metadata) file | ||||||
| 
 | 
 | ||||||
| 
 |             return newMovieLoadResponse( | ||||||
|             return MovieLoadResponse( |  | ||||||
|                 title, |                 title, | ||||||
|                 data, |                 url, | ||||||
|                 this.name, |  | ||||||
|                 TvType.Movie, |                 TvType.Movie, | ||||||
|                 data, |                 data | ||||||
|                 poster, |             ) { | ||||||
|                 date, |                 this.year = date | ||||||
|                 description, |                 this.plot = description | ||||||
|                 ratingAverage, |                 this.rating = ratingAverage | ||||||
|                 tagsList, |                 this.tags = tagsList | ||||||
|                 null, |                 this.trailers = trailer | ||||||
|                 trailer, |                 addPoster(poster, authHeader) | ||||||
|                 null, |             } | ||||||
|                 null, |  | ||||||
|             ) |  | ||||||
|         } else  // a tv serie |         } else  // a tv serie | ||||||
|         { |         { | ||||||
| 
 | 
 | ||||||
|  | @ -144,9 +141,9 @@ class NginxProvider : MainAPI() { | ||||||
|                                     this.name = name |                                     this.name = name | ||||||
|                                     this.season = seasonInt |                                     this.season = seasonInt | ||||||
|                                     this.episode = epNum |                                     this.episode = epNum | ||||||
|                                     this.posterUrl = poster |                                     this.posterUrl = poster  // will require headers too | ||||||
|                                     addDate(date) |  | ||||||
|                                     this.description = plot |                                     this.description = plot | ||||||
|  |                                     addDate(date) | ||||||
|                             } |                             } | ||||||
|                         ) |                         ) | ||||||
|                     } |                     } | ||||||
|  | @ -154,10 +151,10 @@ class NginxProvider : MainAPI() { | ||||||
|             return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) { |             return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) { | ||||||
|                 this.name = title |                 this.name = title | ||||||
|                 this.url = url |                 this.url = url | ||||||
|                 this.posterUrl = posterUrl |  | ||||||
|                 this.episodes = episodeList |                 this.episodes = episodeList | ||||||
|                 this.plot = description |                 this.plot = description | ||||||
|                 this.tags = tagsList |                 this.tags = tagsList | ||||||
|  |                 addPoster(posterUrl, authHeader) | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -189,7 +186,7 @@ class NginxProvider : MainAPI() { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     override suspend fun getMainPage(): HomePageResponse? { |     override suspend fun getMainPage(): HomePageResponse { | ||||||
|         val authHeader = getAuthHeader(storedCredentials)  // call again because it isn't reloaded if in main class and storedCredentials loads after |         val authHeader = getAuthHeader(storedCredentials)  // call again because it isn't reloaded if in main class and storedCredentials loads after | ||||||
|         if (mainUrl == "NONE"){ |         if (mainUrl == "NONE"){ | ||||||
|             throw ErrorLoadingException("No nginx url specified in the settings: Nginx Settigns > Nginx server url, try again in a few seconds") |             throw ErrorLoadingException("No nginx url specified in the settings: Nginx Settigns > Nginx server url, try again in a few seconds") | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue