From 5c5cde5a047d2f3f0dd6fa925452ed67498d364d Mon Sep 17 00:00:00 2001 From: Ayush Sehrawat <69469790+AyushSehrawat@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:47:39 +0530 Subject: [PATCH 1/3] chore: new release (#132) * feat: remove unused variables * fix: update openapi client * fix: temporary update to rankings page * fix: frontend version showing unknown * fix: lint --- .env.example | 4 +- docker-compose.yml | 2 - docker-entrypoint.sh | 2 - src/lib/client/schemas.gen.ts | 214 ++-------------------- src/lib/client/services.gen.ts | 8 +- src/lib/client/types.gen.ts | 85 ++------- src/routes/settings/about/+page.server.ts | 23 +++ src/routes/settings/about/+page.ts | 17 +- src/routes/settings/ranking/+page.svelte | 79 +++----- 9 files changed, 97 insertions(+), 337 deletions(-) create mode 100644 src/routes/settings/about/+page.server.ts diff --git a/.env.example b/.env.example index 4e68e51..5f0dd13 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1 @@ -BACKEND_URL=http://localhost:8080 -DIALECT=sqlite # or postgres -DATABASE_URL=/path/to/media.db # or postgres://user:password@localhost:5432/media \ No newline at end of file +BACKEND_URL=http://localhost:8080 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bd4eed6..e980d7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,6 @@ services: environment: - ORIGIN=http://localhost:3000 # No trailing slash, read more below - BACKEND_URL=http://127.0.0.1:8080 # No trailing slash, read more below - - DIALECT=sqlite # or postgres - - DATABASE_URL=/path/to/media.db # or postgres://user:password@localhost:5432/media - TZ=America/New_York ports: - '3000:3000' diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b422dc9..e281ae7 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -8,6 +8,4 @@ else fi export BACKEND_URL=${BACKEND_URL} -export DIALECT=${DIALECT} -export DATABASE_URL=${DATABASE_URL} exec "$@" \ No newline at end of file diff --git a/src/lib/client/schemas.gen.ts b/src/lib/client/schemas.gen.ts index daf458e..4c2363e 100644 --- a/src/lib/client/schemas.gen.ts +++ b/src/lib/client/schemas.gen.ts @@ -1,21 +1,5 @@ // This file is auto-generated by @hey-api/openapi-ts -export const AddItemsResponseSchema = { - properties: { - success: { - type: 'boolean', - title: 'Success' - }, - message: { - type: 'string', - title: 'Message' - } - }, - type: 'object', - required: ['success', 'message'], - title: 'AddItemsResponse' -} as const; - export const AllDebridModelSchema = { properties: { enabled: { @@ -80,7 +64,7 @@ export const AppModelSchema = { version: { type: 'string', title: 'Version', - default: '0.15.1' + default: '0.16.0' }, debug: { type: 'boolean', @@ -180,14 +164,14 @@ export const AppModelSchema = { api_key: '', enabled: false, lists: [], - update_interval: 300 + update_interval: 86400 }, listrr: { api_key: '', enabled: false, movie_lists: [], show_lists: [], - update_interval: 300 + update_interval: 86400 }, trakt: { api_key: '', @@ -197,7 +181,7 @@ export const AppModelSchema = { fetch_trending: false, popular_count: 10, trending_count: 10, - update_interval: 300, + update_interval: 86400, user_lists: [], watchlist: [] } @@ -791,7 +775,7 @@ export const ContentModelSchema = { mdblist: { '$ref': '#/components/schemas/MdblistModel', default: { - update_interval: 300, + update_interval: 86400, enabled: false, api_key: '', lists: [] @@ -800,7 +784,7 @@ export const ContentModelSchema = { listrr: { '$ref': '#/components/schemas/ListrrModel', default: { - update_interval: 300, + update_interval: 86400, enabled: false, movie_lists: [], show_lists: [], @@ -810,7 +794,7 @@ export const ContentModelSchema = { trakt: { '$ref': '#/components/schemas/TraktModel', default: { - update_interval: 300, + update_interval: 86400, enabled: false, api_key: '', watchlist: [], @@ -850,62 +834,6 @@ export const CustomRankSchema = { description: 'Custom Ranks used in SettingsModel.' } as const; -export const DataAndSuccessResponse_RDUser_Schema = { - properties: { - data: { - '$ref': '#/components/schemas/RDUser' - }, - success: { - type: 'boolean', - title: 'Success' - } - }, - type: 'object', - required: ['data', 'success'], - title: 'DataAndSuccessResponse[RDUser]' -} as const; - -export const DataAndSuccessResponse_dict_str__list_EventUpdate___Schema = { - properties: { - data: { - additionalProperties: { - items: { - '$ref': '#/components/schemas/EventUpdate' - }, - type: 'array' - }, - type: 'object', - title: 'Data' - }, - success: { - type: 'boolean', - title: 'Success' - } - }, - type: 'object', - required: ['data', 'success'], - title: 'DataAndSuccessResponse[dict[str, list[EventUpdate]]]' -} as const; - -export const DataAndSuccessResponse_dict_str__str__Schema = { - properties: { - data: { - additionalProperties: { - type: 'string' - }, - type: 'object', - title: 'Data' - }, - success: { - type: 'boolean', - title: 'Success' - } - }, - type: 'object', - required: ['data', 'success'], - title: 'DataAndSuccessResponse[dict[str, str]]' -} as const; - export const DatabaseModelSchema = { properties: { host: { @@ -1009,18 +937,6 @@ export const EventUpdateSchema = { type: 'integer', title: 'Item Id' }, - imdb_id: { - type: 'string', - title: 'Imdb Id' - }, - title: { - type: 'string', - title: 'Title' - }, - type: { - type: 'string', - title: 'Type' - }, emitted_by: { type: 'string', title: 'Emitted By' @@ -1028,14 +944,10 @@ export const EventUpdateSchema = { run_at: { type: 'string', title: 'Run At' - }, - last_state: { - type: 'string', - title: 'Last State' } }, type: 'object', - required: ['item_id', 'imdb_id', 'title', 'type', 'emitted_by', 'run_at', 'last_state'], + required: ['item_id', 'emitted_by', 'run_at'], title: 'EventUpdate' } as const; @@ -1093,25 +1005,6 @@ export const IndexerModelSchema = { title: 'IndexerModel' } as const; -export const ItemsByImdbResponseSchema = { - properties: { - success: { - type: 'boolean', - title: 'Success' - }, - items: { - items: { - type: 'object' - }, - type: 'array', - title: 'Items' - } - }, - type: 'object', - required: ['success', 'items'], - title: 'ItemsByImdbResponse' -} as const; - export const ItemsResponseSchema = { properties: { success: { @@ -1238,7 +1131,7 @@ export const ListrrModelSchema = { update_interval: { type: 'integer', title: 'Update Interval', - default: 300 + default: 86400 }, enabled: { type: 'boolean', @@ -1271,28 +1164,12 @@ export const ListrrModelSchema = { title: 'ListrrModel' } as const; -export const LogsResponseSchema = { - properties: { - success: { - type: 'boolean', - title: 'Success' - }, - logs: { - type: 'string', - title: 'Logs' - } - }, - type: 'object', - required: ['success', 'logs'], - title: 'LogsResponse' -} as const; - export const MdblistModelSchema = { properties: { update_interval: { type: 'integer', title: 'Update Interval', - default: 300 + default: 86400 }, enabled: { type: 'boolean', @@ -1359,22 +1236,6 @@ export const MediafusionConfigSchema = { title: 'MediafusionConfig' } as const; -export const MessageAndSuccessResponseSchema = { - properties: { - message: { - type: 'string', - title: 'Message' - }, - success: { - type: 'boolean', - title: 'Success' - } - }, - type: 'object', - required: ['message', 'success'], - title: 'MessageAndSuccessResponse' -} as const; - export const MessageResponseSchema = { properties: { message: { @@ -2249,10 +2110,6 @@ export const RealDebridModelSchema = { export const RemoveResponseSchema = { properties: { - success: { - type: 'boolean', - title: 'Success' - }, message: { type: 'string', title: 'Message' @@ -2266,53 +2123,45 @@ export const RemoveResponseSchema = { } }, type: 'object', - required: ['success', 'message', 'ids'], + required: ['message', 'ids'], title: 'RemoveResponse' } as const; export const ResetResponseSchema = { properties: { - success: { - type: 'boolean', - title: 'Success' - }, message: { type: 'string', title: 'Message' }, ids: { items: { - type: 'string' + type: 'integer' }, type: 'array', title: 'Ids' } }, type: 'object', - required: ['success', 'message', 'ids'], + required: ['message', 'ids'], title: 'ResetResponse' } as const; export const RetryResponseSchema = { properties: { - success: { - type: 'boolean', - title: 'Success' - }, message: { type: 'string', title: 'Message' }, ids: { items: { - type: 'string' + type: 'integer' }, type: 'array', title: 'Ids' } }, type: 'object', - required: ['success', 'message', 'ids'], + required: ['message', 'ids'], title: 'RetryResponse' } as const; @@ -2322,39 +2171,16 @@ export const RootResponseSchema = { type: 'string', title: 'Message' }, - success: { - type: 'boolean', - title: 'Success' - }, version: { type: 'string', title: 'Version' } }, type: 'object', - required: ['message', 'success', 'version'], + required: ['message', 'version'], title: 'RootResponse' } as const; -export const ScrapeResponseSchema = { - properties: { - success: { - type: 'boolean', - title: 'Success' - }, - data: { - items: { - '$ref': '#/components/schemas/ScrapedTorrent' - }, - type: 'array', - title: 'Data' - } - }, - type: 'object', - required: ['success', 'data'], - title: 'ScrapeResponse' -} as const; - export const ScrapedTorrentSchema = { properties: { rank: { @@ -2526,10 +2352,6 @@ export const SetSettingsSchema = { export const SetTorrentRDResponseSchema = { properties: { - success: { - type: 'boolean', - title: 'Success' - }, message: { type: 'string', title: 'Message' @@ -2544,7 +2366,7 @@ export const SetTorrentRDResponseSchema = { } }, type: 'object', - required: ['success', 'message', 'item_id', 'torrent_id'], + required: ['message', 'item_id', 'torrent_id'], title: 'SetTorrentRDResponse' } as const; @@ -3956,7 +3778,7 @@ export const TraktModelSchema = { update_interval: { type: 'integer', title: 'Update Interval', - default: 300 + default: 86400 }, enabled: { type: 'boolean', diff --git a/src/lib/client/services.gen.ts b/src/lib/client/services.gen.ts index 321a6d5..08438a2 100644 --- a/src/lib/client/services.gen.ts +++ b/src/lib/client/services.gen.ts @@ -1,7 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import { createClient, createConfig, type Options } from '@hey-api/client-fetch'; -import type { RootError, RootResponse2, HealthError, HealthResponse, RdError, RdResponse, TorboxError, TorboxResponse, ServicesError, ServicesResponse, TraktOauthInitiateError, TraktOauthInitiateResponse, TraktOauthCallbackData, TraktOauthCallbackError, TraktOauthCallbackResponse, StatsError, StatsResponse2, LogsError, LogsResponse2, EventsError, EventsResponse, MountError, MountResponse, OverseerrWebhookOverseerrPostError, OverseerrWebhookOverseerrPostResponse, GetSettingsSchemaError, GetSettingsSchemaResponse, LoadSettingsError, LoadSettingsResponse, SaveSettingsError, SaveSettingsResponse, GetAllSettingsError, GetAllSettingsResponse, GetSettingsData, GetSettingsError, GetSettingsResponse, SetAllSettingsData, SetAllSettingsError, SetAllSettingsResponse, SetSettingsData, SetSettingsError, SetSettingsResponse, GetStatesError, GetStatesResponse, GetItemsData, GetItemsError, GetItemsResponse, AddItemsData, AddItemsError, AddItemsResponse2, GetItemData, GetItemError, GetItemResponse, GetItemsByImdbIdsData, GetItemsByImdbIdsError, GetItemsByImdbIdsResponse, ResetItemsData, ResetItemsError, ResetItemsResponse, RetryItemsData, RetryItemsError, RetryItemsResponse, RemoveItemData, RemoveItemError, RemoveItemResponse, SetTorrentRdMagnetData, SetTorrentRdMagnetError, SetTorrentRdMagnetResponse, SetTorrentRdItemsIdSetTorrentRdPostData, SetTorrentRdItemsIdSetTorrentRdPostError, SetTorrentRdItemsIdSetTorrentRdPostResponse, ScrapeData, ScrapeError, ScrapeResponse2, GetRdTorrentsData, GetRdTorrentsError, GetRdTorrentsResponse, GetTrendingData, GetTrendingError, GetTrendingResponse, GetMoviesNowPlayingData, GetMoviesNowPlayingError, GetMoviesNowPlayingResponse, GetMoviesPopularData, GetMoviesPopularError, GetMoviesPopularResponse, GetMoviesTopRatedData, GetMoviesTopRatedError, GetMoviesTopRatedResponse, GetMoviesUpcomingData, GetMoviesUpcomingError, GetMoviesUpcomingResponse, GetMovieDetailsData, GetMovieDetailsError, GetMovieDetailsResponse, GetTvAiringTodayData, GetTvAiringTodayError, GetTvAiringTodayResponse, GetTvOnTheAirData, GetTvOnTheAirError, GetTvOnTheAirResponse, GetTvPopularData, GetTvPopularError, GetTvPopularResponse, GetTvTopRatedData, GetTvTopRatedError, GetTvTopRatedResponse, GetTvDetailsData, GetTvDetailsError, GetTvDetailsResponse, GetTvSeasonDetailsData, GetTvSeasonDetailsError, GetTvSeasonDetailsResponse, GetTvEpisodeDetailsData, GetTvEpisodeDetailsError, GetTvEpisodeDetailsResponse, SearchCollectionData, SearchCollectionError, SearchCollectionResponse, SearchMovieData, SearchMovieError, SearchMovieResponse, SearchMultiData, SearchMultiError, SearchMultiResponse, SearchTvData, SearchTvError, SearchTvResponse, GetFromExternalIdData, GetFromExternalIdError, GetFromExternalIdResponse } from './types.gen'; +import type { RootError, RootResponse2, HealthError, HealthResponse, RdError, RdResponse, TorboxError, TorboxResponse, ServicesError, ServicesResponse, TraktOauthInitiateError, TraktOauthInitiateResponse, TraktOauthCallbackData, TraktOauthCallbackError, TraktOauthCallbackResponse, StatsError, StatsResponse2, LogsError, LogsResponse, EventsError, EventsResponse, MountError, MountResponse, OverseerrWebhookOverseerrPostError, OverseerrWebhookOverseerrPostResponse, GetSettingsSchemaError, GetSettingsSchemaResponse, LoadSettingsError, LoadSettingsResponse, SaveSettingsError, SaveSettingsResponse, GetAllSettingsError, GetAllSettingsResponse, GetSettingsData, GetSettingsError, GetSettingsResponse, SetAllSettingsData, SetAllSettingsError, SetAllSettingsResponse, SetSettingsData, SetSettingsError, SetSettingsResponse, GetStatesError, GetStatesResponse, GetItemsData, GetItemsError, GetItemsResponse, AddItemsData, AddItemsError, AddItemsResponse, GetItemData, GetItemError, GetItemResponse, GetItemsByImdbIdsData, GetItemsByImdbIdsError, GetItemsByImdbIdsResponse, ResetItemsData, ResetItemsError, ResetItemsResponse, RetryItemsData, RetryItemsError, RetryItemsResponse, RemoveItemData, RemoveItemError, RemoveItemResponse, SetTorrentRdMagnetData, SetTorrentRdMagnetError, SetTorrentRdMagnetResponse, SetTorrentRdItemsIdSetTorrentRdPostData, SetTorrentRdItemsIdSetTorrentRdPostError, SetTorrentRdItemsIdSetTorrentRdPostResponse, ScrapeData, ScrapeError, ScrapeResponse, GetRdTorrentsData, GetRdTorrentsError, GetRdTorrentsResponse, GetTrendingData, GetTrendingError, GetTrendingResponse, GetMoviesNowPlayingData, GetMoviesNowPlayingError, GetMoviesNowPlayingResponse, GetMoviesPopularData, GetMoviesPopularError, GetMoviesPopularResponse, GetMoviesTopRatedData, GetMoviesTopRatedError, GetMoviesTopRatedResponse, GetMoviesUpcomingData, GetMoviesUpcomingError, GetMoviesUpcomingResponse, GetMovieDetailsData, GetMovieDetailsError, GetMovieDetailsResponse, GetTvAiringTodayData, GetTvAiringTodayError, GetTvAiringTodayResponse, GetTvOnTheAirData, GetTvOnTheAirError, GetTvOnTheAirResponse, GetTvPopularData, GetTvPopularError, GetTvPopularResponse, GetTvTopRatedData, GetTvTopRatedError, GetTvTopRatedResponse, GetTvDetailsData, GetTvDetailsError, GetTvDetailsResponse, GetTvSeasonDetailsData, GetTvSeasonDetailsError, GetTvSeasonDetailsResponse, GetTvEpisodeDetailsData, GetTvEpisodeDetailsError, GetTvEpisodeDetailsResponse, SearchCollectionData, SearchCollectionError, SearchCollectionResponse, SearchMovieData, SearchMovieError, SearchMovieResponse, SearchMultiData, SearchMultiError, SearchMultiResponse, SearchTvData, SearchTvError, SearchTvResponse, GetFromExternalIdData, GetFromExternalIdError, GetFromExternalIdResponse } from './types.gen'; export const client = createClient(createConfig()); @@ -90,7 +90,7 @@ export class DefaultService { * Get Logs */ public static logs(options?: Options) { - return (options?.client ?? client).get({ + return (options?.client ?? client).get({ ...options, url: '/logs' }); @@ -231,7 +231,7 @@ export class ItemsService { * Add media items with bases on imdb IDs */ public static addItems(options?: Options) { - return (options?.client ?? client).post({ + return (options?.client ?? client).post({ ...options, url: '/items/add' }); @@ -322,7 +322,7 @@ export class ScrapeService { * Scrape media item based on IMDb ID. */ public static scrape(options: Options) { - return (options?.client ?? client).get({ + return (options?.client ?? client).get({ ...options, url: '/scrape' }); diff --git a/src/lib/client/types.gen.ts b/src/lib/client/types.gen.ts index 3192208..be814c5 100644 --- a/src/lib/client/types.gen.ts +++ b/src/lib/client/types.gen.ts @@ -1,10 +1,5 @@ // This file is auto-generated by @hey-api/openapi-ts -export type AddItemsResponse = { - success: boolean; - message: string; -}; - export type AllDebridModel = { enabled?: boolean; api_key?: string; @@ -71,25 +66,6 @@ export type CustomRank = { rank?: number; }; -export type DataAndSuccessResponse_RDUser_ = { - data: RDUser; - success: boolean; -}; - -export type DataAndSuccessResponse_dict_str__list_EventUpdate___ = { - data: { - [key: string]: Array; - }; - success: boolean; -}; - -export type DataAndSuccessResponse_dict_str__str__ = { - data: { - [key: string]: (string); - }; - success: boolean; -}; - export type DatabaseModel = { host?: string; }; @@ -115,12 +91,8 @@ export type EmbyLibraryModel = { export type EventUpdate = { item_id: number; - imdb_id: string; - title: string; - type: string; emitted_by: string; run_at: string; - last_state: string; }; export type ExternalIDExternalSource = 'imdb_id' | 'facebook_id' | 'instagram_id' | 'tvdb_id' | 'tiktok_id' | 'twitter_id' | 'wikidata_id' | 'youtube_id'; @@ -140,13 +112,6 @@ export type IndexerModel = { update_interval?: number; }; -export type ItemsByImdbResponse = { - success: boolean; - items: Array<{ - [key: string]: unknown; - }>; -}; - export type ItemsResponse = { success: boolean; items: Array<{ @@ -188,11 +153,6 @@ export type ListrrModel = { api_key?: string; }; -export type LogsResponse = { - success: boolean; - logs: string; -}; - export type MdblistModel = { update_interval?: number; enabled?: boolean; @@ -208,11 +168,6 @@ export type MediafusionConfig = { catalogs?: Array<(string)>; }; -export type MessageAndSuccessResponse = { - message: string; - success: boolean; -}; - export type MessageResponse = { message: string; }; @@ -356,34 +311,25 @@ export type RealDebridModel = { }; export type RemoveResponse = { - success: boolean; message: string; ids: Array<(number)>; }; export type ResetResponse = { - success: boolean; message: string; - ids: Array<(string)>; + ids: Array<(number)>; }; export type RetryResponse = { - success: boolean; message: string; - ids: Array<(string)>; + ids: Array<(number)>; }; export type RootResponse = { message: string; - success: boolean; version: string; }; -export type ScrapeResponse = { - success: boolean; - data: Array; -}; - export type ScrapedTorrent = { rank: number; raw_title: string; @@ -414,7 +360,6 @@ export type SetSettings = { }; export type SetTorrentRDResponse = { - success: boolean; message: string; item_id: number; torrent_id: string; @@ -769,11 +714,11 @@ export type RootResponse2 = (RootResponse); export type RootError = (unknown); -export type HealthResponse = (MessageAndSuccessResponse); +export type HealthResponse = (MessageResponse); export type HealthError = (unknown); -export type RdResponse = (DataAndSuccessResponse_RDUser_); +export type RdResponse = (RDUser); export type RdError = (unknown); @@ -797,7 +742,7 @@ export type TraktOauthCallbackData = { }; }; -export type TraktOauthCallbackResponse = (MessageAndSuccessResponse); +export type TraktOauthCallbackResponse = (MessageResponse); export type TraktOauthCallbackError = (unknown | HTTPValidationError); @@ -805,15 +750,19 @@ export type StatsResponse2 = (StatsResponse); export type StatsError = (unknown); -export type LogsResponse2 = (LogsResponse); +export type LogsResponse = (string); export type LogsError = (unknown); -export type EventsResponse = (DataAndSuccessResponse_dict_str__list_EventUpdate___); +export type EventsResponse = ({ + [key: string]: Array; +}); export type EventsError = (unknown); -export type MountResponse = (DataAndSuccessResponse_dict_str__str__); +export type MountResponse = ({ + [key: string]: (string); +}); export type MountError = (unknown); @@ -898,7 +847,7 @@ export type AddItemsData = { }; }; -export type AddItemsResponse2 = (AddItemsResponse); +export type AddItemsResponse = (MessageResponse); export type AddItemsError = (unknown | HTTPValidationError); @@ -923,7 +872,9 @@ export type GetItemsByImdbIdsData = { }; }; -export type GetItemsByImdbIdsResponse = (ItemsByImdbResponse); +export type GetItemsByImdbIdsResponse = (Array<{ + [key: string]: unknown; +}>); export type GetItemsByImdbIdsError = (unknown | HTTPValidationError); @@ -979,7 +930,7 @@ export type SetTorrentRdItemsIdSetTorrentRdPostData = { }; }; -export type SetTorrentRdItemsIdSetTorrentRdPostResponse = (unknown); +export type SetTorrentRdItemsIdSetTorrentRdPostResponse = (SetTorrentRDResponse); export type SetTorrentRdItemsIdSetTorrentRdPostError = (unknown | HTTPValidationError); @@ -991,7 +942,7 @@ export type ScrapeData = { }; }; -export type ScrapeResponse2 = (ScrapeResponse); +export type ScrapeResponse = (Array); export type ScrapeError = (HTTPValidationError); diff --git a/src/routes/settings/about/+page.server.ts b/src/routes/settings/about/+page.server.ts new file mode 100644 index 0000000..77e49f6 --- /dev/null +++ b/src/routes/settings/about/+page.server.ts @@ -0,0 +1,23 @@ +import type { PageServerLoad } from './$types'; +import fs from 'fs/promises'; +import path from 'path'; +import { dev } from '$app/environment'; + +export const prerender = true; + +export const load = (async () => { + let versionFilePath: string = '/riven/version.txt'; + if (dev) { + versionFilePath = './version.txt'; + } + let frontendVersion = 'Unknown'; + try { + frontendVersion = (await fs.readFile(path.resolve(versionFilePath), 'utf-8')).trim(); + } catch (err) { + console.error('Error reading frontend version file:', err); + } + + return { + frontendVersion + }; +}) satisfies PageServerLoad; diff --git a/src/routes/settings/about/+page.ts b/src/routes/settings/about/+page.ts index a6202c3..c5728b0 100644 --- a/src/routes/settings/about/+page.ts +++ b/src/routes/settings/about/+page.ts @@ -1,11 +1,8 @@ import type { PageLoad } from './$types'; import { error } from '@sveltejs/kit'; -import fs from 'fs/promises'; -import path from 'path'; -import { dev } from '$app/environment'; import { SettingsService } from '$lib/client'; -export const load: PageLoad = async () => { +export const load: PageLoad = async ({ data }) => { async function getAboutInfo() { const toGet = ['version', 'symlink']; const { data, error: apiError } = await SettingsService.getSettings({ @@ -19,16 +16,8 @@ export const load: PageLoad = async () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any return data! as any; } - let versionFilePath: string = '/riven/version.txt'; - if (dev) { - versionFilePath = './version.txt'; - } - let frontendVersion = 'Unknown'; - try { - frontendVersion = (await fs.readFile(path.resolve(versionFilePath), 'utf-8')).trim(); - } catch (err) { - console.error('Error reading frontend version file:', err); - } + const frontendVersion = data.frontendVersion; + return { settings: await getAboutInfo(), frontendVersion diff --git a/src/routes/settings/ranking/+page.svelte b/src/routes/settings/ranking/+page.svelte index 88483c5..aacd00c 100644 --- a/src/routes/settings/ranking/+page.svelte +++ b/src/routes/settings/ranking/+page.svelte @@ -23,12 +23,28 @@ require: [], exclude: [], preferred: [], + resolutions: { + '2160p': false, + '1080p': true, + '720p': true, + '480p': false, + '360p': false, + unknown: true + }, + options: { + title_similarity: 0.85, + remove_all_trash: true, + remove_ranks_under: -10000, + remove_unknown_languages: false, + allow_english_in_languages: false + }, + languages: { + required: [], + exclude: ['common'], + preferred: [] + }, custom_ranks: { - uhd: { - enable: false, - fetch: false, - rank: 120 - } + '...': '...' } } }, @@ -37,53 +53,18 @@ )} -

There are 7 profile in ranking:

+

There are 3 profile in ranking:

    -
  • default - The default ranking model.
  • -
  • remux - The ranking model for the best remux.
  • -
  • web - The ranking model for the best web release.
  • -
  • resolution - The ranking model for the best resolution.
  • -
  • overall - The ranking model for the best overall quality.
  • -
  • anime - The ranking model for anime releases.
  • -
  • all - The ranking model for all releases.
  • +
  • default - Optimized for streaming without transcoding
  • +
  • best - Aimed at obtaining the highest quality content available
  • +
  • custom - This is a custom profile that you can create yourself
-

What are require, exclude and preferred?

-

- These are array of regex patterns that are used to filter the releases. Example: +

+ You can read more in detail about all the settings on rankings wiki here

- -
-
-{JSON.stringify(
-				{
-					exclude: [
-						'\\bupscaled?\\b',
-						'^(?!.*2160p.*1080p).*$',
-						'\\bmatte\\b',
-						'\\bcamrp\\b',
-						'\\bwebrip\\b',
-						'\\bweb-dl\\b',
-						'\\bwebhd\\b',
-						'\\bweb\\b',
-						'\\bhdrip\\b'
-					]
-				},
-				null,
-				2
-			)}
-        
- -

- What is enable, fetch and rank in custom_ranks? -

-

fetch means if you want to grab it or not when its scraped

-

- enable just means you can set your own rank instead of using the internal ranking system from - the profile name you specify -

-

rank is the priority of the custom rank

- - From e4b5277cb8c2edb706c514d9840d65954fd636f7 Mon Sep 17 00:00:00 2001 From: Ayush Sehrawat <69469790+AyushSehrawat@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:19:18 +0000 Subject: [PATCH 2/3] chore: release 0.16.0 Release-As: 0.16.0 From 4554ffd32303313a81019bec8ebd20642a40a52f Mon Sep 17 00:00:00 2001 From: Spoked <5782630+dreulavelle@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:20:19 -0500 Subject: [PATCH 3/3] chore(main): release 0.16.0 (#133) --- CHANGELOG.md | 7 +++++++ version.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a7fa1..edf5553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.16.0](https://github.com/rivenmedia/riven-frontend/compare/v0.14.1...v0.16.0) (2024-10-18) + + +### Miscellaneous Chores + +* release 0.16.0 ([e4b5277](https://github.com/rivenmedia/riven-frontend/commit/e4b5277cb8c2edb706c514d9840d65954fd636f7)) + ## [0.14.1](https://github.com/rivenmedia/riven-frontend/compare/v0.14.0...v0.14.1) (2024-10-18) diff --git a/version.txt b/version.txt index 930e300..04a373e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.14.1 +0.16.0