ActivateWindow and sortby
#1
Hi, I'm using  ActivateWindow(Music,$INFO[ListItem.FolderPath],return) on a music artist to open a list of albums, however the container opens with the sort method of title, how can I force it to open with the sort method of year, I've tried the following:-

ActivateWindow(Music,$INFO[ListItem.FolderPath]&sortby=year,return)

Any ideas?
Reply
#2
What kind of paths?
You can build xsp nodes like this for albums:
Quote:musicdb://albums/?xsp=%7b%22order%22%3a%7b%22direction%22%3a%22ascending%22%2c%22ignorefolders%22%3a0%2c%22method%22%3a%22year%22%7d%2c%22type%22%3a%22albums%22%7d
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
#3
It a db path from a artist item,
Code:
ListItem.FolderPath
returns a path in this form

Code:
musicdb://artists/28/?albumartistsonly=false

So I need to add the xsp to sortby year to the end of the ListItem.FolderPath

giving me 

Code:
ActivateWindow(Music,$INFO[ListItem.FolderPath]&xsp=%7b%22order%22%3a%7b%22direction%22%3a%22ascending%22%2c%22ignorefolders%22%3a0%2c%22method%22%3a%22year%22%7d%2c%22type%22%3a%22albums%22%7d,return)

However this still does not work, the music window opens and the albums display but are still ordered by title.
Reply
#4
you can try

code:
{"limit":0,"order":{"direction":"ascending","ignorefolders":0,"method":"year"},"rules":{"or":[{"field":"albumartist","operator":"contains","value":["$INFO[container[fooid].listitem.artist]"]},]},"type":"albums"}

