2018-09-12 10:26:21 -07:00
|
|
|
define(["connectionManager","listView","cardBuilder","imageLoader","libraryBrowser","emby-itemscontainer","emby-linkbutton"],function(connectionManager,listView,cardBuilder,imageLoader,libraryBrowser){"use strict";function renderItems(page,item){var sections=[];item.ArtistCount&§ions.push({name:Globalize.translate("TabArtists"),type:"MusicArtist"}),item.ProgramCount&&"Person"==item.Type&§ions.push({name:Globalize.translate("HeaderUpcomingOnTV"),type:"Program"}),item.MovieCount&§ions.push({name:Globalize.translate("TabMovies"),type:"Movie"}),item.SeriesCount&§ions.push({name:Globalize.translate("TabShows"),type:"Series"}),item.EpisodeCount&§ions.push({name:Globalize.translate("TabEpisodes"),type:"Episode"}),item.TrailerCount&§ions.push({name:Globalize.translate("TabTrailers"),type:"Trailer"}),item.GameCount&§ions.push({name:Globalize.translate("TabGames"),type:"Game"}),item.AlbumCount&§ions.push({name:Globalize.translate("TabAlbums"),type:"MusicAlbum"}),item.MusicVideoCount&§ions.push({name:Globalize.translate("TabMusicVideos"),type:"MusicVideo"});var elem=page.querySelector("#childrenContent");elem.innerHTML=sections.map(function(section){var html="",sectionClass="verticalSection";return"Audio"===section.type&&(sectionClass+=" verticalSection-extrabottompadding"),html+='<div class="'+sectionClass+'" data-type="'+section.type+'">',html+='<div class="sectionTitleContainer sectionTitleContainer-cards">',html+='<h2 class="sectionTitle sectionTitle-cards padded-left">',html+=section.name,html+="</h2>",html+='<a is="emby-linkbutton" href="#" class="clearLink hide" style="margin-left:1em;vertical-align:middle;"><button is="emby-button" type="button" class="raised more raised-mini noIcon">'+Globalize.translate("ButtonMore")+"</button></a>",html+="</div>",html+='<div is="emby-itemscontainer" class="itemsContainer padded-left padded-right">',html+="</div>",html+="</div>"}).join("");for(var sectionElems=elem.querySelectorAll(".verticalSection"),i=0,length=sectionElems.length;i<length;i++)renderSection(page,item,sectionElems[i],sectionElems[i].getAttribute("data-type"))}function renderSection(page,item,element,type){switch(type){case"Program":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"Program",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"StartDate"},{shape:"backdrop",showTitle:!0,centerText:!0,overlayMoreButton:!0,preferThumb:!0,overlayText:!1,showAirTime:!0,showAirDateTime:!0,showChannelName:!0});break;case"Movie":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"Movie",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"SortName"},{shape:"portrait",showTitle:!0,centerText:!0,overlayMoreButton:!0,overlayText:!1,showYear:!0});break;case"MusicVideo":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"MusicVideo",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"SortName"},{shape:"portrait",showTitle:!0,centerText:!0,overlayPlayButton:!0});break;case"Game":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"Game",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"SortName"},{shape:"portrait",showTitle:!0,centerText:!0,overlayMoreButton:!0});break;case"Trailer":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"Trailer",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"SortName"},{shape:"portrait",showTitle:!0,centerText:!0,overlayPlayButton:!0});break;case"Series":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"Series",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:10,SortBy:"SortName"},{shape:"portrait",showTitle:!0,centerText:!0,overlayMoreButton:!0});break;case"MusicAlbum":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"MusicAlbum",PersonTypes:"",ArtistIds:"",AlbumArtistIds:""},{shape:"square",playFromHere:!0,showTitle:!0,showYear:!0,coverImage:!0,centerText:!0,overlayPlayButton:!0});break;case"MusicArtist":loadItems(element,item,type,{MediaTypes:"",IncludeItemTypes:"MusicArtist",PersonTypes:"",ArtistIds:"",AlbumArtistIds:"",Limit:8,SortBy:"So
|