<?xml version="1.0" encoding="UTF-8"?>
<includes>
	<include file="Defaults.xml" />
	<include file="Embuary_Widgets.xml" />
	<include file="Embuary_InfoDialog.xml" />
	<include file="Embuary_VideoInfoDialog.xml" />
	<include file="Embuary_ItemLayouts.xml" />
	<include file="Embuary_Includes.xml" />
	<include file="Embuary_LabelButtonIncludes.xml" />
	<include file="Embuary_MetaIncludes.xml" />
	<include file="Embuary_HeaderBar.xml" />
	<include file="Embuary_Animations.xml" />
	<include file="Embuary_Variables.xml" />
	<include file="Embuary_Wide_View_50.xml" />
	<include file="Embuary_Poster_View_51.xml" />
	<include file="Embuary_Square_View_52.xml" />
	<include file="Embuary_List_View_53.xml" />
	<include file="Embuary_Season_View_54.xml" />
	<include file="Embuary_Episode_View_55.xml" />
	<include file="Embuary_Set_View_56.xml" />
	<include file="Embuary_PVRSet_View_57.xml" />
	<include file="Embuary_Banner_View_58.xml" />
	<include file="Embuary_BigList_View_59.xml" />
	<include file="Embuary_Genre_View.xml" />
	<include file="Embuary_Lyrics.xml" />
	<include file="Embuary_TagHubIncludes.xml" />
	<include file="Embuary_EmbyConHubIncludes.xml" />
	<include file="Embuary_Settings.xml" />
	<include file="Embuary_WidgetTemplates.xml" />
	<include file="Embuary_WidgetCalls.xml" />
	<include file="Embuary_PositionSelectorIncludes.xml" />
	<include file="Embuary_HomeIncludes.xml" />
	<include file="Embuary_SkinSettings.xml" />
	<include file="Embuary_Sidebar.xml" />
	<include file="Embuary_Overlays.xml" />
	<include file="script-skinshortcuts-includes.xml" />

	<!-- General -->
	<expression name="DefaultTheme">[String.IsEqual(Skin.CurrentColourTheme,SKINDEFAULT) | String.StartsWith(Skin.CurrentColourTheme,Default)]</expression>

	<expression name="BlurVignette">[Skin.HasSetting(BlurEnabled) + !String.IsEmpty(Window(home).Property(listitem_blurred)) + ![[Player.HasVideo | Player.HasGame] + !Skin.HasSetting(HideBackgroundPlayback)]]</expression>

	<expression name="IsDefaultSkin">[String.IsEqual(Skin.CurrentColourTheme,SKINDEFAULT) | String.StartsWith(Skin.CurrentColourTheme,Default)]</expression>

	<expression name="IsHDR">[[String.IsEqual(ListItem.DBType,movie) | String.IsEqual(ListItem.DBType,episode) | String.IsEqual(ListItem.DBType,video)] + [String.Contains(ListItem.Label,(HDR)) | String.Contains(ListItem.Filename,.HDR.) | String.Contains(ListItem.Filename,-HDR-) | String.Contains(ListItem.Filename,- HDR -) | String.Contains(ListItem.Filename,(HDR))]]</expression>

	<expression name="HasHDRTag">[
		[[String.Contains(ListItem.Tag, / ) | String.Contains(Container(2000).ListItem.Tag, / )] + [String.Contains(ListItem.Tag,HDR ) | String.Contains(Container(2000).ListItem.Tag,HDR ) | String.Contains(ListItem.Tag, HDR) | String.Contains(Container(2000).ListItem.Tag, HDR)]]
		| [!String.Contains(ListItem.Tag, / ) + !String.Contains(Container(2000).ListItem.Tag, / ) + [String.IsEqual(ListItem.Tag,HDR) | String.IsEqual(Container(2000).ListItem.Tag,HDR)]]
		]
	</expression>

	<expression name="ArtistSlideshow">[
		Skin.HasSetting(VisRandomFanart)
		+ !Skin.HasSetting(VisFanartDisabled)
		+ System.HasAddon(script.artistslideshow)
		+ [[!String.IsEmpty(Window(Visualisation).Property(ArtistSlideshow)) + !String.EndsWith(Window(Visualisation).Property(ArtistSlideshow),black) + !String.IsEmpty(Window(Visualisation).Property(ArtistSlideshow.ArtworkReady))] | [!String.IsEmpty(Window(Visualisation).Property(ArtistSlideshow.Image)) + !String.Contains(Window(Visualisation).Property(ArtistSlideshow.Image),black-hd.png)]]
		]
	</expression>

	<expression name="HasEmbyContext">[[!String.IsEmpty(ListItem.DBID) + !String.IsEqual(ListItem.DBID,-1) | !String.IsEmpty(ListItem.Property(embyid))] + !String.IsEmpty(Window(10000).Property(emby_context)) + !Skin.HasSetting(KioskMode) + !String.StartsWith(ListItem.FolderPath,plugin://plugin.video.embycon)]</expression>

	<expression name="HasEmbyConContext">[!String.IsEmpty(ListItem.Property(id)) + String.StartsWith(ListItem.FolderPath,plugin://plugin.video.embycon)]</expression>

	<expression name="HasLibraryEditButton">[!Skin.HasSetting(HideLibraryEditButtons) + !Skin.HasSetting(KioskMode) + !String.StartsWith(ListItem.Path,plugin://)]</expression>

	<expression name="CinemaMode">[!String.IsEmpty(Skin.String(IntroPath)) | Integer.IsGreater(Skin.String(TrailerCount),0)]</expression>

	<expression name="PlayingCinemaMode">[String.Contains(Player.Art(thumb),KodiCinemaMode) | String.Contains(Player.Art(thumb),script.embuary.helper/resources/trailer.jpg)]</expression>

	<expression name="HideVideoOSD">[String.Contains(Player.Icon,script.embuary.helper/resources/trailer.jpg) | [String.Contains(Player.Icon,KodiCinemaMode) + !String.Contains(VideoPlayer.Title,Trailer)]]</expression>

	<expression name="PlayerSeek">[Player.Seeking | [!Player.Paused + Player.DisplayAfterSeek] | !String.IsEmpty(Player.SeekNumeric)]</expression>

	<expression name="ForceCinemaMode">[Skin.HasSetting(AlwaysCinemaMode) + [!String.IsEmpty(Skin.String(IntroPath)) | Integer.IsGreater(Skin.String(TrailerCount),0)]]</expression>

	<expression name="SkinSetup">[Skin.HasSetting(ApplySkinDefaults) + !Window.IsVisible(startup)]</expression>

	<expression name="HolidayTheme">[System.Date(12-01,01-07) + !Skin.HasSetting(HideHolidayTheme) + [[!Window.IsVisible(visualisation) + !VideoPlayer.IsFullscreen] | Window.IsActive(fullscreeninfo) | Window.IsActive(script-embuary-person.xml) | Window.IsActive(script-embuary-video.xml)]]</expression>

	<expression name="HolidayTheme2">[System.Date(10-30,11-01) + !Skin.HasSetting(HideHolidayTheme) + [[!Window.IsVisible(visualisation) + !VideoPlayer.IsFullscreen] | Window.IsActive(fullscreeninfo) | Window.IsActive(script-embuary-person.xml) | Window.IsActive(script-embuary-video.xml)]]</expression>

	<expression name="HolidayTheme3">[System.Date(05-04,05-05) + !Skin.HasSetting(HideHolidayTheme) + [[!Window.IsVisible(visualisation) + !VideoPlayer.IsFullscreen] | Window.IsActive(fullscreeninfo) | Window.IsActive(script-embuary-person.xml) | Window.IsActive(script-embuary-video.xml)]]</expression>

	<expression name="HolidayTheme4">[System.Date(09-08,09-09) + !Skin.HasSetting(HideHolidayTheme) + [[!Window.IsVisible(visualisation) + !VideoPlayer.IsFullscreen] | Window.IsActive(fullscreeninfo) | Window.IsActive(script-embuary-person.xml) | Window.IsActive(script-embuary-video.xml)]]</expression>

	<expression name="HideBackground">[Window.IsVisible(eventlog) | Window.IsVisible(settingscategory.xml) | Window.IsVisible(systeminfo) | Window.IsVisible(skinsettings) | Window.IsVisible(addonsettings) | Window.IsVisible(filemanager) | Window.IsVisible(profiles) | Window.IsVisible(weather) | Window.IsVisible(pvrguideinfo)]</expression>

	<expression name="InfoDialogActive">[Window.IsVisible(musicinformation) | Window.IsVisible(movieinformation) | Window.IsVisible(addoninformation) | Window.IsVisible(pvrguideinfo) | Window.IsVisible(pvrrecordinginfo) | Window.IsVisible(fullscreeninfo) | Window.IsVisible(script-embuary-video.xml) | Window.IsVisible(script-embuary-person.xml) | Window.IsVisible(1115) | Window.IsVisible(subtitlesearch) | Window.IsVisible(favourites)]</expression>

	<expression name="ScrollbarContainers">[Control.IsVisible(50) | Control.IsVisible(51) | Control.IsVisible(52) | Control.IsVisible(53) | Control.IsVisible(58) | Control.IsVisible(59)]</expression>

	<expression name="IsPlugin">[String.StartsWith(Container.Folderpath,plugin://) + !String.StartsWith(Container.FolderPath,plugin://plugin.video.emby/)]</expression>

	<expression name="IsEmbyConSource">[String.StartsWith(Container.Folderpath,plugin://plugin.video.embycon) | Window.IsVisible(1160) | Window.IsVisible(1161) | Window.IsVisible(1162) | Window.IsVisible(1163) | Window.IsVisible(1164) | Window.IsVisible(1165) | Window.IsVisible(1166) | Window.IsVisible(1167) | Window.IsVisible(1168) | Window.IsVisible(1169)]</expression>

	<expression name="IsSearching">[Container(101).IsUpdating | Container(102).IsUpdating | Container(103).IsUpdating | Container(104).IsUpdating | Container(105).IsUpdating | Container(106).IsUpdating | Container(107).IsUpdating | Container(108).IsUpdating | Container(109).IsUpdating | Container(110).IsUpdating | Container(111).IsUpdating | Container(112).IsUpdating | Container(113).IsUpdating | Container(114).IsUpdating | Container(115).IsUpdating | Container(116).IsUpdating | Container(117).IsUpdating | Container(118).IsUpdating | Container(119).IsUpdating | Container(120).IsUpdating | Container(121).IsUpdating]</expression>

	<!--<expression name="OnLibaryUpdate">[!String.IsEmpty(Window(home).Property(EmbuaryForceWidgetUpdate)) + [Window.IsVisible(home) | Window.IsVisible(1114) | Window.IsVisible(1120) | Window.IsVisible(1121) | Window.IsVisible(1122) | Window.IsVisible(1126) | Window.IsVisible(1130) | Window.IsVisible(1125)]]</expression>-->
	<expression name="OnLibaryUpdate">false</expression>

	<expression name="HasLibrary">[Library.HasContent(movies) | Library.HasContent(tvshows) | Library.HasContent(music) | Library.HasContent(musicvideos) | Library.HasContent(video)]</expression>

	<expression name="HasWeather">[String.IsEmpty(Weather.Plugin) | String.IsEqual(Weather.fanartcode,na)]</expression>

	<expression name="AutoCloseInfoDialog">[
		[String.StartsWith(ListItem.Path,plugin://plugin.video.embycon) + [String.IsEqual(ListItem.DBType,season) + String.IsEqual(ListItem.Label,All)]]
		| [!String.IsEqual(ListItem.DBType,movie) + !String.IsEqual(ListItem.DBType,tvshow) + !String.IsEqual(ListItem.DBType,episode) + !String.IsEqual(ListItem.DBType,season) + !String.IsEqual(ListItem.DBType,video) + String.IsEmpty(ListItem.Plot)]
		]
	</expression>

	<expression name="TmbdVideoFacts">
		[!String.IsEmpty(Container(10051).ListItem.Premiered) | !String.IsEmpty(Container(10051).ListItem.Property(release)) | !String.IsEmpty(Container(10051).ListItem.Property(Budget)) | !String.IsEmpty(Container(10051).ListItem.Property(Revenue))]
	</expression>

	<expression name="TmbdPersonFacts">
		[!String.IsEmpty(Container(10051).ListItem.Property(Age)) | !String.IsEmpty(Container(10051).ListItem.Property(Birthday)) | !String.IsEmpty(Container(10051).ListItem.Property(Deathday)) | !String.IsEmpty(Container(10051).ListItem.Property(place_of_birth))]
	</expression>

	<!-- Views -->
	<expression name="WideViewVisible">[
		[
			!Container.Content(seasons)
			+ !Container.Content(episodes)
			+ !String.Contains(Container.Folderpath,setid)
			+ ![String.Contains(Container.FolderPath,BoxSet) + !String.Contains(Container.FolderPath,CollapseBoxSet) + Container.Content(movies)]
			+ !Container.Content(albums)
			+ !Container.Content(songs) + !Container.Content(actors)
			+ !Container.Content(directors)
			+ !Window.IsVisible(MyPVRSearch.xml)
			+ !Window.IsVisible(MyPVRTimers.xml)
			+ !Window.IsVisible(MyPVRguide.xml)
			+ !String.StartsWith(Container.FolderPath,pvr://channels/radio/)
			+ !String.StartsWith(Container.Folderpath,androidapp://)
			+ !Container.Content(games)
			+ ![[String.StartsWith(Container.Folderpath,pvr://channels/tv) | String.StartsWith(Container.Folderpath,pvr://recordings/tv)] + String.IsEqual(Skin.String(EPGar),2to3)]
		]
		| Window.IsVisible(MyPics.xml)
		]
	</expression>

	<expression name="PosterViewVisible">[
		[Container.Content(movies) | Container.Content(tvshows) | Container.Content(sets) | Container.Content(actors) | Container.Content(directors) | String.StartsWith(Container.FolderPath,plugin://script.embuary.helper/?info=getgenre) | [[String.StartsWith(Container.Folderpath,pvr://channels/tv) | String.StartsWith(Container.Folderpath,pvr://recordings/tv)] + String.IsEqual(Skin.String(EPGar),2to3)]]
		+ !String.Contains(Container.Folderpath,setid)
		+ ![String.Contains(Container.FolderPath,BoxSet) + !String.Contains(Container.FolderPath,CollapseBoxSet) + Container.Content(movies)]
		]
	</expression>

	<expression name="SquareViewVisible">[
		[
			!Container.Content(seasons)
			+ !Container.Content(episodes)
			+ !Container.Content(movies)
			+ !Container.Content(sets)
			+ !Container.Content(tvshows)
			+ !Container.Content(videos)
			+ !Window.IsVisible(MyPVRSearch.xml)
			+ !Window.IsVisible(MyPVRTimers.xml)
			+ !Window.IsVisible(MyPVRguide.xml)
			+ !String.StartsWith(Container.Folderpath,androidapp://)
			+ !String.StartsWith(Container.FolderPath,pvr://channels/radio/)
			+ !Container.Content(games)
		]
		| Window.IsVisible(MyPics.xml)
		]
	</expression>

	<expression name="SeasonViewVisible">[
		Container.Content(seasons)
		+ [!String.StartsWith(Container.FolderPath,plugin://) | String.StartsWith(Container.FolderPath,plugin://plugin.video.emby)]
		]
	</expression>

	<expression name="ListViewVisible">[
		[
			!Container.Content(seasons)
			+ !Container.Content(episodes)
			+ !String.Contains(Container.FolderPath,setid)
			+ ![String.Contains(Container.FolderPath,BoxSet) + !String.Contains(Container.FolderPath,CollapseBoxSet) + Container.Content(movies)]
			+ !Window.IsVisible(MyPVRguide.xml)
		]
		| [Container.Content(episodes) + String.StartsWith(Container.FolderPath,plugin://) + !String.StartsWith(Container.FolderPath,plugin://plugin.video.emby) + !String.StartsWith(Container.FolderPath,plugin://plugin.video.plexbmc) + !String.StartsWith(Container.FolderPath,plugin://script.embuary) + !String.StartsWith(plugin.video.plexkodiconnect)]
		| [Container.Content(seasons) + String.StartsWith(Container.FolderPath,plugin://) + !String.StartsWith(Container.FolderPath,plugin://plugin.video.emby)]
		| Window.IsVisible(MyPics.xml)
		]
	</expression>

	<expression name="EpisodeViewVisible">[
		Container.Content(episodes)
		+ !Window.IsVisible(pictures)
		+ [!String.StartsWith(Container.FolderPath,plugin://) | String.StartsWith(Container.FolderPath,plugin://plugin.video.emby) | String.StartsWith(Container.FolderPath,plugin://script.embuary) | String.StartsWith(Container.FolderPath,plugin://plugin.video.plexbmc) | String.StartsWith(plugin.video.plexkodiconnect)]
		]
	</expression>

	<expression name="BannerViewVisible">[
		[Container.Content(movies) | Container.Content(tvshows)]
		+ !String.Contains(Container.FolderPath,setid)
		+ ![String.Contains(Container.FolderPath,BoxSet) + !String.Contains(Container.FolderPath,CollapseBoxSet) + Container.Content(movies)]
		]
	</expression>

	<expression name="SetViewVisible">[
		[Container.Content(movies) | Container.Content(tvshows) | Container.Content(sets)]
		]
	</expression>

	<expression name="HideHeaderBasedOnContainer">[
		Control.IsVisible(56) + [Container(560).HasPrevious + !Integer.IsEqual(Container(560).CurrentItem,1)]]
		| [Control.IsVisible(54) + [Container(540).HasPrevious + !Integer.IsEqual(Container(540).CurrentItem,1)]]
		| [Control.IsVisible(55) + [Container(550).HasPrevious + !Integer.IsEqual(Container(550).CurrentItem,1)]]
		| [Control.IsVisible(59) + !Container.Content(episodes) + Container(59).HasPrevious]
		| [Control.IsVisible(59) + Container.Content(episodes) + Container.HasParent + [Container(59).HasPrevious | [Integer.IsGreater(Container(59).NumItems,1) + Integer.IsGreaterOrEqual(Container(59).CurrentItem,1)]]]
		| [Control.IsVisible(59) + Container.Content(episodes) + !Container.HasParent + [Container(59).HasPrevious | [Integer.IsGreater(Container(59).NumItems,2) + Integer.IsGreaterOrEqual(Container(59).CurrentItem,2)]]]
		| [Control.IsVisible(50) + [[Integer.IsGreaterOrEqual(Container(50).CurrentItem,12) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(50).CurrentItem,13) | Container(50).HasPrevious] + ![String.IsEqual(Skin.String(EPGar),4to3) + String.StartsWith(Container.Folderpath,pvr://)]]
		| [Control.IsVisible(50) + [[Integer.IsGreaterOrEqual(Container(50).CurrentItem,15) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(50).CurrentItem,16) | Container(50).HasPrevious] + String.IsEqual(Skin.String(EPGar),4to3) + String.StartsWith(Container.Folderpath,pvr://)]
		| [Control.IsVisible(51) + [[Integer.IsGreaterOrEqual(Container(51).CurrentItem,14) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(51).CurrentItem,15) | Container(51).HasPrevious]]
		| [Control.IsVisible(52) + [[Integer.IsGreaterOrEqual(Container(52).CurrentItem,10) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(52).CurrentItem,13) | Container(52).HasPrevious]]
		| [Control.IsVisible(58) + !Skin.HasSetting(HideBannerLabels) + [[Integer.IsGreaterOrEqual(Container(58).CurrentItem,8) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(58).CurrentItem,9)| Container(58).HasPrevious]]
		| [Control.IsVisible(58) + Skin.HasSetting(HideBannerLabels) + [[Integer.IsGreaterOrEqual(Container(58).CurrentItem,10) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(58).CurrentItem,11) | Container(58).HasPrevious]]
		| [Control.IsVisible(53) + [Integer.IsGreaterOrEqual(Container(53).NumItems,8) | [Integer.IsGreaterOrEqual(Container(53).NumItems,7) + Container.HasParent]] + [[Integer.IsGreaterOrEqual(Container(53).CurrentItem,4) + Container.HasParent] | Integer.IsGreaterOrEqual(Container(53).CurrentItem,5) | Container(53).HasPrevious]
		]
	</expression>

	<expression name="RecHasThumb">
		[String.StartsWith(ListItem.Path,pvr://recordings) + !String.StartsWith(ListItem.Icon,Default) + !String.IsEqual(ListItem.ActualIcon,ListItem.Icon)]
	</expression>

	<expression name="PlayerRecHasThumb">
		[String.StartsWith(Player.Filenameandpath,pvr://recordings) + !String.IsEqual(Window(home).Property(Player.Channellogo),Player.Icon)]
	</expression>

	<expression name="IsWatched">
		[Integer.IsLess(ListItem.Property(UnWatchedEpisodes),1) + !String.IsEqual(ListItem.Overlay,OverlayUnwatched.png) + [String.IsEqual(ListItem.Overlay,OverlayWatched.png) | Integer.IsGreaterOrEqual(ListItem.PlayCount,1)]]
	</expression>

	<expression name="ForceLabels">
		[String.StartsWith(Container.FolderPath,plugin://script.embuary.helper/?info=getgenre)]
	</expression>

</includes>


