Skip to content

Instantly share code, notes, and snippets.

@CF-Terence
CF-Terence / gist:3016533
Created June 29, 2012 07:47
XBMC search function
/*
* Function: Search the array list of TV shows and get the results that matches exactly/contain the characters in the search string
*/
self.getSearchedMovieArray = function(search_string){
//CF.setJoin("d"+(listJoin+1), 0); //hide the movie wall list
//CF.setJoin("d"+listJoin, 1); // show the thumbnail and title wall list only.
//push all values into array into a singular format
self.rpc("VideoLibrary.GetMovies", { "sort": {"order": "ascending", "method": "label"}, "properties": ["playcount", "title", "thumbnail", "fanart"]}, function(data) {
@CF-Terence
CF-Terence / gist:2934095
Created June 15, 2012 01:26 — forked from jarrodbell/gist:2924984
Delaying color picker commands
// Push the modules into the startup process
CF.modules.push({name: "Color Picker", object: ColorPicker});
var myColorPicker;
function sendCmd(string) {
CF.send("AppleKNX", string);
};
// Only one CF.userMain function in all scripts is allowed!
@CF-Terence
CF-Terence / gist:2297598
Created April 4, 2012 03:50
Playing Dune from XBMC
self.playMovie = function(file) {
if (file === undefined) {
var file = self.currentMovieFile; // This would give full path :D:\Movie\MoviesHD\Title of the movie (2011).mkv
}
// truncate front characters from e.g. D:\Movie\MoviesHD\Title of the movie (2011).mkv to get filename and extension only.
var filext = file.slice(14); // Note : Slice characters will depend on directory path e.g. D:\Movie\MoviesHD\
//send command to Dune player.
CF.request("http://192.168.0.104/cgi-bin/do?cmd=start_file_playback&media_url=storage_name://Clayton2tb5/Movie/MoviesHD/"+filext, null);