API v1 to v2 Differences Reference¶
Overview¶
This document provides a complete mapping of API v1 methods to their API v2 equivalents. Use this as a quick reference during migration.
Quick Comparison Table¶
| Category | API v1 | API v2 | Module |
|---|---|---|---|
| HTTP | showtime.httpGet() |
http.request() |
movian/http |
| Service | plugin.createService() |
service.create() |
movian/service |
| Pages | plugin.addURI() |
new page.Route() |
movian/page |
| Search | plugin.addSearcher() |
new page.Searcher() |
movian/page |
| Settings | plugin.createSettings() |
new settings.globalSettings() |
movian/settings |
| Storage | plugin.createStore() |
store.create() |
movian/store |
| Cache | plugin.cachePut/Get() |
misc.cachePut/Get() + JSON |
native/misc |
| Logging | showtime.print() |
console.log() |
Built-in |
| JSON | showtime.JSONDecode() |
JSON.parse() |
Built-in |
| Strings | showtime.entityDecode() |
string.entityDecode() |
native/string |
| Popups | showtime.message() |
popup.message() |
native/popup |
| Crypto | showtime.md5digest() |
crypto.hashCreate() |
native/crypto |
| Files | showtime.basename() |
fs.basename() |
native/fs |
| System | showtime.currentVersionString |
Core.currentVersionString |
Global |
| Plugin | plugin.path |
Plugin.path |
Global |
Complete Mapping Reference¶
HTTP & Networking¶
Simple GET Request¶
API v1:
API v2:
GET with Parameters¶
API v1:
API v2:
var http = require('movian/http');
var response = http.request(url, {
args: {param: 'value'},
headers: headers
});
Advanced HTTP Request¶
API v1:
API v2:
var http = require('movian/http');
http.request(url, {
method: 'POST',
postdata: data,
headers: headers
}, callback);
Services & Pages¶
Create Service¶
API v1:
API v2:
Add Page Route¶
API v1:
API v2:
Add Search Provider¶
API v1:
API v2:
var page = require('movian/page');
new page.Searcher(title, icon, function(page, query) {
// Search handler
});
Storage & Data¶
Create Store¶
API v1:
API v2:
Cache Put¶
API v1:
API v2:
var misc = require('native/misc');
misc.cachePut(
'plugin/' + Plugin.id + '/' + stash,
key,
JSON.stringify(object),
maxage
);
Cache Get¶
API v1:
API v2:
var misc = require('native/misc');
var json = misc.cacheGet('plugin/' + Plugin.id + '/' + stash, key);
var object = json ? JSON.parse(json) : null;
Settings¶
Create Settings¶
API v1:
API v2:
var settings = require('movian/settings');
var s = new settings.globalSettings(Plugin.id, title, icon, description);
Create String Setting¶
API v1:
API v2:
String Utilities¶
Entity Decode¶
API v1:
API v2:
Query String Split¶
API v1:
API v2:
Path Escape¶
API v1:
API v2:
Parameter Escape¶
API v1:
API v2:
Duration to String¶
API v1:
API v2:
Popup & UI¶
Message Dialog¶
API v1:
API v2:
Notification¶
API v1:
API v2:
Text Dialog¶
API v1:
API v2:
Auth Credentials¶
API v1:
API v2:
Cryptography¶
MD5 Digest¶
API v1:
API v2:
var crypto = require('native/crypto');
var hash = crypto.hashCreate('md5');
crypto.hashUpdate(hash, str);
var digest = crypto.hashFinalize(hash);
var hexdigest = Duktape.enc('hex', digest);
SHA1 Digest¶
API v1:
API v2:
var crypto = require('native/crypto');
var hash = crypto.hashCreate('sha1');
crypto.hashUpdate(hash, str);
var digest = crypto.hashFinalize(hash);
var hexdigest = Duktape.enc('hex', digest);
File System¶
Basename¶
API v1:
API v2:
Copy File¶
API v1:
API v2:
System Information¶
Current Version String¶
API v1:
API v2:
Current Version Int¶
API v1:
API v2:
Device ID¶
API v1:
API v2:
System IP Address¶
API v1:
API v2:
JSON Operations¶
JSON Decode¶
API v1:
API v2:
JSON Encode¶
API v1:
API v2:
Logging¶
Print¶
API v1:
API v2:
Trace¶
API v1:
API v2:
Plugin Information¶
Plugin Path¶
API v1:
API v2:
Plugin ID¶
API v1:
API v2:
Plugin Descriptor¶
API v1:
API v2:
Advanced Features¶
Rich Text¶
API v1:
API v2:
Item Hook¶
API v1:
API v2:
var itemhook = require('movian/itemhook');
itemhook.create({
title: "Action",
handler: function(item) { }
});
Subtitle Provider¶
API v1:
plugin.addSubtitleProvider(function(req) {
req.addSubtitle(url, title, lang, format, source, score);
});
API v2:
var subtitle = require('native/subtitle');
subtitle.addProvider(function(root, query, basescore, autosel) {
subtitle.addItem(root, url, title, lang, format, source,
basescore + score, autosel);
}, Plugin.id, Plugin.id);
HTTP Auth¶
API v1:
API v2:
Select View¶
API v1:
API v2:
Probe¶
API v1:
API v2:
Sleep¶
API v1:
API v2:
Get Subtitle Languages¶
API v1:
API v2:
XML-RPC¶
API v1:
API v2:
var io = require('native/io');
var xml = require('movian/xml');
var args = [arg1, arg2, ...];
var result = io.xmlrpc(url, method, JSON.stringify(args));
var parsed = xml.htsmsg(result);
Module Reference¶
movian/* Modules¶
| Module | Purpose | Common Methods |
|---|---|---|
movian/http |
HTTP requests | request() |
movian/service |
Service registration | create() |
movian/page |
Page routing | Route(), Searcher() |
movian/store |
Persistent storage | create() |
movian/settings |
Plugin settings | globalSettings() |
movian/prop |
Property system | RichText() |
movian/itemhook |
Item actions | create() |
movian/xml |
XML parsing | htsmsg() |
native/* Modules¶
| Module | Purpose | Common Methods |
|---|---|---|
native/popup |
UI dialogs | message(), notify(), textDialog() |
native/string |
String utilities | entityDecode(), pathEscape() |
native/crypto |
Cryptography | hashCreate(), hashUpdate() |
native/fs |
File system | basename(), copyfile() |
native/io |
I/O operations | probe(), xmlrpc() |
native/misc |
Miscellaneous | cachePut(), cacheGet() |
native/subtitle |
Subtitles | addProvider(), getLanguages() |
Deprecated Methods¶
These API v1 methods have no direct API v2 equivalent or are handled differently:
| API v1 Method | Status | Alternative |
|---|---|---|
plugin.config |
Removed | Use settings module |
plugin.properties |
Changed | Use prop.global.plugin[Plugin.id] |
showtime.RichText |
Moved | Use prop.RichText from movian/prop |
Migration Priority¶
High Priority (Core Functionality)¶
- ✅
plugin.jsonapiversion field - ✅ HTTP requests (
showtime.httpGet→http.request) - ✅ Service creation (
plugin.createService→service.create) - ✅ Page routes (
plugin.addURI→new page.Route) - ✅ Logging (
showtime.print→console.log)
Medium Priority (Common Features)¶
- ✅ Settings (
plugin.createSettings→new settings.globalSettings) - ✅ Storage (
plugin.createStore→store.create) - ✅ String utilities (
showtime.*→string.*) - ✅ JSON operations (
showtime.JSON*→JSON.*) - ✅ Popups (
showtime.message→popup.message)
Low Priority (Advanced Features)¶
- ✅ Cache (
plugin.cache*→misc.cache*+ JSON) - ✅ Cryptography (
showtime.*digest→crypto.*) - ✅ File system (
showtime.basename→fs.basename) - ✅ Item hooks (
plugin.addItemHook→itemhook.create) - ✅ Subtitle providers (
plugin.addSubtitleProvider→subtitle.addProvider)
See Also¶
- API Versions - API version overview
- Migration Guide - Step-by-step migration
- Plugin Architecture - Plugin system overview
- API Reference - Complete API v2 documentation
Source References¶
- API v1 Emulation:
movian/res/ecmascript/legacy/api-v1.js - API Version Constants:
movian/src/ecmascript/ecmascript.h:227 - Runtime Implementation:
movian/src/ecmascript/ecmascript.c
Status: ✅ Ready for Use
Last Updated: 2025-11-08
Movian Version: 4.8+
Accuracy: 🟢 Verified from source code