• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
Apply custom filtering to dynamic content?
#76
That should work out of the box:
Code:

plugin://script.embuary.helper/?info=getbyargs&filter_args='"{"and": [{"or": [{"operator": "is", "field": "actor", "value": $ESCINFO[Container(90050).ListItemAbsolute(0).Label]},{"operator": "is", "field": "actor", "value": $ESCINFO[Container(90050).ListItemAbsolute(1).Label]},{"operator": "is", "field": "actor", "value": $ESCINFO[Container(90050).ListItemAbsolute(3).Label]}]}, {"operator": "isnot", "field": "title", "value": $ESCINFO[ListItem.Title]}]}"'&type=movie
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#77
if you have issues it's always save to urlencode it.

Edit:
Tested and can confirm that you have to urlencode it for some what ever reasons. Anyway. Works as it should
Code:
plugin://script.embuary.helper/?info=getbyargs&filter_args=%7B%22and%22%3A%20%5B%7B%22or%22%3A%20%5B%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem.Label]%22%7D%2C%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem(1).Label]%22%7D%2C%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem(2).Label]%22%7D%5D%7D%2C%20%7B%22operator%22%3A%20%22isnot%22%2C%20%22field%22%3A%20%22title%22%2C%20%22value%22%3A%20%22$INFO[ListItem.Label]%22%7D%5D%7D&type=movie
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#78
(2019-09-03, 16:16)sualfred Wrote: if you have issues it's always save to urlencode it.

Edit:
Tested and can confirm that you have to urlencode it for some what ever reasons. Anyway. Works as it should
Code:
plugin://script.embuary.helper/?info=getbyargs&filter_args=%7B%22and%22%3A%20%5B%7B%22or%22%3A%20%5B%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem.Label]%22%7D%2C%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem(1).Label]%22%7D%2C%7B%22operator%22%3A%20%22is%22%2C%20%22field%22%3A%20%22actor%22%2C%20%22value%22%3A%20%22$INFO[Container(200).ListItem(2).Label]%22%7D%5D%7D%2C%20%7B%22operator%22%3A%20%22isnot%22%2C%20%22field%22%3A%20%22title%22%2C%20%22value%22%3A%20%22$INFO[ListItem.Label]%22%7D%5D%7D&type=movie

@sualfred, thanks! I will do it this way. I tried without url encoding and it worked, except for movies with & and ‘ in the title, which threw a plugin error in the log.

Regards,

Bart
Reply
#79
@sualfred, thank you, it works as expected.

Regards,

Bart
Reply
#80
np
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#81
Sorry for the basic question - I read through this thread and I'm slightly confused. Should infolabels work in xsp? I'm in the movie info screen and as soon as I move from static text to an info labe, I can no longer get this working. Is this just for text input from the keyboard or can it also be used to populate content for lists based off the selected list item in infoscreens?

xml:
videodb://movies/titles/?xsp={"rules":{"and":[{"field":"director","operator":"is","value":["Quentin Tarantino"]}]},"type":"movies"}

This works well, but I can't figure out how to have this dynamically...
Reply
#82
(2019-03-06, 06:10)jurialmunkey Wrote: Proof of concept:

Here's local video info being called from videoinfo dialog for movies in the set. This is done entirely with the skinning engine and local content. There is even a breadrcrumb memory so that you can backtrack.

Also @jurialmunkey, how do you get the information for the newly selected video to repopulate the infoscreen on this video?
Reply
#83
(2020-09-12, 15:42)QuizKid Wrote: Sorry for the basic question - I read through this thread and I'm slightly confused. Should infolabels work in xsp? I'm in the movie info screen and as soon as I move from static text to an info labe, I can no longer get this working. Is this just for text input from the keyboard or can it also be used to populate content for lists based off the selected list item in infoscreens?

xml:
videodb://movies/titles/?xsp={"rules":{"and":[{"field":"director","operator":"is","value":["Quentin Tarantino"]}]},"type":"movies"}

This works well, but I can't figure out how to have this dynamically...

