{
key: 'symlink',
value: {
- host_path: form.data.host_path,
- container_path: form.data.container_path
+ rclone_path: form.data.rclone_path,
+ library_path: form.data.library_path
}
},
{
@@ -56,14 +116,14 @@ export const contentSettingsServices: string[] = ['content'];
export const contentSettingsSchema = z.object({
overseerr_enabled: z.boolean().default(false),
- overseerr_url: z.string().url().optional().default(''),
+ overseerr_url: z.string().optional().default(''),
overseerr_api_key: z.string().optional().default(''),
mdblist_enabled: z.boolean().default(false),
mdblist_api_key: z.string().optional().default(''),
mdblist_update_interval: z.number().nonnegative().int().optional().default(80),
mdblist_lists: z.string().array().optional().default(['']),
plex_watchlist_enabled: z.boolean().default(false),
- plex_watchlist_rss: z.union([z.string().url(), z.string().optional()]).optional().default(''),
+ plex_watchlist_rss: z.string().optional().default(''),
plex_watchlist_update_interval: z.number().nonnegative().int().optional().default(80),
listrr_enabled: z.boolean().default(false),
listrr_api_key: z.string().optional().default(''),
@@ -131,13 +191,15 @@ export const mediaServerSettingsToGet: string[] = ['plex'];
export const mediaServerSettingsServices: string[] = ['plex'];
export const mediaServerSettingsSchema = z.object({
+ update_interval: z.string().optional().default(''),
plex_token: z.string().optional().default(''),
- plex_url: z.string().url().optional().default('')
+ plex_url: z.string().optional().default('')
});
export type MediaServerSettingsSchema = typeof mediaServerSettingsSchema;
export function mediaServerSettingsToPass(data: any) {
return {
+ update_interval: data.data.plex.update_interval,
plex_token: data.data.plex.token,
plex_url: data.data.plex.url
};
@@ -148,6 +210,7 @@ export function mediaServerSettingsToSet(form: SuperValidated
{/if}
+
diff --git a/frontend/src/lib/helpers.ts b/frontend/src/lib/helpers.ts
index b1a13a55..6e27eb0c 100644
--- a/frontend/src/lib/helpers.ts
+++ b/frontend/src/lib/helpers.ts
@@ -73,27 +73,3 @@ export function convertIcebergItemsToObject(items: IcebergItem[]) {
return result;
}
-
-export async function saveSettings(fetch: any, toSet: any) {
- const data = await fetch('http://127.0.0.1:8080/settings/set', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(toSet)
- });
-
- const saveSettings = await fetch('http://127.0.0.1:8080/settings/save', {
- method: 'POST'
- });
-
- const loadSettings = await fetch('http://127.0.0.1:8080/settings/load', {
- method: 'GET'
- });
-
- return {
- data,
- saveSettings,
- loadSettings
- };
-}
diff --git a/frontend/src/routes/settings/about/+page.svelte b/frontend/src/routes/settings/about/+page.svelte
index 1a8b0625..a04618aa 100644
--- a/frontend/src/routes/settings/about/+page.svelte
+++ b/frontend/src/routes/settings/about/+page.svelte
@@ -10,13 +10,13 @@
export let data: PageData;
const version = data.settings.data.version;
- const host_path = data.settings.data.symlink.host_path;
- const container_path = data.settings.data.symlink.container_path;
+ const rclone_path = data.settings.data.symlink.rclone_path;
+ const library_path = data.settings.data.symlink.library_path;
interface AboutData {
[key: string]: any;
- host_path: string;
- container_path: string;
+ rclone_path: string;
+ library_path: string;
}
type SupportData = {
@@ -26,8 +26,8 @@
};
const aboutData: AboutData = {
- host_path,
- container_path
+ rclone_path,
+ library_path
};
const supportData: SupportData = {
github: 'https://github.com/dreulavelle/iceberg',
diff --git a/frontend/src/routes/settings/content/+page.server.ts b/frontend/src/routes/settings/content/+page.server.ts
index 8ab7dbb2..4eafebe3 100644
--- a/frontend/src/routes/settings/content/+page.server.ts
+++ b/frontend/src/routes/settings/content/+page.server.ts
@@ -1,8 +1,11 @@
import type { PageServerLoad, Actions } from './$types';
import { fail, error, redirect } from '@sveltejs/kit';
import { message, superValidate } from 'sveltekit-superforms/server';
-import { saveSettings, formatWords } from '$lib/helpers';
+import { formatWords } from '$lib/helpers';
import {
+ setSettings,
+ saveSettings,
+ loadSettings,
contentSettingsSchema,
contentSettingsToGet,
contentSettingsServices,
@@ -41,7 +44,19 @@ export const actions: Actions = {
const toSet = contentSettingsToSet(form);
try {
- const data = await saveSettings(event.fetch, toSet);
+ const data = await setSettings(event.fetch, toSet, contentSettingsServices);
+ if (!data.allServicesTrue) {
+ return message(
+ form,
+ `${contentSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
+ {
+ status: 400
+ }
+ );
+ }
+
+ const save = await saveSettings(event.fetch);
+ const load = await loadSettings(event.fetch);
} catch (e) {
console.error(e);
return message(form, 'Unable to save settings. API is down.', {
@@ -49,21 +64,6 @@ export const actions: Actions = {
});
}
- const data = await event.fetch('http://127.0.0.1:8080/services');
- const services = await data.json();
- const allServicesTrue: boolean = contentSettingsServices.every(
- (service) => services.data[service] === true
- );
- if (!allServicesTrue) {
- return message(
- form,
- `${contentSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
- {
- status: 400
- }
- );
- }
-
if (event.url.searchParams.get('onboarding') === 'true') {
redirect(302, '/onboarding/4');
}
diff --git a/frontend/src/routes/settings/general/+page.server.ts b/frontend/src/routes/settings/general/+page.server.ts
index 6e420686..eb6fa2e0 100644
--- a/frontend/src/routes/settings/general/+page.server.ts
+++ b/frontend/src/routes/settings/general/+page.server.ts
@@ -1,8 +1,11 @@
import type { PageServerLoad, Actions } from './$types';
import { fail, error, redirect } from '@sveltejs/kit';
import { message, superValidate } from 'sveltekit-superforms/server';
-import { saveSettings, formatWords } from '$lib/helpers';
+import { formatWords } from '$lib/helpers';
import {
+ setSettings,
+ saveSettings,
+ loadSettings,
generalSettingsSchema,
generalSettingsToGet,
generalSettingsServices,
@@ -43,7 +46,18 @@ export const actions: Actions = {
const toSet = generalSettingsToSet(form);
try {
- const data = await saveSettings(event.fetch, toSet);
+ const data = await setSettings(event.fetch, toSet, generalSettingsServices);
+ if (!data.allServicesTrue) {
+ return message(
+ form,
+ `${generalSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
+ {
+ status: 400
+ }
+ );
+ }
+ const save = await saveSettings(event.fetch);
+ const load = await loadSettings(event.fetch);
} catch (e) {
console.error(e);
return message(form, 'Unable to save settings. API is down.', {
@@ -51,21 +65,6 @@ export const actions: Actions = {
});
}
- const data = await event.fetch('http://127.0.0.1:8080/services');
- const services = await data.json();
- const allServicesTrue: boolean = generalSettingsServices.every(
- (service) => services.data[service] === true
- );
- if (!allServicesTrue) {
- return message(
- form,
- `${generalSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
- {
- status: 400
- }
- );
- }
-
if (event.url.searchParams.get('onboarding') === 'true') {
redirect(302, '/onboarding/2');
}
diff --git a/frontend/src/routes/settings/mediaserver/+page.server.ts b/frontend/src/routes/settings/mediaserver/+page.server.ts
index a563079e..bd3a796d 100644
--- a/frontend/src/routes/settings/mediaserver/+page.server.ts
+++ b/frontend/src/routes/settings/mediaserver/+page.server.ts
@@ -1,8 +1,11 @@
import type { PageServerLoad, Actions } from './$types';
import { fail, error, redirect } from '@sveltejs/kit';
import { message, superValidate } from 'sveltekit-superforms/server';
-import { saveSettings, formatWords } from '$lib/helpers';
+import { formatWords } from '$lib/helpers';
import {
+ setSettings,
+ saveSettings,
+ loadSettings,
mediaServerSettingsSchema,
mediaServerSettingsToGet,
mediaServerSettingsServices,
@@ -41,7 +44,19 @@ export const actions: Actions = {
const toSet = mediaServerSettingsToSet(form);
try {
- const data = await saveSettings(event.fetch, toSet);
+ const data = await setSettings(event.fetch, toSet, mediaServerSettingsServices);
+ if (!data.allServicesTrue) {
+ return message(
+ form,
+ `${mediaServerSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
+ {
+ status: 400
+ }
+ );
+ }
+
+ const save = await saveSettings(event.fetch);
+ const load = await loadSettings(event.fetch);
} catch (e) {
console.error(e);
return message(form, 'Unable to save settings. API is down.', {
@@ -49,21 +64,6 @@ export const actions: Actions = {
});
}
- const data = await event.fetch('http://127.0.0.1:8080/services');
- const services = await data.json();
- const allServicesTrue: boolean = mediaServerSettingsServices.every(
- (service) => services.data[service] === true
- );
- if (!allServicesTrue) {
- return message(
- form,
- `${mediaServerSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
- {
- status: 400
- }
- );
- }
-
if (event.url.searchParams.get('onboarding') === 'true') {
redirect(302, '/onboarding/3');
}
diff --git a/frontend/src/routes/settings/scrapers/+page.server.ts b/frontend/src/routes/settings/scrapers/+page.server.ts
index d3d73054..f838fd16 100644
--- a/frontend/src/routes/settings/scrapers/+page.server.ts
+++ b/frontend/src/routes/settings/scrapers/+page.server.ts
@@ -1,8 +1,11 @@
import type { PageServerLoad, Actions } from './$types';
import { fail, error, redirect } from '@sveltejs/kit';
import { message, superValidate } from 'sveltekit-superforms/server';
-import { saveSettings, formatWords } from '$lib/helpers';
+import { formatWords } from '$lib/helpers';
import {
+ setSettings,
+ saveSettings,
+ loadSettings,
scrapersSettingsSchema,
scrapersSettingsToGet,
scrapersSettingsServices,
@@ -41,7 +44,19 @@ export const actions: Actions = {
const toSet = scrapersSettingsToSet(form);
try {
- const data = await saveSettings(event.fetch, toSet);
+ const data = await setSettings(event.fetch, toSet, scrapersSettingsServices);
+ if (!data.allServicesTrue) {
+ return message(
+ form,
+ `${scrapersSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
+ {
+ status: 400
+ }
+ );
+ }
+
+ const save = await saveSettings(event.fetch);
+ const load = await loadSettings(event.fetch);
} catch (e) {
console.error(e);
return message(form, 'Unable to save settings. API is down.', {
@@ -49,21 +64,6 @@ export const actions: Actions = {
});
}
- const data = await event.fetch('http://127.0.0.1:8080/services');
- const services = await data.json();
- const allServicesTrue: boolean = scrapersSettingsServices.every(
- (service) => services.data[service] === true
- );
- if (!allServicesTrue) {
- return message(
- form,
- `${scrapersSettingsServices.map(formatWords).join(', ')} service(s) failed to initialize. Please check your settings.`,
- {
- status: 400
- }
- );
- }
-
if (event.url.searchParams.get('onboarding') === 'true') {
redirect(302, '/?onboarding=true');
}
diff --git a/makefile b/makefile
index d867aa74..323ebef3 100644
--- a/makefile
+++ b/makefile
@@ -12,6 +12,7 @@ endif
help:
@echo Iceberg Local Development Environment
@echo -------------------------------------------------------------------------
+ @echo install : Install the required packages
@echo start : Build and run the Iceberg container
@echo stop : Stop and remove the Iceberg container and image
@echo restart : Restart the Iceberg container (without rebuilding image)
@@ -24,11 +25,13 @@ help:
@echo backend : Start the backend development server
@echo -------------------------------------------------------------------------
+install:
+ @python3 -m pip install -r requirements.txt --break-system-packages
+
start: stop
@docker build -t iceberg:latest -f Dockerfile .
@docker run -d --name iceberg --hostname iceberg --net host -e PUID=1000 -e PGID=1000 -v $(DATA_PATH):/iceberg/data -v /mnt:/mnt iceberg:latest
- @echo Iceberg Frontend is running on http://localhost:3000/status/
- @echo Iceberg Backend is running on http://localhost:8080/items/
+ @echo Iceberg is running on http://localhost:3000/
@docker logs iceberg -f
stop:
@@ -55,8 +58,9 @@ ec:
@docker exec -it iceberg /bin/bash -c "vim /iceberg/data/settings.json"
update:
- @-git pull --rebase
- @make start
+ @echo Not implemented yet
+ # @-git pull --rebase
+ # @make start
frontend:
@echo Starting Frontend...
diff --git a/requirements.txt b/requirements.txt
index 7c090cdf..8920fef3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,4 +8,6 @@ pydantic
fastapi
uvicorn[standard]
parse-torrent-title
-thefuzz
\ No newline at end of file
+thefuzz
+apscheduler
+watchdog
\ No newline at end of file