How to fill a list with all the music video from an artist?
#1
I'm trying to fill a list with all the music videos from an artist, no matter the album they belong to. I'm trying with (and all kind of variations based on it...):

<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/*</content>

...but it doesn't work, the reason behind this is that I do get all the songs from an artist bypassing the album with something similar...

musicdb://artists/$INFO[Container(50).ListItem.DBID]/-1/*

...can anyone tell me what I'm doing wrong? Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#2
(2021-06-11, 01:18)manfeed Wrote:  

Have you already tried XSP?
Reply
#3
not sure if it will work, but try this:
<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
(2021-06-11, 12:20)ronie Wrote: not sure if it will work, but try this:
<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>
Thanks, but unfortunately it doesn't work...

My fault... it works ok. Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#5
(2021-06-11, 11:59)Fuchs2468 Wrote:
(2021-06-11, 01:18)manfeed Wrote:  

Have you already tried XSP?
Thanks, no, I don't know how XSP works...
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#6
(2021-06-11, 21:05)manfeed Wrote:
(2021-06-11, 11:59)Fuchs2468 Wrote:
(2021-06-11, 01:18)manfeed Wrote:  

Have you already tried XSP?
Thanks, no, I don't know how XSP works...

This xsp works, I've tested it:-

Code:
{"rules":{"and":[{"field":"artist","operator":"is","value":["$INFO[Container(50).ListItem.Artist]"]}]},"type":"musicvideos"}

You then need to URL encode it (don't encode the $INFO[...]) to give:-

Code:
%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[Container(50).ListItem.Artist]%22%5d%7d%5d%7d%2c%22type%22%3a%22musicvideos%22%7d

Then make the <content> out of it to give:-

Code:
<content>videodb://musicvideos/titles/?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[Container(50).ListItem.Artist]%22%5d%7d%5d%7d%2c%22type%22%3a%22musicvideos%22%7d</content>

This thread will help with xsp https://forum.kodi.tv/showthread.php?tid=341640

I don't know what your Container(50) contains so you may need to use ListItem.Title or ListItem.label
Reply
#7
i use some of this paths depending on use case and available dbid's | labels

musicvideos videodb://musicvideos/artists/
mvidalbums
videoodb://musicvideos/artists/[artists video dbid ]/
all by artist
videodb://musicvideos/artists/[artists video dbid ]/-1/?artistid=[artists video dbid]
all by album of artist videodb://musicvideos/artists/[artists video dbid ]/[album id]/?artistid=[artists video dbid]



$INFO[Control.GetLabel(8001).index(1)] is the label of a filter control, you can use something other, e.g listitem.artist

filter matching title
<variable name="HUB_content_musicvideo_titles">
<value condition="!String.IsEmpty(Control.GetLabel(8001).index(1))">videodb://musicvideos/titles/?
xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%5D%7D%2C%22type%22%3A%22musicvideos%22%7D</value>
<value>videodb://musicvideos/titles/</value>
</variable>
filter matching title or artist
<variable name="HUB_content_musicvideo_titles_or_artist">
<value condition="!String.IsEmpty(Control.GetLabel(8001).index(1))">videodb://musicvideos/titles/?
xsp=%7B%22rules%22%3A%7B%22or%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%2C%7B%22field%22%3A%22artist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%5D%7D%2C%22type%22%3A%22musicvideos%22%7D</value>
<value>videodb://musicvideos/titles/</value>
</variable>

matching titles in artist root
<!-- revisit - cant filter musicvideo folder -->
<variable name="HUB_content_musicvideo_artist">
<value condition="!String.IsEmpty(Control.GetLabel(8001).index(1)) + !String.IsEqual(Window(home).Property(HUB_Music),songs) + !String.IsEqual(Window(home).Property(HUB_Music),albums)">videodb://musicvideos/artists/?
xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%5D%7D%2C%22type%22%3A%22musicvideos%22%7D</value>
<value condition="String.IsEmpty(Control.GetLabel(8001).index(1)) + !String.IsEqual(Window(home).Property(HUB_Music),songs) + !String.IsEqual(Window(home).Property(HUB_Music),albums)">videodb://musicvideos/artists/</value>
</variable>
matching titles in artist root
<variable name="HUB_content_musicvideo_albums">
<value condition="!String.IsEmpty(Control.GetLabel(8001).index(1)) + String.IsEqual(Window(home).Property(HUB_Music),albums)">videodb://musicvideos/albums/?x
sp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22album%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[Control.GetLabel(8001).index(1)]%22%5D%7D%5D%7D%2C%22type%22%3A%22musicvideos%22%7D</value>
<value condition="String.IsEmpty(Control.GetLabel(8001).index(1)) + String.IsEqual(Window(home).Property(HUB_Music),albums)">videodb://musicvideos/albums/</value>
</variable>
Skins                                                                                        
Reply
#8
(Yesterday, 10:09)roidy Wrote:
(2021-06-11, 21:05)manfeed Wrote:
(2021-06-11, 11:59)Fuchs2468 Wrote: Have you already tried XSP?
Thanks, no, I don't know how XSP works...

This xsp works, I've tested it:-

Code:
{"rules":{"and":[{"field":"artist","operator":"is","value":["$INFO[Container(50).ListItem.Artist]"]}]},"type":"musicvideos"}

You then need to URL encode it (don't encode the $INFO[...]) to give:-

Code:
%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[Container(50).ListItem.Artist]%22%5d%7d%5d%7d%2c%22type%22%3a%22musicvideos%22%7d

Then make the <content> out of it to give:-

Code:
<content>videodb://musicvideos/titles/?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[Container(50).ListItem.Artist]%22%5d%7d%5d%7d%2c%22type%22%3a%22musicvideos%22%7d</content>

This thread will help with xsp https://forum.kodi.tv/showthread.php?tid=341640

I don't know what your Container(50) contains so you may need to use ListItem.Title or ListItem.label

Thanks! It works very well!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#9
(2021-06-11, 12:20)ronie Wrote: not sure if it will work, but try this:
<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>

Thanks @ronie

The option given by @roidy didn't work for me at first, but since he said he was sure it worked I double checked my code and I realized I had made a silly mistake (that's often the case when you spend hours trying different options...) after fixing it roidy's code worked and then I tested yours and it also worked!... apologies for the mistake, and thanks again for your help!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#10
(2021-06-11, 21:04)manfeed Wrote:
(2021-06-11, 12:20)ronie Wrote: not sure if it will work, but try this:
<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>
Thanks, but unfortunately it doesn't work...

My fault... it works ok. Thanks!

May I ask what the issue was? 

<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>

Doesn't work for me either.
Reply
#11
(Yesterday, 13:11)roidy Wrote:
(2021-06-11, 21:04)manfeed Wrote:
(2021-06-11, 12:20)ronie Wrote: not sure if it will work, but try this:
<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>
Thanks, but unfortunately it doesn't work...

My fault... it works ok. Thanks!

May I ask what the issue was? 

<content>videodb://musicvideos/artists/$INFO[Container(50).ListItem.DBID]/-1/?artistid=$INFO[Container(50).ListItem.DBID]</content>

Doesn't work for me either.
A visibility condition... this code works ok under "Artists" in Music Videos section... (container 597 is the number of the view being used)

                    <control type="list" id="5949">
                        <visible>Container.Content(musicvideos) | String.StartsWith(container.folderpath,library://video/musicvideos/) | String.StartsWith(container.folderpath,videodb://musicvideos)</visible>
                        <width>512</width>
                        <height>258</height>
                        <left>25</left>
                        <top>750</top>
                        <orientation>vertical</orientation>
                        <itemlayout width="510" height="28">
                            <control type="label">
                                <scroll>false</scroll>
                                <height>28</height>
                                <aligny>center</aligny>
                                <align>left</align>
                                <font>font28</font>
                                <label>· $INFO[ListItem.Label] $INFO[ListItem.Duration,(,)]</label>
                            </control>
                        </itemlayout>
                        <focusedlayout width="510" height="28">
                            <control type="label">
                                <scroll>false</scroll>
                                <height>28</height>
                                <aligny>center</aligny>
                                <align>left</align>
                                <font>font28</font>
                                <label>· $INFO[ListItem.Label] $INFO[ListItem.Duration,(,)]</label>
                            </control>
                        </focusedlayout>
                        <content>videodb://musicvideos/artists/$INFO[Container(597).ListItem.DBID]/-1/?artistid=$INFO[Container(597).ListItem.DBID]</content>
                    </control>
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#12
(Yesterday, 13:24)manfeed Wrote: this code works ok under "Artists" in Music Videos section...

That's the problem I'm trying to get the Music Videos for artists under the main music library not the music video library.

For some reason artist dbid's are not the same between the main music section and the music video section, even though the artists are the same.... guess I'll stick to the xsp method.
Reply
#13
(Yesterday, 15:38)roidy Wrote:
(Yesterday, 13:24)manfeed Wrote: this code works ok under "Artists" in Music Videos section...

That's the problem I'm trying to get the Music Videos for artists under the main music library not the music video library.

For some reason artist dbid's are not the same between the main music section and the music video section, even though the artists are the same.... guess I'll stick to the xsp method.
Only difference I found between your xsp metod and ronie’s is that with yours, Aly&AJ returned nothing, whereas ronie’s one worked. There must be an issue with special characters like ‘&’ with xsp…
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :) 
Reply
#14
(Yesterday, 16:04)manfeed Wrote:
(Yesterday, 15:38)roidy Wrote:
(Yesterday, 13:24)manfeed Wrote: this code works ok under "Artists" in Music Videos section...

That's the problem I'm trying to get the Music Videos for artists under the main music library not the music video library.

For some reason artist dbid's are not the same between the main music section and the music video section, even though the artists are the same.... guess I'll stick to the xsp method.
Only difference I found between your xsp metod and ronie’s is that with yours, Aly&AJ returned nothing, whereas ronie’s one worked. There must be an issue with special characters like ‘&’ with xsp…

Yep, special characters need to be encoded. I use onload to run 

Code:
<onload>RunScript(script.embuary.helper,action=encode,string='$INFO[ListItem.Artist]',prop=EncodedArtistName)</onload>

Then use the resulting window property in the xsp request:-

Code:
<content>videodb://musicvideos/titles/?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[Window(home).Property(EncodedArtistName)]%22%5d%7d%5d%7d%2c%22type%22%3a%22musicvideos%22%7d</content>

Seems to work fine for any special character's I've come across so far. Just don't try using this method in a list, python will never keep up with the scrolling.
Reply



Logout Mark Read Team Forum Stats Members Help
How to fill a list with all the music video from an artist?0
This forum uses Lukasz Tkacz MyBB addons.