• 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)
Apply custom filtering to dynamic content?
(2023-09-24, 14:20)manfeed Wrote:
(2023-09-24, 03:43)jurialmunkey Wrote: @manfeed - Okay music should be fixed now and bitrate working as a filter for songs in v1.1.24
Thanks! Now it works well for music too. I somehow thought I could filter by any field. I'm afraid I will have to ask you to add another filter then, but that will be for a new song field that will be available for Omega, so everything is fine for now.   Smile
@jurialmunkey

First of all, thanks for your hard work extending the boundaries of what Kodi can do! Now that Omega has reached Beta, I can tell you what music library field I would need to filter by. It's the new field 'VideoURL' (I'm not sure if that's the actual name, since the infolabel that shows that information is 'ListItem.SongVideoURL'). The reason why I need this is that I would like to provide the users a list with all available music videos for an artist when opening the info music dialog screen for an artist.

Thanks in advance!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
(2023-11-04, 01:55)manfeed Wrote:
(2023-09-24, 14:20)manfeed Wrote:
(2023-09-24, 03:43)jurialmunkey Wrote: @manfeed - Okay music should be fixed now and bitrate working as a filter for songs in v1.1.24
Thanks! Now it works well for music too. I somehow thought I could filter by any field. I'm afraid I will have to ask you to add another filter then, but that will be for a new song field that will be available for Omega, so everything is fine for now.   Smile
@jurialmunkey

First of all, thanks for your hard work extending the boundaries of what Kodi can do! Now that Omega has reached Beta, I can tell you what music library field I would need to filter by. It's the new field 'VideoURL' (I'm not sure if that's the actual name, since the infolabel that shows that information is 'ListItem.SongVideoURL'). The reason why I need this is that I would like to provide the users a list with all available music videos for an artist when opening the info music dialog screen for an artist.

Thanks in advance!

@manfeed - It looks like I should be able to retrieve this field via JSON-RPC with the "songvideourl" property.

What scraper / scraper settings do you need to use to get this field in the library?

EDIT: Figured it out -- needed script.videolinks
https://github.com/the-black-eagle/script.videolinks
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
@manfeed - Added to v1.1.46 of skinvariables
https://github.com/jurialmunkey/script.s...ag/v1.1.46

I tested using this path and it got every song in my library with a songvideourl, so appears to work correctly.
Code:
plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key=songvideourl&filter_value=plugin://&&musicdb://songs/

Note that in the filtered list ListItem.SongVideoURL will be added as a property ListItem.Property(SongVideoURL) rather than an infolabel because I couldn't see any setter added for it in the Python API. The artwork for videothumb will still be in Art(videothumb) though.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
@jurialmunkey

Thanks, it works like a charm! Today I can finally say that my old dream about how this feature should work has come true. I really think this feature is a game changer for the music library, I'm discovering music videos from my artists I didn't even know that existed, and in other cases, I can't help but playing my favourite ones; really, really cool!

Thanks again!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
(2023-11-05, 01:15)manfeed Wrote: @jurialmunkey

Thanks, it works like a charm! Today I can finally say that my old dream about how this feature should work has come true. I really think this feature is a game changer for the music library, I'm discovering music videos from my artists I didn't even know that existed, and in other cases, I can't help but playing my favourite ones; really, really cool!

Thanks again!

No problem at all!

I'm happy that you mentioned it because I didn't know that was in the works. Like you say, really really great feature.

I used to basically try to fake this by using youtube search as a widget, so it's amazing to have a proper way to do it now -- especially since it stops all the false-positive matches from youtube or having to scroll through the search results to find the actual video you want!

Side note black_eagle just added an info tag setter for me, so I'll make an update to skinvariables and infotagger to allow it to be set directly to the infolabel once that hits the nightlies.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
(2023-11-04, 05:56)jurialmunkey Wrote: @manfeed - Added to v1.1.46 of skinvariables
https://github.com/jurialmunkey/script.s...ag/v1.1.46

I tested using this path and it got every song in my library with a songvideourl, so appears to work correctly.
Code:
plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key=songvideourl&filter_value=plugin://&&musicdb://songs/

Note that in the filtered list ListItem.SongVideoURL will be added as a property ListItem.Property(SongVideoURL) rather than an infolabel because I couldn't see any setter added for it in the Python API. The artwork for videothumb will still be in Art(videothumb) though.

@jurialmunkey

