jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
200 stars 94 forks source link

[Feature] Added YouTube video section for Movie/TV Show/Music/People information dialog #709

Closed Hawkedon closed 2 years ago

Hawkedon commented 2 years ago

Hi @jurialmunkey, I added this feature to the Arctic Horizon skin for personal use, and found it's very useful. I think some people may have interest on it too. Could you please add it to the official skin and the Arctic Horizon 2 skin if there is no objection from your side? Thanks!

Left base folder: C:\Temp\skin.arctic.horizon\Old
Right base folder: C:\Temp\skin.arctic.horizon\New
--- 1080i\Custom_1142_Recommendations.xml   2021-12-26 22:08:34.000000000 -0700
+++ 1080i\Custom_1142_Recommendations.xml   2022-04-26 06:14:31.000000000 -0700
@@ -371,12 +371,23 @@
                         <param name="hideisupdating" value="true" />
                         <movement>3</movement>
                         <include>Defs_InfoList_OnClick</include>
                         <include>Defs_InfoList_OnBack</include>
                         <content target="videos">$INFO[Window.Property(Path.CastFeature)]</content>
                     </include>
+                    <include content="Info_Widget_Poster" condition="Skin.HasSetting(EnableExtendedInfo)" >
+                        <param name="id" value="5011" />
+                        <param name="groupid" value="5111" />
+                        <param name="label" value="$LOCALIZE[31141]" />
+                        <param name="visible" value="System.HasAddon(plugin.video.youtube)" />
+                        <param name="viewtype-include" value="Viewtype_Landscape" />
+                        <param name="hideisupdating" value="true" />
+                        <movement>3</movement>
+                        <include>Defs_YoutubeList_OnClick</include>
+                        <content target="videos">$INFO[Window.Property(Path.Youtube)]</content>
+                    </include>
                     <include content="Info_Widget_Poster" condition="!Skin.HasSetting(DisableInfoListPosters) + Skin.HasSetting(EnableExtendedInfo)" >
                         <param name="id" value="5099" />
                         <param name="groupid" value="5199" />
                         <param name="label" value="$LOCALIZE[31232]" />
                         <param name="visible" value="String.IsEqual(Window.Property(DBType),movie) | String.IsEqual(Window.Property(DBType),tvshow) | String.IsEqual(Window.Property(DBType),season) | String.IsEqual(Window.Property(DBType),episode)" />
                         <param name="hideisupdating" value="true" />
--- 1080i\Includes_Defs.xml 2021-12-26 22:08:34.000000000 -0700
+++ 1080i\Includes_Defs.xml 2022-04-26 06:10:36.000000000 -0700
@@ -340,12 +340,18 @@
             <onclick condition="!String.IsEmpty(ListItem.DBID) + String.IsEqual(ListItem.DBType,movie)">RunScript(plugin.video.themoviedb.helper,add_path='"$INFO[ListItem.Label,videodb://movies/titles/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22,%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D]"',call_auto=1190)</onclick>
             <onclick condition="!String.IsEmpty(ListItem.DBID) + String.IsEqual(ListItem.DBType,tvshow)">RunScript(plugin.video.themoviedb.helper,add_path='"$INFO[ListItem.Label,videodb://tvshows/titles/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sorttitle%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22,%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D]"',call_auto=1190)</onclick>
             <!-- <onclick>RunScript(plugin.video.themoviedb.helper,add_path=$INFO[ListItem.FolderPath],call_auto=1190)</onclick> -->
         </definition>
     </include>

