trakt-tools 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "id": "trakt-tools",
3
3
  "name": "Trakt",
4
4
  "description": "Track movies and TV shows using trakt.tv",
5
- "version": "1.6.1",
5
+ "version": "1.7.0",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trakt-tools",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "OpenClaw plugin for Trakt.tv - track movies and TV shows",
5
5
  "type": "module",
6
6
  "openclaw": {
package/src/index.ts CHANGED
@@ -96,6 +96,24 @@ const TOOLS: ToolDef[] = [
96
96
  page: Type.Optional(Type.Number({ description: 'Page number' })),
97
97
  }),
98
98
  },
99
+ {
100
+ name: 'trakt_watchlist_add',
101
+ command: 'watchlist',
102
+ subcommand: 'add',
103
+ description:
104
+ 'Add movies or shows to the Trakt.tv watchlist. Searches by title and queues matches in one sync call. Accepts multiple titles. Items already on the list are reported under `existing_*` counts.',
105
+ parameters: Type.Object({
106
+ titles: Type.Array(Type.String(), {
107
+ description: 'Title(s) to add to the watchlist',
108
+ minItems: 1,
109
+ }),
110
+ type: Type.Optional(
111
+ Type.Union([Type.Literal('movie'), Type.Literal('show')], {
112
+ description: 'Content type (default: show)',
113
+ })
114
+ ),
115
+ }),
116
+ },
99
117
  {
100
118
  name: 'trakt_progress',
101
119
  command: 'progress',
@@ -208,6 +226,21 @@ function buildCliArgs(
208
226
  }
209
227
  }
210
228
 
229
+ // watchlist add: same title-array shape as history add, minus watched_at
230
+ // (the watchlist API has no "added at" field — Trakt assigns listed_at
231
+ // server-side at sync time).
232
+ if (command === 'watchlist' && subcommand === 'add') {
233
+ const titles = params.titles as string[] | undefined;
234
+ if (titles) {
235
+ if (params.type) args.push('--type', String(params.type));
236
+ for (const title of titles) {
237
+ args.push(title);
238
+ }
239
+ args.push('--json');
240
+ return args;
241
+ }
242
+ }
243
+
211
244
  const skipKeys = new Set(['query', 'titles']);
212
245
  for (const [key, value] of Object.entries(params)) {
213
246
  if (skipKeys.has(key) || value === undefined || value === null || value === false) continue;