@muhammedaksam/easiarr 0.8.0 → 0.8.2
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.
- package/package.json +1 -1
- package/src/api/jellyfin-api.ts +15 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muhammedaksam/easiarr",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "TUI tool for generating docker-compose files for the *arr media ecosystem with 41 apps, TRaSH Guides best practices, VPN routing, and Traefik reverse proxy support",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
package/src/api/jellyfin-api.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface StartupConfiguration {
|
|
|
17
17
|
|
|
18
18
|
export interface StartupUser {
|
|
19
19
|
Name: string
|
|
20
|
-
|
|
20
|
+
Pw: string
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface StartupRemoteAccess {
|
|
@@ -154,10 +154,22 @@ export class JellyfinClient {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
157
|
+
* Get the first user (initializes user in database)
|
|
158
|
+
*/
|
|
159
|
+
async getFirstUser(): Promise<{ Name: string; Password: string }> {
|
|
160
|
+
return this.request<{ Name: string; Password: string }>("/Startup/FirstUser")
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Create/update the initial admin user
|
|
165
|
+
* Must call getFirstUser first to initialize the user
|
|
158
166
|
*/
|
|
159
167
|
async createAdminUser(name: string, password: string): Promise<void> {
|
|
160
|
-
|
|
168
|
+
// First, get the initial user (this initializes the user in the database)
|
|
169
|
+
await this.getFirstUser()
|
|
170
|
+
|
|
171
|
+
// Then update with our credentials
|
|
172
|
+
const user: StartupUser = { Name: name, Pw: password }
|
|
161
173
|
await this.request("/Startup/User", {
|
|
162
174
|
method: "POST",
|
|
163
175
|
body: JSON.stringify(user),
|