Kodi Community Forum

Full Version: [GIT USERS] New dependency: script.maximinimalism.functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
***For those of you that install the very latest code for Maximinimalism from my Github account***

The latest code requires a new script: "script.maximinimalism.functions" that handles recent / random item content. This script is not yet available on the Kodi repository.

You can download it here: script.maximinimalism.functions. Unzip into your addons folder or install from zip like any other addon.
(2015-02-28, 23:53)thedeadman Wrote: [ -> ]https://github.com/chrisbevan/script.max...master.zip

The '.' is killing the link Smile
Fixed in OP. Sorry about that!
Out of interest, what does this do differently from library data provider? What necessitated it?
Hi JurialMunkey,

The script is - as you quite rightly say - a derivative of library data provider / skin widgets.

The main reason for going my own way was because Maximinimalism doesn't manage recent items on the home screen. My setup makes refreshing content more hassle than I wanted (killing off skin strings in various times and places - too hacky for my blood). This version doesn't run as a service and can be called anywhere.

Other reasons:

- I want to allow the user to swap between recent items listings on the fly (there's an option in the sidebar - give it a whirl). Instant random selections are quite handy in the music section I think.
- I want to be able to extend into new 'playlist' type in the future (i.e. beyond 'recommended', 'random', 'recent').
- I want to be able to open the tracklisting of a recent album rather than to just play it straight away.
- I wanted to be able to group recent episodes by their tvshow -> season, and to be able to direct the click event appropriately.

Other than all that, hell, I just wanted to play around with JSON-RPC and see what I might do with it in future :-)

With a bit of tweaking, the script should be usable by other skinners if they want. If there's any demand for it, I'll look to remove any Maximinimalism specific code.
Always fun to play around with JSON-RPC Tongue

Except for the recent episodes by season thing, most of this is achievable with some Smartplaylists saved in the skin directory and a var for content. Except for recommended episodes, everything else library data provider can do can also be done with smartplaylists -- plus a whole bunch more.

For instance I have a playlist saved in skin.arctic.zephyr/extras/NewEpisodes.xsp
PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name>New Episodes</name>
    <match>all</match>
    <limit>10</limit>
    <order direction="descending">dateadded</order>
</smartplaylist> 

In the content tag I use something like
Code:
<content>$VAR[EpisodesContent]</content>

Code:
<variable name="EpisodesContent">
    <value condition="**SOMECONDITION**">special://skin/extras/NewEpisodes.xsp</value>
    etc. etc.
</variable>

In my experience, the smart playlist will update everytime it is accessed, which is useful if you want to refresh random content everytime.


----
Some other playlists I use:
RandomMovies.xsp -- Random Movies that haven't been watched recently
PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name></name>
    <match>all</match>
    <rule field="lastplayed" operator="notinthelast">
        <value>14 Days</value>
    </rule>
    <limit>10</limit>
    <order direction="ascending">random</order>
</smartplaylist> 


-----
RecentlyWatchedEpisodes.xsp
PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="episodes">
    <name></name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>28 Days</value>
    </rule>
    <limit>10</limit>
    <order direction="descending">lastplayed</order>
</smartplaylist> 


-----
TVShows in progress ordered by most recently played. Used with target="video" in the content tag, this will jump to the show in the library -- Not quite jumping to the season, but close Wink
PHP Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="tvshows">
    <name></name>
    <match>all</match>
    <rule field="inprogress" operator="true" />
    <limit>10</limit>
    <order direction="descending">lastplayed</order>
</smartplaylist> 
Cool, thanks JurialMunkey!
Hi Mr thedeadman,

Thanks for a great skin, the only skin that both my wife and I love!

I am trying out the random/recent items, however, for the TV shows it display the seasons instead of episodes, am I doing something wrong?

Best,
Klaus
Thanks klausindc!

The new seasons / episodes thing is still a work in progress, so you're definitely not doing anything wrong :-)

The idea is to group recent episodes by tv show and then by season.. Clicking on an item should open the episode list for that tvshow / season. It makes more sense to me to do it this way as many tvshows need to be watched in order.. It also means that the random episodes option is never filled with a bunch of random episodes from the same show, giving the user a bit more variety :-)

Chances are in the final version i'll add an extra option to just return episodes as other skins do.
Hi again,

Thanks for clarifying. Now that you say why, I actually like that the seasons are displayed instead of the episodes :-)

Klaus