+    <include name="Defs_YoutubeList_OnClick">
+        <definition>
+            <onclick>RunPlugin(plugin://plugin.video.youtube/play/?video_id=$INFO[ListItem.Property(video_id)])</onclick>
+        </definition>
+    </include>
+
     <include name="Defs_Null"><description>Nothing</description></include>

     <include name="Defs_InfoButtonList">
         <left>80</left>
         <right>80</right>
         <bottom>-50</bottom>
--- 1080i\Includes_DialogMusicInfo.xml  2021-12-26 22:08:34.000000000 -0700
+++ 1080i\Includes_DialogMusicInfo.xml  2022-04-26 06:28:02.000000000 -0700
@@ -77,11 +77,22 @@
                     <onclick>Dialog.Close(12001)</onclick>
                     <onclick condition="Window.IsVisible(MyMusicNav.xml)">Container.Update($INFO[ListItem.FolderPath])</onclick>
                     <onclick condition="!Window.IsVisible(MyMusicNav.xml)">ActivateWindow(music,$INFO[ListItem.FolderPath],return)</onclick>
                     <movement>2</movement>
                     <content target="music">musicdb://albums/?xsp=%7b%22rules%22%3a%7b%22and%22%3a%5b%7b%22field%22%3a%22artist%22%2c%22operator%22%3a%22is%22%2c%22value%22%3a%5b%22$INFO[ListItem.AlbumArtist]%22%5d%7d%2c%7b%22field%22%3a%22album%22%2c%22operator%22%3a%22isnot%22%2c%22value%22%3a%5b%22$INFO[ListItem.Album]%22%5d%7d%5d%7d%2c%22type%22%3a%22albums%22%7d</content>
                 </include>
+                <include content="Info_Widget_Poster" >
+                    <param name="id" value="5004" />
+                    <param name="groupid" value="5104" />
+                    <param name="label" value="YouTube" />
+                    <param name="visible" value="System.HasAddon(plugin.video.youtube)" />
+                    <param name="viewtype-include" value="Viewtype_Landscape" />
+                    <onclick>Dialog.Close(12001)</onclick>
+                    <include>Defs_YoutubeList_OnClick</include>
+                    <movement>2</movement>
+                    <content target="videos">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.Artist] $INFO[ListItem.Title]&amp;hide_folders=true</content>
+                </include>
             </include>
         </include>

     </include>
 </includes>
--- 1080i\Includes_DialogVideoInfo.xml  2021-12-26 22:08:34.000000000 -0700
+++ 1080i\Includes_DialogVideoInfo.xml  2022-04-26 06:14:52.000000000 -0700
@@ -269,15 +269,26 @@
                     <include>Defs_InfoList_OnClick</include>
                     <include>Defs_InfoList_OnBack</include>
                     <movement>3</movement>
                     <content target="videos">plugin://plugin.video.themoviedb.helper?info=crew_in_tvshows&amp;type=person&amp;tmdb_id=$INFO[ListItem.Property(tmdb_id)]</content>
                 </include>
                 <!-- List 06 -->
-                <include content="Info_Widget_Poster">
+                <include content="Info_Widget_Poster" >
                     <param name="id" value="5006" />
                     <param name="groupid" value="5106" />
+                    <param name="label" value="YouTube" />
+                    <param name="visible" value="System.HasAddon(plugin.video.youtube)" />
+                    <param name="viewtype-include" value="Viewtype_Landscape" />                    
+                    <include>Defs_YoutubeList_OnClick</include>
+                    <movement>3</movement>
+                    <content target="videos">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.Label]&amp;hide_folders=true</content>
+                </include>
+                <!-- List 07 -->
+                <include content="Info_Widget_Poster">
+                    <param name="id" value="5007" />
+                    <param name="groupid" value="5107" />
                     <param name="label" value="Images" />
                     <onclick>SetFocus(9506)</onclick>
                     <include>Defs_InfoList_OnBack</include>
                     <movement>3</movement>
                     <content target="videos">plugin://plugin.video.themoviedb.helper?info=images&amp;type=person&amp;tmdb_id=$INFO[ListItem.Property(tmdb_id)]</content>
                 </include>
@@ -462,12 +473,13 @@
                     <onfocus>SetProperty(Path.Studio,"$VAR[Info_FromStudio]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Year,"$VAR[Info_FromYear]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Genre,"$VAR[Info_FromGenre]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Recommended,"$VAR[Info_Recommended]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Similar,"$VAR[Info_Similar]",1142)</onfocus>
                     <onfocus>SetProperty(Path.CastFeature,"$VAR[Info_CastFeature]",1142)</onfocus>