which
is
code:
ActivateWindow(music,musicdb://albums/?xsp=%7B%22limit%22%3A0%2C%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22year%22%7D%2C%22rules%22%3A%7B%22or%22%3A%5B%7B%22field%22%3A%22albumartist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22$INFO[container(fooid).listitem.artist]%22%5D%7D%2C%5D%7D%2C%22type%22%3A%22albums%22%7D%20)


maybe youll need to get issues with special chars....but may that help
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#5
Thanks I'll have a play around and see if I can get it to work.
Reply
#6
(2020-04-28, 17:36)roidy Wrote: Thanks I'll have a play around and see if I can get it to work.

got a typo somewhere above

that is working for me

albums by artist containing 'faith' by year

code:
ActivateWindow(music,musicdb://albums/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22year%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22albumartist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22faith%22%5D%7D%5D%7D%2C%22type%22%3A%22albums%22%7D,return)
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#7
(2020-04-28, 18:43)mardukL Wrote:
code:
ActivateWindow(music,musicdb://albums/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sortyear%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22albumartist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22faith%22%5D%7D%5D%7D%2C%22type%22%3A%22albums%22%7D,return)

Replacing "faith" in your example with ListItem.Artist does indeed return the correct albums, however they are still sorted by title and not year Sad And as you said this method will likely break if the Artist name contains a character that needs escaping. It also fails to list albums where the artist only appears on one track like compilations and soundtracks.
Reply
#8
(2020-04-28, 18:52)roidy Wrote:
(2020-04-28, 18:43)mardukL Wrote:
code:
ActivateWindow(music,musicdb://albums/?xsp=%7B%22order%22%3A%7B%22direction%22%3A%22ascending%22%2C%22ignorefolders%22%3A0%2C%22method%22%3A%22sortyear%22%7D%2C%22rules%22%3A%7B%22and%22%3A%5B%7B%22field%22%3A%22albumartist%22%2C%22operator%22%3A%22contains%22%2C%22value%22%3A%5B%22faith%22%5D%7D%5D%7D%2C%22type%22%3A%22albums%22%7D,return)

Replacing "faith" in your example with ListItem.Artist does indeed return the correct albums, however they are still sorted by title and not year Sad And as you said this method will likely break if the Artist name contains a character that needs escaping. It also fails to list albums where the artist only appears on one track like compilations and soundtracks.

than the only way i can think of is using an additional onckilick action

like
container.setsortmethod()

some posibilitys
txt:
video)files : name, size , date , file
(video)addons : name , lastused
movies: title , year , rating , userrating , mpaa , duration , dateadded , playcount

actors/ directors: name , appearences
sets : name

tvshow : title , episode , lastplayed , dateadded , year , userrating
episode: episode , rating , userrating , mpaa , production code=status?, date , playcount , name

artist: artist , dateadded
album : album , artist , artistthenyear / , year , dateadded , playcount , lastplayed , rating , userrating
song : track , title , album , artist , artistthenyear , name , duration , rating , userrating , year , dateadded , playcount , lastplayed



source
https://kodi.wiki/view/List_of_built-in_...rt_methods
txt:

https://github.com/xbmc/xbmc/blob/master...#L529-L577
1 Name
2 Date
3 Size
4 File
5 Path
6 DriveType
7 Title
8 TrackNumber
9 Time
10 Artist
11 ArtistThenYear
12 Album
13 AlbumType
14 Genre
15 Country
16 Year
17 Rating
18 UserRating
19 Votes
20 Top250
21 ProgramCount
22 PlaylistOrder
23 EpisodeNumber
24 Season
25 NumberOfEpisodes
26 NumberOfWatchedEpisodes
27 TvShowStatus
28 TvShowTitle
29 SortTitle
30 ProductionCode
31 MPAA
32 VideoResolution
33 VideoCodec
34 VideoAspectRatio
35 AudioChannels
36 AudioCodec
37 AudioLanguage
38 SubtitleLanguage
39 Studio
40 DateAdded
41 LastPlayed
42 Playcount
43 Listeners
44 Bitrate
45 Random
46 Channel
47 ChannelNumber
48 DateTaken
49 Relevance
50 InstallDate
51 LastUpdated
52 LastUsed

Skins |  Titan M O D   •   S W A N (WIP)
Reply
#9
Yep, that's the method i went with... Just took a while to figure out SetSortMethod takes a numerical value, the main Skinning Manual Page simply says "(For list of ID's see List of sort methods below)" and then fails to provide a link to the information, so it's took me a lot of searching to find it. I'm also not sure why a numerical value is used and not a more user friendly text string.

Thanks
Reply
#10
ok.

the link on the wiki, is in the description, where it says
'see here'
my link was 'disrupted' after putting them into txt syntax (in the post above)

if anyone else need to look...
https://kodi.wiki/view/List_of_built-in_...rt_methods
https://github.com/xbmc/xbmc/blob/75b310...h#L49-L164

https://github.com/xbmc/xbmc/blob/master...#L529-L577
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#11
(2020-05-03, 05:54)mardukL Wrote: ok.

the link on the wiki, is in the description, where it says
'see here'
my link was 'disrupted' after putting them into txt syntax (in the post above)




if anyone else need to look...
https://kodi.wiki/view/List_of_built-in_...rt_methods
https://github.com/xbmc/xbmc/blob/75b310...h#L49-L164

i am also wasnt aware about the numerical value, because never tested....but good to know :-)

https://github.com/xbmc/xbmc/blob/master...#L529-L577
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#12
That's what I'm saying, there is no link in the description, it simply says see below, and then nothing Sad

https://kodi.wiki/view/Skinning_Manual#G...ilt-in.27s


Image
Reply
#13
(2020-05-03, 08:53)roidy Wrote: That's what I'm saying, there is no link in the description, it simply says see below, and then nothing Sad

https://kodi.wiki/view/Skinning_Manual#G...ilt-in.27s


Image

I noticed latetly that the description is correct.
If you scroll down to Point 3.

Where the Sortmethods are Listed with the corresponding id

Excerp:
Quote:3 List of sort methods
These ID's can be used with the Container.SetSortMethod(id) function as listed here:

ID   Description
1    Name
...
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#14
Yep, sure from https://kodi.wiki/view/List_of_built-in_...rt_methods you're right the information is there....

However I'm talking about from the MAIN SKINNING MANUAL PAGE, which is where I'm guessing most people would start there search.

https://kodi.wiki/view/Skinning_Manual#G...ilt-in.27s

Follow my link and you will see the info isn't there, it just says see below, and then nothing, making to hard to find from the main page.
Reply
#15
i've removed the 'see below' text and replaced it with a link to the list of sort methods.
it should be easy to find for everyone now.
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

Logout Mark Read Team Forum Stats Members Help
ActivateWindow and sortby0