Just in case anyone else was having issues with this in the future, I realised what I was doing wrong is that I was putting the whole section after the xsp= into a json URL encoder so it was also encoding the characters within the infolabel string, - $ [ ] - but they should be kept as is. So the above would be:
xml:

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
Reply
#84
(2020-09-13, 08:28)QuizKid Wrote:
(2019-03-06, 06:10)jurialmunkey Wrote: Proof of concept:

Here's local video info being called from videoinfo dialog for movies in the set. This is done entirely with the skinning engine and local content. There is even a breadrcrumb memory so that you can backtrack.

Also @jurialmunkey, how do you get the information for the newly selected video to repopulate the infoscreen on this video?
hi, i was'nt get asked and unsure if he us doin it the same way, but
the result may be the same.
video: https://streamable.com/vn0nh
- i use the dialog, replace window and focus the wished item by using its db id.
- the path need to be conditional to differ between a kodi setting ( show movie set folder)
xml:


<include condition="!Skin.HasSetting(Dialog_ItemsForceSelect)" content="Action_ItemForceInfo"/>
<include condition="Skin.HasSetting(Dialog_ItemsForceSelect)" content="Action_ItemForceSelect"/>

<include name="Action_ItemForceInfo">
<onclick>Dialog.Close(movieinformation)</onclick>
<onclick condition="String.IsEqual(Container($PARAM[id]).ListItem.dbtype,movie) + [!System.GetBool(videolibrary.groupmoviesets) | [System.GetBool(videolibrary.groupmoviesets) + String.IsEmpty(Container($PARAM[id]).ListItem.SetId)]]">ReplaceWindow(Videos,videodb://movies/titles/$INFO[Container($PARAM[id]).ListItem.dbid])</onclick>
<onclick condition="String.IsEqual(Container($PARAM[id]).ListItem.dbtype,movie) + System.GetBool(videolibrary.groupmoviesets) + !String.IsEmpty(Container($PARAM[id]).ListItem.SetId)">ReplaceWindow(Videos,videodb://movies/sets/$INFO[Container($PARAM[id]).ListItem.SetId]/$INFO[Container($PARAM[id]).ListItem.dbid]?setid=$INFO[Container($PARAM[id]).ListItem.SetId])</onclick>
<onclick condition="String.IsEqual(Container($PARAM[id]).ListItem.dbtype,tvshow)">ReplaceWindow(Videos,videodb://tvshows/titles/$INFO[Container($PARAM[id]).ListItem.dbid])</onclick>
<onclick>Action(info)</onclick> maybe use alarm clock if !window.ismedia, as it dont perform the info when coming from home.xml
</include>

<include name="Action_ItemForceSelect">
<onclick condition="String.IsEqual(Container($PARAM[id]).ListItem.dbtype,movie)">PlayMedia($INFO[Container($PARAM[id]).ListItem.filenameandpath],resume)</onclick>
<onclick>Dialog.Close(movieinformation)</onclick>
<onclick condition="String.IsEqual(Container($PARAM[id]).ListItem.dbtype,tvshow)">ReplaceWindow(Videos,videodb://tvshows/titles/$INFO[Container($PARAM[id]).ListItem.dbid]/)</onclick>
</include>
- the $PARAM[id] is the container id which uses the override onclick

hope that helps.
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#85
if someone interested, i created a llittle helper to build such xsp path outside of KODI.
Pretty helpfull when like to create long paths.

Description:
txt:

It will either create xsp urls for use within kodi, based on kodi smart playlist syntax ( https://kodi.wiki/view/Smart_playlists/XSP_Method )
    So it lead you trough some options to define your wished url
    or you can simply decode a xsp url when copy paste it in ( user prompt )
    
    When finished it writes the
    - encoded url , decoded url and an experimental full content path to a text file and open it for a lookup.

- just requieres python and pip install of inquierer inquirer. To have a select dialog.

python:

import urllib.parse
import webbrowser

# pip install inquirer
import inquirer


def options(option_value,xsp_type=None,field=None):
    
    if option_value == 'Choose Method':
        list = ['encode', 'decode']
    
    if option_value == 'xsp_type':
        list = ['songs', 'albums', 'artists', 'movies', 'tvshows', 'episodes', 'musicvideos', 'mixed']
    
    elif option_value == 'match':
        list = ['and', 'or']
    
    elif option_value == 'field':
        if xsp_type == 'songs':
            list = ['Genre', 'Source', 'Album', 'Artist', 'AlbumArtist', 'Title', 'Year', 'Time', 'TrackNumber', 'Filename', 'Path', 'Playcount', 'LastPlayed', 'Rating', 'UserRating', 'Comment', 'Moods']
        elif xsp_type ==  'albums':
            list = ['Genre', 'Source', 'Album', 'Artist', 'AlbumArtist', 'Year', 'Review', 'Themes', 'Moods', 'Styles', 'Compilation', 'AlbumType', 'MusicLabel', 'Rating', 'UserRating', 'Playcount', 'LastPlayed', 'Path']
        elif xsp_type ==  'artists':
            list = ['Artist', 'Source', 'Genre', 'Moods', 'Styles', 'Instruments', 'Biography', 'ArtistType', 'Gender', 'Disambiguation', 'Born', 'BandFormed', 'Disbanded', 'Died', 'Role', 'Path']
        elif xsp_type ==  'tvshows':
            list = ['Title', 'OriginalTitle', 'Plot', 'TvShowStatus', 'Votes', 'Rating', 'UserRating', 'Year', 'Genre', 'Director', 'Actor', 'NumberOfEpisodes', 'NumberOfWatchedEpisodes', 'Playcount', 'Path', 'Studio', 'MPAA', 'DateAdded', 'LastPlayed', 'InProgress', 'Tag']
        elif xsp_type ==  'episodes':
            list = ['Title', 'TvShowTitle', 'OriginalTitle', 'Plot', 'Votes', 'Rating', 'UserRating', 'Time', 'Writer', 'AirDate', 'Playcount', 'LastPlayed', 'InProgress', 'Genre', 'Year', 'Premiered', 'Director', 'Actor', 'EpisodeNumber', 'Season', 'Filename', 'Path', 'Studio', 'Mpaa', 'DateAdded', 'Tag', 'VideoResolution', 'AudioChannels', 'AudioCount', 'SubtitleCount', 'VideoCodec', 'AudioCodec', 'AudioLanguage', 'SubtitleLanguage', 'VideoAspectRatio']
        elif xsp_type ==  'movies':
            list = ['Title', 'OriginalTitle', 'Plot', 'PlotOutline', 'Tagline', 'Votes', 'Rating', 'UserRating', 'Time', 'Writer', 'Playcount', 'LastPlayed', 'InProgress', 'Genre', 'Country', 'Year', 'Premiered', 'Director', 'Actor', 'Mpaa', 'Top250', 'Studio', 'Trailer', 'Filename', 'Path', 'Set', 'Tag', 'DateAdded', 'VideoResolution', 'AudioChannels', 'AudioCount', 'SubtitleCount', 'VideoCodec', 'AudioCodec', 'AudioLanguage', 'SubtitleLanguage', 'VideoAspectRatio']
        elif xsp_type ==  'musicvideos':
            list = ['Title', 'Genre', 'Album', 'Year', 'Artist', 'Filename', 'Path', 'Playcount', 'LastPlayed', 'Rating', 'UserRating', 'Time', 'Director', 'Studio', 'Plot', 'Tag', 'DateAdded', 'VideoResolution', 'AudioChannels', 'AudioCount', 'SubtitleCount', 'VideoCodec', 'AudioCodec', 'AudioLanguage', 'SubtitleLanguage', 'VideoAspectRatio']
        else:
            list = ['Playlist', 'VirtualFolder']

    elif option_value == 'operator':
        list = ['contains', 'doesnotcontain', 'is', 'isnot', 'startswith', 'endswith', 'lessthan', 'greaterthan', 'after', 'before']
        if field == 'date':
            # untested
            list.extend(['inthelast', 'notinthelast'])
    
    if option_value == 'Do You wanna add another Rule':
        list = ['yes', 'no']
    
    # main operand, result = {'option_value': 'RESULT STRING'}
    questions = [
        inquirer.List
           (
            option_value,
              message=f"choose {option_value}",
              choices=list,
           ),
    ]
    
    answer_dict = inquirer.prompt(questions)
    
    ## convert n override
    option_value = answer_dict[option_value]
    # test print('\n','options END', option_value,'\n\n')
    
    
    
    return option_value

def writeopenfile(method,source,result,url=None):
    lines = ['source:', source,' ','result :', result]
    with open('urlencode_decode_kodi_xsp_.txt', 'w') as f:
        for line in lines:
            f.write(line)
            f.write('\n')
    
    if method == 'encode':
        # append = ['\n','Kodi Content Tag', url]
        with open('urlencode_decode_kodi_xsp_.txt', 'a') as f:
           # f.writelines('\n'.join(append))
           f.writelines('\n'.join(['\n','experimental Kodi xml Content Tag', '<content>', url,'</content>']))
    
    webbrowser.open("urlencode_decode_kodi_xsp_.txt")
    
    return

def add_rules(xsp_type,xsp_rules,num_rules=2):
    # num_rules just inner indexing
    seperator = ','
    field = options("field", xsp_type)
    operator = options("operator", xsp_type, field)
    field_value = input("enter the field value to operate:")
    
    new_rule = '{"field":"%s","operator":"%s","value":["%s"]}' % (field,operator,field_value)
    
    xsp_rules = xsp_rules + seperator + new_rule
    
    #  inner_loop = input("like to add another rule?? type [y] if you're d'accord:")
    inner_loop = options("Do You wanna add another Rule")
    
    if inner_loop == 'yes':
        num_rules = num_rules + 1
        # print(
            # 'fixed content is=:"', xsp_type,'"\n',
            # 'current rules are=:"', xsp_rules,'"\n',
            # 'start set rule number:"', num_rules,'"\n'
            # )
        xsp_rules = add_rules(xsp_type,xsp_rules,num_rules)
    
    return xsp_rules

def main():
    
    # method = input("encode or decode:")
    method =  options("Choose Method")
    
    # use numpad
    if method == 'encode':
        xsp_type = options("xsp_type")
        match = options("match")
        field = options("field", xsp_type)
        operator = options("operator", xsp_type, field)
        field_value = input("enter the field value to operate:")
        
        xsp_rules = '{"field":"%s","operator":"%s","value":["%s"]}' % (field,operator,field_value)
        
        # add rule subr
        # get_newrule = input('like to add another rule?? :')
        get_newrule = options("Do You wanna add another Rule")
        
        if get_newrule == 'yes':
            xsp_rule = xsp_rules
            xsp_rules = add_rules(xsp_type,xsp_rule)
        
        # example* source =
        #    *  '{"rules":{"and":[{"field":"%s","operator":"%s","value":["%s"]}]},"type":"%s"}' % (field,operator,field_value,xsp_type)
        #    *  '{"rules":{"and":[{"field":"actor","operator":"contains","value":["$VAR[videoinfo_cast_container_id]"]},{"field":"title","operator":"isnot","value":["$INFO[Window(home).Property(EncodedTitle)]"]}]},"type":"movies"}'
        source = '{"rules":{"%s":[%s]},"type":"%s"}' % (match,xsp_rules,xsp_type)
        
        result = urllib.parse.quote(source.encode())
        
        
        # experimental : set db_url_root_path
        if xsp_type == 'movies' or xsp_type == 'tvshows' or xsp_type == 'episodes' or xsp_type == 'musicvideos' or xsp_type == 'videos':
            db = 'videodb'
        else:
            db = 'musicdb'
        # else: files\\ ??
        
        if xsp_type == 'movies' or xsp_type == 'tvshows' or xsp_type == 'musicvideos':
            db_url_root_path = "%s://%s/titles/?xsp=" % (db,xsp_type)
        
        elif xsp_type == 'episodes':
            db_url_root_path = f"{db}://tvshows/titles/-1/-1/?xsp="
        
        else:
            db_url_root_path = "%sdb://%s/?xsp=" % (db,xsp_type)
        
        url = db_url_root_path + result
        print(' source \n', source,'\n\n result \n', result,'\n\n full_encodedpath: \n<content>\n', url,'\n</content>')
        
        writeopenfile(method,source,result,url)
        
    # decode
    elif method == 'decode':
        # example source = '%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22christian%20bale%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D'
        source = input("Copy Paste percent encode URL :\n")
        result = urllib.parse.unquote(source)
        
        print(' source \n',source,'\n\n result: \n', result)
        writeopenfile(method,source,result)
        
    else:
        print(' Not possible ')
        
if __name__ == '__main__':
    main()

Or if you just wanna do offline de*/encoding...
python:

import urllib.parse
import webbrowser
import clipboard

def main():
    
    user_input = input("encode or decode:")
    
    #encode
    if user_input == 'encode':
        source = input("Copy Paste decoded URL here:")
        # example source =  {"rules":{"and":[{"field":"artist","operator":"is","value":["Smashing Pumpkins"]}]},"type":"Albums"}
        #                   {"rules":{"and":[{"field":"type","operator":"is","value":["soundtrack"]}]},"type":"albums"}
        #                   {"rules":{"and":[{"field":"title","operator":"contains","value":["bad"]},{"field":"rating","operator":"isnot","value":["7"]}]},"type":"tvshows"}
        result = urllib.parse.quote(source.encode())
    
    # decode, default
    elif user_input == 'decode':
        source = input("Copy Paste encoded URL here:")
        # videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22INFOLABELINTEGER%22%5D%7D%2C%7B%22field%22%3A%22title%22%2C%22operator%22%3A%22isnot%22%2C%22value%22%3A%5B%22INFOLABEL%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D
        # example source = '%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22actor%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22christian%20bale%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D'
        result = urllib.parse.unquote(source)
        
    print(' source: \n',source,'\n\n result: \n', result)    
    
    lines = ['source:', source, 'result :', result]
    with open('urlencode_decode_kodi_xsp_.txt', 'w') as f:
        for line in lines:
            f.write(line)
            f.write('\n')
    
    webbrowser.open("urlencode_decode_kodi_xsp_.txt")
    
    user_input = input("run again:")
    if user_input == 'y':
        main()
    else:
        pass

if __name__ == '__main__':
    main()
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#86
Not sure if I'm running into a syntax issue or what I'm trying to do can't be done...

I was using Embuary Helper's getsimilar widget to populate a container based on the genre of a selected movie. Content path:

xml:

plugin://script.embuary.helper/?info=getsimilar&dbid=$INFO[ListItem.DBID]&type=movie

But I want to stop children's (e.g. UK MPAA ratings U / PG) and older content (e.g. UK MPAA ratings 12A / 15 / 18  / X) from being mixed, so I was trying to recreate this filter in XSP in order to add an additional MPAA condition.

I understand this can be done in a single AND statement in a smart playlist as in the screenshot, so this is my reasoning for hoping it can be done with XSP.

xml:

<smartplaylist type="movies">
    <name>similargenre</name>
    <match>all</match>
    <rule field="genre" operator="is">
        <value>Action</value>
        <value>Thriller</value>
        <value>Science-Fiction</value>
    </rule>
    <rule field="mpaarating" operator="isnot">
        <value>15</value>
        <value>18</value>
    </rule>
</smartplaylist>

Image

Confirmation this works here: https://forum.kodi.tv/showthread.php?tid...pid2960352

But I'm having trouble escaping the strings separated by a "/"... when using them in my XSP string.

This works:

xml:

videodb://movies/titles/?xsp={"rules":{"and":[{"field":"genre","operator":"contains","value":[$ESCINFO[Window(home).Property(GenreSplit.0)]]},{"field":"mpaarating","operator":"isnot","value":[$ESCINFO[ListItem.MPAA]]}]},"type":"movies"}
But I can't find any way to get it to accept values such as "Action / Thriller" using ListItem.Genre or "G / PG" using variables or just hardcoded values in the XSP.

Does anyone know if this is possible? I run into similar problems with my director widget, which uses the following contentpath and can't handle values such as "Joel Cohen / Ethan Cohen"

xml:

videodb://movies/titles/?xsp={"rules":{"and":[{"field":"director","operator":"is","value":[$ESCINFO[ListItem.Director]]}]},"type":"movies"}

Does anyone know if this is possible?
Reply
#87
(2019-03-06, 15:03)sualfred Wrote:
Code:
<content sortby="year" sortorder="descending">...</content>

Works well. And for mixed content I use my helper script. Like the screenshot attached.


Image
hi, I found this post while searching for a way to combine movies and tv shows. This is EXACTLY what I'm looking for. Would this also work for multiple video node sources?

Appreciate any help!
Reply
#88
(2023-02-27, 16:08)3000 Wrote:
(2019-03-06, 15:03)sualfred Wrote:
Code:
<content sortby="year" sortorder="descending">...</content>

Works well. And for mixed content I use my helper script. Like the screenshot attached.


Image
hi, I found this post while searching for a way to combine movies and tv shows. This is EXACTLY what I'm looking for. Would this also work for multiple video node sources?

Appreciate any help!

The only way 'in skin' to combine movie and TV shows in one list would be using two <content> tags but the list would basically just append the results of the second <content> tag to the end. So if you wanted to sort a filtered group of movies and TV shows by 'last played', it would sort all the movies and then sort all the TV shows and stick the TV shows on the end. So not proper sorting but might work for some use cases.

If you want a combined list with proper sorting behaviour you'll need a plugin addon to build the list for you so quite a bit more work, unless it's a plugin list already included in an existing addon such as embuary helper or tmdb helper.

What are you trying to do?
Reply
#89
(2023-02-27, 21:57)realcopacetic Wrote:
(2023-02-27, 16:08)3000 Wrote:
(2019-03-06, 15:03)sualfred Wrote:
Code:
<content sortby="year" sortorder="descending">...</content>

Works well. And for mixed content I use my helper script. Like the screenshot attached.


Image
hi, I found this post while searching for a way to combine movies and tv shows. This is EXACTLY what I'm looking for. Would this also work for multiple video node sources?

Appreciate any help!

The only way 'in skin' to combine movie and TV shows in one list would be using two <content> tags but the list would basically just append the results of the second <content> tag to the end. So if you wanted to sort a filtered group of movies and TV shows by 'last played', it would sort all the movies and then sort all the TV shows and stick the TV shows on the end. So not proper sorting but might work for some use cases.

If you want a combined list with proper sorting behaviour you'll need a plugin addon to build the list for you so quite a bit more work, unless it's a plugin list already included in an existing addon such as embuary helper or tmdb helper.

What are you trying to do?
hi, thank you for your reply!!

I want to separate my movies and tv shows via tags. So movies and tv shows that fit the same tag should appear in one list/place/folder.

So appending sounds very interesting. I'd have movies first, then tv shows of the same tag in one place. Great!

But proper sorting would be really cool too...

Could you explain a bit more? Really appreciate it!
Reply
#90
(2023-02-27, 22:48)3000 Wrote:
(2023-02-27, 21:57)realcopacetic Wrote:
(2023-02-27, 16:08)3000 Wrote: hi, I found this post while searching for a way to combine movies and tv shows. This is EXACTLY what I'm looking for. Would this also work for multiple video node sources?

Appreciate any help!

The only way 'in skin' to combine movie and TV shows in one list would be using two <content> tags but the list would basically just append the results of the second <content> tag to the end. So if you wanted to sort a filtered group of movies and TV shows by 'last played', it would sort all the movies and then sort all the TV shows and stick the TV shows on the end. So not proper sorting but might work for some use cases.

If you want a combined list with proper sorting behaviour you'll need a plugin addon to build the list for you so quite a bit more work, unless it's a plugin list already included in an existing addon such as embuary helper or tmdb helper.

What are you trying to do?
hi, thank you for your reply!!

I want to separate my movies and tv shows via tags. So movies and tv shows that fit the same tag should appear in one list/place/folder.

So appending sounds very interesting. I'd have movies first, then tv shows of the same tag in one place. Great!

But proper sorting would be really cool too...

Could you explain a bit more? Really appreciate it!

No worries. So you have three options.
1) Doing it in skin with xsp only - it will be quick to get set up and you don't need to worry about addons, but you won't be able to mix your movies and tvshows together. However you sort them, it will always be movie, movie... movie, tvshow tvshow... tvshow. Or vice versa if you put the tvshow <content> tag first. I would recommend you start with this just to see if it works as you want first.

For this to work, you would want to add the following to your list container. You can change sortby and limit as you need. But this will choose 5 movies and 5 tvshows.

xml:

<content sortby="random" limit="5">videodb://movies/titles/</content>
<content sortby="random" limit="5">videodb://tvshows/titles/</content>

Now you want to add the xps filtering to the end of the paths to say that you only want results where the field 'tags' is or contains a certain value. First if the value was hardcoded e.g. the tag you want to filter by was 'football', it would look like this:

<content sortby="random" limit="5">videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22football%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</content>
<content sortby="random" limit="5">videodb://tvshows/titles/videodb://tvshows/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22football%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D</content>

Few things to note:
json:
{"rules":{"and":[{"field":"tags","operator":"is","value":["football"]}]},"type":"tvshows"}
  • The only difference with these two lines because you want them to filter by the same tag is the bit at the end where type is either 'movies' or 'tvshows'
  • To make it dynamic, you can replace 'football' with an infolabel or var then it would look like:

<content sortby="random" limit="5">videodb://movies/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[XYZ]%22%5D%7D%5D%7D%2C%22type%22%3A%22movies%22%7D</content>
<content sortby="random" limit="5">videodb://tvshows/titles/videodb://tvshows/titles/?xsp=%7B%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22tags%22%2C%22operator%22%3A%22is%22%2C%22value%22%3A%5B%22$INFO[XYZ]%22%5D%7D%5D%7D%2C%22type%22%3A%22tvshows%22%7D</content>
  • Notice that the infolabel doesn't get encoded it stays as $INFO[] and whatever is in the square brackets also doesn't get encoded, whether it's ListItem.Label or a window property or a skin string or any other place you will get the tag from that you want to filter by.
  • One other thing to note is that certain characters will break the xsp for instance if the tag has a '/' in it. To get around this, it is recommended you escape the infolabel, by changing $INFO to $ESCINFO. But if you do this, you also need to remove the %22 from either side of the $ESCINFO[] as you no longer need the "" around it.
2) Doing it with an addon
If you install an addon like Embuary Helper, then you just need to find a widget that does what you need it to. I know you can filter any by tag e.g. one of the Mixed Content widgets.

https://github.com/sualfred/script.embua...ed-content
<content sortby="random" limit="5">plugin://script.embuary.helper/?info=getinprogress&tag=HDR</content>

The only thing is that these are filtering by something AND by tag, e.g. by in progress status or genre. I'm not sure if there's one just for filtering by tag.

You can also check TMDB Helper widgets here: https://github.com/jurialmunkey/plugin.v...nal-Params

3) Making your own addon
If there's nothing quite doing what you need then you can always make your own. It's not easy, depending on your competency with Python etc. I've been learning since December and have just about got my addon doing what I want. I can give some limited help here as I've been learning how those addons above work to make my own, so can talk you through the steps, but it depends on your appetite for it.
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8

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