Kodi Community Forum

Full Version: How do you set a Viewtype for *all* pages in a list, not the individual ones?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I've been recently trying to solve an annoyance in Kodi that I've been having since I've started using it back in v17. In my case it has to do with the Kodi twitch.tv addon. I've asked this in the addon thread, but I was told it's the problem of the skin, not the addon. Anyway, the problem is the following:

I am browsing through the twitch.tv addon menu and I choose an option like "Browse Live Channels" that returns a list of currently live streams. Basically any option that returns a list of results will do, but I'm just giving this as an example. So after results are returned I will see this nice list of streams sorted line-by-line. I believe this view is called WideList and seems to be the default view mode globally in Kodi. I would like to change the view type for these results from "WideList" to "InfoWall", so I move my mouse cursor to the left screen edge to bring up the side menu. I now select the InfoWall option from the Viewtype list and this re-arranges the results into a nice list with stream thumbnails. The problem is when I try to change the page i.e. I go to the next page of the search results and the view will suddenly switch back to WideList. It's very unpleasant and impractical to have to manually change the view type for every page.

How can I make it so that the view type will be set for all pages in this particular list of results (i.e. "Browse Live Channels"), but not other (i.e. "Search Streams" or other addons)?
Please note I'm not trying to change the global default view type in Kodi from WideList to something else, as I'm sure some people get the cringes as soon as they read the word "default" in this context.
I'm trying to set a local default view type for a given set of search results.

I've done some poking around, and found out that kodi seems to be storing these settings in a sqlite3 database called ViewModes6.db.
The contents look like this:
sqlite> SELECT * from view;
Basically it is evident from this list that settings are being stored per each page rather than the list as a whole. What would be the easiest way to achieve what I'm looking for? For the live channels it appears two extra parameters (offset=25&platform=all) appear in every page URL after the first, so I'm guessing perhaps there should be some way to make it so that dynamic parameters (i.e. offset) are ignored. Maybe only match everything up to "plugin://plugin.video.twitch/?mode=stream_list" and everything that follows this string ignored?

For the search streams it's a similar story. The only static parameters seem to be "content=streams" and "mode=search_results".
Is there a way to make the view type sorting apply to pages that only partial match the text (i.e. regex or some other parser) rather than full string match?

you would need to look for <viewmode>
AppData\Roaming\Kodi\userdata guisettings.xml
I'm sorry, but you're going to have to be a bit more specific. There are several sub-sections in that file that have a <viewmode> defined i.e. games, musicfiles, musiclastfm, musicnavalbums, musicnavartists, musicnavsongs, pictures, programs, videofiles, videonavactors, videonavepisodes, videonavgenres, videonavmusicvideos, videonavseasons, videonavtitles, videonavtvshows, videonavyears and defaultvideosettings. Which one of these controls the twitch.tv plugin view mode? I may be wrong, but judging by the names, there isn't one in the given list.

I also find it puzzling because the numbers in those sections are set to 720896, 65536 and 0 while the actual view modes in the Esuary skin are defined by the files and numbers as follows:
-rw-r--r--  1 root root  6019 nov  4  2012 View_500_Wall.xml
-rw-r--r--  1 root root  5734 nov  4  2012 View_501_Banner.xml
-rw-r--r--  1 root root  2746 nov  4  2012 View_502_FanArt.xml
-rw-r--r--  1 root root 10035 nov  4  2012 View_50_List.xml
-rw-r--r--  1 root root  5715 nov  4  2012 View_51_Poster.xml
-rw-r--r--  1 root root  6617 nov  4  2012 View_52_IconWall.xml
-rw-r--r--  1 root root  7425 nov  4  2012 View_53_Shift.xml
-rw-r--r--  1 root root 16565 nov  4  2012 View_54_InfoWall.xml
-rw-r--r--  1 root root 10239 nov  4  2012 View_55_WideList.xml
There have been some threads in my search that suggest editing a file called MyVideoNav.xml of the given skin and setting the <defaultcontrol> value to the appropriate view i.e. 54 in my case. There's also suggestions to set the views list in a way that the preferred list view should be put in the first place i.e. <views>54,51,52,53,50,55,500,501,502</views>. But if I understand kodi correctly this ain't gonna work because it applies to the Video folder only, not the twitch addon.