Hi, since this method worked well in my tests (with a small number of artists) I started using it in my main system, with my whole music library (850 artists - 22000 songs). I call for all video links for an artist in the info dialog screen with the line (by the way, I don't know how I could show the right syntax of the line, because it keeps changing the code for &amp):

xml:
<content>plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key__one=songvideourl&filter_value__one=plugin://&filter_key__two=artist&filter_value__two=$INFO[ListItem.Label]&&musicdb://songs/</content>

It gets the right data, but my issue is that despite having a very powerful windows PC with the music database in a local SSD it takes almost 15 seconds to show the results. A related side effect is that when opening the info dialog screen for another artist, you get the data from the previous artist during those 15 seconds until the new data is fetched. Is there something I could do to shorten that delay?

Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
@manfeed - Yeah with 22000 songs it is going to be slow because the filter is applied after the directory is retrieved -- so musicdb://songs/ path is essentially asking it to retrieve details for all 22000 songs and then filter by artist

I'll add some threading which should help speed up the process but the best approach would be to prefilter the list by using a more specific path if possible.

Do you have the Artist DBID? Because a much faster path to use will be :

Code:
musicdb://artists/ARTISTDBID/-1/-2/?albumartistsonly=true&artistid=ARTISTDBID

Otherwise you can use the standard filtering approach with an encoded smart playlist path to get only songs by artist first:

Code:
musicdb://songs/?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%22artist%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[ListItem.Label]%22%5D%7D%5D%7D%2C%22type%22%3A%22songs%22%7D

e.g. Assuming $INFO[ListItem.Label] is Artist name then this should work
Code:
plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key__one=songvideourl&filter_value__one=plugin://&&musicdb://songs/?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%22artist%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[ListItem.Label]%22%5D%7D%5D%7D%2C%22type%22%3A%22songs%22%7D


---

BTW "&" is what the paths actually use. The only reason we need to replace "&" with "&amp;" in skins is because XML reserves "&" as a special character -- so to use "&" in a skin XML we need to replace it with its XML character reference "&amp;" (which then becomes "&" when the XML is parsed).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
(2023-11-11, 01:44)jurialmunkey Wrote: e.g. Assuming $INFO[ListItem.Label] is Artist name then this should work
Code:
plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key__one=songvideourl&filter_value__one=plugin://&&musicdb://songs/?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%22artist%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[ListItem.Label]%22%5D%7D%5D%7D%2C%22type%22%3A%22songs%22%7D
You made my day, now it's less than a second! When I'm older I want to be like you...

Many thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
@jurialmunkey

Sorry to ask you again... you're becoming kind of a wishing well for me. Currently I have a list in my info dialog screen that shows all the videos for an artist/album, you can browse it and click on any of them and the video starts playing, it's very cool, but I think it could be even cooler if I somehow could offer the user a way to play all the videos in a row, without having to click in each one... I have tried many things, but still unable to get that... Do you know of any way to make that possible? Thanks in advance!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
@manfeed Does using the "isdir" param with "PlayMedia()" on the container url not work?

i.e.

PlayMedia(plugin://CONTAINERURL,isdir)
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
(2023-11-16, 08:45)jurialmunkey Wrote: @manfeed Does using the "isdir" param with "PlayMedia()" on the container url not work?

i.e.

PlayMedia(plugin://CONTAINERURL,isdir)

Sorry, I have a number for the container, but I don’t know what is CONTAINERURL. How can I get that?

For instance, the container I use is:

code:
<control type="fixedlist" id="6828">
    <width>680</width>
    <height>390</height>
    <onclick>PlayMedia($INFO[ListItem.Property(SongVideoURL)],1)</onclick>
    <itemlayout width="675" height="43">
        <control type="label">
            <font>font15</font>
            <width>670</width>
            <height>43</height>
            <align>left</align>
            <aligny>center</aligny>
            <label>$INFO[ListItem.Label][/B] $INFO[ListItem.Year,(,)]</label>
        </control>
    </itemlayout>
    <focusedlayout width="675" height="43">
        <control type="label">
            <font>font15</font>
            <left>1</left>
            <height>43</height>
            <width>670</width>
            <align>left</align>
            <aligny>center</aligny>
            <label>$INFO[ListItem.Label][/B] $INFO[ListItem.Year,(,)]</label>
        </control>
    </focusedlayout>
    <content>plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key__one=songvideourl&filter_value__one=plugin://&&musicdb://songs/?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%2C%7B%22field%22%3A%22album%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Window(home).Property(EncodedAlbumName)]%22%5D%7D%5D%7D%2C%22type%22%3A%22songs%22%7D</content>
</control>

I tried this, but it doesn't work:

code:
<control type="button" id="612">
    <visible>String.IsEqual(ListItem.DBTYPE,album)</visible>
    <font>IconMediumMD</font>
    <width>65</width>
    <texturenofocus/>
    <include>ButtonInfoDialogsCommonValues</include>
    <label></label>
    <onclick>PlayMedia(plugin://script.skinvariables/?info=get_filter_dir&library=music&filter_key__one=songvideourl&filter_value__one=plugin://&&musicdb://songs/?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%2C%7B%22field%22%3A%22album%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[Window(home).Property(EncodedAlbumName)]%22%5D%7D%5D%7D%2C%22type%22%3A%22songs%22%7D,isdir)</onclick>
</control>

Thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
@manfeed Yeah your example of what you tried is what I meant but seeing it written out, I see the problem now! You aren't wanting to queue the items but rather videos in the properties of the items. No sensible way to do that natively that I can think of (short of hardcoding 100s of onclicks for each position in the list)

I think definitely will need a script. Shouldn't be too hard to knock together something. I'll have a think about best way to approach it and get back to you.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8(current)

Logout Mark Read Team Forum Stats Members Help
Apply custom filtering to dynamic content?0