+                    <onfocus>SetProperty(Path.Youtube,"$VAR[Info_Youtube]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Posters,"$VAR[Info_Posters]",1142)</onfocus>
                     <onfocus>SetProperty(Path.Fanart,"$VAR[Info_Fanart]",1142)</onfocus>
                     <onfocus>SetProperty(Art.Fanart,"$INFO[ListItem.Art(fanart)]",1142)</onfocus>
                     <onfocus>SetProperty(Art.Discart,"$INFO[ListItem.Art(discart)]",1142)</onfocus>
                     <onfocus>SetProperty(Art.Clearlogo,"$INFO[ListItem.Art(clearlogo)]",1142)</onfocus>
                     <onfocus>SetProperty(Art.Fanart1,"$INFO[ListItem.Art(fanart1)]",1142)</onfocus>
--- 1080i\Includes_Info.xml 2021-12-26 22:08:34.000000000 -0700
+++ 1080i\Includes_Info.xml 2022-04-26 05:54:44.000000000 -0700
@@ -58,16 +58,16 @@

     <variable name="Info_CrewMembers">
         <value condition="[String.IsEqual(ListItem.DBType,movie) | String.IsEqual(ListItem.DBType,tvshow) | String.IsEqual(ListItem.DBType,season) | String.IsEqual(ListItem.DBType,episode)] + Skin.HasSetting(EnableExtendedInfo) + System.HasAddon(plugin.video.themoviedb.helper)">plugin://plugin.video.themoviedb.helper/?info=crew&amp;$VAR[Info_Param_Type]&amp;$VAR[Info_Param_IMDB_or_QUERY]&amp;nextpage=false</value>
     </variable>

     <variable name="Info_Youtube">
-        <value condition="!String.IsEmpty(ListItem.TvShowTitle) + System.HasAddon(plugin.video.youtube)">$INFO[ListItem.TvShowTitle,plugin://plugin.video.youtube/search/?q=,]</value>
-        <value condition="!String.IsEmpty(ListItem.Artist) + System.HasAddon(plugin.video.youtube)">$INFO[ListItem.Artist,plugin://plugin.video.youtube/search/?q=,]</value>
-        <value condition="!String.IsEmpty(ListItem.Title) + System.HasAddon(plugin.video.youtube)">$INFO[ListItem.Title,plugin://plugin.video.youtube/search/?q=,]</value>
-        <value condition="System.HasAddon(plugin.video.youtube)">$INFO[ListItem.Label,plugin://plugin.video.youtube/search/?q=,]</value>
+        <value condition="!String.IsEmpty(ListItem.TvShowTitle) + System.HasAddon(plugin.video.youtube)">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.TvShowTitle]&amp;hide_folders=true</value>
+        <value condition="!String.IsEmpty(ListItem.Artist) + System.HasAddon(plugin.video.youtube)">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.Artist]&amp;hide_folders=true</value>
+        <value condition="!String.IsEmpty(ListItem.Title) + System.HasAddon(plugin.video.youtube)">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.Title]&amp;hide_folders=true</value>
+        <value condition="System.HasAddon(plugin.video.youtube)">plugin://plugin.video.youtube/search/?q=$INFO[ListItem.Label]&amp;hide_folders=true</value>
     </variable>

     <variable name="Info_FromDirector">
         <value condition="String.IsEqual(ListItem.DBType,movie) + Skin.HasSetting(EnableExtendedInfo) + System.HasAddon(plugin.video.themoviedb.helper)">plugin://plugin.video.themoviedb.helper/?info=crew_in_movies&amp;type=person&amp;filter_key=job&amp;filter_value=Director&amp;query=$INFO[ListItem.Director]&amp;exclude_key=title&amp;exclude_value=$INFO[ListItem.Title]&amp;nextpage=false</value>
         <value condition="String.IsEqual(ListItem.DBType,movie) + !Window.IsVisible(DialogVideoInfo.xml) + !String.IsEmpty(Window(Home).Property(ListItem.director.0))">videodb://movies/titles/?xsp=%7b%22rules%22%3a%7b%22and%22%3a%5b%7b%22field%22%3a%22director%22%2c%22operator%22%3a%22is%22%2c%22value%22%3a%5b%22$INFO[Window(Home).Property(ListItem.director.0)]%22%5d%7d%5d%7d%2c%22type%22%3a%22movies%22%7d</value>
         <value condition="String.IsEqual(ListItem.DBType,movie)">videodb://movies/titles/?xsp=%7b%22rules%22%3a%7b%22and%22%3a%5b%7b%22field%22%3a%22director%22%2c%22operator%22%3a%22is%22%2c%22value%22%3a%5b%22$INFO[ListItem.Director]%22%5d%7d%5d%7d%2c%22type%22%3a%22movies%22%7d</value>
@@ -586,13 +586,13 @@
                 </include>
             </control>
         </definition>
     </include>

     <include name="Info_ImageViewer">
-        <param name="listid" default="5006" />
+        <param name="listid" default="5007" />
         <param name="buttonid" default="9506" />
         <param name="art" default="Art(poster)" />
         <definition>
             <control type="button" id="$PARAM[buttonid]">
                 <include>Defs_Hidden_Button</include>
                 <onleft>Control.Move($PARAM[listid],-1)</onleft>
jurialmunkey commented 2 years ago

I'm not working on AH1 anymore but I'll add a videos section in AH2 recommendations page.