core/torrent-handler/core-system-manifest.js
2025-02-27 19:18:54 +01:00

168 lines
4.0 KiB
JavaScript

// core/torrent-handler/manifest.js
export default {
coreID: "1000",
name: "Torrent Handler (Transmission)",
description: "System for handling torrents",
version: "1.0.0",
author: "MasterDraco",
// Configuration schema
configuration: [
{
field: "transmission_url",
type: "string",
label: "Transmission URL",
description: "URL to the Transmission RPC interface (e.g. http://localhost:9091/transmission/rpc)",
required: true,
default: "http://localhost:9091/transmission/rpc"
},
{
field: "transmission_username",
type: "string",
label: "Username",
description: "Username for Transmission authentication",
required: false,
default: ""
},
{
field: "transmission_password",
type: "string",
label: "Password",
description: "Password for Transmission authentication",
required: false,
default: ""
},
{
field: "default_seed_ratio",
type: "number",
label: "Default Seed Ratio",
description: "Default ratio to seed torrents (e.g. 2.0 means seed until shared 2x the download size)",
required: false,
default: 1.0
},
{
field: "default_seed_time",
type: "number",
label: "Default Seed Time (minutes)",
description: "Default time to seed torrents in minutes",
required: false,
default: 60
},
{
field: "auto_start_torrents",
type: "boolean",
label: "Auto-start Torrents",
description: "Automatically start torrents when added",
required: false,
default: true
}
],
// Navigation structure
navigation: [
{
id: "torrent_dashboard",
name: "Torrent Dashboard",
icon: "download",
route: "/torrents"
},
{
id: "torrent_add",
name: "Add Torrent",
icon: "plus-circle",
route: "/torrents/add"
},
{
id: "torrent_settings",
name: "Torrent Settings",
icon: "settings",
route: "/torrents/settings"
}
],
// Main features
features: [
{
feature: "transmission_connection",
description: "Connect to Transmission RPC API",
dataModel: {
url: "string",
username: "string",
password: "string",
sessionId: "string"
}
},
{
feature: "torrent_management",
description: "Start, stop, and delete torrents",
dataModel: {
torrentId: "number",
action: "string"
}
},
{
feature: "add_torrent",
description: "Add new torrents by uploading torrent file",
dataModel: {
torrentFile: "file",
seedRatio: "number",
seedTime: "number",
autoStart: "boolean",
downloadDirectory: "string"
}
},
{
feature: "torrent_settings",
description: "Configure default torrent settings",
dataModel: {
defaultSeedRatio: "number",
defaultSeedTime: "number",
defaultDownloadDirectory: "string"
}
}
],
// Extension points (hooks)
hooks: [
{
id: "torrent_added",
purpose: "Called when a new torrent is added to the system",
dataFormat: {
torrentId: "number",
name: "string",
size: "number",
addedTimestamp: "number"
}
},
{
id: "torrent_completed",
purpose: "Called when a torrent completes downloading",
dataFormat: {
torrentId: "number",
name: "string",
downloadDirectory: "string",
files: "array"
}
},
{
id: "torrent_removed",
purpose: "Called when a torrent is removed from the system",
dataFormat: {
torrentId: "number",
name: "string",
reason: "string"
}
},
{
id: "before_torrent_action",
purpose: "Called before performing an action on a torrent (start, stop, delete)",
dataFormat: {
torrentId: "number",
name: "string",
action: "string",
cancel: "boolean"
}
}
]
};