aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: fda11cef8108eea79250fe69bfaf96d81b9597a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# JnJ - Jellies and Jams
A jellyfin client built into mpv
## Configuring
Every option in JnJ may be configured via a script-message. Example:
```lua
local mp = require("mp")
local utils = require("mp.utils")

--                             action                     keybind
mp.commandv("script-message", "jnj-bind-toggle",          "Ctrl+j")
mp.commandv("script-message", "jnj-bind-enter",           "l")
mp.commandv("script-message", "jnj-bind-leave",           "h")
mp.commandv("script-message", "jnj-bind-down",            "j")
mp.commandv("script-message", "jnj-bind-up",              "k")
mp.commandv("script-message", "jnj-bind-toggle-played",   "m")
mp.commandv("script-message", "jnj-bind-toggle-favorite", "s")

-- send user login info (this should be done through a script message to ensure
-- other scripts cannot leach your password from the script-message
mp.commandv("script-message-to", "jellies_and_jams" "jnj-set-settings",
  utils.format_json({
    url = 'http://localhost:8096',
    username = 'username',
    password = 'password'
  }))
```

### Available actions
- jnj-set-settings
- jnj-bind-toggle
- jnj-bind-open
- jnj-bind-close
- jnj-bind-leave
- jnj-bind-down
- jnj-bind-up
- jnj-bind-toggle-played
- jnj-bind-toggle-favorite
- jnj-bind-top
- jnj-bind-bottom
- jnj-bind-pagedown
- jnj-bind-pageup

`jnj-bind-*` takes a keybind as their only argument

`jnj-set-settings` takes a json formatted string of the following structure:
```json
{
  "url":"",
  "username":"",
  "password":"",
  "header":{
    "prefix": "jellyfin/",
    "separator":"/",
    "contents":[
      ["watched", " ","favorite"," ","runtime"],
      ["stars"," ","rating"," ","release"]
    ]
  },
  "client":{
    "name":"Jellyfin Lua Client",
    "device":"Mpv",
    "version":"1.1"
  }
}
```
All filled in values are provided by default, but may be changed by the user.